{"id":25507810,"url":"https://github.com/aplini/moe-counter-php","last_synced_at":"2025-10-11T05:10:32.862Z","repository":{"id":59040548,"uuid":"526165193","full_name":"ApliNi/Moe-counter-PHP","owner":"ApliNi","description":"开箱即用的Moe-counter (PHP 版本), 支持HTML格式和更多功能!","archived":false,"fork":false,"pushed_at":"2023-04-10T02:19:38.000Z","size":112,"stargazers_count":17,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T11:37:49.759Z","etag":null,"topics":["badge","counter","html","moe-counter","php","sqlite3","visitors"],"latest_commit_sha":null,"homepage":"https://ipacel.cc/+/MoeCounter2/?name=name","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ApliNi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-18T10:32:09.000Z","updated_at":"2024-08-22T13:42:10.000Z","dependencies_parsed_at":"2023-01-19T00:45:56.204Z","dependency_job_id":null,"html_url":"https://github.com/ApliNi/Moe-counter-PHP","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ApliNi%2FMoe-counter-PHP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ApliNi%2FMoe-counter-PHP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ApliNi%2FMoe-counter-PHP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ApliNi%2FMoe-counter-PHP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ApliNi","download_url":"https://codeload.github.com/ApliNi/Moe-counter-PHP/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248217159,"owners_count":21066634,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["badge","counter","html","moe-counter","php","sqlite3","visitors"],"created_at":"2025-02-19T07:41:53.819Z","updated_at":"2025-10-11T05:10:32.825Z","avatar_url":"https://github.com/ApliNi.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Moe-counter-PHP\n\n开箱即用的 Moe-counter (PHP 版本)\n\n![Moe-counter](https://ipacel.cc/+/MoeCounter2/?name=github)\n\n\n---\n\n### 使用方法\n\n将MoeCounter目录复制到您的网站任意一个目录下即可. \n\n要求: 服务器有安装php, 启用sqlite扩展. \n\n---\n\n\n### 配置\n打开 index.php, 第4行开始的数组就是软件配置\n\n\u003cdetails\u003e\u003csummary\u003e点击展开: 默认配置\u003c/summary\u003e\n\n```\n// 配置文件\n$c = array(\n\t// 默认运行模式\n\t/**\n\t * ADD_NUM = 加计数器, 每次访问+1, 新建记录为0\n\t * MONITOR = 数字显示模式, 此模式不需要数据库\n\t * RECORD_NUM = 显示数据库中的记录总数\n\t */\n\t'mode' =\u003e 'ADD_NUM',\n\t// 是否允许用户选择模式\n\t'selectMode' =\u003e true,\n\t// 默认渲染模式\n\t/**\n\t * xml = XML图片, 适用于Github等代理获取图片的场景\n\t * html = HTML代码, 适用于自己的网站和可以嵌入页面的场景, 支持使用CDN外链图片, 带宽占用很低\n\t * string = 输出字符串, 意义不明, 最省带宽\n\t */\n\t'out_mode' =\u003e 'xml',\n\t// 使用HTML格式时的图片位置, left | right | counter\n\t'html_align' =\u003e 'center',\n\n\n\t// 是否允许自动创建记录\n\t'createRecord' =\u003e true,\n\t// 允许自动创建的最大记录数量, 达到此值将不再继续创建\n\t'maxRecordNum' =\u003e 520000, // -1 禁用\n\t// 名称最大长度\n\t'maxNameLength' =\u003e 24,\n\t// 图片显示的最小数字长度\n\t'minNumLength' =\u003e 5,\n\n\n\t// 存放图片的目录, 普通路径结尾需要添加斜杠\n\t// 'imgPath-html' =\u003e 'https://ipacel.cc/+/MoeCounter/img/',\n\t'imgPath-html' =\u003e 'https://fastly.jsdelivr.net/gh/ApliNi/Moe-counter-PHP@main/MoeCounter/img/',\n\t'imgPath-xml' =\u003e 'img/',\n\t// 图片名称前缀 `xxx{0-9}.png`, 也可以使用原版Moe-counter的目录 `xxx/{0-9}.png`\n\t'img_prefix' =\u003e 'gelbooru',\n\t// 图片格式\n\t'imgFormat' =\u003e 'gif',\n\n\n\t//图片宽高\n\t'imgWidth' =\u003e 45,\n\t'imgHeight' =\u003e 100,\n);\n```\n\n\u003c/details\u003e\n\n\n\n### URL参数\n参数的默认值可以在配置文件中找到\n```\n# 运行模式\n?mode=\n\n\tADD_NUM #加计数器, 每次访问+1, 新建记录为0\n\t\t\u0026name=name #定义一个用于计数的名称\n\n\tMONITOR #数字显示模式, 此模式不需要数据库\n\t\t\u0026num=112 #需要显示的数字\n\n\tRECORD_NUM #显示数据库中的记录总数\n\n\n# 渲染模式\n\u0026out_mode=\n\n\txml #XML图片, 适用于Github等代理获取图片的场景\n\t\t\u0026img_prefix=gelbooru #猫图片名称前缀 `xxx{0-9}.png`, 也可以使用原版Moe-counter的目录 `xxx/{0-9}.png`\n\t\t\u0026min_num_length=1 #自定义最小数字长度, 不足的部分会补0\n\n\thtml #HTML代码, 适用于自己的网站和可以嵌入页面的场景, 支持使用CDN外链图片, 带宽占用很低\n\t\t\u0026img_prefix=gelbooru\n\t\t\u0026min_num_length=1\n\t\t\u0026align=counter #使用HTML格式时的图片位置, left | right | counter\n\n\tstring #输出字符串, 供js获取数据\n\t\t\u0026min_num_length=1\n```\n\n例子:   \n`https://ipacel.cc/+/MoeCounter2/?name=name`  \n`https://ipacel.cc/+/MoeCounter2/?mode=ADD_NUM\u0026name=name\u0026out_mode=html\u0026img_prefix=gelbooru\u0026align=counter`  \n`https://ipacel.cc/+/MoeCounter2/?mode=MONITOR\u0026num=1234567890`  \n\n#### HTML 格式调用方法\n```\n\u003ciframe src=\"---URL---\" frameborder=\"0\" scrolling=\"no\" width=\"100%\" height=\"100px\"\u003e\u003c/iframe\u003e\n```\n如果您的主机带宽足够小, 可以使用html格式节省流量. \n\n---\n### v2版本的变化\n添加了更多功能, 使用完整URL参数名. 此版本与v1的URL完全不兼容, 数据库不影响. \n\n---\n\n图片来源: https://github.com/journey-ad/Moe-counter\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faplini%2Fmoe-counter-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faplini%2Fmoe-counter-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faplini%2Fmoe-counter-php/lists"}