Help Center
Find answers or browse our knowledge base.
Latest Questions
FIles structure of an addon
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 (replaceaddonidwith 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.sqlwhen 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?