Help Center

Find answers or browse our knowledge base.

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 (replace addonid 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 – executes db.sql (auto-handled by system).
  •  
  • uninstall.php – executes droptable.sql (auto-handled).
  •  
  • update.php – executes update.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 from post_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?
You must login to vote.
1 found this helpful, 0 did not
Thank you for your feedback!

Related Articles