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 2609 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
************************************************************************/
// Tell header.php to use the admin template
define('PUN_ADMIN_CONSOLE', 1);
define('PUN_ROOT', './');
require PUN_ROOT.'include/common.php';
require PUN_ROOT.'include/common_admin.php';
if ($pun_user['g_id'] > PUN_ADMIN)
message($lang_common['No permission']);
if (isset($_POST['form_sent']))
{
confirm_referrer('admin_permissions.php');
$form = array_map('intval', $_POST['form']);
while (list($key, $input) = @each($form))
{
// Only update values that have changed
if (array_key_exists('p_'.$key, $pun_config) && $pun_config['p_'.$key] != $input)
$db->query('UPDATE '.$db->prefix.'config SET conf_value='.$input.' WHERE conf_name=\'p_'.$db->escape($key).'\'') or error('Unable to update board config', __FILE__, __LINE__, $db->error());
}
// Regenerate the config cache
require_once PUN_ROOT.'include/cache.php';
generate_config_cache();
redirect('admin_permissions.php', 'Permissions updated. Redirecting &hellip;');
}
$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Permissions';
require PUN_ROOT.'header.php';
generate_admin_menu('permissions');
?>
<div class="blockform">
<h2><span>Permissions</span></h2>
<div class="box">
<form method="post" action="admin_permissions.php">
<p class="submittop"><input type="submit" name="save" value="Save changes" /></p>
<div class="inform">
<input type="hidden" name="form_sent" value="1" />
<fieldset>
<legend>Posting</legend>
<div class="infldset">
<table class="aligntop" cellspacing="0">
<tr>
<th scope="row">BBCode</th>
<td>
<input type="radio" name="form[message_bbcode]" value="1"<?php if ($pun_config['p_message_bbcode'] == '1') echo ' checked="checked"' ?> />&nbsp;<strong>Yes</strong>&nbsp;&nbsp;&nbsp;<input type="radio" name="form[message_bbcode]" value="0"<?php if ($pun_config['p_message_bbcode'] == '0') echo ' checked="checked"' ?> />&nbsp;<strong>No</strong>
<span>Allow BBCode in posts (recommended).</span>
</td>
</tr>
<tr>
<th scope="row">Image tag</th>
<td>
<input type="radio" name="form[message_img_tag]" value="1"<?php if ($pun_config['p_message_img_tag'] == '1') echo ' checked="checked"' ?> />&nbsp;<strong>Yes</strong>&nbsp;&nbsp;&nbsp;<input type="radio" name="form[message_img_tag]" value="0"<?php if ($pun_config['p_message_img_tag'] == '0') echo ' checked="checked"' ?> />&nbsp;<strong>No</strong>
<span>Allow the BBCode [img][/img] tag in posts.</span>
</td>
</tr>
<tr>
<th scope="row">All caps message</th>
<td>
<input type="radio" name="form[message_all_caps]" value="1"<?php if ($pun_config['p_message_all_caps'] == '1') echo ' checked="checked"' ?> />&nbsp;<strong>Yes</strong>&nbsp;&nbsp;&nbsp;<input type="radio" name="form[message_all_caps]" value="0"<?php if ($pun_config['p_message_all_caps'] == '0') echo ' checked="checked"' ?> />&nbsp;<strong>No</strong>
<span>Allow a message to contain only capital letters.</span>
</td>
</tr>
<tr>
<th scope="row">All caps subject</th>
<td>
<input type="radio" name="form[subject_all_caps]" value="1"<?php if ($pun_config['p_subject_all_caps'] == '1') echo ' checked="checked"' ?> />&nbsp;<strong>Yes</strong>&nbsp;&nbsp;&nbsp;<input type="radio" name="form[subject_all_caps]" value="0"<?php if ($pun_config['p_subject_all_caps'] == '0') echo ' checked="checked"' ?> />&nbsp;<strong>No</strong>
<span>Allow a subject to contain only capital letters.</span>
</td>
</tr>
<tr>
<th scope="row">Require guest e-mail</th>
<td>
<input type="radio" name="form[force_guest_email]" value="1"<?php if ($pun_config['p_force_guest_email'] == '1') echo ' checked="checked"' ?> />&nbsp;<strong>Yes</strong>&nbsp;&nbsp;&nbsp;<input type="radio" name="form[force_guest_email]" value="0"<?php if ($pun_config['p_force_guest_email'] == '0') echo ' checked="checked"' ?> />&nbsp;<strong>No</strong>
<span>Require guests to supply an e-mail address when posting.</span>
</td>
</tr>
</table>
</div>
</fieldset>
</div>
<div class="inform">
<fieldset>
<legend>Signatures</legend>
<div class="infldset">
<table class="aligntop" cellspacing="0">
<tr>
<th scope="row">BBCodes in signatures</th>
<td>
<input type="radio" name="form[sig_bbcode]" value="1"<?php if ($pun_config['p_sig_bbcode'] == '1') echo ' checked="checked"' ?> />&nbsp;<strong>Yes</strong>&nbsp;&nbsp;&nbsp;<input type="radio" name="form[sig_bbcode]" value="0"<?php if ($pun_config['p_sig_bbcode'] == '0') echo ' checked="checked"' ?> />&nbsp;<strong>No</strong>
<span>Allow BBCodes in user signatures.</span>
</td>
</tr>
<tr>
<th scope="row">Image tag in signatures</th>
<td>
<input type="radio" name="form[sig_img_tag]" value="1"<?php if ($pun_config['p_sig_img_tag'] == '1') echo ' checked="checked"' ?> />&nbsp;<strong>Yes</strong>&nbsp;&nbsp;&nbsp;<input type="radio" name="form[sig_img_tag]" value="0"<?php if ($pun_config['p_sig_img_tag'] == '0') echo ' checked="checked"' ?> />&nbsp;<strong>No</strong>
<span>Allow the BBCode [img][/img] tag in user signatures (not recommended).</span>
</td>
</tr>
<tr>
<th scope="row">All caps signature</th>
<td>
<input type="radio" name="form[sig_all_caps]" value="1"<?php if ($pun_config['p_sig_all_caps'] == '1') echo ' checked="checked"' ?> />&nbsp;<strong>Yes</strong>&nbsp;&nbsp;&nbsp;<input type="radio" name="form[sig_all_caps]" value="0"<?php if ($pun_config['p_sig_all_caps'] == '0') echo ' checked="checked"' ?> />&nbsp;<strong>No</strong>
<span>Allow a signature to contain only capital letters.</span>
</td>
</tr>
<tr>
<th scope="row">Maximum signature length</th>
<td>
<input type="text" name="form[sig_length]" size="5" maxlength="5" value="<?php echo $pun_config['p_sig_length'] ?>" />
<span>The maximum number of characters a user signature may contain.</span>
</td>
</tr>
<tr>
<th scope="row">Maximum signature lines</th>
<td>
<input type="text" name="form[sig_lines]" size="3" maxlength="3" value="<?php echo $pun_config['p_sig_lines'] ?>" />
<span>The maximum number of lines a user signature may contain.</span>
</td>
</tr>
</table>
</div>
</fieldset>
</div>
<div class="inform">
<fieldset>
<legend>Moderators</legend>
<div class="infldset">
<table class="aligntop" cellspacing="0">
<tr>
<th scope="row">Edit user profiles</th>
<td>
<input type="radio" name="form[mod_edit_users]" value="1"<?php if ($pun_config['p_mod_edit_users'] == '1') echo ' checked="checked"' ?> />&nbsp;<strong>Yes</strong>&nbsp;&nbsp;&nbsp;<input type="radio" name="form[mod_edit_users]" value="0"<?php if ($pun_config['p_mod_edit_users'] == '0') echo ' checked="checked"' ?> />&nbsp;<strong>No</strong>
<span>Allow moderators to edit user profiles.</span>
</td>
</tr>
<tr>
<th scope="row">Rename users</th>
<td>
<input type="radio" name="form[mod_rename_users]" value="1"<?php if ($pun_config['p_mod_rename_users'] == '1') echo ' checked="checked"' ?> />&nbsp;<strong>Yes</strong>&nbsp;&nbsp;&nbsp;<input type="radio" name="form[mod_rename_users]" value="0"<?php if ($pun_config['p_mod_rename_users'] == '0') echo ' checked="checked"' ?> />&nbsp;<strong>No</strong>
<span>Allow moderators to rename users. Other moderators and administrators are excluded.</span>
</td>
</tr>
<tr>
<th scope="row">Change user passwords</th>
<td>
<input type="radio" name="form[mod_change_passwords]" value="1"<?php if ($pun_config['p_mod_change_passwords'] == '1') echo ' checked="checked"' ?> />&nbsp;<strong>Yes</strong>&nbsp;&nbsp;&nbsp;<input type="radio" name="form[mod_change_passwords]" value="0"<?php if ($pun_config['p_mod_change_passwords'] == '0') echo ' checked="checked"' ?> />&nbsp;<strong>No</strong>
<span>Allow moderators to change user passwords. Other moderators and administrators are excluded.</span>
</td>
</tr>
<tr>
<th scope="row">Ban users</th>
<td>
<input type="radio" name="form[mod_ban_users]" value="1"<?php if ($pun_config['p_mod_ban_users'] == '1') echo ' checked="checked"' ?> />&nbsp;<strong>Yes</strong>&nbsp;&nbsp;&nbsp;<input type="radio" name="form[mod_ban_users]" value="0"<?php if ($pun_config['p_mod_ban_users'] == '0') echo ' checked="checked"' ?> />&nbsp;<strong>No</strong>
<span>Allow moderators to ban users (and edit/remove current bans).</span>
</td>
</tr>
</table>
</div>
</fieldset>
</div>
<div class="inform">
<fieldset>
<legend>Registration</legend>
<div class="infldset">
<table class="aligntop" cellspacing="0">
<tr>
<th scope="row">Allow banned e-mail addresses</th>
<td>
<input type="radio" name="form[allow_banned_email]" value="1"<?php if ($pun_config['p_allow_banned_email'] == '1') echo ' checked="checked"' ?> />&nbsp;<strong>Yes</strong>&nbsp;&nbsp;&nbsp;<input type="radio" name="form[allow_banned_email]" value="0"<?php if ($pun_config['p_allow_banned_email'] == '0') echo ' checked="checked"' ?> />&nbsp;<strong>No</strong>
<span>Allow users to register with or change to a banned e-mail address/domain. If left at it's default setting (yes) this action will be allowed, but an alert e-mail will be sent to the mailing list (an effective way of detecting multiple registrations).</span>
</td>
</tr>
<tr>
<th scope="row">Allow duplicate e-mail addresses</th>
<td>
<input type="radio" name="form[allow_dupe_email]" value="1"<?php if ($pun_config['p_allow_dupe_email'] == '1') echo ' checked="checked"' ?> />&nbsp;<strong>Yes</strong>&nbsp;&nbsp;&nbsp;<input type="radio" name="form[allow_dupe_email]" value="0"<?php if ($pun_config['p_allow_dupe_email'] == '0') echo ' checked="checked"' ?> />&nbsp;<strong>No</strong>
<span>Controls whether users should be allowed to register with an e-mail address that another user already has. If allowed, an alert e-mail will be sent to the mailing list if a duplicate is detected.</span>
</td>
</tr>
</table>
</div>
</fieldset>
</div>
<p class="submitend"><input type="submit" name="save" value="Save changes" /></p>
</form>
</div>
</div>
<div class="clearer"></div>
</div>
<?php
require PUN_ROOT.'footer.php';
<?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 admin template
define('PUN_ADMIN_CONSOLE', 1);
define('PUN_ROOT', './');
require PUN_ROOT.'include/common.php';
require PUN_ROOT.'include/common_admin.php';
if ($pun_user['g_id'] > PUN_ADMIN)
message($lang_common['No permission']);
if (isset($_GET['action']) || isset($_POST['prune']) || isset($_POST['prune_comply']))
{
if (isset($_POST['prune_comply']))
{
confirm_referrer('admin_prune.php');
$prune_from = $_POST['prune_from'];
$prune_sticky = isset($_POST['prune_sticky']) ? '1' : '0';
$prune_days = intval($_POST['prune_days']);
$prune_date = ($prune_days) ? time() - ($prune_days*86400) : -1;
@set_time_limit(0);
if ($prune_from == 'all')
{
$result = $db->query('SELECT id FROM '.$db->prefix.'forums') or error('Unable to fetch forum list', __FILE__, __LINE__, $db->error());
$num_forums = $db->num_rows($result);
for ($i = 0; $i < $num_forums; ++$i)
{
$fid = $db->result($result, $i);
prune($fid, $prune_sticky, $prune_date);
update_forum($fid);
}
}
else
{
$prune_from = intval($prune_from);
prune($prune_from, $prune_sticky, $prune_date);
update_forum($prune_from);
}
// Locate any "orphaned redirect topics" and delete them
$result = $db->query('SELECT t1.id FROM '.$db->prefix.'topics AS t1 LEFT JOIN '.$db->prefix.'topics AS t2 ON t1.moved_to=t2.id WHERE t2.id IS NULL AND t1.moved_to IS NOT NULL') or error('Unable to fetch redirect topics', __FILE__, __LINE__, $db->error());
$num_orphans = $db->num_rows($result);
if ($num_orphans)
{
for ($i = 0; $i < $num_orphans; ++$i)
$orphans[] = $db->result($result, $i);
$db->query('DELETE FROM '.$db->prefix.'topics WHERE id IN('.implode(',', $orphans).')') or error('Unable to delete redirect topics', __FILE__, __LINE__, $db->error());
}
redirect('admin_prune.php', 'Posts pruned. Redirecting &hellip;');
}
$prune_days = $_POST['req_prune_days'];
if (!@preg_match('#^\d+$#', $prune_days))
message('Days to prune must be a positive integer.');
$prune_date = time() - ($prune_days*86400);
$prune_from = $_POST['prune_from'];
// Concatenate together the query for counting number or topics to prune
$sql = 'SELECT COUNT(id) FROM '.$db->prefix.'topics WHERE last_post<'.$prune_date.' AND moved_to IS NULL';
if (!$prune_sticky)
$sql .= ' AND sticky=\'0\'';
if ($prune_from != 'all')
{
$prune_from = intval($prune_from);
$sql .= ' AND forum_id='.$prune_from;
// Fetch the forum name (just for cosmetic reasons)
$result = $db->query('SELECT forum_name FROM '.$db->prefix.'forums WHERE id='.$prune_from) or error('Unable to fetch forum name', __FILE__, __LINE__, $db->error());
$forum = '"'.pun_htmlspecialchars($db->result($result)).'"';
}
else
$forum = 'all forums';
$result = $db->query($sql) or error('Unable to fetch topic prune count', __FILE__, __LINE__, $db->error());
$num_topics = $db->result($result);
if (!$num_topics)
message('There are no topics that are '.$prune_days.' days old. Please decrease the value of "Days old" and try again.');
$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Prune';
require PUN_ROOT.'header.php';
generate_admin_menu('prune');
?>
<div class="blockform">
<h2><span>Prune</span></h2>
<div class="box">
<form method="post" action="admin_prune.php?action=foo">
<div class="inform">
<input type="hidden" name="prune_days" value="<?php echo $prune_days ?>" />
<input type="hidden" name="prune_sticky" value="<?php echo $prune_sticky ?>" />
<input type="hidden" name="prune_from" value="<?php echo $prune_from ?>" />
<fieldset>
<legend>Confirm prune posts</legend>
<div class="infldset">
<p>Are you sure that you want to prune all topics older than <?php echo $prune_days ?> days from <?php echo $forum ?>? (<?php echo $num_topics ?> topics)</p>
<p>WARNING! Pruning posts deletes them permanently.</p>
</div>
</fieldset>
</div>
<p><input type="submit" name="prune_comply" value="Prune" /><a href="javascript:history.go(-1)">Go back</a></p>
</form>
</div>
</div>
<div class="clearer"></div>
</div>
<?php
require PUN_ROOT.'footer.php';
}
else
{
$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Prune';
$required_fields = array('req_prune_days' => 'Days old');
$focus_element = array('prune', 'req_prune_days');
require PUN_ROOT.'header.php';
generate_admin_menu('prune');
?>
<div class="blockform">
<h2><span>Prune</span></h2>
<div class="box">
<form id="prune" method="post" action="admin_prune.php?action=foo" onsubmit="return process_form(this)">
<div class="inform">
<input type="hidden" name="form_sent" value="1" />
<fieldset>
<legend>Prune old posts</legend>
<div class="infldset">
<table class="aligntop" cellspacing="0">
<tr>
<th scope="row">Days old</th>
<td>
<input type="text" name="req_prune_days" size="3" maxlength="3" tabindex="1" />
<span>The number of days "old" a topic must be to be pruned. E.g. if you were to enter 30, every topic that didn't contain a post dated less than 30 days old would be deleted.</span>
</td>
</tr>
<tr>
<th scope="row">Prune sticky topics</th>
<td>
<input type="radio" name="prune_sticky" value="1" tabindex="2" checked="checked" />&nbsp;<strong>Yes</strong>&nbsp;&nbsp;&nbsp;<input type="radio" name="prune_sticky" value="0" />&nbsp;<strong>No</strong>
<span>When enabled sticky topics will also be pruned.</span>
</td>
</tr>
<tr>
<th scope="row">Prune from forum</th>
<td>
<select name="prune_from" tabindex="3">
<option value="all">All forums</option>
<?php
$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id WHERE f.redirect_url IS NULL ORDER BY c.disp_position, c.id, f.disp_position') or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());
$cur_category = 0;
while ($forum = $db->fetch_assoc($result))
{
if ($forum['cid'] != $cur_category) // Are we still in the same category?
{
if ($cur_category)
echo "\t\t\t\t\t\t\t\t\t\t\t".'</optgroup>'."\n";
echo "\t\t\t\t\t\t\t\t\t\t\t".'<optgroup label="'.pun_htmlspecialchars($forum['cat_name']).'">'."\n";
$cur_category = $forum['cid'];
}
echo "\t\t\t\t\t\t\t\t\t\t\t\t".'<option value="'.$forum['fid'].'">'.pun_htmlspecialchars($forum['forum_name']).'</option>'."\n";
}
?>
</optgroup>
</select>
<span>The forum from which you want to prune posts.</span>
</td>
</tr>
</table>
<p class="topspace">Use this feature with caution. Pruned posts can <strong>never</strong> be recovered. For best performance you should put the forum in maintenance mode during pruning.</p>
<div class="fsetsubmit"><input type="submit" name="prune" value="Prune" tabindex="5" /></div>
</div>
</fieldset>
</div>
</form>
</div>
</div>
<div class="clearer"></div>
</div>
<?php
require PUN_ROOT.'footer.php';
}
<?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 admin template
define('PUN_ADMIN_CONSOLE', 1);
define('PUN_ROOT', './');
require PUN_ROOT.'include/common.php';
require PUN_ROOT.'include/common_admin.php';
if ($pun_user['g_id'] > PUN_ADMIN)
message($lang_common['No permission']);
// Add a rank
if (isset($_POST['add_rank']))
{
confirm_referrer('admin_ranks.php');
$rank = trim($_POST['new_rank']);
$min_posts = $_POST['new_min_posts'];
if ($rank == '')
message('You must enter a rank title.');
if (!@preg_match('#^\d+$#', $min_posts))
message('Minimum posts must be a positive integer value.');
// Make sure there isn't already a rank with the same min_posts value
$result = $db->query('SELECT 1 FROM '.$db->prefix.'ranks WHERE min_posts='.$min_posts) or error('Unable to fetch rank info', __FILE__, __LINE__, $db->error());
if ($db->num_rows($result))
message('There is already a rank with a minimun posts value of '.$min_posts.'.');
$db->query('INSERT INTO '.$db->prefix.'ranks (rank, min_posts) VALUES(\''.$db->escape($rank).'\', '.$min_posts.')') or error('Unable to add rank', __FILE__, __LINE__, $db->error());
// Regenerate the ranks cache
require_once PUN_ROOT.'include/cache.php';
generate_ranks_cache();
redirect('admin_ranks.php', 'Rank added. Redirecting &hellip;');
}
// Update a rank
else if (isset($_POST['update']))
{
confirm_referrer('admin_ranks.php');
$id = intval(key($_POST['update']));
$rank = trim($_POST['rank'][$id]);
$min_posts = trim($_POST['min_posts'][$id]);
if ($rank == '')
message('You must enter a rank title.');
if (!@preg_match('#^\d+$#', $min_posts))
message('Minimum posts must be a positive integer value.');
// Make sure there isn't already a rank with the same min_posts value
$result = $db->query('SELECT 1 FROM '.$db->prefix.'ranks WHERE id!='.$id.' AND min_posts='.$min_posts) or error('Unable to fetch rank info', __FILE__, __LINE__, $db->error());
if ($db->num_rows($result))
message('There is already a rank with a minimun posts value of '.$min_posts.'.');
$db->query('UPDATE '.$db->prefix.'ranks SET rank=\''.$db->escape($rank).'\', min_posts='.$min_posts.' WHERE id='.$id) or error('Unable to update rank', __FILE__, __LINE__, $db->error());
// Regenerate the ranks cache
require_once PUN_ROOT.'include/cache.php';
generate_ranks_cache();
redirect('admin_ranks.php', 'Rank updated. Redirecting &hellip;');
}
// Remove a rank
else if (isset($_POST['remove']))
{
confirm_referrer('admin_ranks.php');
$id = intval(key($_POST['remove']));
$db->query('DELETE FROM '.$db->prefix.'ranks WHERE id='.$id) or error('Unable to delete rank', __FILE__, __LINE__, $db->error());
// Regenerate the ranks cache
require_once PUN_ROOT.'include/cache.php';
generate_ranks_cache();
redirect('admin_ranks.php', 'Rank removed. Redirecting &hellip;');
}
$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Ranks';
$focus_element = array('ranks', 'new_rank');
require PUN_ROOT.'header.php';
generate_admin_menu('ranks');
?>
<div class="blockform">
<h2><span>Ranks</span></h2>
<div class="box">
<form id="ranks" method="post" action="admin_ranks.php?action=foo">
<div class="inform">
<fieldset>
<legend>Add rank</legend>
<div class="infldset">
<p>Enter a rank and the minimum number of posts that a user has to have to aquire the rank. Different ranks cannot have the same value for minimum posts. If a title is set for a user, the title will be displayed instead of any rank. <strong>User ranks must be enabled in <a href="admin_options.php#ranks">Options</a> for this to have any effect.</strong></p>
<table cellspacing="0">
<thead>
<tr>
<th class="tcl" scope="col">Rank&nbsp;title</th>
<th class="tc2" scope="col">Minimum&nbsp;posts</th>
<th class="hidehead" scope="col">Action</th>
</tr>
</thead>
<tbody>
<tr>
<td><input type="text" name="new_rank" size="24" maxlength="50" tabindex="1" /></td>
<td><input type="text" name="new_min_posts" size="7" maxlength="7" tabindex="2" /></td>
<td><input type="submit" name="add_rank" value=" Add " tabindex="3" /></td>
</tr>
</tbody>
</table>
</div>
</fieldset>
</div>
<div class="inform">
<fieldset>
<legend>Edit/remove ranks</legend>
<div class="infldset">
<?php
$result = $db->query('SELECT id, rank, min_posts FROM '.$db->prefix.'ranks ORDER BY min_posts') or error('Unable to fetch rank list', __FILE__, __LINE__, $db->error());
if ($db->num_rows($result))
{
?>
<table cellspacing="0">
<thead>
<tr>
<th class="tcl" scope="col"><strong>Rank&nbsp;title</strong></th>
<th class="tc2" scope="col"><strong>Minimum&nbsp;Posts</strong></th>
<th class="hidehead" scope="col">Actions</th>
</tr>
</thead>
<tbody>
<?php
while ($cur_rank = $db->fetch_assoc($result))
echo "\t\t\t\t\t\t\t\t".'<tr><td><input type="text" name="rank['.$cur_rank['id'].']" value="'.pun_htmlspecialchars($cur_rank['rank']).'" size="24" maxlength="50" /></td><td><input type="text" name="min_posts['.$cur_rank['id'].']" value="'.$cur_rank['min_posts'].'" size="7" maxlength="7" /></td><td><input type="submit" name="update['.$cur_rank['id'].']" value="Update" />&nbsp;<input type="submit" name="remove['.$cur_rank['id'].']" value="Remove" /></td></tr>'."\n";
?>
</tbody>
</table>
<?php
}
else
echo "\t\t\t\t\t\t\t".'<p>No ranks in list.</p>'."\n";
?>
</div>
</fieldset>
</div>
</form>
</div>
</div>
<div class="clearer"></div>
</div>
<?php
require PUN_ROOT.'footer.php';
<?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 admin template
define('PUN_ADMIN_CONSOLE', 1);
define('PUN_ROOT', './');
require PUN_ROOT.'include/common.php';
require PUN_ROOT.'include/common_admin.php';
if ($pun_user['g_id'] > PUN_MOD)
message($lang_common['No permission']);
// Zap a report
if (isset($_POST['zap_id']))
{
confirm_referrer('admin_reports.php');
$zap_id = intval(key($_POST['zap_id']));
$result = $db->query('SELECT zapped FROM '.$db->prefix.'reports WHERE id='.$zap_id) or error('Unable to fetch report info', __FILE__, __LINE__, $db->error());
$zapped = $db->result($result);
if ($zapped == '')
$db->query('UPDATE '.$db->prefix.'reports SET zapped='.time().', zapped_by='.$pun_user['id'].' WHERE id='.$zap_id) or error('Unable to zap report', __FILE__, __LINE__, $db->error());
redirect('admin_reports.php', 'Report zapped. Redirecting &hellip;');
}
$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Reports';
require PUN_ROOT.'header.php';
generate_admin_menu('reports');
?>
<div class="blockform">
<h2><span>New reports</span></h2>
<div class="box">
<form method="post" action="admin_reports.php?action=zap">
<?php
$result = $db->query('SELECT r.id, r.post_id, r.topic_id, r.forum_id, r.reported_by, r.created, r.message, t.subject, f.forum_name, u.username AS reporter FROM '.$db->prefix.'reports AS r LEFT JOIN '.$db->prefix.'topics AS t ON r.topic_id=t.id LEFT JOIN '.$db->prefix.'forums AS f ON r.forum_id=f.id LEFT JOIN '.$db->prefix.'users AS u ON r.reported_by=u.id WHERE r.zapped IS NULL ORDER BY created DESC') or error('Unable to fetch report list', __FILE__, __LINE__, $db->error());
if ($db->num_rows($result))
{
while ($cur_report = $db->fetch_assoc($result))
{
$reporter = ($cur_report['reporter'] != '') ? '<a href="profile.php?id='.$cur_report['reported_by'].'">'.pun_htmlspecialchars($cur_report['reporter']).'</a>' : 'Deleted user';
$forum = ($cur_report['forum_name'] != '') ? '<a href="viewforum.php?id='.$cur_report['forum_id'].'">'.pun_htmlspecialchars($cur_report['forum_name']).'</a>' : 'Deleted';
$topic = ($cur_report['subject'] != '') ? '<a href="viewtopic.php?id='.$cur_report['topic_id'].'">'.pun_htmlspecialchars($cur_report['subject']).'</a>' : 'Deleted';
$post = ($cur_report['post_id'] != '') ? str_replace("\n", '<br />', pun_htmlspecialchars($cur_report['message'])) : 'Deleted';
$postid = ($cur_report['post_id'] != '') ? '<a href="viewtopic.php?pid='.$cur_report['post_id'].'#p'.$cur_report['post_id'].'">Post #'.$cur_report['post_id'].'</a>' : 'Deleted';
?>
<div class="inform">
<fieldset>
<legend>Reported <?php echo format_time($cur_report['created']) ?></legend>
<div class="infldset">
<table cellspacing="0">
<tr>
<th scope="row">Forum&nbsp;&raquo;&nbsp;Topic&nbsp;&raquo;&nbsp;Post</th>
<td><?php echo $forum ?>&nbsp;&raquo;&nbsp;<?php echo $topic ?>&nbsp;&raquo;&nbsp;<?php echo $postid ?></td>
</tr>
<tr>
<th scope="row">Report by <?php echo $reporter ?><div><input type="submit" name="zap_id[<?php echo $cur_report['id'] ?>]" value=" Zap " /></div></th>
<td><?php echo $post ?></td>
</tr>
</table>
</div>
</fieldset>
</div>
<?php
}
}
else
echo "\t\t\t\t".'<p>There are no new reports.</p>'."\n";
?>
</form>
</div>
</div>
<div class="blockform block2">
<h2><span>10 last zapped reports</span></h2>
<div class="box">
<div class="fakeform">
<?php
$result = $db->query('SELECT r.id, r.post_id, r.topic_id, r.forum_id, r.reported_by, r.message, r.zapped, r.zapped_by AS zapped_by_id, t.subject, f.forum_name, u.username AS reporter, u2.username AS zapped_by FROM '.$db->prefix.'reports AS r LEFT JOIN '.$db->prefix.'topics AS t ON r.topic_id=t.id LEFT JOIN '.$db->prefix.'forums AS f ON r.forum_id=f.id LEFT JOIN '.$db->prefix.'users AS u ON r.reported_by=u.id LEFT JOIN '.$db->prefix.'users AS u2 ON r.zapped_by=u2.id WHERE r.zapped IS NOT NULL ORDER BY zapped DESC LIMIT 10') or error('Unable to fetch report list', __FILE__, __LINE__, $db->error());
if ($db->num_rows($result))
{
while ($cur_report = $db->fetch_assoc($result))
{
$reporter = ($cur_report['reporter'] != '') ? '<a href="profile.php?id='.$cur_report['reported_by'].'">'.pun_htmlspecialchars($cur_report['reporter']).'</a>' : 'Deleted user';
$forum = ($cur_report['forum_name'] != '') ? '<a href="viewforum.php?id='.$cur_report['forum_id'].'">'.pun_htmlspecialchars($cur_report['forum_name']).'</a>' : 'Deleted';
$topic = ($cur_report['subject'] != '') ? '<a href="viewtopic.php?id='.$cur_report['topic_id'].'">'.pun_htmlspecialchars($cur_report['subject']).'</a>' : 'Deleted';
$post = ($cur_report['post_id'] != '') ? str_replace("\n", '<br />', pun_htmlspecialchars($cur_report['message'])) : 'Post deleted';
$post_id = ($cur_report['post_id'] != '') ? '<a href="viewtopic.php?pid='.$cur_report['post_id'].'#p'.$cur_report['post_id'].'">Post #'.$cur_report['post_id'].'</a>' : 'Deleted';
$zapped_by = ($cur_report['zapped_by'] != '') ? '<a href="profile.php?id='.$cur_report['zapped_by_id'].'">'.pun_htmlspecialchars($cur_report['zapped_by']).'</a>' : 'N/A';
?>
<div class="inform">
<fieldset>
<legend>Zapped <?php echo format_time($cur_report['zapped']) ?></legend>
<div class="infldset">
<table cellspacing="0">
<tr>
<th scope="row">Forum&nbsp;&raquo;&nbsp;Topic&nbsp;&raquo;&nbsp;Post</th>
<td><?php echo $forum ?>&nbsp;&raquo;&nbsp;<?php echo $topic ?>&nbsp;&raquo;&nbsp;<?php echo $post_id ?></td>
</tr>
<tr>
<th scope="row">Reported by <?php echo $reporter ?><div class="topspace">Zapped by <?php echo $zapped_by ?></div></th>
<td><?php echo $post ?></td>
</tr>
</table>
</div>
</fieldset>
</div>
<?php
}
}
else
echo "\t\t\t\t".'<p>There are no zapped reports.</p>'."\n";
?>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<?php
require PUN_ROOT.'footer.php';
<?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 admin template
define('PUN_ADMIN_CONSOLE', 1);
define('PUN_ROOT', './');
require PUN_ROOT.'include/common.php';
require PUN_ROOT.'include/common_admin.php';
if ($pun_user['g_id'] > PUN_MOD)
message($lang_common['No permission']);
// Show IP statistics for a certain user ID
if (isset($_GET['ip_stats']))
{
$ip_stats = intval($_GET['ip_stats']);
if ($ip_stats < 1)
message($lang_common['Bad request']);
$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Users';
require PUN_ROOT.'header.php';
?>
<div class="linkst">
<div class="inbox">
<div><a href="javascript:history.go(-1)">Go back</a></div>
</div>
</div>
<div id="users1" class="blocktable">
<h2><span>Users</span></h2>
<div class="box">
<div class="inbox">
<table cellspacing="0">
<thead>
<tr>
<th class="tcl" scope="col">IP address</th>
<th class="tc2" scope="col">Last used</th>
<th class="tc3" scope="col">Times found</th>
<th class="tcr" scope="col">Action</th>
</tr>
</thead>
<tbody>
<?php
$result = $db->query('SELECT poster_ip, MAX(posted) AS last_used, COUNT(id) AS used_times FROM '.$db->prefix.'posts WHERE poster_id='.$ip_stats.' GROUP BY poster_ip ORDER BY last_used DESC') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
if ($db->num_rows($result))
{
while ($cur_ip = $db->fetch_assoc($result))
{
?>
<tr>
<td class="tcl"><a href="moderate.php?get_host=<?php echo $cur_ip['poster_ip'] ?>"><?php echo $cur_ip['poster_ip'] ?></a></td>
<td class="tc2"><?php echo format_time($cur_ip['last_used']) ?></td>
<td class="tc3"><?php echo $cur_ip['used_times'] ?></td>
<td class="tcr"><a href="admin_users.php?show_users=<?php echo $cur_ip['poster_ip'] ?>">Find more users for this ip</a></td>
</tr>
<?php
}
}
else
echo "\t\t\t\t".'<tr><td class="tcl" colspan="4">There are currently no posts by that user in the forum.</td></tr>'."\n";
?>
</tbody>
</table>
</div>
</div>
</div>
<div class="linksb">
<div class="inbox">
<div><a href="javascript:history.go(-1)">Go back</a></div>
</div>
</div>
<?php
require PUN_ROOT.'footer.php';
}
if (isset($_GET['show_users']))
{
$ip = $_GET['show_users'];
if (!@preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $ip))
message('The supplied IP address is not correctly formatted.');
$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Users';
require PUN_ROOT.'header.php';
?>
<div class="linkst">
<div class="inbox">
<div><a href="javascript:history.go(-1)">Go back</a></div>
</div>
</div>
<div id="users2" class="blocktable">
<h2><span>Users</span></h2>
<div class="box">
<div class="inbox">
<table cellspacing="0">
<thead>
<tr>
<th class="tcl" scope="col">Username</th>
<th class="tc2" scope="col">E-mail</th>
<th class="tc3" scope="col">Title/Status</th>
<th class="tc4" scope="col">Posts</th>
<th class="tc5" scope="col">Admin note</th>
<th class="tcr" scope="col">Actions</th>
</tr>
</thead>
<tbody>
<?php
$result = $db->query('SELECT DISTINCT poster_id, poster FROM '.$db->prefix.'posts WHERE poster_ip=\''.$db->escape($ip).'\' ORDER BY poster DESC') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
$num_posts = $db->num_rows($result);
if ($num_posts)
{
// Loop through users and print out some info
for ($i = 0; $i < $num_posts; ++$i)
{
list($poster_id, $poster) = $db->fetch_row($result);
$result2 = $db->query('SELECT u.id, u.username, u.email, u.title, u.num_posts, u.admin_note, g.g_id, g.g_user_title FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE u.id>1 AND u.id='.$poster_id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
if (($user_data = $db->fetch_assoc($result2)))
{
$user_title = get_title($user_data);
$actions = '<a href="admin_users.php?ip_stats='.$user_data['id'].'">View IP stats</a> - <a href="search.php?action=show_user&amp;user_id='.$user_data['id'].'">Show posts</a>';
?>
<tr>
<td class="tcl"><?php echo '<a href="profile.php?id='.$user_data['id'].'">'.pun_htmlspecialchars($user_data['username']).'</a>' ?></td>
<td class="tc2"><a href="mailto:<?php echo $user_data['email'] ?>"><?php echo $user_data['email'] ?></a></td>
<td class="tc3"><?php echo $user_title ?></td>
<td class="tc4"><?php echo $user_data['num_posts'] ?></td>
<td class="tc5"><?php echo ($user_data['admin_note'] != '') ? $user_data['admin_note'] : '&nbsp;' ?></td>
<td class="tcr"><?php echo $actions ?></td>
</tr>
<?php
}
else
{
?>
<tr>
<td class="tcl"><?php echo pun_htmlspecialchars($poster) ?></td>
<td class="tc2">&nbsp;</td>
<td class="tc3">Guest</td>
<td class="tc4">&nbsp;</td>
<td class="tc5">&nbsp;</td>
<td class="tcr">&nbsp;</td>
</tr>
<?php
}
}
}
else
echo "\t\t\t\t".'<tr><td class="tcl" colspan="6">The supplied IP address could not be found in the database.</td></tr>'."\n";
?>
</tbody>
</table>
</div>
</div>
</div>
<div class="linksb">
<div class="inbox">
<div><a href="javascript:history.go(-1)">Go back</a></div>
</div>
</div>
<?php
require PUN_ROOT.'footer.php';
}
else if (isset($_POST['find_user']))
{
$form = $_POST['form'];
$form['username'] = $_POST['username'];
// trim() all elements in $form
$form = array_map('trim', $form);
$conditions = array();
$posts_greater = trim($_POST['posts_greater']);
$posts_less = trim($_POST['posts_less']);
$last_post_after = trim($_POST['last_post_after']);
$last_post_before = trim($_POST['last_post_before']);
$registered_after = trim($_POST['registered_after']);
$registered_before = trim($_POST['registered_before']);
$order_by = $_POST['order_by'];
$direction = $_POST['direction'];
$user_group = $_POST['user_group'];
if (preg_match('/[^0-9]/', $posts_greater.$posts_less))
message('You entered a non-numeric value into a numeric only column.');
// Try to convert date/time to timestamps
if ($last_post_after != '')
$last_post_after = strtotime($last_post_after);
if ($last_post_before != '')
$last_post_before = strtotime($last_post_before);
if ($registered_after != '')
$registered_after = strtotime($registered_after);
if ($registered_before != '')
$registered_before = strtotime($registered_before);
if ($last_post_after == -1 || $last_post_before == -1 || $registered_after == -1 || $registered_before == -1)
message('You entered an invalid date/time.');
if ($last_post_after != '')
$conditions[] = 'u.last_post>'.$last_post_after;
if ($last_post_before != '')
$conditions[] = 'u.last_post<'.$last_post_before;
if ($registered_after != '')
$conditions[] = 'u.registered>'.$registered_after;
if ($registered_before != '')
$conditions[] = 'u.registered<'.$registered_before;
$like_command = ($db_type == 'pgsql') ? 'ILIKE' : 'LIKE';
while (list($key, $input) = @each($form))
{
if ($input != '' && in_array($key, array('username', 'email', 'title', 'realname', 'url', 'jabber', 'icq', 'msn', 'aim', 'yahoo', 'location', 'signature', 'admin_note')))
$conditions[] = 'u.'.$db->escape($key).' '.$like_command.' \''.$db->escape(str_replace('*', '%', $input)).'\'';
}
if ($posts_greater != '')
$conditions[] = 'u.num_posts>'.$posts_greater;
if ($posts_less != '')
$conditions[] = 'u.num_posts<'.$posts_less;
if ($user_group != 'all')
$conditions[] = 'u.group_id='.intval($user_group);
if (empty($conditions))
message('You didn\'t enter any search terms.');
$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Users';
require PUN_ROOT.'header.php';
?>
<div class="linkst">
<div class="inbox">
<div><a href="javascript:history.go(-1)">Go back</a></div>
</div>
</div>
<div id="users2" class="blocktable">
<h2><span>Users</span></h2>
<div class="box">
<div class="inbox">
<table cellspacing="0">
<thead>
<tr>
<th class="tcl" scope="col">Username</th>
<th class="tc2" scope="col">E-mail</th>
<th class="tc3" scope="col">Title/Status</th>
<th class="tc4" scope="col">Posts</th>
<th class="tc5" scope="col">Admin note</th>
<th class="tcr" scope="col">Actions</th>
</tr>
</thead>
<tbody>
<?php
$result = $db->query('SELECT u.id, u.username, u.email, u.title, u.num_posts, u.admin_note, g.g_id, g.g_user_title FROM '.$db->prefix.'users AS u LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE u.id>1 AND '.implode(' AND ', $conditions).' ORDER BY '.$db->escape($order_by).' '.$db->escape($direction)) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
if ($db->num_rows($result))
{
while ($user_data = $db->fetch_assoc($result))
{
$user_title = get_title($user_data);
// This script is a special case in that we want to display "Not verified" for non-verified users
if (($user_data['g_id'] == '' || $user_data['g_id'] == PUN_UNVERIFIED) && $user_title != $lang_common['Banned'])
$user_title = '<span class="warntext">Not verified</span>';
$actions = '<a href="admin_users.php?ip_stats='.$user_data['id'].'">View IP stats</a> - <a href="search.php?action=show_user&amp;user_id='.$user_data['id'].'">Show posts</a>';
?>
<tr>
<td class="tcl"><?php echo '<a href="profile.php?id='.$user_data['id'].'">'.pun_htmlspecialchars($user_data['username']).'</a>' ?></td>
<td class="tc2"><a href="mailto:<?php echo $user_data['email'] ?>"><?php echo $user_data['email'] ?></a></td>
<td class="tc3"><?php echo $user_title ?></td>
<td class="tc4"><?php echo $user_data['num_posts'] ?></td>
<td class="tc5"><?php echo ($user_data['admin_note'] != '') ? $user_data['admin_note'] : '&nbsp;' ?></td>
<td class="tcr"><?php echo $actions ?></td>
</tr>
<?php
}
}
else
echo "\t\t\t\t".'<tr><td class="tcl" colspan="6">No match.</td></tr>'."\n";
?>
</tbody>
</table>
</div>
</div>
</div>
<div class="linksb">
<div class="inbox">
<div><a href="javascript:history.go(-1)">Go back</a></div>
</div>
</div>
<?php
require PUN_ROOT.'footer.php';
}
else
{
$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Users';
$focus_element = array('find_user', 'username');
require PUN_ROOT.'header.php';
generate_admin_menu('users');
?>
<div class="blockform">
<h2><span>User search</span></h2>
<div class="box">
<form id="find_user" method="post" action="admin_users.php?action=find_user">
<p class="submittop"><input type="submit" name="find_user" value="Submit search" tabindex="1" /></p>
<div class="inform">
<fieldset>
<legend>Enter search criteria</legend>
<div class="infldset">
<p>Search for users in the database. You can enter one or more terms to search for. Wildcards in the form of asterisks (*) are accepted.</p>
<table class="aligntop" cellspacing="0">
<tr>
<th scope="row">Username</th>
<td><input type="text" name="username" size="25" maxlength="25" tabindex="2" /></td>
</tr>
<tr>
<th scope="row">E-mail address</th>
<td><input type="text" name="form[email]" size="30" maxlength="50" tabindex="3" /></td>
</tr>
<tr>
<th scope="row">Title</th>
<td><input type="text" name="form[title]" size="30" maxlength="50" tabindex="4" /></td>
</tr>
<tr>
<th scope="row">Real name</th>
<td><input type="text" name="form[realname]" size="30" maxlength="40" tabindex="5" /></td>
</tr>
<tr>
<th scope="row">Website</th>
<td><input type="text" name="form[url]" size="35" maxlength="100" tabindex="6" /></td>
</tr>
<tr>
<th scope="row">ICQ</th>
<td><input type="text" name="form[icq]" size="12" maxlength="12" tabindex="7" /></td>
</tr>
<tr>
<th scope="row">MSN Messenger</th>
<td><input type="text" name="form[msn]" size="30" maxlength="50" tabindex="8" /></td>
</tr>
<tr>
<th scope="row">AOL IM</th>
<td><input type="text" name="form[aim]" size="20" maxlength="20" tabindex="9" /></td>
</tr>
<tr>
<th scope="row">Yahoo! Messenger</th>
<td><input type="text" name="form[yahoo]" size="20" maxlength="20" tabindex="10" /></td>
</tr>
<tr>
<th scope="row">Location</th>
<td><input type="text" name="form[location]" size="30" maxlength="30" tabindex="11" /></td>
</tr>
<tr>
<th scope="row">Signature</th>
<td><input type="text" name="form[signature]" size="35" maxlength="512" tabindex="12" /></td>
</tr>
<tr>
<th scope="row">Admin note</th>
<td><input type="text" name="form[admin_note]" size="30" maxlength="30" tabindex="13" /></td>
</tr>
<tr>
<th scope="row">Number of posts greater than</th>
<td><input type="text" name="posts_greater" size="5" maxlength="8" tabindex="14" /></td>
</tr>
<tr>
<th scope="row">Number of posts less than</th>
<td><input type="text" name="posts_less" size="5" maxlength="8" tabindex="15" /></td>
</tr>
<tr>
<th scope="row">Last post is after</th>
<td><input type="text" name="last_post_after" size="24" maxlength="19" tabindex="16" />
<span>(yyyy-mm-dd hh:mm:ss)</span></td>
</tr>
<tr>
<th scope="row">Last post is before</th>
<td><input type="text" name="last_post_before" size="24" maxlength="19" tabindex="17" />
<span>(yyyy-mm-dd hh:mm:ss)</span></td>
</tr>
<tr>
<th scope="row">Registered after</th>
<td><input type="text" name="registered_after" size="24" maxlength="19" tabindex="18" />
<span>(yyyy-mm-dd hh:mm:ss)</span></td>
</tr>
<tr>
<th scope="row">Registered before</th>
<td><input type="text" name="registered_before" size="24" maxlength="19" tabindex="19" />
<span>(yyyy-mm-dd hh:mm:ss)</span></td>
</tr>
<tr>
<th scope="row">Order by</th>
<td>
<select name="order_by" tabindex="20">
<option value="username" selected="selected">username</option>
<option value="email">e-mail</option>
<option value="num_posts">posts</option>
<option value="last_post">last post</option>
<option value="registered">registered</option>
</select>&nbsp;&nbsp;&nbsp;<select name="direction" tabindex="21">
<option value="ASC" selected="selected">ascending</option>
<option value="DESC">descending</option>
</select>
</td>
</tr>
<tr>
<th scope="row">User group</th>
<td>
<select name="user_group" tabindex="22">
<option value="all" selected="selected">All groups</option>
<?php
$result = $db->query('SELECT g_id, g_title FROM '.$db->prefix.'groups WHERE g_id!='.PUN_GUEST.' ORDER BY g_title') or error('Unable to fetch user group list', __FILE__, __LINE__, $db->error());
while ($cur_group = $db->fetch_assoc($result))
echo "\t\t\t\t\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n";
?>
</select>
</td>
</tr>
</table>
</div>
</fieldset>
</div>
<p class="submitend"><input type="submit" name="find_user" value="Submit search" tabindex="23" /></p>
</form>
</div>
<h2 class="block2"><span>IP search</span></h2>
<div class="box">
<form method="get" action="admin_users.php">
<div class="inform">
<fieldset>
<legend>Enter IP to search for</legend>
<div class="infldset">
<table class="aligntop" cellspacing="0">
<tr>
<th scope="row">IP address<div><input type="submit" value=" Find " tabindex="25" /></div></th>
<td><input type="text" name="show_users" size="18" maxlength="15" tabindex="24" />
<span>The IP address to search for in the post database.</span></td>
</tr>
</table>
</div>
</fieldset>
</div>
</form>
</div>
</div>
<div class="clearer"></div>
</div>
<?php
require PUN_ROOT.'footer.php';
}
<Limit GET POST PUT>
Order Allow,Deny
Deny from All
</Limit>
\ No newline at end of file
<html>
<head>
<title>.</title>
</head>
<body>
.
</body>
</html>
\ No newline at end of file
<?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
************************************************************************/
define('PUN_ROOT', './');
require PUN_ROOT.'include/common.php';
if ($pun_user['g_read_board'] == '0')
message($lang_common['No view']);
$id = isset($_GET['id']) ? intval($_GET['id']) : 0;
if ($id < 1)
message($lang_common['Bad request']);
// Fetch some info about the post, the topic and the forum
$result = $db->query('SELECT f.id AS fid, f.forum_name, f.moderators, f.redirect_url, fp.post_replies, fp.post_topics, t.id AS tid, t.subject, t.posted, t.closed, p.poster, p.poster_id, p.message, p.hide_smilies FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND p.id='.$id) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
if (!$db->num_rows($result))
message($lang_common['Bad request']);
$cur_post = $db->fetch_assoc($result);
// Sort out who the moderators are and if we are currently a moderator (or an admin)
$mods_array = ($cur_post['moderators'] != '') ? unserialize($cur_post['moderators']) : array();
$is_admmod = ($pun_user['g_id'] == PUN_ADMIN || ($pun_user['g_id'] == PUN_MOD && array_key_exists($pun_user['username'], $mods_array))) ? true : false;
// Determine whether this post is the "topic post" or not
$result = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE topic_id='.$cur_post['tid'].' ORDER BY posted LIMIT 1') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
$topic_post_id = $db->result($result);
$is_topic_post = ($id == $topic_post_id) ? true : false;
// Do we have permission to edit this post?
if (($pun_user['g_delete_posts'] == '0' ||
($pun_user['g_delete_topics'] == '0' && $is_topic_post) ||
$cur_post['poster_id'] != $pun_user['id'] ||
$cur_post['closed'] == '1') &&
!$is_admmod)
message($lang_common['No permission']);
// Load the delete.php language file
require PUN_ROOT.'lang/'.$pun_user['language'].'/delete.php';
if (isset($_POST['delete']))
{
if ($is_admmod)
confirm_referrer('delete.php');
require PUN_ROOT.'include/search_idx.php';
if ($is_topic_post)
{
// Delete the topic and all of it's posts
delete_topic($cur_post['tid']);
update_forum($cur_post['fid']);
redirect('viewforum.php?id='.$cur_post['fid'], $lang_delete['Topic del redirect']);
}
else
{
// Delete just this one post
delete_post($id, $cur_post['tid']);
update_forum($cur_post['fid']);
redirect('viewtopic.php?id='.$cur_post['tid'], $lang_delete['Post del redirect']);
}
}
$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_delete['Delete post'];
require PUN_ROOT.'header.php';
require PUN_ROOT.'include/parser.php';
$cur_post['message'] = parse_message($cur_post['message'], $cur_post['hide_smilies']);
?>
<div class="linkst">
<div class="inbox">
<ul><li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li><li>&nbsp;&raquo;&nbsp;<a href="viewforum.php?id=<?php echo $cur_post['fid'] ?>"><?php echo pun_htmlspecialchars($cur_post['forum_name']) ?></a></li><li>&nbsp;&raquo;&nbsp;<?php echo pun_htmlspecialchars($cur_post['subject']) ?></li></ul>
</div>
</div>
<div class="blockform">
<h2><span><?php echo $lang_delete['Delete post'] ?></span></h2>
<div class="box">
<form method="post" action="delete.php?id=<?php echo $id ?>">
<div class="inform">
<fieldset>
<legend class="warntext"><?php echo $lang_delete['Warning'] ?></legend>
<div class="infldset">
<div class="postmsg">
<p><?php echo $lang_common['Author'] ?>: <strong><?php echo pun_htmlspecialchars($cur_post['poster']) ?></strong></p>
<?php echo $cur_post['message'] ?>
</div>
</div>
</fieldset>
</div>
<p><input type="submit" name="delete" value="<?php echo $lang_delete['Delete'] ?>" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
</form>
</div>
</div>
<?php
require PUN_ROOT.'footer.php';
<?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
************************************************************************/
define('PUN_ROOT', './');
require PUN_ROOT.'include/common.php';
if ($pun_user['g_read_board'] == '0')
message($lang_common['No view']);
$id = isset($_GET['id']) ? intval($_GET['id']) : 0;
if ($id < 1)
message($lang_common['Bad request']);
// Fetch some info about the post, the topic and the forum
$result = $db->query('SELECT f.id AS fid, f.forum_name, f.moderators, f.redirect_url, fp.post_replies, fp.post_topics, t.id AS tid, t.subject, t.posted, t.closed, p.poster, p.poster_id, p.message, p.hide_smilies FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND p.id='.$id) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
if (!$db->num_rows($result))
message($lang_common['Bad request']);
$cur_post = $db->fetch_assoc($result);
// Sort out who the moderators are and if we are currently a moderator (or an admin)
$mods_array = ($cur_post['moderators'] != '') ? unserialize($cur_post['moderators']) : array();
$is_admmod = ($pun_user['g_id'] == PUN_ADMIN || ($pun_user['g_id'] == PUN_MOD && array_key_exists($pun_user['username'], $mods_array))) ? true : false;
// Determine whether this post is the "topic post" or not
$result = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE topic_id='.$cur_post['tid'].' ORDER BY posted LIMIT 1') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
$topic_post_id = $db->result($result);
$can_edit_subject = ($id == $topic_post_id && (($pun_user['g_edit_subjects_interval'] == '0' || (time() - $cur_post['posted']) < $pun_user['g_edit_subjects_interval']) || $is_admmod)) ? true : false;
// Do we have permission to edit this post?
if (($pun_user['g_edit_posts'] == '0' ||
$cur_post['poster_id'] != $pun_user['id'] ||
$cur_post['closed'] == '1') &&
!$is_admmod)
message($lang_common['No permission']);
// Load the post.php/edit.php language file
require PUN_ROOT.'lang/'.$pun_user['language'].'/post.php';
// Start with a clean slate
$errors = array();
if (isset($_POST['form_sent']))
{
if ($is_admmod)
confirm_referrer('edit.php');
// If it is a topic it must contain a subject
if ($can_edit_subject)
{
$subject = pun_trim($_POST['req_subject']);
if ($subject == '')
$errors[] = $lang_post['No subject'];
else if (pun_strlen($subject) > 70)
$errors[] = $lang_post['Too long subject'];
else if ($pun_config['p_subject_all_caps'] == '0' && strtoupper($subject) == $subject && $pun_user['g_id'] > PUN_MOD)
$subject = ucwords(strtolower($subject));
}
// Clean up message from POST
$message = pun_linebreaks(pun_trim($_POST['req_message']));
if ($message == '')
$errors[] = $lang_post['No message'];
else if (strlen($message) > 65535)
$errors[] = $lang_post['Too long message'];
else if ($pun_config['p_message_all_caps'] == '0' && strtoupper($message) == $message && $pun_user['g_id'] > PUN_MOD)
$message = ucwords(strtolower($message));
// Validate BBCode syntax
if ($pun_config['p_message_bbcode'] == '1' && strpos($message, '[') !== false && strpos($message, ']') !== false)
{
require PUN_ROOT.'include/parser.php';
$message = preparse_bbcode($message, $errors);
}
$hide_smilies = isset($_POST['hide_smilies']) ? intval($_POST['hide_smilies']) : 0;
if ($hide_smilies != '1') $hide_smilies = '0';
// Did everything go according to plan?
if (empty($errors) && !isset($_POST['preview']))
{
$edited_sql = (!isset($_POST['silent']) || !$is_admmod) ? $edited_sql = ', edited='.time().', edited_by=\''.$db->escape($pun_user['username']).'\'' : '';
require PUN_ROOT.'include/search_idx.php';
if ($can_edit_subject)
{
// Update the topic and any redirect topics
$db->query('UPDATE '.$db->prefix.'topics SET subject=\''.$db->escape($subject).'\' WHERE id='.$cur_post['tid'].' OR moved_to='.$cur_post['tid']) or error('Unable to update topic', __FILE__, __LINE__, $db->error());
// We changed the subject, so we need to take that into account when we update the search words
update_search_index('edit', $id, $message, $subject);
}
else
update_search_index('edit', $id, $message);
// Update the post
$db->query('UPDATE '.$db->prefix.'posts SET message=\''.$db->escape($message).'\', hide_smilies=\''.$hide_smilies.'\''.$edited_sql.' WHERE id='.$id) or error('Unable to update post', __FILE__, __LINE__, $db->error());
redirect('viewtopic.php?pid='.$id.'#p'.$id, $lang_post['Edit redirect']);
}
}
$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_post['Edit post'];
$required_fields = array('req_subject' => $lang_common['Subject'], 'req_message' => $lang_common['Message']);
$focus_element = array('edit', 'req_message');
require PUN_ROOT.'header.php';
$cur_index = 1;
?>
<div class="linkst">
<div class="inbox">
<ul><li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li><li>&nbsp;&raquo;&nbsp;<a href="viewforum.php?id=<?php echo $cur_post['fid'] ?>"><?php echo pun_htmlspecialchars($cur_post['forum_name']) ?></a></li><li>&nbsp;&raquo;&nbsp;<?php echo pun_htmlspecialchars($cur_post['subject']) ?></li></ul>
</div>
</div>
<?php
// If there are errors, we display them
if (!empty($errors))
{
?>
<div id="posterror" class="block">
<h2><span><?php echo $lang_post['Post errors'] ?></span></h2>
<div class="box">
<div class="inbox"
<p><?php echo $lang_post['Post errors info'] ?></p>
<ul>
<?php
while (list(, $cur_error) = each($errors))
echo "\t\t\t\t".'<li><strong>'.$cur_error.'</strong></li>'."\n";
?>
</ul>
</div>
</div>
</div>
<?php
}
else if (isset($_POST['preview']))
{
require_once PUN_ROOT.'include/parser.php';
$preview_message = parse_message($message, $hide_smilies);
?>
<div id="postpreview" class="blockpost">
<h2><span><?php echo $lang_post['Post preview'] ?></span></h2>
<div class="box">
<div class="inbox">
<div class="postright">
<div class="postmsg">
<?php echo $preview_message."\n" ?>
</div>
</div>
</div>
</div>
</div>
<?php
}
?>
<div class="blockform">
<h2><span><?php echo $lang_post['Edit post'] ?></span></h2>
<div class="box">
<form id="edit" method="post" action="edit.php?id=<?php echo $id ?>&amp;action=edit" onsubmit="return process_form(this)">
<div class="inform">
<fieldset>
<legend><?php echo $lang_post['Edit post legend'] ?></legend>
<input type="hidden" name="form_sent" value="1" />
<div class="infldset txtarea">
<?php if ($can_edit_subject): ?> <label><?php echo $lang_common['Subject'] ?><br />
<input class="longinput" type="text" name="req_subject" size="80" maxlength="70" tabindex="<?php echo $cur_index++ ?>" value="<?php echo pun_htmlspecialchars(isset($_POST['req_subject']) ? $_POST['req_subject'] : $cur_post['subject']) ?>" /><br /></label>
<?php endif; ?> <label><?php echo $lang_common['Message'] ?><br />
<textarea name="req_message" rows="20" cols="95" tabindex="<?php echo $cur_index++ ?>"><?php echo pun_htmlspecialchars(isset($_POST['req_message']) ? $message : $cur_post['message']) ?></textarea><br /></label>
<ul class="bblinks">
<li><a href="help.php#bbcode" onclick="window.open(this.href); return false;"><?php echo $lang_common['BBCode'] ?></a>: <?php echo ($pun_config['p_message_bbcode'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li>
<li><a href="help.php#img" onclick="window.open(this.href); return false;"><?php echo $lang_common['img tag'] ?></a>: <?php echo ($pun_config['p_message_img_tag'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li>
<li><a href="help.php#smilies" onclick="window.open(this.href); return false;"><?php echo $lang_common['Smilies'] ?></a>: <?php echo ($pun_config['o_smilies'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li>
</ul>
</div>
</fieldset>
<?php
$checkboxes = array();
if ($pun_config['o_smilies'] == '1')
{
if (isset($_POST['hide_smilies']) || $cur_post['hide_smilies'] == '1')
$checkboxes[] = '<label><input type="checkbox" name="hide_smilies" value="1" checked="checked" tabindex="'.($cur_index++).'" />&nbsp;'.$lang_post['Hide smilies'];
else
$checkboxes[] = '<label><input type="checkbox" name="hide_smilies" value="1" tabindex="'.($cur_index++).'" />&nbsp;'.$lang_post['Hide smilies'];
}
if ($is_admmod)
{
if ((isset($_POST['form_sent']) && isset($_POST['silent'])) || !isset($_POST['form_sent']))
$checkboxes[] = '<label><input type="checkbox" name="silent" value="1" tabindex="'.($cur_index++).'" checked="checked" />&nbsp;'.$lang_post['Silent edit'];
else
$checkboxes[] = '<label><input type="checkbox" name="silent" value="1" tabindex="'.($cur_index++).'" />&nbsp;'.$lang_post['Silent edit'];
}
if (!empty($checkboxes))
{
?>
</div>
<div class="inform">
<fieldset>
<legend><?php echo $lang_common['Options'] ?></legend>
<div class="infldset">
<div class="rbox">
<?php echo implode('</label>'."\n\t\t\t\t\t\t\t", $checkboxes).'</label>'."\n" ?>
</div>
</div>
</fieldset>
<?php
}
?>
</div>
<p><input type="submit" name="submit" value="<?php echo $lang_common['Submit'] ?>" tabindex="<?php echo $cur_index++ ?>" accesskey="s" /><input type="submit" name="preview" value="<?php echo $lang_post['Preview'] ?>" tabindex="<?php echo $cur_index++ ?>" accesskey="p" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
</form>
</div>
</div>
<?php
require PUN_ROOT.'footer.php';
<?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
************************************************************************
INSTRUCTIONS
This script is used to include information about your board from
pages outside the forums and to syndicate news about recent
discussions via RSS. The script can display a list of recent
discussions (sorted by post time or last post time), a list of
active users or a collection of general board statistics. The
script can be called directly via an URL (for RSS), from a PHP
include command or through the use of Server Side Includes (SSI).
The scripts behaviour is controlled via variables supplied in the
URL to the script. The different variables are: action (what to
output), show (how many topics to display), fid (the ID or ID's of
the forum(s) to poll for topics), nfid (the ID or ID's of forums
that should be excluded) and type (output as HTML or RSS). The
only mandatory variable is action. Possible/default values are:
action: active (show most recently active topics) (HTML or RSS)
new (show newest topics) (HTML or RSS)
online (show users online) (HTML)
online_full (as above, but includes a full list) (HTML)
stats (show board statistics) (HTML)
show: Any integer value between 1 and 50. This variables is
ignored for RSS output. The default is 15.
fid: One or more forum ID's (comma-separated). If ignored,
topics from all guest-readable forums will be polled.
nfid: One or more forum ID's (comma-separated) that are to be
excluded. E.g. the ID of a a test forum.
type: RSS. Anything else means HTML output.
Here are some examples using PHP include().
Show the 15 most recently active topics from all forums:
include('http://host.com/forums/extern.php?action=active');
Show the 10 newest topics from forums with ID 5, 6 and 7:
include('http://host.com/forums/extern.php?action=new&show=10&fid=5,6,7');
Show users online:
include('http://host.com/forums/extern.php?action=online');
Show users online with full listing of users:
include('http://host.com/forums/extern.php?action=online_full');
Show board statistics:
include('http://host.com/forums/extern.php?action=stats');
Here are some examples using SSI.
Show the 5 newest topics from forums with ID 11 and 22:
<!--#include virtual="forums/extern.php?action=new&show=5&fid=11,22" -->
Show board statistics:
<!--#include virtual="forums/extern.php?action=stats" -->
And finally some examples using extern.php to output an RSS 0.91
feed.
Output the 15 most recently active topics:
http://host.com/extern.php?action=active&type=RSS
Output the 15 newest topics from forum with ID=2:
http://host.com/extern.php?action=active&type=RSS&fid=2
Below you will find some variables you can edit to tailor the
scripts behaviour to your needs.
/***********************************************************************/
// The maximum number of topics that will be displayed
$show_max_topics = 60;
// The length at which topic subjects will be truncated (for HTML output)
$max_subject_length = 30;
/***********************************************************************/
// DO NOT EDIT ANYTHING BELOW THIS LINE! (unless you know what you are doing)
define('PUN_ROOT', './');
@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 install.php to install PunBB first.');
// Make sure PHP reports all errors except E_NOTICE
error_reporting(E_ALL ^ E_NOTICE);
// Turn off magic_quotes_runtime
set_magic_quotes_runtime(0);
// Load the functions script
require PUN_ROOT.'include/functions.php';
// Load DB abstraction layer and try to connect
require PUN_ROOT.'include/dblayer/common_db.php';
// 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';
}
// Make sure we (guests) have permission to read the forums
$result = $db->query('SELECT g_read_board FROM '.$db->prefix.'groups WHERE g_id=3') or error('Unable to fetch group info', __FILE__, __LINE__, $db->error());
if ($db->result($result) == '0')
pun_exit('No permission');
// Attempt to load the common language file
@include PUN_ROOT.'lang/'.$pun_config['o_default_lang'].'/common.php';
if (!isset($lang_common))
pun_exit('There is no valid language pack \''.$pun_config['o_default_lang'].'\' installed. Please reinstall a language of that name.');
// Check if we are to display a maintenance message
if ($pun_config['o_maintenance'] && !defined('PUN_TURN_OFF_MAINT'))
maintenance_message();
if (!isset($_GET['action']))
pun_exit('No parameters supplied. See extern.php for instructions.');
//
// Converts the CDATA end sequence ]]> into ]]&gt;
//
function escape_cdata($str)
{
return str_replace(']]>', ']]&gt;', $str);
}
//
// Show recent discussions
//
if ($_GET['action'] == 'active' || $_GET['action'] == 'new')
{
$order_by = ($_GET['action'] == 'active') ? 't.last_post' : 't.posted';
$forum_sql = '';
// Was any specific forum ID's supplied?
if (isset($_GET['fid']) && $_GET['fid'] != '')
{
$fids = explode(',', trim($_GET['fid']));
$fids = array_map('intval', $fids);
if (!empty($fids))
$forum_sql = ' AND f.id IN('.implode(',', $fids).')';
}
// Any forum ID's to exclude?
if (isset($_GET['nfid']) && $_GET['nfid'] != '')
{
$nfids = explode(',', trim($_GET['nfid']));
$nfids = array_map('intval', $nfids);
if (!empty($nfids))
$forum_sql = ' AND f.id NOT IN('.implode(',', $nfids).')';
}
// Should we output this as RSS?
if (isset($_GET['type']) && strtoupper($_GET['type']) == 'RSS')
{
$rss_description = ($_GET['action'] == 'active') ? $lang_common['RSS Desc Active'] : $lang_common['RSS Desc New'];
$url_action = ($_GET['action'] == 'active') ? '&amp;action=new' : '';
// Send XML/no cache headers
header('Content-Type: text/xml');
header('Expires: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
// It's time for some syndication!
echo '<?xml version="1.0" encoding="'.$lang_common['lang_encoding'].'"?>'."\r\n";
echo '<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd">'."\r\n";
echo '<rss version="0.91">'."\r\n";
echo '<channel>'."\r\n";
echo "\t".'<title>'.pun_htmlspecialchars($pun_config['o_board_title']).'</title>'."\r\n";
echo "\t".'<link>'.$pun_config['o_base_url'].'/</link>'."\r\n";
echo "\t".'<description>'.pun_htmlspecialchars($rss_description.' '.$pun_config['o_board_title']).'</description>'."\r\n";
echo "\t".'<language>en-us</language>'."\r\n";
// Fetch 15 topics
$result = $db->query('SELECT t.id, t.poster, t.subject, t.posted, t.last_post, f.id AS fid, f.forum_name FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=3) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.moved_to IS NULL'.$forum_sql.' ORDER BY '.$order_by.' DESC LIMIT 15') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
while ($cur_topic = $db->fetch_assoc($result))
{
if ($pun_config['o_censoring'] == '1')
$cur_topic['subject'] = censor_words($cur_topic['subject']);
echo "\t".'<item>'."\r\n";
echo "\t\t".'<title>'.pun_htmlspecialchars($cur_topic['subject']).'</title>'."\r\n";
echo "\t\t".'<link>'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id'].$url_action.'</link>'."\r\n";
echo "\t\t".'<description><![CDATA['.escape_cdata($lang_common['Forum'].': <a href="'.$pun_config['o_base_url'].'/viewforum.php?id='.$cur_topic['fid'].'">'.$cur_topic['forum_name'].'</a><br />'."\r\n".$lang_common['Author'].': '.$cur_topic['poster'].'<br />'."\r\n".$lang_common['Posted'].': '.date('r', $cur_topic['posted']).'<br />'."\r\n".$lang_common['Last post'].': '.date('r', $cur_topic['last_post'])).']]></description>'."\r\n";
echo "\t".'</item>'."\r\n";
}
echo '</channel>'."\r\n";
echo '</rss>';
}
// Output regular HTML
else
{
$show = isset($_GET['show']) ? intval($_GET['show']) : 15;
if ($show < 1 || $show > 50)
$show = 15;
// Fetch $show topics
$result = $db->query('SELECT t.id, t.subject FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=3) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.moved_to IS NULL'.$forum_sql.' ORDER BY '.$order_by.' DESC LIMIT '.$show) or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
while ($cur_topic = $db->fetch_assoc($result))
{
if ($pun_config['o_censoring'] == '1')
$cur_topic['subject'] = censor_words($cur_topic['subject']);
if (pun_strlen($cur_topic['subject']) > $max_subject_length)
$subject_truncated = pun_htmlspecialchars(trim(substr($cur_topic['subject'], 0, ($max_subject_length-5)))).' &hellip;';
else
$subject_truncated = pun_htmlspecialchars($cur_topic['subject']);
echo '<li><a href="'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id'].'&amp;action=new" title="'.pun_htmlspecialchars($cur_topic['subject']).'">'.$subject_truncated.'</a></li>'."\n";
}
}
return;
}
//
// Show users online
//
else if ($_GET['action'] == 'online' || $_GET['action'] == 'online_full')
{
// Load the index.php language file
require PUN_ROOT.'lang/'.$pun_config['o_default_lang'].'/index.php';
// Fetch users online info and generate strings for output
$num_guests = $num_users = 0;
$users = array();
$result = $db->query('SELECT user_id, ident FROM '.$db->prefix.'online WHERE idle=0 ORDER BY ident', true) or error('Unable to fetch online list', __FILE__, __LINE__, $db->error());
while ($pun_user_online = $db->fetch_assoc($result))
{
if ($pun_user_online['user_id'] > 1)
{
$users[] = '<a href="'.$pun_config['o_base_url'].'/profile.php?id='.$pun_user_online['user_id'].'">'.pun_htmlspecialchars($pun_user_online['ident']).'</a>';
++$num_users;
}
else
++$num_guests;
}
echo $lang_index['Guests online'].': '.$num_guests.'<br />';
if ($_GET['action'] == 'online_full')
echo $lang_index['Users online'].': '.implode(', ', $users).'<br />';
else
echo $lang_index['Users online'].': '.$num_users.'<br />';
return;
}
//
// Show board statistics
//
else if ($_GET['action'] == 'stats')
{
// Load the index.php language file
require PUN_ROOT.'lang/'.$pun_config['o_default_lang'].'/index.php';
// Collect some statistics from the database
$result = $db->query('SELECT COUNT(id)-1 FROM '.$db->prefix.'users') or error('Unable to fetch total user count', __FILE__, __LINE__, $db->error());
$stats['total_users'] = $db->result($result);
$result = $db->query('SELECT id, username FROM '.$db->prefix.'users ORDER BY registered DESC LIMIT 1') or error('Unable to fetch newest registered user', __FILE__, __LINE__, $db->error());
$stats['last_user'] = $db->fetch_assoc($result);
$result = $db->query('SELECT SUM(num_topics), SUM(num_posts) FROM '.$db->prefix.'forums') or error('Unable to fetch topic/post count', __FILE__, __LINE__, $db->error());
list($stats['total_topics'], $stats['total_posts']) = $db->fetch_row($result);
echo $lang_index['No of users'].': '.$stats['total_users'].'<br />';
echo $lang_index['Newest user'].': <a href="'.$pun_config['o_base_url'].'/profile.php?id='.$stats['last_user']['id'].'">'.pun_htmlspecialchars($stats['last_user']['username']).'</a><br />';
echo $lang_index['No of topics'].': '.$stats['total_topics'].'<br />';
echo $lang_index['No of posts'].': '.$stats['total_posts'];
return;
}
else
pun_exit('Bad request');
<?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();
$tpl_temp = trim(ob_get_contents());
$tpl_main = str_replace('<pun_main>', $tpl_temp, $tpl_main);
ob_end_clean();
// END SUBST - <pun_main>
// START SUBST - <pun_footer>
ob_start();
?>
<div id="brdfooter" class="block">
<h2><span><?php echo $lang_common['Board footer'] ?></span></h2>
<div class="box">
<div class="inbox">
<?php
// If no footer style has been specified, we use the default (only copyright/debug info)
$footer_style = isset($footer_style) ? $footer_style : NULL;
if ($footer_style == 'index' || $footer_style == 'search')
{
if (!$pun_user['is_guest'])
{
echo "\n\t\t\t".'<dl id="searchlinks" class="conl">'."\n\t\t\t\t".'<dt><strong>'.$lang_common['Search links'].'</strong></dt>'."\n\t\t\t\t".'<dd><a href="search.php?action=show_24h">'.$lang_common['Show recent posts'].'</a></dd>'."\n";
echo "\t\t\t\t".'<dd><a href="search.php?action=show_unanswered">'.$lang_common['Show unanswered posts'].'</a></dd>'."\n";
if ($pun_config['o_subscriptions'] == '1')
echo "\t\t\t\t".'<dd><a href="search.php?action=show_subscriptions">'.$lang_common['Show subscriptions'].'</a></dd>'."\n";
echo "\t\t\t\t".'<dd><a href="search.php?action=show_user&amp;user_id='.$pun_user['id'].'">'.$lang_common['Show your posts'].'</a></dd>'."\n\t\t\t".'</dl>'."\n";
}
else
{
if ($pun_user['g_search'] == '1')
{
echo "\n\t\t\t".'<dl id="searchlinks" class="conl">'."\n\t\t\t\t".'<dt><strong>'.$lang_common['Search links'].'</strong></dt><dd><a href="search.php?action=show_24h">'.$lang_common['Show recent posts'].'</a></dd>'."\n";
echo "\t\t\t\t".'<dd><a href="search.php?action=show_unanswered">'.$lang_common['Show unanswered posts'].'</a></dd>'."\n\t\t\t".'</dl>'."\n";
}
}
}
else if ($footer_style == 'viewforum' || $footer_style == 'viewtopic')
{
echo "\n\t\t\t".'<div class="conl">'."\n";
// Display the "Jump to" drop list
if ($pun_config['o_quickjump'] == '1')
{
// Load cached quickjump
@include PUN_ROOT.'cache/cache_quickjump_'.$pun_user['g_id'].'.php';
if (!defined('PUN_QJ_LOADED'))
{
require_once PUN_ROOT.'include/cache.php';
generate_quickjump_cache($pun_user['g_id']);
require PUN_ROOT.'cache/cache_quickjump_'.$pun_user['g_id'].'.php';
}
}
if ($footer_style == 'viewforum' && $is_admmod)
echo "\t\t\t".'<p id="modcontrols"><a href="moderate.php?fid='.$forum_id.'&amp;p='.$p.'">'.$lang_common['Moderate forum'].'</a></p>'."\n";
else if ($footer_style == 'viewtopic' && $is_admmod)
{
echo "\t\t\t".'<dl id="modcontrols"><dt><strong>'.$lang_topic['Mod controls'].'</strong></dt><dd><a href="moderate.php?fid='.$forum_id.'&amp;tid='.$id.'&amp;p='.$p.'">'.$lang_common['Delete posts'].'</a></dd>'."\n";
echo "\t\t\t".'<dd><a href="moderate.php?fid='.$forum_id.'&amp;move_topics='.$id.'">'.$lang_common['Move topic'].'</a></dd>'."\n";
if ($cur_topic['closed'] == '1')
echo "\t\t\t".'<dd><a href="moderate.php?fid='.$forum_id.'&amp;open='.$id.'">'.$lang_common['Open topic'].'</a></dd>'."\n";
else
echo "\t\t\t".'<dd><a href="moderate.php?fid='.$forum_id.'&amp;close='.$id.'">'.$lang_common['Close topic'].'</a></dd>'."\n";
if ($cur_topic['sticky'] == '1')
echo "\t\t\t".'<dd><a href="moderate.php?fid='.$forum_id.'&amp;unstick='.$id.'">'.$lang_common['Unstick topic'].'</a></dd></dl>'."\n";
else
echo "\t\t\t".'<dd><a href="moderate.php?fid='.$forum_id.'&amp;stick='.$id.'">'.$lang_common['Stick topic'].'</a></dd></dl>'."\n";
}
echo "\t\t\t".'</div>'."\n";
}
?>
<p class="conr">Powered by <a href="http://punbb.informer.com/">PunBB</a><?php if ($pun_config['o_show_version'] == '1') echo ' '.$pun_config['o_cur_version']; ?><br />&copy; Copyright 2002&#8211;2008 PunBB</p>
<?php
// Display debug info (if enabled/defined)
if (defined('PUN_DEBUG'))
{
// Calculate script generation time
list($usec, $sec) = explode(' ', microtime());
$time_diff = sprintf('%.3f', ((float)$usec + (float)$sec) - $pun_start);
echo "\t\t\t".'<p class="conr">[ Generated in '.$time_diff.' seconds, '.$db->get_num_queries().' queries executed ]</p>'."\n";
}
?>
<div class="clearer"></div>
</div>
</div>
</div>
<?php
// End the transaction
$db->end_transaction();
// Display executed queries (if enabled)
if (defined('PUN_SHOW_QUERIES'))
display_saved_queries();
$tpl_temp = trim(ob_get_contents());
$tpl_main = str_replace('<pun_footer>', $tpl_temp, $tpl_main);
ob_end_clean();
// END SUBST - <pun_footer>
// Close the db connection (and free up any result data)
$db->close();
// Spit out the page
pun_exit($tpl_main);
<?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