Help Center
Find answers or browse our knowledge base.
Latest Questions
FIles structure of an addon
ScriptsTribe Plugin System – File & Folder Documentation
This document explains the structure of a standard addon in the ScriptsTribe Plugin System. Each file/folder has a specific role in functionality, hooks, theming, and database setup.
1. Root Structure
modules/addonid/
– main folder of the addon (replaceaddonid
with your addon name).content/themes/{$theme}/templates/addonid/
– template files (frontend views) for your addon.
2. Core PHP Files
index.php
– main entry point for addon’s frontend page.any_other_page.php
– extra frontend page(s) for your addon.init.php
– auto-loaded on every request; register globals, assign Smarty variables, run system-wide logic.user.init.php
– runs only when user is logged in; injects blocks into logged-in views.profile.init.php
– logic/hooks for user profile pages.page.init.php / pages.init.php
– hooks for single page vs. pages directory.event.init.php / events.init.php
– hooks for event detail or event listings.group.init.php / groups.init.php
– hooks for group detail or group listings.blog.init.php / blogs.init.php
– hooks for blog post detail or blog listing.market.init.php
– marketplace integration.forums.init.php
– forum page integration.jobs.init.php
– jobs module integration.
3. Database & Installers
db.sql
– tables created when addon installs.update.sql
– incremental DB updates for new versions.droptable.sql
– drop statements for uninstall.install.php
– executesdb.sql
(auto-handled by system).uninstall.php
– executesdroptable.sql
(auto-handled).update.php
– executesupdate.sql
when version upgrades.db_changes.php
– optional dynamic DB modifications.
4. Metadata & Config
plugin.php
– main addon metadata (name, description, author, version, requirements).version.json
– changelog, what’s new, structured version info.verify.php
– license verification logic (e.g., Sngine / PortaSale )..htaccess
– rewrite rules if addon has its own routes.
5. Admin & Settings
admin.php
– addon admin panel; injected into global admin automatically.user_settings.php
– user-side settings page.page_settings.php
,event.settings.php
,group.settings.php
– module-specific settings.
6. Hooks
Hooks allow addons to inject tabs, menus, or content dynamically:
hooks/user_settings_tab.php
– adds tab in user settings.hooks/profile_tab.php
– adds tab in user profile.hooks/page_tab.php
,hooks/page_settings_tab.php
– add tabs to pages.hooks/event_tab.php
,hooks/event_settings_tab.php
– event tabs.hooks/group_tab.php
,hooks/group_settings_tab.php
– group tabs.hooks/post_to_feed.php
– injects addon posts into user feed (renamed frompost_enrich.php
).
7. Assets
assets/img/preview.png
– addon preview image.assets/js/addonid.js
– addon-specific JS.assets/css/addonid.css
– addon-specific CSS.
8. AJAX
ajax/anything_ajax.php
– handle AJAX calls for your addon.
9. Templates
templates/addonid/index.tpl
– main addon view template.templates/addonid/any_other_page.tpl
– additional view template.
Sidebars
home_right_top.tpl
– block at the top of the right sidebar on the Home/Newsfeed page.home_right_bottom.tpl
– block at the bottom of the right sidebar on the Home/Newsfeed page.home_content.tpl
– injects content inside the main content area of the Home/Newsfeed page.profile_left_top.tpl
– block at the top of the left sidebar on profile pages.profile_left_bottom.tpl
– block at the bottom of the left sidebar on profile pages.profile_content.tpl
– injects content inside the main content area of the profile page.page_left_top.tpl
– block at the top of the left sidebar on Page detail view.page_left_bottom.tpl
– block at the bottom of the left sidebar on Page detail view.page_content.tpl
– injects content inside the main content area of Page detail view.event_left_top.tpl
– block at the top of the left sidebar on Event detail view.event_left_bottom.tpl
– block at the bottom of the left sidebar on Event detail view.event_content.tpl
– injects content inside the main content area of Event detail view.group_left_top.tpl
– block at the top of the left sidebar on Group detail view.group_left_bottom.tpl
– block at the bottom of the left sidebar on Group detail view.group_content.tpl
– injects content inside the main content area of Group detail view.forums_right_top.tpl
– block at the top of the right sidebar on Forum pages.forums_left_bottom.tpl
– block at the bottom of the left sidebar on Forum pages.forums_content.tpl
– injects content inside the main content area of Forum pages.
Menus
main_menu_top.tpl
– Injects addon links or content "Saved" of the main navigation menu.main_menu_bottom.tpl
– Injects addon links or content at the very bottom of the main navigation menu.user_menu.tpl
– user dropdown.admin_menu.tpl
– admin sidebar link.footer_menu.tpl
– footer links.mobile_bottom_menu.tpl
– mobile nav bar.top_notification_menu.tpl
– top right notification area.
Tabs
- user_settings_tab_link.tpl + user_settings_tab_content.tpl – link & content for user settings tab.
PHP dependency: /modules/{addonid}/hooks/user_settings_tab.php - profile_tab_link.tpl + profile_tab_content.tpl – profile tab UI.
PHP dependency: /modules/{addonid}/hooks/profile_tab.php - event_tab_link.tpl + event_tab_content.tpl – event tab UI.
PHP dependency: /modules/{addonid}/hooks/event_tab.php - event_settings_tab_link.tpl + event_settings_tab_content.tpl – event settings tab UI.
PHP dependency: /modules/{addonid}/hooks/event_settings_tab.php - group_tab_link.tpl + group_tab_content.tpl – group tab UI.
PHP dependency: /modules/{addonid}/hooks/group_tab.php - group_settings_tab_link.tpl + group_settings_tab_content.tpl – group settings UI.
PHP dependency: /modules/{addonid}/hooks/group_settings_tab.php - page_tab_link.tpl + page_tab_content.tpl – page tab UI.
PHP dependency: /modules/{addonid}/hooks/page_tab.php - page_settings_tab_link.tpl + page_settings_tab_content.tpl – page settings UI.
PHP dependency: /modules/{addonid}/hooks/page_settings_tab.php - feed.story.tpl + feed.content.tpl – activity feed UI (“Bill Mayheptad posted a forum thread” and its content).
PHP dependency: /modules/{addonid}/hooks/post_to_feed.php
10. The files
π modules
βββ π addonid
βββ index.php
βββ any_other_page.php
βββ init.php
βββ user.init.php
βββ profile.init.php
βββ page.init.php
βββ pages.init.php
βββ event.init.php
βββ events.init.php
βββ group.init.php
βββ groups.init.php
βββ blog.init.php
βββ blogs.init.php
βββ market.init.php
βββ forums.init.php
βββ jobs.init.php
βββ db.sql
βββ update.sql
βββ droptable.sql
βββ install.php
βββ uninstall.php
βββ update.php
βββ plugin.php
βββ version.json
βββ verify.php
βββ .htaccess
βββ admin.php
βββ user_settings.php
βββ page_settings.php
βββ event.settings.php
βββ group.settings.php
βββ db_changes.php
β
βββ π hooks
β βββ user_settings_tab.php
β βββ event_tab.php
β βββ event_settings_tab.php
β βββ group_tab.php
β βββ group_settings_tab.php
β βββ page_tab.php
β βββ page_settings_tab.php
β βββ profile_tab.php
β βββ post_to_feed.php
β
βββ π assets
β βββ π img
β β βββ preview.png
β βββ π js
β β βββ addonid.js
β βββ π css
β βββ addonid.css
β
βββ π ajax
βββ anything_ajax.php
π content
βββ π themes
βββ π {$theme}
βββ π templates
βββ π addonid
βββ index.tpl
βββ any_other_page.tpl
β
βββ π sidebars
β βββ home_right_top.tpl
β βββ home_right_bottom.tpl
β βββ home_content.tpl
β βββ profile_left_top.tpl
β βββ profile_left_bottom.tpl
β βββ profile_content.tpl
β βββ page_left_top.tpl
β βββ page_left_bottom.tpl
β βββ page_content.tpl
β βββ event_left_top.tpl
β βββ event_left_bottom.tpl
β βββ event_content.tpl
β βββ group_left_top.tpl
β βββ group_left_bottom.tpl
β βββ group_content.tpl
β βββ forums_right_top.tpl
β βββ forums_left_bottom.tpl
β βββ forums_content.tpl
β
βββ π menus
β βββ main_menu_top.tpl
β βββ main_menu_bottom.tpl
β βββ user_menu.tpl
β βββ admin_menu.tpl
β βββ footer_menu.tpl
β βββ mobile_bottom_menu.tpl
β βββ top_notification_menu.tpl
β
βββ π tabs
βββ user_settings_tab_link.tpl
βββ user_settings_tab_content.tpl
βββ profile_tab_link.tpl
βββ profile_tab_content.tpl
βββ event_tab_link.tpl
βββ event_tab_content.tpl
βββ event_settings_tab_link.tpl
βββ event_settings_tab_content.tpl
βββ group_tab_link.tpl
βββ group_tab_content.tpl
βββ group_settings_tab_link.tpl
βββ group_settings_tab_content.tpl
βββ page_tab_link.tpl
βββ page_tab_content.tpl
βββ page_settings_tab_link.tpl
βββ page_settings_tab_content.tpl
Was this answer helpful?
How could it be better?
What went wrong?