Topic: Toggle Button

##
##        Mod title:  Toggle Button
##
##      Mod version:  1.0
##   Works on PunBB:  Should work on any version, but only tested with 1.1.5 
##     Release date:  2004-09-10
##           Author:  Smartys (keyrex1@verizon.net)
##
##      Description:  Adds a toggle button to moderate.php so you can check
##                    multiple boxes faster! And Rickard called us lazy! :P
##
##   Affected files:  moderate.php
##                    header.php
##
##       Affects DB:  No
##
##       DISCLAIMER:  Please note that "mods" are not officially supported by
##                    PunBB. Installation of this modification is done at your
##                    own risk. Backup your forum database and any and all
##                    applicable files before proceeding.
##
##


#
#---------[ 1. OPEN ]---------------------------------------------------------
#

header.php


#
#---------[ 2. FIND ]------------------------------------------------
#

// START SUBST - <pun_head>
ob_start();

if (isset($destination))
    echo '<meta http-equiv="refresh" content="'.$delay.';URL='.$destination.'">'."\n";


#
#---------[ 3. REPLACE WITH ]---------------------------------------------------
#

// START SUBST - <pun_head>
ob_start();

if (isset($moderate))
{
?>

<SCRIPT LANGUAGE=JAVASCRIPT>    
function selectAll(f) {
for(i=0;i<f.length;i++)
if(f.elements[i].type == "checkbox")
f.elements[i].click();
}
</SCRIPT>

<?php

}

if (isset($destination))
    echo '<meta http-equiv="refresh" content="'.$delay.';URL='.$destination.'">'."\n";
#
#---------[ 4. SAVE/UPLOAD ]-------------------------------------------------
#



#
#---------[ 5. OPEN ]--------------------------------------------------------
#

moderate.php


#
#---------[ 6. FIND ]------------------------------------------------
#

<td><b><a href="index.php"><?php echo pun_htmlspecialchars($pun_config['o_board_title']) ?></a> / <a href="viewforum.php?id=<?php echo $fid ?>"><?php echo pun_htmlspecialchars($forum_name) ?></a> / <?php echo pun_htmlspecialchars($subject) ?></b></td>


#
#---------[ 7. REPLACE WITH ]------------------------------------------------
#

<td><b><a href="index.php"><?php echo pun_htmlspecialchars($pun_config['o_board_title']) ?></a> / <a href="viewforum.php?id=<?php echo $fid ?>"><?php echo pun_htmlspecialchars($forum_name) ?></a> / <?php echo pun_htmlspecialchars($subject) ?></b></td><td align=right><a href="javascript:selectAll(document.forms[0])"><font size=1>Toggle</font></a></td>


#
#---------[ 8. FIND ]------------------------------------------------
#

<td><b><a href="index.php"><?php echo pun_htmlspecialchars($pun_config['o_board_title']) ?></a> / <?php echo pun_htmlspecialchars($forum_name) ?></b></td>


#
#---------[ 9. REPLACE WITH ]------------------------------------------------
#

<td><b><a href="index.php"><?php echo pun_htmlspecialchars($pun_config['o_board_title']) ?></a> / <?php echo pun_htmlspecialchars($forum_name) ?></b></td><td align=right><a href="javascript:selectAll(document.forms[0])"><font size=1>Toggle</font></a></td>


#
#---------[ 10. FIND ]------------------------------------------------
#

$pun_root = './';
require $pun_root.'include/common.php';


#
#---------[ 11. REPLACE WITH ]------------------------------------------------
#

$pun_root = './';
require $pun_root.'include/common.php';
$moderate = true;


#
#---------[ 12. SAVE/UPLOAD ]-------------------------------------------------
#

Enjoy the laziness! tongue