Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*************************************************************************************
- * OurThemes.php *
- **************************************************************************************
- * Written by: SMF Modders Team *
- * Website: SMFModders.com *
- **************************************************************************************
- * This file is the main source file for the SMF Modders Theme Site. *
- **************************************************************************************
- * The contents of this file are owned and copyrighted by SMFModders.com. Do not *
- * copy, reproduce, or share the code from this file. *
- *************************************************************************************/
- if (!defined('SMF'))
- die('Hacking Attempt...');
- function Themes()
- {
- // Globalize what we need...
- global $context, $sourcedir;
- // Our Sub-actions...
- $subActions = array(
- 'main' => 'main',
- 'submit' => 'submit',
- 'submit2' => 'submit2',
- 'modify' => 'modify',
- 'modify2' => 'modify2',
- 'remove' => 'remove',
- 'approve' => 'approve',
- 'disapprove' => 'disapprove',
- );
- @$area = $_REQUEST['area'];
- if (!empty($subActions[$area]))
- $subActions[$area]();
- else
- $subActions['main']();
- // Require and load
- require_once($sourcedir. '/Subs-Themes.php');
- themesiteresults();
- // Load our template...
- loadTemplate('OurThemes');
- // Can we? Array.
- $context['can'] = array(
- 'view' => allowedTo('view_themesite'),
- 'submit' => allowedTo('submit_theme'),
- 'modify' => allowedTo('modify_themes'),
- 'remove' => allowedTo('remove_themes'),
- 'no_approval_req' => allowedTo('no_theme_approval_required'),
- 'approve' => allowedTo('approve_themes'),
- 'disapprove' => allowedTo('disapprove_themes'),
- 'report' => allowedTo('report_theme_issue'),
- 'override_maintenance' => allowedTo('view_themesite_maintenance')
- );
- // Can we view the theme site?
- isAllowedTo('view_themesite');
- }
- function main()
- {
- // Globalize what we need...
- global $context, $txt, $scripturl, $sourcedir, $settings;
- // Load our sub-template!
- $context['sub_template'] = 'main';
- // What is our page title?
- $context['page_title'] = 'Themes - '. $context['forum_name'];
- // Build the link tree.
- $context['linktree'][] = array(
- 'url' => $scripturl . '?action=themes;area=main',
- 'name' => 'Themes',
- );
- // Can we view the theme site?
- isAllowedTo('view_themesite');
- }
- function modify()
- {
- // Globalize what we need...
- global $context, $txt, $scripturl, $sourcedir;
- // Require and load
- require_once($sourcedir. '/Subs-Themes.php');
- themesiteresults();
- // Load our sub-template!
- $context['sub_template'] = 'modify';
- // What is our page title?
- $context['page_title'] = 'Modify '. $context['theme'][$_REQUEST['id']]['name']. ' - '. $context['forum_name'];
- // Linktree!
- $context['linktree'][] = array(
- 'url' => $scripturl . '?action=themes;area=main',
- 'name' => 'Theme',
- );
- $context['linktree'][] = array(
- 'url' => $scripturl. '?action=themes;area=modify;id='. $_REQUEST['id'],
- 'name' => 'Modify Theme ('. $context['mod'][$_REQUEST['id']]['name']. ')',
- );
- // Can we be here?
- isAllowedTo('modify_themes');
- }
- function modify2()
- {
- // Globalize what we need...
- global $sourcedir;
- // Require our file, and call our function
- require_once($sourcedir. '/Subs-Themes.php');
- modify_query();
- themesiteresults();
- // Can we modify themes?
- isAllowedTo('modify_themes');
- }
- // It's nice to finally have a *small* function!
- function remove()
- {
- // Globalize what we need...
- global $sourcedir;
- // Require our file, and call our function
- require_once($sourcedir. '/Subs-Themes.php');
- removetheme();
- // Can we remove themes?
- isAllowedTo('remove_themes');
- }
- function submit()
- {
- // Globalize what we need...
- global $context, $txt, $scripturl;
- // Load our sub-template
- $context['sub_template'] = 'submit';
- // Define a page title
- $context['page_title'] = 'Submit a Theme - '. $context['forum_name'];
- // What date was the theme submitted?
- $context['date_submitted'] = date("F d, Y");
- // What time was the theme submitted?
- $context['time_submitted'] = date("g:i:sA");
- // Linktree!
- $context['linktree'][] = array(
- 'url' => $scripturl . '?action=themes;area=main',
- 'name' => 'Themes',
- );
- $context['linktree'][] = array(
- 'url' => $scripturl. '?action=themes;area=submit',
- 'name' => 'Submit a Theme',
- );
- // Can we submit a theme...?
- isAllowedTo('submit_theme');
- }
- function submit2()
- {
- // Globalize what we need...
- global $sourcedir;
- // Require our file, and call our function
- require_once($sourcedir. '/Subs-Themes.php');
- addtheme();
- // Can we submit themes?
- isAllowedTo('submit_theme');
- }
- function approve()
- {
- // Globalize what we need...
- global $sourcedir;
- // Require our file, and call our function
- require_once($sourcedir. '/Subs-Themes.php');
- approve_theme();
- // Can we approve themes?
- isAllowedTo('approve_themes');
- }
- function disapprove()
- {
- // Globalize what we need...
- global $sourcedir;
- // Require our file, and call our function
- require_once($sourcedir. '/Subs-Themes.php');
- disapprove_theme();
- // Can we disapprove themes?
- isAllowedTo('disapprove_themes');
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement