Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • osian/sucs-site
  • kais58/sucs-site
  • imranh/sucs-site
  • foshjedi2004/sucs-site
  • gigosaurus/sucs-site
  • matstn/sucs-site
  • ripp_/sucs-site
  • eggnog/sucs-site
  • sucssite/sucs-site
  • elbows/sucs-site
  • realitykiller/sucs-site
  • crox/sucs-site
  • vectre/sucs-site
  • welshbyte/sucs-site
  • paperclipman/sucs-site
15 results
Show changes
Showing
with 0 additions and 909 deletions
<?php
/***********************************************************************
Copyright (C) 2002-2008 PunBB
This file is part of PunBB.
PunBB is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
PunBB is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston,
MA 02111-1307 USA
************************************************************************/
// Make sure no one attempts to run this script "directly"
if (!defined('PUN'))
pun_exit();
// Send no-cache headers
header('Expires: Thu, 21 Jul 1977 07:30:00 GMT'); // When yours truly first set eyes on this world! :)
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache'); // For HTTP/1.0 compability
// Load the template
if (defined('PUN_ADMIN_CONSOLE'))
$tpl_main = file_get_contents(PUN_ROOT.'include/template/admin.tpl');
else if (defined('PUN_HELP'))
$tpl_main = file_get_contents(PUN_ROOT.'include/template/help.tpl');
else
$tpl_main = file_get_contents(PUN_ROOT.'include/template/main.tpl');
// START SUBST - <pun_include "*">
while (preg_match('#<pun_include "([^/\\\\]*?)\.(php[45]?|inc|html?|txt)">#', $tpl_main, $cur_include))
{
if (!file_exists(PUN_ROOT.'include/user/'.$cur_include[1].'.'.$cur_include[2]))
error('Unable to process user include '.htmlspecialchars($cur_include[0]).' from template main.tpl. There is no such file in folder /include/user/');
ob_start();
include PUN_ROOT.'include/user/'.$cur_include[1].'.'.$cur_include[2];
$tpl_temp = ob_get_contents();
$tpl_main = str_replace($cur_include[0], $tpl_temp, $tpl_main);
ob_end_clean();
}
// END SUBST - <pun_include "*">
// START SUBST - <pun_content_direction>
$tpl_main = str_replace('<pun_content_direction>', $lang_common['lang_direction'], $tpl_main);
// END SUBST - <pun_content_direction>
// START SUBST - <pun_char_encoding>
$tpl_main = str_replace('<pun_char_encoding>', $lang_common['lang_encoding'], $tpl_main);
// END SUBST - <pun_char_encoding>
// START SUBST - <pun_head>
ob_start();
// Is this a page that we want search index spiders to index?
if (!defined('PUN_ALLOW_INDEX'))
echo '<meta name="ROBOTS" content="NOINDEX, FOLLOW" />'."\n";
?>
<title><?php echo $page_title ?></title>
<link rel="stylesheet" type="text/css" href="style/<?php echo $pun_user['style'].'.css' ?>" />
<?php
if (defined('PUN_ADMIN_CONSOLE'))
echo '<link rel="stylesheet" type="text/css" href="style/imports/base_admin.css" />'."\n";
if (isset($required_fields))
{
// Output JavaScript to validate form (make sure required fields are filled out)
?>
<script type="text/javascript">
<!--
function process_form(the_form)
{
var element_names = new Object()
<?php
// Output a JavaScript array with localised field names
while (list($elem_orig, $elem_trans) = @each($required_fields))
echo "\t".'element_names["'.$elem_orig.'"] = "'.addslashes(str_replace('&nbsp;', ' ', $elem_trans)).'"'."\n";
?>
if (document.all || document.getElementById)
{
for (i = 0; i < the_form.length; ++i)
{
var elem = the_form.elements[i]
if (elem.name && elem.name.substring(0, 4) == "req_")
{
if (elem.type && (elem.type=="text" || elem.type=="textarea" || elem.type=="password" || elem.type=="file") && elem.value=='')
{
alert("\"" + element_names[elem.name] + "\" <?php echo $lang_common['required field'] ?>")
elem.focus()
return false
}
}
}
}
return true
}
// -->
</script>
<?php
}
$user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? strtolower($_SERVER['HTTP_USER_AGENT']) : '';
if (strpos($user_agent, 'msie') !== false && strpos($user_agent, 'windows') !== false && strpos($user_agent, 'opera') === false)
echo '<script type="text/javascript" src="style/imports/minmax.js"></script>';
$tpl_temp = trim(ob_get_contents());
$tpl_main = str_replace('<pun_head>', $tpl_temp, $tpl_main);
ob_end_clean();
// END SUBST - <pun_head>
// START SUBST - <body>
if (isset($focus_element))
{
$tpl_main = str_replace('<body onload="', '<body onload="document.getElementById(\''.$focus_element[0].'\').'.$focus_element[1].'.focus();', $tpl_main);
$tpl_main = str_replace('<body>', '<body onload="document.getElementById(\''.$focus_element[0].'\').'.$focus_element[1].'.focus()">', $tpl_main);
}
// END SUBST - <body>
// START SUBST - <pun_page>
$tpl_main = str_replace('<pun_page>', htmlspecialchars(basename($_SERVER['PHP_SELF'], '.php')), $tpl_main);
// END SUBST - <pun_page>
// START SUBST - <pun_title>
$tpl_main = str_replace('<pun_title>', '<h1><span>'.pun_htmlspecialchars($pun_config['o_board_title']).'</span></h1>', $tpl_main);
// END SUBST - <pun_title>
// START SUBST - <pun_desc>
$tpl_main = str_replace('<pun_desc>', '<p><span>'.$pun_config['o_board_desc'].'</span></p>', $tpl_main);
// END SUBST - <pun_desc>
// START SUBST - <pun_navlinks>
$tpl_main = str_replace('<pun_navlinks>','<div id="brdmenu" class="inbox">'."\n\t\t\t". generate_navlinks()."\n\t\t".'</div>', $tpl_main);
// END SUBST - <pun_navlinks>
// START SUBST - <pun_status>
if ($pun_user['is_guest'])
$tpl_temp = '<div id="brdwelcome" class="inbox">'."\n\t\t\t".'<p>'.$lang_common['Not logged in'].'</p>'."\n\t\t".'</div>';
else
{
$tpl_temp = '<div id="brdwelcome" class="inbox">'."\n\t\t\t".'<ul class="conl">'."\n\t\t\t\t".'<li>'.$lang_common['Logged in as'].' <strong>'.pun_htmlspecialchars($pun_user['username']).'</strong></li>'."\n\t\t\t\t".'<li>'.$lang_common['Last visit'].': '.format_time($pun_user['last_visit']).'</li>';
if ($pun_user['g_id'] < PUN_GUEST)
{
$result_header = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'reports WHERE zapped IS NULL') or error('Unable to fetch reports info', __FILE__, __LINE__, $db->error());
if ($db->result($result_header))
$tpl_temp .= "\n\t\t\t\t".'<li class="reportlink"><strong><a href="admin_reports.php">There are new reports</a></strong></li>';
if ($pun_config['o_maintenance'] == '1')
$tpl_temp .= "\n\t\t\t\t".'<li class="maintenancelink"><strong><a href="admin_options.php#maintenance">Maintenance mode is enabled!</a></strong></li>';
}
if (in_array(basename($_SERVER['PHP_SELF']), array('index.php', 'search.php')))
$tpl_temp .= "\n\t\t\t".'</ul>'."\n\t\t\t".'<ul class="conr">'."\n\t\t\t\t".'<li><a href="search.php?action=show_new">'.$lang_common['Show new posts'].'</a></li>'."\n\t\t\t\t".'<li><a href="misc.php?action=markread">'.$lang_common['Mark all as read'].'</a></li>'."\n\t\t\t".'</ul>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>';
else
$tpl_temp .= "\n\t\t\t".'</ul>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>';
}
$tpl_main = str_replace('<pun_status>', $tpl_temp, $tpl_main);
// END SUBST - <pun_status>
// START SUBST - <pun_announcement>
if ($pun_config['o_announcement'] == '1')
{
ob_start();
?>
<div id="announce" class="block">
<h2><span><?php echo $lang_common['Announcement'] ?></span></h2>
<div class="box">
<div class="inbox">
<div><?php echo $pun_config['o_announcement_message'] ?></div>
</div>
</div>
</div>
<?php
$tpl_temp = trim(ob_get_contents());
$tpl_main = str_replace('<pun_announcement>', $tpl_temp, $tpl_main);
ob_end_clean();
}
else
$tpl_main = str_replace('<pun_announcement>', '', $tpl_main);
// END SUBST - <pun_announcement>
// START SUBST - <pun_main>
ob_start();
define('PUN_HEADER', 1);
<?php
/***********************************************************************
Copyright (C) 2002-2008 PunBB
This file is part of PunBB.
PunBB is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
PunBB is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston,
MA 02111-1307 USA
************************************************************************/
// Tell header.php to use the help template
define('PUN_HELP', 1);
define('PUN_ROOT', './');
require PUN_ROOT.'include/common.php';
if ($pun_user['g_read_board'] == '0')
message($lang_common['No view']);
// Load the help.php language file
require PUN_ROOT.'lang/'.$pun_user['language'].'/help.php';
$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_help['Help'];
require PUN_ROOT.'header.php';
?>
<h2><?php echo $lang_common['BBCode'] ?></h2>
<div class="box">
<div class="inbox">
<p><a name="bbcode"></a><?php echo $lang_help['BBCode info 1'] ?></p><br />
<p><?php echo $lang_help['BBCode info 2'] ?></p>
</div>
</div>
<h2><?php echo $lang_help['Text style'] ?></h2>
<div class="box">
<p><?php echo $lang_help['Text style info'] ?></p><br />
<div style="padding-left: 4px">
[b]<?php echo $lang_help['Bold text'] ?>[/b] <?php echo $lang_help['produces'] ?> <b><?php echo $lang_help['Bold text'] ?></b><br />
[u]<?php echo $lang_help['Underlined text'] ?>[/u] <?php echo $lang_help['produces'] ?> <span class="bbu"><?php echo $lang_help['Underlined text'] ?></span><br />
[i]<?php echo $lang_help['Italic text'] ?>[/i] <?php echo $lang_help['produces'] ?> <i><?php echo $lang_help['Italic text'] ?></i><br />
[color=#FF0000]<?php echo $lang_help['Red text'] ?>[/color] <?php echo $lang_help['produces'] ?> <span style="color: #ff0000"><?php echo $lang_help['Red text'] ?></span><br />
[color=blue]<?php echo $lang_help['Blue text'] ?>[/color] <?php echo $lang_help['produces'] ?> <span style="color: blue"><?php echo $lang_help['Blue text'] ?></span>
</div>
</div>
<h2><?php echo $lang_help['Links and images'] ?></h2>
<div class="box">
<p><?php echo $lang_help['Links info'] ?></p><br />
<div style="padding-left: 4px">
[url=<?php echo $pun_config['o_base_url'].'/' ?>]<?php echo pun_htmlspecialchars($pun_config['o_board_title']) ?>[/url] <?php echo $lang_help['produces'] ?> <a href="<?php echo $pun_config['o_base_url'].'/' ?>"><?php echo pun_htmlspecialchars($pun_config['o_board_title']) ?></a><br />
[url]<?php echo $pun_config['o_base_url'].'/' ?>[/url] <?php echo $lang_help['produces'] ?> <a href="<?php echo $pun_config['o_base_url'] ?>"><?php echo $pun_config['o_base_url'].'/' ?></a><br />
[email]myname@mydomain.com[/email] <?php echo $lang_help['produces'] ?> <a href="mailto:myname@mydomain.com">myname@mydomain.com</a><br />
[email=myname@mydomain.com]<?php echo $lang_help['My e-mail address'] ?>[/email] <?php echo $lang_help['produces'] ?> <a href="mailto:myname@mydomain.com"><?php echo $lang_help['My e-mail address'] ?></a><br /><br />
</div>
<p><a name="img"></a><?php echo $lang_help['Images info'] ?></p>
<div>[img]http://punbb.informer.com/img/small_logo.png[/img] <?php echo $lang_help['produces'] ?> <img src="http://punbb.informer.com/img/small_logo.png" alt="http://punbb.informer.com/img/small_logo.png" /></div>
</div>
<h2><?php echo $lang_help['Quotes'] ?></h2>
<div class="box">
<div style="padding-left: 4px">
<?php echo $lang_help['Quotes info'] ?><br /><br />
&nbsp;&nbsp;&nbsp;&nbsp;[quote=James]<?php echo $lang_help['Quote text'] ?>[/quote]<br /><br />
<?php echo $lang_help['produces quote box'] ?><br /><br />
<div class="postmsg">
<blockquote><div class="incqbox"><h4>James <?php echo $lang_common['wrote'] ?>:</h4><p><?php echo $lang_help['Quote text'] ?></p></div></blockquote>
</div>
<br />
<?php echo $lang_help['Quotes info 2'] ?><br /><br />
&nbsp;&nbsp;&nbsp;&nbsp;[quote]<?php echo $lang_help['Quote text'] ?>[/quote]<br /><br />
<?php echo $lang_help['produces quote box'] ?><br /><br />
<div class="postmsg">
<blockquote><div class="incqbox"><p><?php echo $lang_help['Quote text'] ?></p></div></blockquote>
</div>
</div>
</div>
<h2><?php echo $lang_help['Code'] ?></h2>
<div class="box">
<div style="padding-left: 4px">
<?php echo $lang_help['Code info'] ?><br /><br />
&nbsp;&nbsp;&nbsp;&nbsp;[code]<?php echo $lang_help['Code text'] ?>[/code]<br /><br />
<?php echo $lang_help['produces code box'] ?><br /><br />
<div class="postmsg">
<div class="codebox"><div class="incqbox"><h4><?php echo $lang_common['Code'] ?>:</h4><div class="scrollbox" style="height: 4.5em"><pre><?php echo $lang_help['Code text'] ?></pre></div></div></div>
</div>
</div>
</div>
<h2><?php echo $lang_help['Nested tags'] ?></h2>
<div class="box">
<div style="padding-left: 4px">
<?php echo $lang_help['Nested tags info'] ?><br /><br />
&nbsp;&nbsp;&nbsp;&nbsp;[b][u]<?php echo $lang_help['Bold, underlined text'] ?>[/u][/b] <?php echo $lang_help['produces'] ?> <span class="bbu"><b><?php echo $lang_help['Bold, underlined text'] ?></b></span><br /><br />
</div>
</div>
<h2><?php echo $lang_common['Smilies'] ?></h2>
<div class="box">
<div style="padding-left: 4px">
<a name="smilies"></a><?php echo $lang_help['Smilies info'] ?><br /><br />
<?php
// Display the smiley set
require PUN_ROOT.'include/parser.php';
$num_smilies = count($smiley_text);
for ($i = 0; $i < $num_smilies; ++$i)
{
// Is there a smiley at the current index?
if (!isset($smiley_text[$i]))
continue;
echo "\t\t".'&nbsp;&nbsp;&nbsp;&nbsp;'.$smiley_text[$i];
// Save the current text and image
$cur_img = $smiley_img[$i];
$cur_text = $smiley_text[$i];
// Loop through the rest of the array and see if there are any duplicate images
// (more than one text representation for one image)
for ($next = $i + 1; $next < $num_smilies; ++$next)
{
// Did we find a dupe?
if (isset($smiley_img[$next]) && $smiley_img[$i] == $smiley_img[$next])
{
echo ' '.$lang_common['and'].' '.$smiley_text[$next];
// Remove the dupe so we won't display it twice
unset($smiley_text[$next]);
unset($smiley_img[$next]);
}
}
echo ' '.$lang_help['produces'].' <img src="img/smilies/'.$cur_img.'" width="15" height="15" alt="'.$cur_text.'" /><br />'."\n";
}
?>
<br />
</div>
</div>
<?php
require PUN_ROOT.'footer.php';
<html>
<head>
<title>.</title>
</head>
<body>
.
</body>
</html>
\ No newline at end of file
<html>
<head>
<title>.</title>
</head>
<body>
.
</body>
</html>
\ No newline at end of file
lib/punbb/img/smilies/big_smile.png

544 B

lib/punbb/img/smilies/cool.png

560 B

lib/punbb/img/smilies/hmm.png

564 B

<html>
<head>
<title>.</title>
</head>
<body>
.
</body>
</html>
\ No newline at end of file
lib/punbb/img/smilies/lol.png

538 B

lib/punbb/img/smilies/mad.png

560 B

lib/punbb/img/smilies/neutral.png

565 B

lib/punbb/img/smilies/roll.png

559 B

lib/punbb/img/smilies/sad.png

568 B

lib/punbb/img/smilies/smile.png

598 B

lib/punbb/img/smilies/tongue.png

563 B

lib/punbb/img/smilies/wink.png

642 B

lib/punbb/img/smilies/yikes.png

554 B

<?php
/***********************************************************************
Copyright (C) 2002-2008 PunBB
This file is part of PunBB.
PunBB is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
PunBB is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston,
MA 02111-1307 USA
************************************************************************/
// Make sure no one attempts to run this script "directly"
if (!defined('PUN'))
pun_exit();
//
// If we are running pre PHP 4.2.0, we add our own implementation of var_export
//
if (!function_exists('var_export'))
{
function var_export()
{
$args = func_get_args();
$indent = (isset($args[2])) ? $args[2] : '';
if (is_array($args[0]))
{
$output = 'array ('."\n";
foreach ($args[0] as $k => $v)
{
if (is_numeric($k))
$output .= $indent.' '.$k.' => ';
else
$output .= $indent.' \''.str_replace('\'', '\\\'', str_replace('\\', '\\\\', $k)).'\' => ';
if (is_array($v))
$output .= var_export($v, true, $indent.' ');
else
{
if (gettype($v) != 'string' && !empty($v))
$output .= $v.','."\n";
else
$output .= '\''.str_replace('\'', '\\\'', str_replace('\\', '\\\\', $v)).'\','."\n";
}
}
$output .= ($indent != '') ? $indent.'),'."\n" : ')';
}
else
$output = $args[0];
if ($args[1] == true)
return $output;
else
echo $output;
}
}
//
// Generate the config cache PHP script
//
function generate_config_cache()
{
global $db;
// Get the forum config from the DB
$result = $db->query('SELECT * FROM '.$db->prefix.'config', true) or error('Unable to fetch forum config', __FILE__, __LINE__, $db->error());
while ($cur_config_item = $db->fetch_row($result))
$output[$cur_config_item[0]] = $cur_config_item[1];
// Output config as PHP code
$fh = @fopen(PUN_ROOT.'cache/cache_config.php', 'wb');
if (!$fh)
error('Unable to write configuration cache file to cache directory. Please make sure PHP has write access to the directory \'cache\'', __FILE__, __LINE__);
fwrite($fh, '<?php'."\n\n".'define(\'PUN_CONFIG_LOADED\', 1);'."\n\n".'$pun_config = '.var_export($output, true).';'."\n\n".'?>');
fclose($fh);
}
//
// Generate the bans cache PHP script
//
function generate_bans_cache()
{
global $db;
// Get the ban list from the DB
$result = $db->query('SELECT * FROM '.$db->prefix.'bans', true) or error('Unable to fetch ban list', __FILE__, __LINE__, $db->error());
$output = array();
while ($cur_ban = $db->fetch_assoc($result))
$output[] = $cur_ban;
// Output ban list as PHP code
$fh = @fopen(PUN_ROOT.'cache/cache_bans.php', 'wb');
if (!$fh)
error('Unable to write bans cache file to cache directory. Please make sure PHP has write access to the directory \'cache\'', __FILE__, __LINE__);
fwrite($fh, '<?php'."\n\n".'define(\'PUN_BANS_LOADED\', 1);'."\n\n".'$pun_bans = '.var_export($output, true).';'."\n\n".'?>');
fclose($fh);
}
//
// Generate the ranks cache PHP script
//
function generate_ranks_cache()
{
global $db;
// Get the rank list from the DB
$result = $db->query('SELECT * FROM '.$db->prefix.'ranks ORDER BY min_posts', true) or error('Unable to fetch rank list', __FILE__, __LINE__, $db->error());
$output = array();
while ($cur_rank = $db->fetch_assoc($result))
$output[] = $cur_rank;
// Output ranks list as PHP code
$fh = @fopen(PUN_ROOT.'cache/cache_ranks.php', 'wb');
if (!$fh)
error('Unable to write ranks cache file to cache directory. Please make sure PHP has write access to the directory \'cache\'', __FILE__, __LINE__);
fwrite($fh, '<?php'."\n\n".'define(\'PUN_RANKS_LOADED\', 1);'."\n\n".'$pun_ranks = '.var_export($output, true).';'."\n\n".'?>');
fclose($fh);
}
//
// Generate quickjump cache PHP scripts
//
function generate_quickjump_cache($group_id = false)
{
global $db, $lang_common, $pun_user;
// If a group_id was supplied, we generate the quickjump cache for that group only
if ($group_id !== false)
$groups[0] = $group_id;
else
{
// A group_id was now supplied, so we generate the quickjump cache for all groups
$result = $db->query('SELECT g_id FROM '.$db->prefix.'groups') or error('Unable to fetch user group list', __FILE__, __LINE__, $db->error());
$num_groups = $db->num_rows($result);
for ($i = 0; $i < $num_groups; ++$i)
$groups[] = $db->result($result, $i);
}
// Loop through the groups in $groups and output the cache for each of them
while (list(, $group_id) = @each($groups))
{
// Output quickjump as PHP code
$fh = @fopen(PUN_ROOT.'cache/cache_quickjump_'.$group_id.'.php', 'wb');
if (!$fh)
error('Unable to write quickjump cache file to cache directory. Please make sure PHP has write access to the directory \'cache\'', __FILE__, __LINE__);
$output = '<?php'."\n\n".'if (!defined(\'PUN\')) exit;'."\n".'define(\'PUN_QJ_LOADED\', 1);'."\n\n".'?>';
$output .= "\t\t\t\t".'<form id="qjump" method="get" action="viewforum.php">'."\n\t\t\t\t\t".'<div><label><?php echo $lang_common[\'Jump to\'] ?>'."\n\n\t\t\t\t\t".'<br /><select name="id" onchange="window.location=(\'viewforum.php?id=\'+this.options[this.selectedIndex].value)">'."\n";
$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.redirect_url FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$group_id.') WHERE fp.read_forum IS NULL OR fp.read_forum=1 ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());
$cur_category = 0;
while ($cur_forum = $db->fetch_assoc($result))
{
if ($cur_forum['cid'] != $cur_category) // A new category since last iteration?
{
if ($cur_category)
$output .= "\t\t\t\t\t\t".'</optgroup>'."\n";
$output .= "\t\t\t\t\t\t".'<optgroup label="'.pun_htmlspecialchars($cur_forum['cat_name']).'">'."\n";
$cur_category = $cur_forum['cid'];
}
$redirect_tag = ($cur_forum['redirect_url'] != '') ? ' &gt;&gt;&gt;' : '';
$output .= "\t\t\t\t\t\t\t".'<option value="'.$cur_forum['fid'].'"<?php echo ($forum_id == '.$cur_forum['fid'].') ? \' selected="selected"\' : \'\' ?>>'.pun_htmlspecialchars($cur_forum['forum_name']).$redirect_tag.'</option>'."\n";
}
$output .= "\t\t\t\t\t".'</optgroup>'."\n\t\t\t\t\t".'</select>'."\n\t\t\t\t\t".'<input type="submit" value="<?php echo $lang_common[\'Go\'] ?>" accesskey="g" />'."\n\t\t\t\t\t".'</label></div>'."\n\t\t\t\t".'</form>'."\n";
fwrite($fh, $output);
fclose($fh);
}
}
<?php
/***********************************************************************
Copyright (C) 2002-2008 PunBB
This file is part of PunBB.
PunBB is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
PunBB is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston,
MA 02111-1307 USA
************************************************************************/
// Enable DEBUG mode by removing // from the following line
//define('PUN_DEBUG', 1);
// This displays all executed queries in the page footer.
// DO NOT enable this in a production environment!
//define('PUN_SHOW_QUERIES', 1);
if (!defined('PUN_ROOT'))
pun_exit('The constant PUN_ROOT must be defined and point to a valid PunBB installation root directory.');
// Load the functions script
require PUN_ROOT.'include/functions.php';
// Reverse the effect of register_globals
unregister_globals();
@include PUN_ROOT.'config.php';
// If PUN isn't defined, config.php is missing or corrupt
if (!defined('PUN'))
pun_exit('The file \'config.php\' doesn\'t exist or is corrupt. Please run <a href="install.php">install.php</a> to install PunBB first.');
// Record the start time (will be used to calculate the generation time for the page)
list($usec, $sec) = explode(' ', microtime());
$pun_start = ((float)$usec + (float)$sec);
// Make sure PHP reports all errors except E_NOTICE. PunBB supports E_ALL, but a lot of scripts it may interact with, do not.
error_reporting(E_ALL ^ E_NOTICE);
if (get_magic_quotes_runtime())
set_magic_quotes_runtime(0);
// Strip slashes from GET/POST/COOKIE (if magic_quotes_gpc is enabled)
if (get_magic_quotes_gpc())
{
function stripslashes_array($array)
{
return is_array($array) ? array_map('stripslashes_array', $array) : stripslashes($array);
}
$_GET = stripslashes_array($_GET);
$_POST = stripslashes_array($_POST);
$_COOKIE = stripslashes_array($_COOKIE);
}
// Seed the random number generator (PHP <4.2.0 only)
if (version_compare(PHP_VERSION, '4.2.0', '<'))
mt_srand((double)microtime()*1000000);
// If a cookie name is not specified in config.php, we use the default (punbb_cookie)
if (empty($cookie_name))
$cookie_name = 'punbb_cookie';
// Define a few commonly used constants
define('PUN_UNVERIFIED', 32000);
define('PUN_ADMIN', 1);
define('PUN_MOD', 2);
define('PUN_GUEST', 3);
define('PUN_MEMBER', 4);
// Load DB abstraction layer and connect
require PUN_ROOT.'include/dblayer/common_db.php';
// Start a transaction
$db->start_transaction();
// Load cached config
@include PUN_ROOT.'cache/cache_config.php';
if (!defined('PUN_CONFIG_LOADED'))
{
require PUN_ROOT.'include/cache.php';
generate_config_cache();
require PUN_ROOT.'cache/cache_config.php';
}
// Enable output buffering
if (!defined('PUN_DISABLE_BUFFERING'))
{
// For some very odd reason, "Norton Internet Security" unsets this
$_SERVER['HTTP_ACCEPT_ENCODING'] = isset($_SERVER['HTTP_ACCEPT_ENCODING']) ? $_SERVER['HTTP_ACCEPT_ENCODING'] : '';
// Should we use gzip output compression?
if ($pun_config['o_gzip'] && extension_loaded('zlib') && (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false || strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate') !== false))
ob_start('ob_gzhandler');
else
ob_start();
}
// Check/update/set cookie and fetch user info
$pun_user = array();
//check_cookie($pun_user);
auth_user($pun_user);
// Attempt to load the common language file
@include PUN_ROOT.'lang/'.$pun_user['language'].'/common.php';
if (!isset($lang_common))
pun_exit('There is no valid language pack \''.pun_htmlspecialchars($pun_user['language']).'\' installed. Please reinstall a language of that name.');
// Check if we are to display a maintenance message
if ($pun_config['o_maintenance'] && $pun_user['g_id'] > PUN_ADMIN && !defined('PUN_TURN_OFF_MAINT'))
maintenance_message();
// Load cached bans
@include PUN_ROOT.'cache/cache_bans.php';
if (!defined('PUN_BANS_LOADED'))
{
require_once PUN_ROOT.'include/cache.php';
generate_bans_cache();
require PUN_ROOT.'cache/cache_bans.php';
}
// Check if current user is banned
check_bans();
// Update online list
update_users_online();
<?php
/***********************************************************************
Copyright (C) 2002-2008 PunBB
This file is part of PunBB.
PunBB is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
PunBB is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston,
MA 02111-1307 USA
************************************************************************/
// Make sure no one attempts to run this script "directly"
if (!defined('PUN'))
exit;
//
// Display the admin navigation menu
//
function generate_admin_menu($page = '')
{
global $pun_config, $pun_user;
$is_admin = $pun_user['g_id'] == PUN_ADMIN ? true : false;
?>
<div id="adminconsole" class="block2col">
<div id="adminmenu" class="blockmenu">
<h2><span><?php echo ($is_admin) ? 'Admin' : 'Moderator' ?> menu</span></h2>
<div class="box">
<div class="inbox">
<ul>
<li<?php if ($page == 'index') echo ' class="isactive"'; ?>><a href="admin_index.php">Index</a></li>
<?php if ($is_admin): ?> <li<?php if ($page == 'categories') echo ' class="isactive"'; ?>><a href="admin_categories.php">Categories</a></li>
<?php endif; ?><?php if ($is_admin): ?> <li<?php if ($page == 'forums') echo ' class="isactive"'; ?>><a href="admin_forums.php">Forums</a></li>
<?php endif; ?> <li<?php if ($page == 'users') echo ' class="isactive"'; ?>><a href="admin_users.php">Users</a></li>
<?php if ($is_admin): ?> <li<?php if ($page == 'groups') echo ' class="isactive"'; ?>><a href="admin_groups.php">User groups</a></li>
<?php endif; ?><?php if ($is_admin): ?> <li<?php if ($page == 'options') echo ' class="isactive"'; ?>><a href="admin_options.php">Options</a></li>
<?php endif; ?><?php if ($is_admin): ?> <li<?php if ($page == 'permissions') echo ' class="isactive"'; ?>><a href="admin_permissions.php">Permissions</a></li>
<?php endif; ?> <li<?php if ($page == 'censoring') echo ' class="isactive"'; ?>><a href="admin_censoring.php">Censoring</a></li>
<?php if ($is_admin): ?> <li<?php if ($page == 'ranks') echo ' class="isactive"'; ?>><a href="admin_ranks.php">Ranks</a></li>
<?php endif; ?><?php if ($is_admin || $pun_config['p_mod_ban_users'] == '1'): ?> <li<?php if ($page == 'bans') echo ' class="isactive"'; ?>><a href="admin_bans.php">Bans</a></li>
<?php endif; ?><?php if ($is_admin): ?> <li<?php if ($page == 'prune') echo ' class="isactive"'; ?>><a href="admin_prune.php">Prune</a></li>
<?php endif; ?><?php if ($is_admin): ?> <li<?php if ($page == 'maintenance') echo ' class="isactive"'; ?>><a href="admin_maintenance.php">Maintenance</a></li>
<?php endif; ?> <li<?php if ($page == 'reports') echo ' class="isactive"'; ?>><a href="admin_reports.php">Reports</a></li>
</ul>
</div>
</div>
<?php
// See if there are any plugins
$plugins = array();
$d = dir(PUN_ROOT.'plugins');
while (($entry = $d->read()) !== false)
{
$prefix = substr($entry, 0, strpos($entry, '_'));
$suffix = substr($entry, strlen($entry) - 4);
if ($suffix == '.php' && ((!$is_admin && $prefix == 'AMP') || ($is_admin && ($prefix == 'AP' || $prefix == 'AMP'))))
$plugins[] = array(substr(substr($entry, strpos($entry, '_') + 1), 0, -4), $entry);
}
$d->close();
// Did we find any plugins?
if (!empty($plugins))
{
?>
<h2 class="block2"><span>Plugins</span></h2>
<div class="box">
<div class="inbox">
<ul>
<?php
while (list(, $cur_plugin) = @each($plugins))
echo "\t\t\t\t\t".'<li'.(($page == $cur_plugin[1]) ? ' class="isactive"' : '').'><a href="admin_loader.php?plugin='.$cur_plugin[1].'">'.str_replace('_', ' ', $cur_plugin[0]).'</a></li>'."\n";
?>
</ul>
</div>
</div>
<?php
}
?>
</div>
<?php
}
//
// Delete topics from $forum_id that are "older than" $prune_date (if $prune_sticky is 1, sticky topics will also be deleted)
//
function prune($forum_id, $prune_sticky, $prune_date)
{
global $db;
$extra_sql = ($prune_date != -1) ? ' AND last_post<'.$prune_date : '';
if (!$prune_sticky)
$extra_sql .= ' AND sticky=\'0\'';
// Fetch topics to prune
$result = $db->query('SELECT id FROM '.$db->prefix.'topics WHERE forum_id='.$forum_id.$extra_sql, true) or error('Unable to fetch topics', __FILE__, __LINE__, $db->error());
$topic_ids = '';
while ($row = $db->fetch_row($result))
$topic_ids .= (($topic_ids != '') ? ',' : '').$row[0];
if ($topic_ids != '')
{
// Fetch posts to prune
$result = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE topic_id IN('.$topic_ids.')', true) or error('Unable to fetch posts', __FILE__, __LINE__, $db->error());
$post_ids = '';
while ($row = $db->fetch_row($result))
$post_ids .= (($post_ids != '') ? ',' : '').$row[0];
if ($post_ids != '')
{
// Delete topics
$db->query('DELETE FROM '.$db->prefix.'topics WHERE id IN('.$topic_ids.')') or error('Unable to prune topics', __FILE__, __LINE__, $db->error());
// Delete subscriptions
$db->query('DELETE FROM '.$db->prefix.'subscriptions WHERE topic_id IN('.$topic_ids.')') or error('Unable to prune subscriptions', __FILE__, __LINE__, $db->error());
// Delete posts
$db->query('DELETE FROM '.$db->prefix.'posts WHERE id IN('.$post_ids.')') or error('Unable to prune posts', __FILE__, __LINE__, $db->error());
// We removed a bunch of posts, so now we have to update the search index
require_once PUN_ROOT.'include/search_idx.php';
strip_search_index($post_ids);
}
}
}