punbb-1.1.1/upload/admin_bans.php |
punbb-1.1.2/upload/admin_bans.php |
54: } | 54: } |
55: else // Otherwise the username is in POST | 55: else // Otherwise the username is in POST |
56: { | 56: { |
57: $ban_user = trim(strtolower($_POST['new_ban_user'])); | 57: $ban_user = trim($_POST['new_ban_user']); |
58: | 58: |
59: if ($ban_user != '') | 59: if ($ban_user != '') |
60: { | 60: { |
121: <td class="puncon2"> | 121: <td class="puncon2"> |
122: <table class="punplain" cellpadding="6"> | 122: <table class="punplain" cellpadding="6"> |
123: <tr> | 123: <tr> |
124: <td class="punright" style="width: 35%"><b>Username</b><br>The username to ban (case insensitive).</td> | 124: <td class="punright" style="width: 35%"><b>Username</b><br>The username to ban.</td> |
125: <td style="width: 35%"><input type="text" name="ban_user" size="25" maxlength="25" value="<?php echo $ban_user ?>" tabindex="1"></td> | 125: <td style="width: 35%"><input type="text" name="ban_user" size="25" maxlength="25" value="<?php echo $ban_user ?>" tabindex="1"></td> |
126: </tr> | 126: </tr> |
127: <tr> | 127: <tr> |
punbb-1.1.1/upload/admin_options.php |
punbb-1.1.2/upload/admin_options.php |
392: </tr> | 392: </tr> |
393: <tr> | 393: <tr> |
394: <td class="punright" style="width: 35%"><b>SMTP username</b><br>Username for SMTP server. Only enter a username if it is required by the SMTP server (most servers <b>don't</b> require authentication).</td> | 394: <td class="punright" style="width: 35%"><b>SMTP username</b><br>Username for SMTP server. Only enter a username if it is required by the SMTP server (most servers <b>don't</b> require authentication).</td> |
395: <td style="width: 65%"><input type="text" name="form[smtp_user]" size="25" maxlength="25" value="<?php echo $pun_config['o_smtp_user'] ?>"></td> | 395: <td style="width: 65%"><input type="text" name="form[smtp_user]" size="25" maxlength="50" value="<?php echo $pun_config['o_smtp_user'] ?>"></td> |
396: </tr> | 396: </tr> |
397: <tr> | 397: <tr> |
398: <td class="punright" style="width: 35%"><b>SMTP password</b><br>Password for SMTP server. Only enter a password if it is required by the SMTP server (most servers <b>don't</b> require authentication).</td> | 398: <td class="punright" style="width: 35%"><b>SMTP password</b><br>Password for SMTP server. Only enter a password if it is required by the SMTP server (most servers <b>don't</b> require authentication).</td> |
399: <td style="width: 65%"><input type="text" name="form[smtp_pass]" size="25" maxlength="25" value="<?php echo $pun_config['o_smtp_pass'] ?>"></td> | 399: <td style="width: 65%"><input type="text" name="form[smtp_pass]" size="25" maxlength="50" value="<?php echo $pun_config['o_smtp_pass'] ?>"></td> |
400: </tr> | 400: </tr> |
401: </table> | 401: </table> |
402: </td> | 402: </td> |
punbb-1.1.1/upload/admin_prune.php |
punbb-1.1.2/upload/admin_prune.php |
87: $prune_from = $_POST['prune_from']; | 87: $prune_from = $_POST['prune_from']; |
88: | 88: |
89: // Concatenate together the query for counting number or topics to prune | 89: // Concatenate together the query for counting number or topics to prune |
90: $sql = 'SELECT COUNT(id) FROM '.$db->prefix.'topics WHERE last_post<'.$prune_date; | 90: $sql = 'SELECT COUNT(id) FROM '.$db->prefix.'topics WHERE last_post<'.$prune_date.' AND moved_to IS NULL'; |
91: | 91: |
92: if ($_POST['prune_sticky'] == '0') | 92: if ($_POST['prune_sticky'] == '0') |
93: $sql .= ' AND sticky=\'0\''; | 93: $sql .= ' AND sticky=\'0\''; |
98: | 98: |
99: // Fetch the forum name (just for cosmetic reasons) | 99: // Fetch the forum name (just for cosmetic reasons) |
100: $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()); | 100: $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()); |
101: $forum = '"'.$db->result($result, 0).'"'; | 101: $forum = '"'.pun_htmlspecialchars($db->result($result, 0)).'"'; |
102: } | 102: } |
103: else | 103: else |
104: $forum = 'all forums'; | 104: $forum = 'all forums'; |
punbb-1.1.1/upload/edit.php |
punbb-1.1.2/upload/edit.php |
124: | 124: |
125: if ($smilies != '1') $smilies = '0'; | 125: if ($smilies != '1') $smilies = '0'; |
126: | 126: |
127: if (!isset($_POST['silent']) || !$is_admmod) | 127: $edited_sql = (!isset($_POST['silent']) || !$is_admmod) ? $edited_sql = ', edited='.time().', edited_by=\''.addslashes($cur_user['username']).'\'' : ''; |
128: $edited_sql = ', edited='.time().', edited_by=\''.addslashes($cur_user['username']).'\''; | |
129: | 128: |
130: if ($is_topicpost && $is_admmod) | 129: if ($is_topicpost && $is_admmod) |
131: { | 130: { |
punbb-1.1.1/upload/footer.php |
punbb-1.1.2/upload/footer.php |
72: <select name="id" onchange="window.location=('viewforum.php?id='+this.options[this.selectedIndex].value)"> | 72: <select name="id" onchange="window.location=('viewforum.php?id='+this.options[this.selectedIndex].value)"> |
73: <?php | 73: <?php |
74: | 74: |
75: if ($cur_user['status'] < PUN_MOD) | 75: $extra_sql = ($cur_user['status'] < PUN_MOD) ? ' WHERE f.admmod_only=\'0\'' : ''; |
76: $extra = ' WHERE f.admmod_only=\'0\''; | |
77: | 76: |
78: $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'.$extra.' ORDER BY c.disp_position, c.id, f.disp_position') or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error()); | 77: $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'.$extra_sql.' ORDER BY c.disp_position, c.id, f.disp_position') or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error()); |
79: | 78: |
80: while ($cur_forum = $db->fetch_assoc($result)) | 79: while ($cur_forum = $db->fetch_assoc($result)) |
81: { | 80: { |
punbb-1.1.1/upload/help.php |
punbb-1.1.2/upload/help.php |
93: <?php echo $lang_help['Quotes info'] ?><br><br> | 93: <?php echo $lang_help['Quotes info'] ?><br><br> |
94: [quote=James]<?php echo $lang_help['Quote text'] ?>[/quote]<br><br> | 94: [quote=James]<?php echo $lang_help['Quote text'] ?>[/quote]<br><br> |
95: <?php echo $lang_help['produces quote box'] ?><br><br> | 95: <?php echo $lang_help['produces quote box'] ?><br><br> |
96: <table style="width: 95%" align="center" cellspacing="4" cellpadding="6"><tr><td class="punquote"><span class="puntext"><b>James <?php echo $lang_common['wrote'] ?>:</b><br><br>Text</span></td></tr></table><br> | 96: <table style="width: 95%" align="center" cellspacing="4" cellpadding="6"><tr><td class="punquote"><span class="puntext"><b>James <?php echo $lang_common['wrote'] ?>:</b><br><br><?php echo $lang_help['Quote text'] ?></span></td></tr></table><br> |
97: <?php echo $lang_help['Quotes info 2'] ?><br><br> | 97: <?php echo $lang_help['Quotes info 2'] ?><br><br> |
98: [quote]<?php echo $lang_help['Quote text'] ?>[/quote]<br><br> | 98: [quote]<?php echo $lang_help['Quote text'] ?>[/quote]<br><br> |
99: <?php echo $lang_help['produces quote box'] ?><br><br> | 99: <?php echo $lang_help['produces quote box'] ?><br><br> |
punbb-1.1.1/upload/include/common.php |
punbb-1.1.2/upload/include/common.php |
48: // Turn off magic_quotes_runtime | 48: // Turn off magic_quotes_runtime |
49: set_magic_quotes_runtime(0); | 49: set_magic_quotes_runtime(0); |
50: | 50: |
51: // Attempt to turn off register_globals (this really isn't needed, but we'll do it anyway) | |
52: @ini_set('register_globals', 0); | |
53: | |
54: // Seed the random number generator | 51: // Seed the random number generator |
55: mt_srand((double)microtime()*1000000); | 52: mt_srand((double)microtime()*1000000); |
56: | 53: |
punbb-1.1.1/upload/include/common_admin.php |
punbb-1.1.2/upload/include/common_admin.php |
84: { | 84: { |
85: global $db; | 85: global $db; |
86: | 86: |
87: if ($prune_date != -1) | 87: $extra_sql = ($prune_date != -1) ? ' AND last_post<'.$prune_date : ''; |
88: $extra = ' AND last_post<'.$prune_date; | |
89: | 88: |
90: if (!$prune_sticky) | 89: if (!$prune_sticky) |
91: $extra .= ' AND sticky=\'0\''; | 90: $extra_sql .= ' AND sticky=\'0\''; |
92: | 91: |
93: // Fetch topics to prune | 92: // Fetch topics to prune |
94: $result = $db->query('SELECT id FROM '.$db->prefix.'topics WHERE forum_id='.$forum_id.$extra) or error('Unable to fetch topics', __FILE__, __LINE__, $db->error()); | 93: $result = $db->query('SELECT id FROM '.$db->prefix.'topics WHERE forum_id='.$forum_id.$extra_sql) or error('Unable to fetch topics', __FILE__, __LINE__, $db->error()); |
95: | 94: |
96: while ($row = $db->fetch_row($result)) | 95: while ($row = $db->fetch_row($result)) |
97: $topic_ids .= (($topic_ids != '') ? ',' : '').$row[0]; | 96: $topic_ids .= (($topic_ids != '') ? ',' : '').$row[0]; |
punbb-1.1.1/upload/index.php |
punbb-1.1.2/upload/index.php |
53: | 53: |
54: | 54: |
55: // Print the categories and forums | 55: // Print the categories and forums |
56: if ($cur_user['status'] < PUN_MOD) | 56: $extra_sql = ($cur_user['status'] < PUN_MOD) ? ' WHERE f.admmod_only=\'0\'' : ''; |
57: $extra = ' WHERE f.admmod_only=\'0\''; | |
58: | 57: |
59: $result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster, f.closed FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id'.$extra.' ORDER BY c.disp_position, c.id, f.disp_position') or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error()); | 58: $result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster, f.closed FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id'.$extra_sql.' ORDER BY c.disp_position, c.id, f.disp_position') or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error()); |
60: | 59: |
61: while ($cur_forum = $db->fetch_assoc($result)) | 60: while ($cur_forum = $db->fetch_assoc($result)) |
62: { | 61: { |
punbb-1.1.1/upload/install.php |
punbb-1.1.2/upload/install.php |
24: | 24: |
25: | 25: |
26: // The PunBB version this script installs | 26: // The PunBB version this script installs |
27: $punbb_version = '1.1.1'; | 27: $punbb_version = '1.1.2'; |
28: | 28: |
29: | 29: |
30: $pun_root = './'; | 30: $pun_root = './'; |
289: break; | 289: break; |
290: | 290: |
291: default: | 291: default: |
292: exit('\''.$db_type.'\' is not a valid database type. <a href="JavaScript: history.go(-1)">Go back</a>.'); | 292: exit('\''.htmlspecialchars($db_type).'\' is not a valid database type. <a href="JavaScript: history.go(-1)">Go back</a>.'); |
293: break; | 293: break; |
294: } | 294: } |
295: | 295: |
864: $db->query('INSERT INTO '.$db_prefix."users (username, password, email) VALUES('Guest', 'Guest', 'Guest')", 1) | 864: $db->query('INSERT INTO '.$db_prefix."users (username, password, email) VALUES('Guest', 'Guest', 'Guest')", 1) |
865: or exit('Unable to insert into table '.$db_prefix.'users. Please check your configuration and try again. <a href="JavaScript: history.go(-1)">Go back</a>.'); | 865: or exit('Unable to insert into table '.$db_prefix.'users. Please check your configuration and try again. <a href="JavaScript: history.go(-1)">Go back</a>.'); |
866: | 866: |
867: $db->query('INSERT INTO '.$db_prefix."users (username, password, email, num_posts, status, last_post, registered, last_visit) VALUES('".addslashes($username)."', '".pun_hash($password1)."', '$email', 1, 2, ".$now.", ".$now.", ".$now.')') | 867: $db->query('INSERT INTO '.$db_prefix."users (username, password, email, num_posts, status, last_post, registered, last_visit, last_action) VALUES('".addslashes($username)."', '".pun_hash($password1)."', '$email', 1, 2, ".$now.", ".$now.", ".$now.", ".$now.')') |
868: or exit('Unable to insert into table '.$db_prefix.'users. Please check your configuration and try again. <a href="JavaScript: history.go(-1)">Go back</a>.'); | 868: or exit('Unable to insert into table '.$db_prefix.'users. Please check your configuration and try again. <a href="JavaScript: history.go(-1)">Go back</a>.'); |
869: | 869: |
870: // Insert config data | 870: // Insert config data |
975: | 975: |
976: | 976: |
977: /// Display config.php and give further instructions | 977: /// Display config.php and give further instructions |
978: $config = '<?php'."\n\n".'$db_type = \''.$db_type."';\n".'$db_host = \''.$db_host."';\n".'$db_name = \''.$db_name."';\n".'$db_username = \''.$db_username."';\n".'$db_password = \''.$db_password."';\n".'$db_prefix = \''.$db_prefix."';\n".'$p_connect = true;'."\n\n".'$cookie_name = '."'punbb_cookie';\n".'$cookie_domain = '."'';\n".'$cookie_path = '."'/';\n".'$cookie_secure = 0;'."\n\n".'$language = \'en\';'."\n\ndefine('PUN', 1);\n\n?>"; | 978: $config = '<?php'."\n\n".'$db_type = \''.$db_type."';\n".'$db_host = \''.$db_host."';\n".'$db_name = \''.$db_name."';\n".'$db_username = \''.$db_username."';\n".'$db_password = \''.$db_password."';\n".'$db_prefix = \''.$db_prefix."';\n".'$p_connect = false;'."\n\n".'$cookie_name = '."'punbb_cookie';\n".'$cookie_domain = '."'';\n".'$cookie_path = '."'/';\n".'$cookie_secure = 0;'."\n\n".'$language = \'en\';'."\n\ndefine('PUN', 1);\n\n?>"; |
979: | 979: |
980: | 980: |
981: ?> | 981: ?> |
punbb-1.1.1/upload/lang/en/en_edit.php |
punbb-1.1.2/upload/lang/en/en_edit.php |
8: 'Too long subject' => 'Subjects cannot be longer than 70 characters.', | 8: 'Too long subject' => 'Subjects cannot be longer than 70 characters.', |
9: 'No caps subject' => 'Subjects must not contain only capital letters and special characters in this forum.', | 9: 'No caps subject' => 'Subjects must not contain only capital letters and special characters in this forum.', |
10: 'No message' => 'You must enter a message.', | 10: 'No message' => 'You must enter a message.', |
11: 'Too long message' => 'Posts cannot be longer that 65535 characters (64 Kb).', | 11: 'Too long message' => 'Posts cannot be longer that 65535 characters (64 KB).', |
12: 'No caps message' => 'Messages must not contain only capital letters and special characters in this forum.', | 12: 'No caps message' => 'Messages must not contain only capital letters and special characters in this forum.', |
13: | 13: |
14: // Miscellaneous | 14: // Miscellaneous |
punbb-1.1.1/upload/login.php |
punbb-1.1.2/upload/login.php |
81: else if ($action == 'out') | 81: else if ($action == 'out') |
82: { | 82: { |
83: if ($cookie['is_guest']) | 83: if ($cookie['is_guest']) |
| 84: { |
84: header('Location: index.php'); | 85: header('Location: index.php'); |
| 86: exit; |
| 87: } |
85: | 88: |
86: // Remove user from "users online" list. | 89: // Remove user from "users online" list. |
87: $db->query('DELETE FROM '.$db->prefix.'online WHERE ident=\''.addslashes($cur_user['username']).'\'') or error('Unable to delete from online list', __FILE__, __LINE__, $db->error()); | 90: $db->query('DELETE FROM '.$db->prefix.'online WHERE ident=\''.addslashes($cur_user['username']).'\'') or error('Unable to delete from online list', __FILE__, __LINE__, $db->error()); |
punbb-1.1.1/upload/misc.php |
punbb-1.1.2/upload/misc.php |
105: | 105: |
106: pun_mail($recipient_email, $mail_subject, $mail_message, $cur_user['username'].' <'.$cur_user['email'].'>'); | 106: pun_mail($recipient_email, $mail_subject, $mail_message, $cur_user['username'].' <'.$cur_user['email'].'>'); |
107: | 107: |
108: redirect('profile.php?id='.$recipient_id, $lang_misc['E-mail sent redirect']); | 108: redirect($_POST['redirect_url'], $lang_misc['E-mail sent redirect']); |
109: } | 109: } |
110: | 110: |
111: | 111: |
| 112: // Try to determine if the data in HTTP_REFERER is valid (if not, we redirect to the users profile after the e-mail is sent) |
| 113: $redirect_url = (isset($_SERVER['HTTP_REFERER']) && preg_match('#^'.preg_quote($pun_config['o_base_url']).'/(.*?)\.php#i', $_SERVER['HTTP_REFERER'])) ? $_SERVER['HTTP_REFERER'] : 'index.php'; |
| 114: |
112: $page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_misc['Send e-mail']; | 115: $page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_misc['Send e-mail']; |
113: $validate_form = true; | 116: $validate_form = true; |
114: $element_names = array('req_subject' => $lang_misc['E-mail subject'], 'req_message' => $lang_misc['E-mail message']); | 117: $element_names = array('req_subject' => $lang_misc['E-mail subject'], 'req_message' => $lang_misc['E-mail message']); |
121: | 124: |
122: <form method="post" action="misc.php?email=<?php echo $recipient_id ?>" id="email" onsubmit="return process_form(this)"> | 125: <form method="post" action="misc.php?email=<?php echo $recipient_id ?>" id="email" onsubmit="return process_form(this)"> |
123: <input type="hidden" name="form_sent" value="1"> | 126: <input type="hidden" name="form_sent" value="1"> |
| 127: <input type="hidden" name="redirect_url" value="<?php echo $redirect_url ?>"> |
124: <table class="punmain" cellspacing="1" cellpadding="4"> | 128: <table class="punmain" cellspacing="1" cellpadding="4"> |
125: <tr class="punhead"> | 129: <tr class="punhead"> |
126: <td class="punhead" colspan="2"><?php echo $lang_misc['Send e-mail'] ?></td> | 130: <td class="punhead" colspan="2"><?php echo $lang_misc['Send e-mail'] ?></td> |
punbb-1.1.1/upload/profile.php |
punbb-1.1.2/upload/profile.php |
49: { | 49: { |
50: // If the user is already logged in we shouldn't be here :) | 50: // If the user is already logged in we shouldn't be here :) |
51: if (!$cookie['is_guest']) | 51: if (!$cookie['is_guest']) |
| 52: { |
52: header('Location: index.php'); | 53: header('Location: index.php'); |
| 54: exit; |
| 55: } |
53: | 56: |
54: $key = $_GET['key']; | 57: $key = $_GET['key']; |
55: | 58: |
940: { | 943: { |
941: $username_field = '<input type="hidden" name="old_username" value="'.pun_htmlspecialchars($user['username']).'"><input type="text" name="username" value="'.pun_htmlspecialchars($user['username']).'" size="25" maxlength="25">'; | 944: $username_field = '<input type="hidden" name="old_username" value="'.pun_htmlspecialchars($user['username']).'"><input type="text" name="username" value="'.pun_htmlspecialchars($user['username']).'" size="25" maxlength="25">'; |
942: $email_field = '<input type="text" name="req_email" value="'.$user['email'].'" size="40" maxlength="50"> - <a href="misc.php?email='.$id.'">'.$lang_common['Send e-mail'].'</a>'; | 945: $email_field = '<input type="text" name="req_email" value="'.$user['email'].'" size="40" maxlength="50"> - <a href="misc.php?email='.$id.'">'.$lang_common['Send e-mail'].'</a>'; |
943: $user_title_field = '<input type="text" name="title" value="'.$user['title'].'" size="30" maxlength="50"> '.$lang_prof_reg['Leave blank']; | 946: $user_title_field = '<input type="text" name="title" value="'.$user['title'].'" size="30" maxlength="50"> '.$lang_profile['Leave blank']; |
944: | 947: |
945: if ($cur_user['status'] == PUN_ADMIN && $img_size) | 948: if ($cur_user['status'] == PUN_ADMIN && $img_size) |
946: $avatar_field .= '<br> <a href="profile.php?action=delete_avatar&id='.$id.'">'.$lang_profile['Delete avatar'].'</a>'; | 949: $avatar_field .= '<br> <a href="profile.php?action=delete_avatar&id='.$id.'">'.$lang_profile['Delete avatar'].'</a>'; |
955: $email_field = '<input type="text" name="req_email" value="'.$user['email'].'" size="40" maxlength="50">'; | 958: $email_field = '<input type="text" name="req_email" value="'.$user['email'].'" size="40" maxlength="50">'; |
956: | 959: |
957: if ($pun_config['p_users_set_title'] == '1') | 960: if ($pun_config['p_users_set_title'] == '1') |
958: $user_title_field = '<input type="text" name="title" value="'.$user['title'].'" size="30" maxlength="50"> '.$lang_prof_reg['Leave blank']; | 961: $user_title_field = '<input type="text" name="title" value="'.$user['title'].'" size="30" maxlength="50"> '.$lang_profile['Leave blank']; |
959: else | 962: else |
960: { | 963: { |
961: $user_title_field = get_title($user); | 964: $user_title_field = get_title($user); |
punbb-1.1.1/upload/register.php |
punbb-1.1.2/upload/register.php |
29: | 29: |
30: // If we are logged in, we shouldn't be here | 30: // If we are logged in, we shouldn't be here |
31: if (!$cookie['is_guest']) | 31: if (!$cookie['is_guest']) |
| 32: { |
32: header('Location: index.php'); | 33: header('Location: index.php'); |
| 34: exit; |
| 35: } |
33: | 36: |
34: // Load the register.php language file | 37: // Load the register.php language file |
35: require $pun_root.'lang/'.$language.'/'.$language.'_register.php'; | 38: require $pun_root.'lang/'.$language.'/'.$language.'_register.php'; |
punbb-1.1.1/upload/search.php |
punbb-1.1.2/upload/search.php |
189: { | 189: { |
190: $word = trim($word); | 190: $word = trim($word); |
191: if ($word != 'and' || $word != 'or' || $word != 'not') | 191: if ($word != 'and' || $word != 'or' || $word != 'not') |
192: $text = preg_replace('#\b'.preg_quote($word).'\b#', ' ', $text); | 192: $keywords = preg_replace('#\b'.preg_quote($word).'\b#', ' ', $keywords); |
193: } | 193: } |
194: } | 194: } |
195: | 195: |
196: // Split up keywords | 196: // Split up keywords |
197: $keywords_array = preg_split('#[\s]+#', substr($keywords, 1, -1)); | 197: $keywords_array = preg_split('#[\s]+#', trim($keywords)); |
198: | 198: |
199: // Should we search in message body or topic subject specifically? | 199: // Should we search in message body or topic subject specifically? |
200: if ($search_in) | 200: $search_in_cond = ($search_in) ? (($search_in > 0) ? ' AND m.subject_match = 0' : ' AND m.subject_match = 1') : ''; |
201: $search_in_cond = ($search_in > 0) ? ' AND m.subject_match = 0' : ' AND m.subject_match = 1'; | |
202: } | 201: } |
203: | 202: |
204: $match_type = 'or'; | 203: $match_type = 'or'; |
693: echo "\t\t\t\t\t".'<option value="-1">'.$lang_search['All forums'].'</option>'."\n"; | 692: echo "\t\t\t\t\t".'<option value="-1">'.$lang_search['All forums'].'</option>'."\n"; |
694: | 693: |
695: | 694: |
696: if ($cur_user['status'] < PUN_USER) | 695: $extra_sql = ($cur_user['status'] < PUN_MOD) ? ' WHERE f.admmod_only=\'0\'' : ''; |
697: $extra = ' WHERE f.admmod_only=\'0\''; | |
698: | 696: |
699: $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'.$extra.' ORDER BY c.disp_position, c.id, f.disp_position') or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error()); | 697: $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'.$extra.' ORDER BY c.disp_position, c.id, f.disp_position') or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error()); |
700: $num_forums = $db->num_rows($result); | 698: $num_forums = $db->num_rows($result); |
punbb-1.1.1/upload/viewtopic.php |
punbb-1.1.2/upload/viewtopic.php |
81: header('Location: viewtopic.php?pid='.$first_new_post_id.'#'.$first_new_post_id); | 81: header('Location: viewtopic.php?pid='.$first_new_post_id.'#'.$first_new_post_id); |
82: else // If there is no new post, we go to the last post | 82: else // If there is no new post, we go to the last post |
83: header('Location: viewtopic.php?id='.$id.'&action=last'); | 83: header('Location: viewtopic.php?id='.$id.'&action=last'); |
| 84: |
| 85: exit; |
84: } | 86: } |
85: | 87: |
86: | 88: |
91: $last_post_id = $db->result($result, 0); | 93: $last_post_id = $db->result($result, 0); |
92: | 94: |
93: if ($last_post_id) | 95: if ($last_post_id) |
| 96: { |
94: header('Location: viewtopic.php?pid='.$last_post_id.'#'.$last_post_id); | 97: header('Location: viewtopic.php?pid='.$last_post_id.'#'.$last_post_id); |
| 98: exit; |
| 99: } |
95: } | 100: } |
96: | 101: |
97: | 102: |