{"id":18637987,"url":"https://github.com/imponeer/smarty-xo","last_synced_at":"2025-10-12T12:41:13.116Z","repository":{"id":38012043,"uuid":"336398005","full_name":"imponeer/smarty-xo","owner":"imponeer","description":"Smarty template engine plugins collections based on ideas for plugins from @xoops","archived":false,"fork":false,"pushed_at":"2025-06-01T07:24:58.000Z","size":61,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-01T15:59:06.037Z","etag":null,"topics":["hacktoberfest","links","pagination","smarty","smarty-plugins","xoops"],"latest_commit_sha":null,"homepage":"","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/imponeer.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-02-05T21:54:36.000Z","updated_at":"2025-06-01T07:25:00.000Z","dependencies_parsed_at":"2024-05-01T08:26:47.658Z","dependency_job_id":"c0fc4954-5451-42bc-a5b4-f97b862a7cfb","html_url":"https://github.com/imponeer/smarty-xo","commit_stats":{"total_commits":22,"total_committers":3,"mean_commits":7.333333333333333,"dds":"0.36363636363636365","last_synced_commit":"66cb2ab9f7b0362f21f6b4385c6e4a651f849a4c"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/imponeer/smarty-xo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imponeer%2Fsmarty-xo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imponeer%2Fsmarty-xo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imponeer%2Fsmarty-xo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imponeer%2Fsmarty-xo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imponeer","download_url":"https://codeload.github.com/imponeer/smarty-xo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imponeer%2Fsmarty-xo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279011294,"owners_count":26084928,"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","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["hacktoberfest","links","pagination","smarty","smarty-plugins","xoops"],"created_at":"2024-11-07T05:38:32.422Z","updated_at":"2025-10-12T12:41:13.089Z","avatar_url":"https://github.com/imponeer.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![License](https://img.shields.io/github/license/imponeer/smarty-xo.svg)](LICENSE)\n[![GitHub release](https://img.shields.io/github/release/imponeer/smarty-xo.svg)](https://github.com/imponeer/smarty-xo/releases) [![Maintainability](https://api.codeclimate.com/v1/badges/8e9a1579e56699e95b05/maintainability)](https://codeclimate.com/github/imponeer/smarty-xo/maintainability) [![PHP](https://img.shields.io/packagist/php-v/imponeer/smarty-xo.svg)](http://php.net) \n[![Packagist](https://img.shields.io/packagist/dm/imponeer/smarty-xo.svg)](https://packagist.org/packages/imponeer/smarty-xo)\n\n# Smarty XO\n\nRewritten (due licensing issues) collection [Smarty](https://smarty.net) plugins that where originally written for [Xoops](https://xoops.org) but now can be used everywhere.\n\n## Installation\n\nTo install and use this package, we recommend to use [Composer](https://getcomposer.org):\n\n```bash\ncomposer require imponeer/smarty-xo\n```\n\nOtherwise, you need to include manually files from `src/` directory. \n\n## Registering in Smarty\n\nIf you want to use these extensions from this package in your project you need register them with [`registerPlugin` function](https://www.smarty.net/docs/en/api.register.plugin.tpl) from [Smarty](https://www.smarty.net). For example:\n```php\n$smarty = new \\Smarty();\n$plugins = [\n  new \\Imponeer\\Smarty\\Extensions\\XO\\XOAppUrlCompiler(\n    function (string $url): string { // function that converts url into path\n       return $url;\n    },\n    function (string $url, array $params = []): string { // function that adds params to path\n       return $url . '?' . http_build_query($params);\n    }\n  ),\n  new \\Imponeer\\Smarty\\Extensions\\XO\\XOPageNavFunction(\n    function (string $url): string { // function that generates real url\n      return $url;\n    },\n    $strPreviousPage = '\u003c',\n    $strNextPage = '\u003e',\n    $oldSchoolUrlMode = true\n  ),\n  new \\Imponeer\\Smarty\\Extensions\\XO\\XOImgUrlCompiler(\n     function (string $imgPath): string { // function that makes psiaudo path into real assets path\n        return $imgPath;\n     }\n  ),\n  new \\Imponeer\\Smarty\\Extensions\\XO\\XOInboxCountFunction(\n     function (): ?int { // function that calc unread messages in user inbox \n       return 0;\n     }\n  )\n];\nforeach ($plugins as $plugin) {\n  if ($plugin instanceof \\Imponeer\\Contracts\\Smarty\\Extension\\SmartyFunctionInterface) {\n    $type = 'function';\n  } else {\n    $type = 'compiler';\n  }\n  $smarty-\u003eregisterPlugin($type, $plugin-\u003egetName(), [$plugin, 'execute']);\n}\n```\n\n## Inspirations list\n\nThis list can be useful for comparing current plugins code with original version to see differences and find some useful data how to use these plugins.\n\n| XO Smarty plugin | Original Plugin (from [Xoops](https://xoops.org)) |\n|---------------|-----------------|\n| [\\Imponeer\\Smarty\\Extensions\\XO\\XOPageNavFunction](./src/XOPageNavFunction.php) | [smarty_function_xoPageNav](https://github.com/XOOPS/XoopsCore25/blob/v2.5.8/htdocs/class/smarty/xoops_plugins/function.xoPageNav.php) |\n| [\\Imponeer\\Smarty\\Extensions\\XO\\XOAppUrlCompiler](./src/XOAppUrlCompiler.php) | [smarty_compiler_xoAppUrl](https://github.com/XOOPS/XoopsCore25/blob/v2.5.8/htdocs/class/smarty/xoops_plugins/compiler.xoAppUrl.php) |\n| [\\Imponeer\\Smarty\\Extensions\\XO\\XOImgUrlCompiler](./src/XOImgUrlCompiler.php) | [smarty_compiler_xoImgUrl](https://github.com/XOOPS/XoopsCore25/blob/v2.5.8/htdocs/class/smarty/xoops_plugins/compiler.xoImgUrl.php) |\n| [\\Imponeer\\Smarty\\Extensions\\XO\\XOInboxCountFunction](./src/XOInboxCountFunction.php) | [smarty_function_xoInboxCount](https://github.com/XOOPS/XoopsCore25/blob/v2.5.8/htdocs/class/smarty/xoops_plugins/function.xoInboxCount.php) |\n\n## How to contribute?\n\nIf you want to add some functionality or fix bugs, you can fork, change and create pull request. If you not sure how this works, try [interactive GitHub tutorial](https://skills.github.com).\n\nIf you found any bug or have some questions, use [issues tab](https://github.com/imponeer/smarty-xo/issues) and write there your questions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimponeer%2Fsmarty-xo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimponeer%2Fsmarty-xo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimponeer%2Fsmarty-xo/lists"}