plugins/SpecialAdmin.php
changeset 324 6f030150b171
parent 318 eec2dfd2f0a3
child 346 35b0a72083ca
equal deleted inserted replaced
323:58fa63f7f23b 324:6f030150b171
  1429       $q = Array(
  1429       $q = Array(
  1430         'DELETE FROM '.table_prefix.'categories WHERE page_id=\'' . $db->escape($_POST['old_page_id']) . '\' AND namespace=\'' . $db->escape($_POST['old_namespace']) . '\';',
  1430         'DELETE FROM '.table_prefix.'categories WHERE page_id=\'' . $db->escape($_POST['old_page_id']) . '\' AND namespace=\'' . $db->escape($_POST['old_namespace']) . '\';',
  1431         'DELETE FROM '.table_prefix.'comments   WHERE page_id=\'' . $db->escape($_POST['old_page_id']) . '\' AND namespace=\'' . $db->escape($_POST['old_namespace']) . '\';',
  1431         'DELETE FROM '.table_prefix.'comments   WHERE page_id=\'' . $db->escape($_POST['old_page_id']) . '\' AND namespace=\'' . $db->escape($_POST['old_namespace']) . '\';',
  1432         'DELETE FROM '.table_prefix.'logs       WHERE page_id=\'' . $db->escape($_POST['old_page_id']) . '\' AND namespace=\'' . $db->escape($_POST['old_namespace']) . '\';',
  1432         'DELETE FROM '.table_prefix.'logs       WHERE page_id=\'' . $db->escape($_POST['old_page_id']) . '\' AND namespace=\'' . $db->escape($_POST['old_namespace']) . '\';',
  1433         'DELETE FROM '.table_prefix.'page_text  WHERE page_id=\'' . $db->escape($_POST['old_page_id']) . '\' AND namespace=\'' . $db->escape($_POST['old_namespace']) . '\';',
  1433         'DELETE FROM '.table_prefix.'page_text  WHERE page_id=\'' . $db->escape($_POST['old_page_id']) . '\' AND namespace=\'' . $db->escape($_POST['old_namespace']) . '\';',
       
  1434         'DELETE FROM '.table_prefix.'acl        WHERE page_id=\'' . $db->escape($_POST['old_page_id']) . '\' AND namespace=\'' . $db->escape($_POST['old_namespace']) . '\';',
  1434         );
  1435         );
  1435       foreach($q as $cq)
  1436       foreach($q as $cq)
  1436       {
  1437       {
  1437         $e = $db->sql_query($cq);
  1438         $e = $db->sql_query($cq);
  1438         if(!$e) $db->_die('Some of the additional tables containing page information could not be updated.');
  1439         if(!$e) $db->_die('Some of the additional tables containing page information could not be updated.');
  2624             <p>
  2625             <p>
  2625               What type of block should this be?
  2626               What type of block should this be?
  2626             </p>
  2627             </p>
  2627             <p>
  2628             <p>
  2628               <select name="type" onchange="setType(this)"> <?php /* (NOT WORKING, at least in firefox 2) onload="var thingy = this; setTimeout('setType(thingy)', 500);" */ ?>
  2629               <select name="type" onchange="setType(this)"> <?php /* (NOT WORKING, at least in firefox 2) onload="var thingy = this; setTimeout('setType(thingy)', 500);" */ ?>
  2629                 <option value="<?php echo BLOCK_WIKIFORMAT; ?>">Wiki-formatted block</option>
  2630                 <option value="<?php echo BLOCK_WIKIFORMAT; ?>">Textual content (wikitext)</option>
  2630                 <option value="<?php echo BLOCK_TEMPLATEFORMAT; ?>">Template-formatted block (old pre-beta 3 behavior)</option>
  2631                 <option value="<?php echo BLOCK_TEMPLATEFORMAT; ?>">List of links with logic capabilities</option>
  2631                 <option value="<?php echo BLOCK_HTML; ?>">Raw HTML block</option>
  2632                 <option value="<?php echo BLOCK_HTML; ?>">Pure HTML</option>
  2632                 <option value="<?php echo BLOCK_PHP; ?>">PHP code block (danger, Will Robinson!)</option>
  2633                 <option value="<?php echo BLOCK_PHP; ?>">PHP code</option>
  2633                 <option value="<?php echo BLOCK_PLUGIN; ?>">Use code from a plugin</option>
  2634                 <option value="<?php echo BLOCK_PLUGIN; ?>">Plugin block</option>
  2634               </select>
  2635               </select>
  2635             </p>
  2636             </p>
  2636             
  2637             
  2637             <p>
  2638             <p>
  2638             
  2639             
  2641             
  2642             
  2642             </p>
  2643             </p>
  2643             
  2644             
  2644             <div class="sbadd_block" id="blocktype_<?php echo BLOCK_WIKIFORMAT; ?>">
  2645             <div class="sbadd_block" id="blocktype_<?php echo BLOCK_WIKIFORMAT; ?>">
  2645               <p>
  2646               <p>
       
  2647                 <b>This block type is for textual content.</b> This could be information, a random fact, or some other blob of fully formatted text. Links show up inline,
       
  2648                 not as a list.
       
  2649               </p>
       
  2650               <p>
  2646                 Wikitext:
  2651                 Wikitext:
  2647               </p>
  2652               </p>
  2648               <p>
  2653               <p>
  2649                 <textarea style="width: 98%;" name="wikiformat_content" rows="15" cols="50"></textarea>
  2654                 <textarea style="width: 98%;" name="wikiformat_content" rows="15" cols="50"></textarea>
  2650               </p>
  2655               </p>
  2651             </div>
  2656             </div>
  2652             
  2657             
  2653             <div class="sbadd_block" id="blocktype_<?php echo BLOCK_TEMPLATEFORMAT; ?>">
  2658             <div class="sbadd_block" id="blocktype_<?php echo BLOCK_TEMPLATEFORMAT; ?>">
  2654               <p>
  2659               <p>
       
  2660                 <b>This block type is for links.</b> Use wikilinks (both internal and external are supported) to build a list of links. All links will be shown block-style,
       
  2661                 or one link per line. You can use logic in these blocks as well:
       
  2662               </p>
       
  2663               <pre>{if user_logged_in&#x7d;
       
  2664   [[Special:Preferences|User control panel]]
       
  2665 {/if&#x7d;</pre>
       
  2666               <p>
  2655                 Template code:
  2667                 Template code:
  2656               </p>
  2668               </p>
  2657               <p>
  2669               <p>
  2658                 <textarea style="width: 98%;" name="templateformat_content" rows="15" cols="50"></textarea>
  2670                 <textarea style="width: 98%;" name="templateformat_content" rows="15" cols="50"></textarea>
  2659               </p>
  2671               </p>
  2660             </div>
  2672             </div>
  2661             
  2673             
  2662             <div class="sbadd_block" id="blocktype_<?php echo BLOCK_HTML; ?>">
  2674             <div class="sbadd_block" id="blocktype_<?php echo BLOCK_HTML; ?>">
       
  2675               <p>
       
  2676                 <b>This block type is for textual content.</b> HTML you use here will not be filtered or parsed at all - it will be displayed verbatim. This gives you
       
  2677                    slightly more control over your content but you can't use wikilinks or other wikitext in here.
       
  2678               </p>
  2663               <p>
  2679               <p>
  2664                 HTML to place inside the sidebar:
  2680                 HTML to place inside the sidebar:
  2665               </p>
  2681               </p>
  2666               <p>
  2682               <p>
  2667                 <textarea style="width: 98%;" name="html_content" rows="15" cols="50"></textarea>
  2683                 <textarea style="width: 98%;" name="html_content" rows="15" cols="50"></textarea>
  2672               <?php if ( defined('ENANO_DEMO_MODE') ) { ?>
  2688               <?php if ( defined('ENANO_DEMO_MODE') ) { ?>
  2673                 <p>Creating PHP blocks in demo mode is disabled for security reasons.</p>
  2689                 <p>Creating PHP blocks in demo mode is disabled for security reasons.</p>
  2674               <?php } else { ?>
  2690               <?php } else { ?>
  2675               <p>
  2691               <p>
  2676                 <b>WARNING:</b> If you don't know what you're doing, or if you are not fluent in PHP, stop now and choose a different block type. You will brick your Enano installation if you are not careful here.
  2692                 <b>WARNING:</b> If you don't know what you're doing, or if you are not fluent in PHP, stop now and choose a different block type. You will brick your Enano installation if you are not careful here.
  2677                 ALWAYS remember to write secure code! The Enano team is not responsible if someone drops all your tables because of an SQL injection vulnerability in your sidebar code. You are probably better off using the template-formatted block type.
  2693                 ALWAYS remember to write secure code! The Enano team is not responsible if someone drops all your tables because of an SQL injection vulnerability in your sidebar code. You are probably better off using the links and logic block type.
  2678               </p>
  2694               </p>
  2679               <p>
  2695               <p>
  2680                 <span style="color: red;">
  2696                 <span style="color: red;">
  2681                   It is especially important to note that this code is NOT checked for errors! If there is a syntax error in your code here, it will prevent any pages from loading AT ALL. So you need to use an external PHP editor (like <a href="http://www.jedit.org">jEdit</a>) to check your syntax before you hit save.
  2697                   It is especially important to note that the syntax of your code is not validated here. If there is a syntax error in your code here, it might prevent Enano from working properly. It is recommended that you use an external PHP editor (like <a href="http://www.jedit.org">jEdit</a>) to check your syntax before you hit save.
  2682                 </span> You have been warned.
  2698                 </span> You have been warned.
  2683               </p>
  2699               </p>
  2684               <p>
  2700               <p>
  2685                 Also, you should avoid using output buffering functions (ob_[start|end|get_contents|clean]) here, because Enano uses those to track output from this script.
  2701                 Also, you should avoid using output buffering functions (ob_[start|end|get_contents|clean]) here, because Enano uses those to track output from this script.
  2686               </p>
  2702               </p>
  2687               <p>
  2703               <p>
  2688                 The standard &lt;?php and ?&gt; tags work here. Don't use an initial "&lt;?php" or it will cause a parse error.
  2704                 The standard &lt;?php and ?&gt; tags work here, but don't use an initial "&lt;?php" or it will cause a parse error.
  2689               </p>
  2705               </p>
  2690               <p>
  2706               <p>
  2691                 PHP code:
  2707                 PHP code:
  2692               </p>
  2708               </p>
  2693               <p>
  2709               <p>