{"id":15529676,"url":"https://github.com/live627/smf-site-integration","last_synced_at":"2025-03-15T22:30:13.717Z","repository":{"id":42030311,"uuid":"373906272","full_name":"live627/smf-site-integration","owner":"live627","description":" Helps webmasters to integrate their websites with SMF. ","archived":false,"fork":false,"pushed_at":"2022-04-17T05:50:15.000Z","size":74,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-22T11:28:55.442Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://custom.simplemachines.org/index.php?mod=1146","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/live627.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2021-06-04T16:51:05.000Z","updated_at":"2022-04-17T05:58:56.000Z","dependencies_parsed_at":"2022-08-12T02:50:45.755Z","dependency_job_id":null,"html_url":"https://github.com/live627/smf-site-integration","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/live627%2Fsmf-site-integration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/live627%2Fsmf-site-integration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/live627%2Fsmf-site-integration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/live627%2Fsmf-site-integration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/live627","download_url":"https://codeload.github.com/live627/smf-site-integration/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243801600,"owners_count":20350105,"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":[],"created_at":"2024-10-02T11:19:37.860Z","updated_at":"2025-03-15T22:30:13.694Z","avatar_url":"https://github.com/live627.png","language":"PHP","funding_links":["https://www.paypal.me/JohnRayes"],"categories":[],"sub_categories":[],"readme":"## Site Integration Mod\n[![MIT license](http://img.shields.io/badge/license-MIT-009999.svg)](http://opensource.org/licenses/MIT)\n[![Latest Version](https://img.shields.io/github/release/live627/smf-site-integration.svg)](https://github.com/live627/smf-site-integration/releases) [![Support](http://img.shields.io/badge/PayPal-$-009966.svg)](https://www.paypal.me/JohnRayes)\n\nPackage name | SMF version | Minimmum PHP version\n--- | --- | ---\nSite Integration Mod 2.0.1 | SMF 2.0.x | PHP 7.0\nSite Integration Mod 1.4.1 | SMF 1.1.x, 2.0.x | PHP 4.3 – PHP 5.4\n\n[View changelog](https://github.com/live627/smf-site-integration/blob/master/CHANGELOG.md)\n\n### Overview\nThe Mod works by looking in a series of specific folders (defined by the admin) for `.php` files to include as actions, each included file will then be accessable within SMF from `index.php?action=(filename without trailing .php`).\n- Create custom pages for your forum that may be accessed via direct link (`smf.example.com/index.php?action=demo`)\n- Select membergroups that can access the actions\n- Choose an action to use as a landing page instead of the board index\n- Choose an action for errors (invalid or missing actions) instead of the board index\n  - Does not change the standard error for missing or hidden topics\n- Elect whether or not to show the action's name in Who's Online\n\nThis mod was borne of a desire for an easier way to integrate small php scripts and HTML pages into SMF without using the normal [SSI.php functions](http://docs.simplemachines.org/index.php?topic=400).\n\n### Features Explained:\nSettings are found in the admin panel: Administration Center » Configuration » Modifications » Site Integration (or `index.php?action=admin;area=modsettings;sa=siteintegration`).\n\n- **Forum Default/Home Action:** This allows you to change the home page of your forums. Please note that your Board Index will still be accessible (`index.php?action=forum`). If you leave the setting blank then your normal Board Index will be your home page/action.\n\n- **Invalid Action Error Action:** This allows you to show a specific action every time an invalid action is passed by the user. If you don't set this then it will just show the home/default page.\n\n- **Site-Wide Language Integration Files:** (_only important if you are using more than one language_) Comma-seperated list of directories to search for language files in the form of `(current action).(current language).php`. These files will then be included before your included file/action, so that you can use a language system similar to the SMF language system where you define the same text variable (`$txt['welcome'] = 'Welcome to my Website!';`) in multiple language files and then access it later (eg `echo $txt['welcome'];`).\n\nFurther explanation of a setting's functionality can be found by clicking on the [?] help button.\n\n### Important Information\n\nThis Mod should work for all installed themes. However, if you wish to customize the default layout, you can edit the `template_SiteIntegration()` function in the `SiteIntegration.template.php` template file. Hint: copy this file to another theme to   have a unique layout for that theme.\n\nYou have to set the permissions for all the includes actions/files that you want normal users or guests to see, by default every included action/file can only be seen by the admin of your website.\n\nYou can access any of the global variables from SMF, just like a mod. An example of declaring globals (this is easily forgotten):\n```php\nglobal $var;\n```\nOr for multiples:\n```php\nglobal $var1, $var2, $var3, ..., $varN;\n```\nYou can use any of the functions which are defined by SMF from within the PHP code on your pages. Remember to `include` the       files first! (Refer to the [Function Database](https://wiki.simplemachines.org/smf/Function_database))\n\nThe index pages from your folders will _**never**_ be turned into actions. I would suggest that you copy an index.php page from one of the other SMF folders to protect your folders, so that people can't see a list of your files.\n\nFinally note that you should always include the code below in all of your '.php ' files, so that if users try to view those files they will be redirected to the file's smf action. You only need to change the value of $smfurl to the web address of your SMF's index.php for it to work, ie. (`http://www.smf.example.com/index.php`).\n```php\n$smfurl = '{web adress of your SMFs index.php}';\nif (!defined('SMF'))\n\theader('Location: ' . $smfurl . '?action=' . strtok(basename($_SERVER['SCRIPT_FILENAME']), '.');\n```\n### Tutorial\n**[View more tutorials](https://github.com/live627/smf-site-integration/tree/main/docs)**\n#### Create a simple action\n1. Create directory `file_includes` in SMF root (`$boarddir`)\n2. Create file in said directory `demo.php`\n3. Save the following code to it\n   ```php\n   \u003c?php\n\n   echo 'Hello world';\n   ```\n4. Navigate browser to Administration Center » Configuration » Modifications » Site Integration\n   1. Click \"Manage\" for settings specific to the `demo` action\n      - _\"File/Action Include Folders\" MUST include `file_includes` or no files will be found_\n   2. Enter the name and choose the group permisisons, click \"Save\"\n   3. Click \"demo\" in the management table to view the action\n      - The address bar should show `smf.example.com/index.php?action=demo`\n\n#### Adding menu buttons for your actions\nDownload [Ultimate Menu](https://custom.simplemachines.org/index.php?mod=3674) for your menu building needs\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flive627%2Fsmf-site-integration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flive627%2Fsmf-site-integration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flive627%2Fsmf-site-integration/lists"}