Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.30 KB | None | 0 0
  1. <?php
  2. /*************************************************************************************
  3. * OurThemes.php                                                                      *
  4. **************************************************************************************
  5. * Written by: SMF Modders Team                                                       *
  6. * Website: SMFModders.com                                                            *
  7. **************************************************************************************
  8. * This file is the main source file for the SMF Modders Theme Site.                  *
  9. **************************************************************************************
  10. * The contents of this file are owned and copyrighted by SMFModders.com. Do not      *
  11. * copy, reproduce, or share the code from this file.                                 *
  12. *************************************************************************************/
  13. if (!defined('SMF'))
  14.     die('Hacking Attempt...');
  15.  
  16. function Themes()
  17. {
  18.  
  19.     // Globalize what we need...
  20.     global $context, $sourcedir;
  21.  
  22.     // Our Sub-actions...
  23.     $subActions = array(
  24.         'main' => 'main',
  25.         'submit' => 'submit',
  26.         'submit2' => 'submit2',
  27.         'modify' => 'modify',
  28.         'modify2' => 'modify2',
  29.         'remove' => 'remove',
  30.         'approve' => 'approve',
  31.         'disapprove' => 'disapprove',
  32.     );
  33.  
  34.     @$area = $_REQUEST['area'];
  35.  
  36.     if (!empty($subActions[$area]))
  37.         $subActions[$area]();
  38.     else
  39.         $subActions['main']();
  40.  
  41.     // Require and load
  42.     require_once($sourcedir. '/Subs-Themes.php');
  43.     themesiteresults();
  44.  
  45.     // Load our template...
  46.     loadTemplate('OurThemes');
  47.  
  48.     // Can we? Array.
  49.     $context['can'] = array(
  50.         'view' => allowedTo('view_themesite'),
  51.         'submit' => allowedTo('submit_theme'),
  52.         'modify' => allowedTo('modify_themes'),
  53.         'remove' => allowedTo('remove_themes'),
  54.         'no_approval_req' => allowedTo('no_theme_approval_required'),
  55.         'approve' => allowedTo('approve_themes'),
  56.         'disapprove' => allowedTo('disapprove_themes'),
  57.         'report' => allowedTo('report_theme_issue'),
  58.         'override_maintenance' => allowedTo('view_themesite_maintenance')
  59.     );
  60.  
  61.     // Can we view the theme site?
  62.     isAllowedTo('view_themesite');
  63.  
  64.  
  65. }
  66.  
  67. function main()
  68. {
  69.  
  70.     // Globalize what we need...
  71.     global $context, $txt, $scripturl, $sourcedir, $settings;
  72.  
  73.     // Load our sub-template!
  74.     $context['sub_template'] = 'main';
  75.  
  76.     // What is our page title?
  77.     $context['page_title'] = 'Themes - '. $context['forum_name'];
  78.  
  79.     // Build the link tree.
  80.     $context['linktree'][] = array(
  81.         'url' => $scripturl . '?action=themes;area=main',
  82.         'name' => 'Themes',
  83.     );
  84.  
  85.     // Can we view the theme site?
  86.     isAllowedTo('view_themesite');
  87.  
  88. }
  89.  
  90. function modify()
  91. {
  92.  
  93.     // Globalize what we need...
  94.     global $context, $txt, $scripturl, $sourcedir;
  95.  
  96.     // Require and load
  97.     require_once($sourcedir. '/Subs-Themes.php');
  98.     themesiteresults();
  99.  
  100.     // Load our sub-template!
  101.     $context['sub_template'] = 'modify';
  102.  
  103.     // What is our page title?
  104.     $context['page_title'] = 'Modify '. $context['theme'][$_REQUEST['id']]['name']. ' - '. $context['forum_name'];
  105.  
  106.     // Linktree!
  107.     $context['linktree'][] = array(
  108.         'url' => $scripturl . '?action=themes;area=main',
  109.         'name' => 'Theme',
  110.     );
  111.     $context['linktree'][] = array(
  112.         'url' => $scripturl. '?action=themes;area=modify;id='. $_REQUEST['id'],
  113.         'name' => 'Modify Theme ('. $context['mod'][$_REQUEST['id']]['name']. ')',
  114.     );
  115.  
  116.     // Can we be here?
  117.     isAllowedTo('modify_themes');
  118. }
  119.  
  120. function modify2()
  121. {
  122.  
  123.     // Globalize what we need...
  124.     global $sourcedir;
  125.  
  126.     // Require our file, and call our function
  127.     require_once($sourcedir. '/Subs-Themes.php');
  128.     modify_query();
  129.     themesiteresults();
  130.  
  131.     // Can we modify themes?
  132.     isAllowedTo('modify_themes');
  133.  
  134. }
  135.  
  136. // It's nice to finally have a *small* function!
  137. function remove()
  138. {
  139.  
  140.     // Globalize what we need...
  141.     global $sourcedir;
  142.  
  143.     // Require our file, and call our function
  144.     require_once($sourcedir. '/Subs-Themes.php');
  145.     removetheme();
  146.  
  147.     // Can we remove themes?
  148.     isAllowedTo('remove_themes');
  149.  
  150. }
  151.  
  152. function submit()
  153. {
  154.  
  155.     // Globalize what we need...
  156.     global $context, $txt, $scripturl;
  157.  
  158.     // Load our sub-template
  159.     $context['sub_template'] = 'submit';
  160.  
  161.     // Define a page title
  162.     $context['page_title'] = 'Submit a Theme - '. $context['forum_name'];
  163.  
  164.     // What date was the theme submitted?
  165.     $context['date_submitted'] = date("F d, Y");
  166.  
  167.     // What time was the theme submitted?
  168.     $context['time_submitted'] = date("g:i:sA");
  169.  
  170.     // Linktree!
  171.     $context['linktree'][] = array(
  172.         'url' => $scripturl . '?action=themes;area=main',
  173.         'name' => 'Themes',
  174.     );
  175.     $context['linktree'][] = array(
  176.         'url' => $scripturl. '?action=themes;area=submit',
  177.         'name' => 'Submit a Theme',
  178.     );
  179.  
  180.     // Can we submit a theme...?
  181.     isAllowedTo('submit_theme');
  182.  
  183. }
  184.  
  185. function submit2()
  186. {
  187.  
  188.     // Globalize what we need...
  189.     global $sourcedir;
  190.  
  191.     // Require our file, and call our function
  192.     require_once($sourcedir. '/Subs-Themes.php');
  193.     addtheme();
  194.  
  195.     // Can we submit themes?
  196.     isAllowedTo('submit_theme');
  197.  
  198. }
  199.  
  200. function approve()
  201. {
  202.  
  203.     // Globalize what we need...
  204.     global $sourcedir;
  205.  
  206.     // Require our file, and call our function
  207.     require_once($sourcedir. '/Subs-Themes.php');
  208.     approve_theme();
  209.  
  210.     // Can we approve themes?
  211.     isAllowedTo('approve_themes');
  212.  
  213. }
  214.  
  215. function disapprove()
  216. {
  217.  
  218.     // Globalize what we need...
  219.     global $sourcedir;
  220.  
  221.     // Require our file, and call our function
  222.     require_once($sourcedir. '/Subs-Themes.php');
  223.     disapprove_theme();
  224.  
  225.     // Can we disapprove themes?
  226.     isAllowedTo('disapprove_themes');
  227.  
  228. }
  229.  
  230. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement