punbb-1.2/upload/admin_groups.php |
punbb-1.2.16/upload/admin_groups.php |
54: message($lang_common['Bad request']); | 54: message($lang_common['Bad request']); |
55: | 55: |
56: $result = $db->query('SELECT * FROM '.$db->prefix.'groups WHERE g_id='.$group_id) or error('Unable to fetch user group info', __FILE__, __LINE__, $db->error()); | 56: $result = $db->query('SELECT * FROM '.$db->prefix.'groups WHERE g_id='.$group_id) or error('Unable to fetch user group info', __FILE__, __LINE__, $db->error()); |
| 57: if (!$db->num_rows($result)) |
| 58: message($lang_common['Bad request']); |
| 59: |
57: $group = $db->fetch_assoc($result); | 60: $group = $db->fetch_assoc($result); |
58: | 61: |
59: $mode = 'edit'; | 62: $mode = 'edit'; |
180: </td> | 183: </td> |
181: </tr> | 184: </tr> |
182: <?php endif; ?><?php endif; ?> </table> | 185: <?php endif; ?><?php endif; ?> </table> |
183: <?php if ($group['g_id'] == PUN_MOD ): ?> <p class="showhot">Please note that in order for a user in this group to have moderator abilities, he/she must be assigned to moderate one or more forums. This is done via the user administration page of the user's profile.</p> | 186: <?php if ($group['g_id'] == PUN_MOD ): ?> <p class="warntext">Please note that in order for a user in this group to have moderator abilities, he/she must be assigned to moderate one or more forums. This is done via the user administration page of the user's profile.</p> |
184: <?php endif; ?> </div> | 187: <?php endif; ?> </div> |
185: </fieldset> | 188: </fieldset> |
186: </div> | 189: </div> |
206: | 209: |
207: $title = trim($_POST['req_title']); | 210: $title = trim($_POST['req_title']); |
208: $user_title = trim($_POST['user_title']); | 211: $user_title = trim($_POST['user_title']); |
209: $read_board = isset($_POST['read_board']) ? $_POST['read_board'] : '1'; | 212: $read_board = isset($_POST['read_board']) ? intval($_POST['read_board']) : '1'; |
210: $post_replies = isset($_POST['post_replies']) ? $_POST['post_replies'] : '1'; | 213: $post_replies = isset($_POST['post_replies']) ? intval($_POST['post_replies']) : '1'; |
211: $post_topics = isset($_POST['post_topics']) ? $_POST['post_topics'] : '1'; | 214: $post_topics = isset($_POST['post_topics']) ? intval($_POST['post_topics']) : '1'; |
212: $edit_posts = isset($_POST['edit_posts']) ? $_POST['edit_posts'] : ($is_admin_group) ? '1' : '0'; | 215: $edit_posts = isset($_POST['edit_posts']) ? intval($_POST['edit_posts']) : ($is_admin_group) ? '1' : '0'; |
213: $delete_posts = isset($_POST['delete_posts']) ? $_POST['delete_posts'] : ($is_admin_group) ? '1' : '0'; | 216: $delete_posts = isset($_POST['delete_posts']) ? intval($_POST['delete_posts']) : ($is_admin_group) ? '1' : '0'; |
214: $delete_topics = isset($_POST['delete_topics']) ? $_POST['delete_topics'] : ($is_admin_group) ? '1' : '0'; | 217: $delete_topics = isset($_POST['delete_topics']) ? intval($_POST['delete_topics']) : ($is_admin_group) ? '1' : '0'; |
215: $set_title = isset($_POST['set_title']) ? $_POST['set_title'] : ($is_admin_group) ? '1' : '0'; | 218: $set_title = isset($_POST['set_title']) ? intval($_POST['set_title']) : ($is_admin_group) ? '1' : '0'; |
216: $search = isset($_POST['search']) ? $_POST['search'] : '1'; | 219: $search = isset($_POST['search']) ? intval($_POST['search']) : '1'; |
217: $search_users = isset($_POST['search_users']) ? $_POST['search_users'] : '1'; | 220: $search_users = isset($_POST['search_users']) ? intval($_POST['search_users']) : '1'; |
218: $edit_subjects_interval = isset($_POST['edit_subjects_interval']) ? intval($_POST['edit_subjects_interval']) : '0'; | 221: $edit_subjects_interval = isset($_POST['edit_subjects_interval']) ? intval($_POST['edit_subjects_interval']) : '0'; |
219: $post_flood = isset($_POST['post_flood']) ? intval($_POST['post_flood']) : '0'; | 222: $post_flood = isset($_POST['post_flood']) ? intval($_POST['post_flood']) : '0'; |
220: $search_flood = isset($_POST['search_flood']) ? intval($_POST['search_flood']) : '0'; | 223: $search_flood = isset($_POST['search_flood']) ? intval($_POST['search_flood']) : '0'; |
226: | 229: |
227: if ($_POST['mode'] == 'add') | 230: if ($_POST['mode'] == 'add') |
228: { | 231: { |
229: $db->query('SELECT 1 FROM '.$db->prefix.'groups WHERE g_title=\''.$db->escape($title).'\'') or error('Unable to check group title collision', __FILE__, __LINE__, $db->error()); | 232: $result = $db->query('SELECT 1 FROM '.$db->prefix.'groups WHERE g_title=\''.$db->escape($title).'\'') or error('Unable to check group title collision', __FILE__, __LINE__, $db->error()); |
230: if ($db->num_rows()) | 233: if ($db->num_rows($result)) |
231: message('There is already a group with the title \''.pun_htmlspecialchars($title).'\'.'); | 234: message('There is already a group with the title \''.pun_htmlspecialchars($title).'\'.'); |
232: | 235: |
233: $db->query('INSERT INTO '.$db->prefix.'groups (g_title, g_user_title, g_read_board, g_post_replies, g_post_topics, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_edit_subjects_interval, g_post_flood, g_search_flood) VALUES(\''.$db->escape($title).'\', '.$user_title.', '.$read_board.', '.$post_replies.', '.$post_topics.', '.$edit_posts.', '.$delete_posts.', '.$delete_topics.', '.$set_title.', '.$search.', '.$search_users.', '.$edit_subjects_interval.', '.$post_flood.', '.$search_flood.')') or error('Unable to add group', __FILE__, __LINE__, $db->error()); | 236: $db->query('INSERT INTO '.$db->prefix.'groups (g_title, g_user_title, g_read_board, g_post_replies, g_post_topics, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_edit_subjects_interval, g_post_flood, g_search_flood) VALUES(\''.$db->escape($title).'\', '.$user_title.', '.$read_board.', '.$post_replies.', '.$post_topics.', '.$edit_posts.', '.$delete_posts.', '.$delete_topics.', '.$set_title.', '.$search.', '.$search_users.', '.$edit_subjects_interval.', '.$post_flood.', '.$search_flood.')') or error('Unable to add group', __FILE__, __LINE__, $db->error()); |
239: $db->query('INSERT INTO '.$db->prefix.'forum_perms (group_id, forum_id, read_forum, post_replies, post_topics) VALUES('.$new_group_id.', '.$cur_forum_perm['forum_id'].', '.$cur_forum_perm['read_forum'].', '.$cur_forum_perm['post_replies'].', '.$cur_forum_perm['post_topics'].')') or error('Unable to insert group forum permissions', __FILE__, __LINE__, $db->error()); | 242: $db->query('INSERT INTO '.$db->prefix.'forum_perms (group_id, forum_id, read_forum, post_replies, post_topics) VALUES('.$new_group_id.', '.$cur_forum_perm['forum_id'].', '.$cur_forum_perm['read_forum'].', '.$cur_forum_perm['post_replies'].', '.$cur_forum_perm['post_topics'].')') or error('Unable to insert group forum permissions', __FILE__, __LINE__, $db->error()); |
240: } | 243: } |
241: else | 244: else |
242: $db->query('UPDATE '.$db->prefix.'groups SET g_title=\''.$db->escape($title).'\', g_user_title='.$user_title.', g_read_board='.$read_board.', g_post_replies='.$post_replies.', g_post_topics='.$post_topics.', g_edit_posts='.$edit_posts.', g_delete_posts='.$delete_posts.', g_delete_topics='.$delete_topics.', g_set_title='.$set_title.', g_search='.$search.', g_search_users='.$search_users.', g_edit_subjects_interval='.$edit_subjects_interval.', g_post_flood='.$post_flood.', g_search_flood='.$search_flood.' WHERE g_id='.$_POST['group_id']) or error('Unable to update group', __FILE__, __LINE__, $db->error()); | 245: { |
| 246: $result = $db->query('SELECT 1 FROM '.$db->prefix.'groups WHERE g_title=\''.$db->escape($title).'\' AND g_id!='.intval($_POST['group_id'])) or error('Unable to check group title collision', __FILE__, __LINE__, $db->error()); |
| 247: if ($db->num_rows($result)) |
| 248: message('There is already a group with the title \''.pun_htmlspecialchars($title).'\'.'); |
| 249: |
| 250: $db->query('UPDATE '.$db->prefix.'groups SET g_title=\''.$db->escape($title).'\', g_user_title='.$user_title.', g_read_board='.$read_board.', g_post_replies='.$post_replies.', g_post_topics='.$post_topics.', g_edit_posts='.$edit_posts.', g_delete_posts='.$delete_posts.', g_delete_topics='.$delete_topics.', g_set_title='.$set_title.', g_search='.$search.', g_search_users='.$search_users.', g_edit_subjects_interval='.$edit_subjects_interval.', g_post_flood='.$post_flood.', g_search_flood='.$search_flood.' WHERE g_id='.intval($_POST['group_id'])) or error('Unable to update group', __FILE__, __LINE__, $db->error()); |
| 251: } |
243: | 252: |
244: // Regenerate the quickjump cache | 253: // Regenerate the quickjump cache |
245: require_once PUN_ROOT.'include/cache.php'; | 254: require_once PUN_ROOT.'include/cache.php'; |
255: confirm_referrer('admin_groups.php'); | 264: confirm_referrer('admin_groups.php'); |
256: | 265: |
257: $group_id = intval($_POST['default_group']); | 266: $group_id = intval($_POST['default_group']); |
258: if ($group_id < 1) | 267: if ($group_id < 4) |
259: message($lang_common['Bad request']); | 268: message($lang_common['Bad request']); |
260: | 269: |
261: $db->query('UPDATE '.$db->prefix.'config SET conf_value='.$group_id.' WHERE conf_name=\'o_default_user_group\'') or error('Unable to update board config', __FILE__, __LINE__, $db->error()); | 270: $db->query('UPDATE '.$db->prefix.'config SET conf_value='.$group_id.' WHERE conf_name=\'o_default_user_group\'') or error('Unable to update board config', __FILE__, __LINE__, $db->error()); |
punbb-1.2/upload/admin_options.php |
punbb-1.2.16/upload/admin_options.php |
37: | 37: |
38: if (isset($_POST['form_sent'])) | 38: if (isset($_POST['form_sent'])) |
39: { | 39: { |
40: // Lazy referer check (in case base_url isn't correct) | 40: // Custom referrer check (so we can output a custom error message) |
41: if (!preg_match('#/admin_options\.php#i', $_SERVER['HTTP_REFERER'])) | 41: if (!preg_match('#^'.preg_quote(str_replace('www.', '', $pun_config['o_base_url']).'/admin_options.php', '#').'#i', str_replace('www.', '', (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '')))) |
42: message($lang_common['Bad referrer']); | 42: message('Bad HTTP_REFERER. If you have moved these forums from one location to another or switched domains, you need to update the Base URL manually in the database (look for o_base_url in the config table) and then clear the cache by deleting all .php files in the /cache directory.'); |
43: | 43: |
44: $form = array_map('trim', $_POST['form']); | 44: $form = array_map('trim', $_POST['form']); |
45: | 45: |
46: if ($form['board_title'] == '') | 46: if ($form['board_title'] == '') |
47: message('You must enter a board title.'); | 47: message('You must enter a board title.'); |
48: | 48: |
| 49: // Clean default_lang |
| 50: $form['default_lang'] = preg_replace('#[\.\\\/]#', '', $form['default_lang']); |
| 51: |
49: require PUN_ROOT.'include/email.php'; | 52: require PUN_ROOT.'include/email.php'; |
50: | 53: |
51: $form['admin_email'] = strtolower($form['admin_email']); | 54: $form['admin_email'] = strtolower($form['admin_email']); |
63: if (substr($form['base_url'], -1) == '/') | 66: if (substr($form['base_url'], -1) == '/') |
64: $form['base_url'] = substr($form['base_url'], 0, -1); | 67: $form['base_url'] = substr($form['base_url'], 0, -1); |
65: | 68: |
| 69: // Clean avatars_dir |
| 70: $form['avatars_dir'] = str_replace("\0", '', $form['avatars_dir']); |
| 71: |
66: // Make sure avatars_dir doesn't end with a slash | 72: // Make sure avatars_dir doesn't end with a slash |
67: if (substr($form['avatars_dir'], -1) == '/') | 73: if (substr($form['avatars_dir'], -1) == '/') |
68: $form['avatars_dir'] = substr($form['avatars_dir'], 0, -1); | 74: $form['avatars_dir'] = substr($form['avatars_dir'], 0, -1); |
69: | 75: |
| 76: if ($form['additional_navlinks'] != '') |
| 77: $form['additional_navlinks'] = trim(pun_linebreaks($form['additional_navlinks'])); |
| 78: |
70: if ($form['announcement_message'] != '') | 79: if ($form['announcement_message'] != '') |
71: $form['announcement_message'] = pun_linebreaks($form['announcement_message']); | 80: $form['announcement_message'] = pun_linebreaks($form['announcement_message']); |
72: else | 81: else |
114: while (list($key, $input) = @each($form)) | 123: while (list($key, $input) = @each($form)) |
115: { | 124: { |
116: // Only update values that have changed | 125: // Only update values that have changed |
117: if ($pun_config['o_'.$key] != $input) | 126: if (array_key_exists('o_'.$key, $pun_config) && $pun_config['o_'.$key] != $input) |
118: { | 127: { |
119: if ($input != '' || is_int($input)) | 128: if ($input != '' || is_int($input)) |
120: $value = '\''.$db->escape($input).'\''; | 129: $value = '\''.$db->escape($input).'\''; |
121: else | 130: else |
122: $value = 'NULL'; | 131: $value = 'NULL'; |
123: | 132: |
124: $db->query('UPDATE '.$db->prefix.'config SET conf_value='.$value.' WHERE conf_name=\'o_'.$key.'\'') or error('Unable to update board config', __FILE__, __LINE__, $db->error()); | 133: $db->query('UPDATE '.$db->prefix.'config SET conf_value='.$value.' WHERE conf_name=\'o_'.$db->escape($key).'\'') or error('Unable to update board config', __FILE__, __LINE__, $db->error()); |
125: } | 134: } |
126: } | 135: } |
127: | 136: |
166: </td> | 175: </td> |
167: </tr> | 176: </tr> |
168: <tr> | 177: <tr> |
| 178: <th scope="row">Base URL</th> |
| 179: <td> |
| 180: <input type="text" name="form[base_url]" size="50" maxlength="100" value="<?php echo $pun_config['o_base_url'] ?>" /> |
| 181: <span>The complete URL of the forum without trailing slash (i.e. http://www.mydomain.com/forums). This <strong>must</strong> be correct in order for all admin and moderator features to work. If you get "Bad referer" errors, it's probably incorrect.</span> |
| 182: </td> |
| 183: </tr> |
| 184: <tr> |
169: <th scope="row">Server timezone</th> | 185: <th scope="row">Server timezone</th> |
170: <td> | 186: <td> |
171: <select name="form[server_timezone]"> | 187: <select name="form[server_timezone]"> |
219: $d = dir(PUN_ROOT.'lang'); | 235: $d = dir(PUN_ROOT.'lang'); |
220: while (($entry = $d->read()) !== false) | 236: while (($entry = $d->read()) !== false) |
221: { | 237: { |
222: if ($entry != '.' && $entry != '..' && is_dir(PUN_ROOT.'lang/'.$entry)) | 238: if ($entry != '.' && $entry != '..' && is_dir(PUN_ROOT.'lang/'.$entry) && file_exists(PUN_ROOT.'lang/'.$entry.'/common.php')) |
223: $languages[] = $entry; | 239: $languages[] = $entry; |
224: } | 240: } |
225: $d->close(); | 241: $d->close(); |
226: | 242: |
| 243: @natsort($languages); |
| 244: |
227: while (list(, $temp) = @each($languages)) | 245: while (list(, $temp) = @each($languages)) |
228: { | 246: { |
229: if ($pun_config['o_default_lang'] == $temp) | 247: if ($pun_config['o_default_lang'] == $temp) |
252: } | 270: } |
253: $d->close(); | 271: $d->close(); |
254: | 272: |
| 273: @natsort($styles); |
| 274: |
255: while (list(, $temp) = @each($styles)) | 275: while (list(, $temp) = @each($styles)) |
256: { | 276: { |
257: if ($pun_config['o_default_style'] == $temp) | 277: if ($pun_config['o_default_style'] == $temp) |
264: </select> | 284: </select> |
265: <span>This is the default style used for guests and users who haven't changed from the default in their profile.</span></td> | 285: <span>This is the default style used for guests and users who haven't changed from the default in their profile.</span></td> |
266: </tr> | 286: </tr> |
267: <tr> | |
268: <th scope="row">Base URL</th> | |
269: <td> | |
270: <input type="text" name="form[base_url]" size="50" maxlength="100" value="<?php echo $pun_config['o_base_url'] ?>" /> | |
271: <span>The complete URL of the forum without trailing slash (i.e. http://www.mydomain.com/forums). This <strong>must</strong> be correct in order for all admin and moderator features to work. If you get "Bad referer" errors, it's probably incorrect.</span> | |
272: </td> | |
273: </tr> | |
274: </table> | 287: </table> |
275: </div> | 288: </div> |
276: </fieldset> | 289: </fieldset> |
459: <span>When disabled, searches will only be allowed in one forum at a time. Disable if server load is high due to excessive searching.</span> | 472: <span>When disabled, searches will only be allowed in one forum at a time. Disable if server load is high due to excessive searching.</span> |
460: </td> | 473: </td> |
461: </tr> | 474: </tr> |
| 475: <tr> |
| 476: <th scope="row">Additional menu items</th> |
| 477: <td> |
| 478: <textarea name="form[additional_navlinks]" rows="3" cols="55"><?php echo pun_htmlspecialchars($pun_config['o_additional_navlinks']) ?></textarea> |
| 479: <span>By entering HTML hyperlinks into this textbox, any number of items can be added to the navigation menu at the top of all pages. The format for adding new links is X = <a href="URL">LINK</a> where X is the position at which the link should be inserted (e.g. 0 to insert at the beginning and 2 to insert after "User list"). Separate entries with a linebreak.</span> |
| 480: </td> |
| 481: </tr> |
462: </table> | 482: </table> |
463: </div> | 483: </div> |
464: </fieldset> | 484: </fieldset> |
punbb-1.2/upload/admin_users.php |
punbb-1.2.16/upload/admin_users.php |
49: ?> | 49: ?> |
50: <div class="linkst"> | 50: <div class="linkst"> |
51: <div class="inbox"> | 51: <div class="inbox"> |
52: <div><a href="javascript:history.go(-1)" />Go back</a></div> | 52: <div><a href="javascript:history.go(-1)">Go back</a></div> |
53: </div> | 53: </div> |
54: </div> | 54: </div> |
55: | 55: |
98: | 98: |
99: <div class="linksb"> | 99: <div class="linksb"> |
100: <div class="inbox"> | 100: <div class="inbox"> |
101: <div><a href="javascript:history.go(-1)" />Go back</a></div> | 101: <div><a href="javascript:history.go(-1)">Go back</a></div> |
102: </div> | 102: </div> |
103: </div> | 103: </div> |
104: <?php | 104: <?php |
111: { | 111: { |
112: $ip = $_GET['show_users']; | 112: $ip = $_GET['show_users']; |
113: | 113: |
114: if (!preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $ip)) | 114: if (!@preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $ip)) |
115: message('The supplied IP address is not correctly formatted.'); | 115: message('The supplied IP address is not correctly formatted.'); |
116: | 116: |
117: | 117: |
121: ?> | 121: ?> |
122: <div class="linkst"> | 122: <div class="linkst"> |
123: <div class="inbox"> | 123: <div class="inbox"> |
124: <div><a href="javascript:history.go(-1)" />Go back</a></div> | 124: <div><a href="javascript:history.go(-1)">Go back</a></div> |
125: </div> | 125: </div> |
126: </div> | 126: </div> |
127: | 127: |
202: | 202: |
203: <div class="linksb"> | 203: <div class="linksb"> |
204: <div class="inbox"> | 204: <div class="inbox"> |
205: <div><a href="javascript:history.go(-1)" />Go back</a></div> | 205: <div><a href="javascript:history.go(-1)">Go back</a></div> |
206: </div> | 206: </div> |
207: </div> | 207: </div> |
208: <?php | 208: <?php |
217: | 217: |
218: // trim() all elements in $form | 218: // trim() all elements in $form |
219: $form = array_map('trim', $form); | 219: $form = array_map('trim', $form); |
| 220: $conditions = array(); |
220: | 221: |
221: $posts_greater = trim($_POST['posts_greater']); | 222: $posts_greater = trim($_POST['posts_greater']); |
222: $posts_less = trim($_POST['posts_less']); | 223: $posts_less = trim($_POST['posts_less']); |
256: $like_command = ($db_type == 'pgsql') ? 'ILIKE' : 'LIKE'; | 257: $like_command = ($db_type == 'pgsql') ? 'ILIKE' : 'LIKE'; |
257: while (list($key, $input) = @each($form)) | 258: while (list($key, $input) = @each($form)) |
258: { | 259: { |
259: if ($input != '') | 260: if ($input != '' && in_array($key, array('username', 'email', 'title', 'realname', 'url', 'jabber', 'icq', 'msn', 'aim', 'yahoo', 'location', 'signature', 'admin_note'))) |
260: $conditions[] = 'u.'.$key.' '.$like_command.' \''.str_replace('*', '%', $input).'\''; | 261: $conditions[] = 'u.'.$db->escape($key).' '.$like_command.' \''.$db->escape(str_replace('*', '%', $input)).'\''; |
261: } | 262: } |
262: | 263: |
263: if ($posts_greater != '') | 264: if ($posts_greater != '') |
266: $conditions[] = 'u.num_posts<'.$posts_less; | 267: $conditions[] = 'u.num_posts<'.$posts_less; |
267: | 268: |
268: if ($user_group != 'all') | 269: if ($user_group != 'all') |
269: $conditions[] = 'u.group_id='.$user_group; | 270: $conditions[] = 'u.group_id='.intval($user_group); |
270: | 271: |
271: if (!isset($conditions)) | 272: if (empty($conditions)) |
272: message('You didn\'t enter any search terms.'); | 273: message('You didn\'t enter any search terms.'); |
273: | 274: |
274: | 275: |
278: ?> | 279: ?> |
279: <div class="linkst"> | 280: <div class="linkst"> |
280: <div class="inbox"> | 281: <div class="inbox"> |
281: <div><a href="javascript:history.go(-1)" />Go back</a></div> | 282: <div><a href="javascript:history.go(-1)">Go back</a></div> |
282: </div> | 283: </div> |
283: </div> | 284: </div> |
284: | 285: |
300: <tbody> | 301: <tbody> |
301: <?php | 302: <?php |
302: | 303: |
303: $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 '.$order_by.' '.$direction) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error()); | 304: $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()); |
304: if ($db->num_rows($result)) | 305: if ($db->num_rows($result)) |
305: { | 306: { |
306: while ($user_data = $db->fetch_assoc($result)) | 307: while ($user_data = $db->fetch_assoc($result)) |
309: | 310: |
310: // This script is a special case in that we want to display "Not verified" for non-verified users | 311: // This script is a special case in that we want to display "Not verified" for non-verified users |
311: if (($user_data['g_id'] == '' || $user_data['g_id'] == PUN_UNVERIFIED) && $user_title != $lang_common['Banned']) | 312: if (($user_data['g_id'] == '' || $user_data['g_id'] == PUN_UNVERIFIED) && $user_title != $lang_common['Banned']) |
312: $user_title = '<span class="showhot">Not verified</span>'; | 313: $user_title = '<span class="warntext">Not verified</span>'; |
313: | 314: |
314: $actions = '<a href="admin_users.php?ip_stats='.$user_data['id'].'">View IP stats</a> - <a href="search.php?action=show_user&user_id='.$user_data['id'].'">Show posts</a>'; | 315: $actions = '<a href="admin_users.php?ip_stats='.$user_data['id'].'">View IP stats</a> - <a href="search.php?action=show_user&user_id='.$user_data['id'].'">Show posts</a>'; |
315: | 316: |
338: | 339: |
339: <div class="linksb"> | 340: <div class="linksb"> |
340: <div class="inbox"> | 341: <div class="inbox"> |
341: <div><a href="javascript:history.go(-1)" />Go back</a></div> | 342: <div><a href="javascript:history.go(-1)">Go back</a></div> |
342: </div> | 343: </div> |
343: </div> | 344: </div> |
344: <?php | 345: <?php |
punbb-1.2/upload/header.php |
punbb-1.2.16/upload/header.php |
15: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 15: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16: GNU General Public License for more details. | 16: GNU General Public License for more details. |
17: | 17: |
18: You should have received a copy of the GNU G>eneral Public License | 18: You should have received a copy of the GNU General Public License |
19: along with this program; if not, write to the Free Software | 19: along with this program; if not, write to the Free Software |
20: Foundation, Inc., 59 Temple Place, Suite 330, Boston, | 20: Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
21: MA 02111-1307 USA | 21: MA 02111-1307 USA |
43: $tpl_main = file_get_contents(PUN_ROOT.'include/template/main.tpl'); | 43: $tpl_main = file_get_contents(PUN_ROOT.'include/template/main.tpl'); |
44: | 44: |
45: | 45: |
| 46: // START SUBST - <pun_include "*"> |
| 47: while (preg_match('#<pun_include "([^/\\\\]*?)\.(php[45]?|inc|html?|txt)">#', $tpl_main, $cur_include)) |
| 48: { |
| 49: if (!file_exists(PUN_ROOT.'include/user/'.$cur_include[1].'.'.$cur_include[2])) |
| 50: error('Unable to process user include '.htmlspecialchars($cur_include[0]).' from template main.tpl. There is no such file in folder /include/user/'); |
| 51: |
| 52: ob_start(); |
| 53: include PUN_ROOT.'include/user/'.$cur_include[1].'.'.$cur_include[2]; |
| 54: $tpl_temp = ob_get_contents(); |
| 55: $tpl_main = str_replace($cur_include[0], $tpl_temp, $tpl_main); |
| 56: ob_end_clean(); |
| 57: } |
| 58: // END SUBST - <pun_include "*"> |
| 59: |
| 60: |
46: // START SUBST - <pun_content_direction> | 61: // START SUBST - <pun_content_direction> |
47: $tpl_main = str_replace('<pun_content_direction>', $lang_common['lang_direction'], $tpl_main); | 62: $tpl_main = str_replace('<pun_content_direction>', $lang_common['lang_direction'], $tpl_main); |
48: // END SUBST - <pun_content_direction> | 63: // END SUBST - <pun_content_direction> |
68: if (defined('PUN_ADMIN_CONSOLE')) | 83: if (defined('PUN_ADMIN_CONSOLE')) |
69: echo '<link rel="stylesheet" type="text/css" href="style/imports/base_admin.css" />'."\n"; | 84: echo '<link rel="stylesheet" type="text/css" href="style/imports/base_admin.css" />'."\n"; |
70: | 85: |
71: if (isset($destination_url)) | 86: if (isset($required_fields)) |
72: echo '<meta http-equiv="refresh" content="'.$delay.';URL='.$destination.'" />'."\n"; | |
73: | |
74: else if (isset($required_fields)) | |
75: { | 87: { |
76: // Output JavaScript to validate form (make sure required fields are filled out) | 88: // Output JavaScript to validate form (make sure required fields are filled out) |
77: | 89: |
114: | 126: |
115: } | 127: } |
116: | 128: |
| 129: $user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? strtolower($_SERVER['HTTP_USER_AGENT']) : ''; |
| 130: if (strpos($user_agent, 'msie') !== false && strpos($user_agent, 'windows') !== false && strpos($user_agent, 'opera') === false) |
| 131: echo '<script type="text/javascript" src="style/imports/minmax.js"></script>'; |
| 132: |
117: $tpl_temp = trim(ob_get_contents()); | 133: $tpl_temp = trim(ob_get_contents()); |
118: $tpl_main = str_replace('<pun_head>', $tpl_temp, $tpl_main); | 134: $tpl_main = str_replace('<pun_head>', $tpl_temp, $tpl_main); |
119: ob_end_clean(); | 135: ob_end_clean(); |
123: // START SUBST - <body> | 139: // START SUBST - <body> |
124: if (isset($focus_element)) | 140: if (isset($focus_element)) |
125: { | 141: { |
126: $tpl_main = str_replace('<body onload="', '<body onload="document.getElementById(\''.$focus_element[0].'\').'.$focus_element[1].'.focus();', $tpl_main); | 142: $tpl_main = str_replace('<body onload="', '<body onload="document.getElementById(\''.$focus_element[0].'\').'.$focus_element[1].'.focus();', $tpl_main); |
127: $tpl_main = str_replace('<body>', '<body onload="document.getElementById(\''.$focus_element[0].'\').'.$focus_element[1].'.focus()">', $tpl_main); | 143: $tpl_main = str_replace('<body>', '<body onload="document.getElementById(\''.$focus_element[0].'\').'.$focus_element[1].'.focus()">', $tpl_main); |
128: } | 144: } |
129: // END SUBST - <body> | 145: // END SUBST - <body> |
130: | 146: |
131: | 147: |
132: // START SUBST - <pun_page> | 148: // START SUBST - <pun_page> |
133: $tpl_main = str_replace('<pun_page>', basename($_SERVER['PHP_SELF'], '.php'), $tpl_main); | 149: $tpl_main = str_replace('<pun_page>', htmlspecialchars(basename($_SERVER['PHP_SELF'], '.php')), $tpl_main); |
134: // END SUBST - <pun_title> | 150: // END SUBST - <pun_title> |
135: | 151: |
136: | 152: |
154: $tpl_temp = '<div id="brdwelcome" class="inbox">'."\n\t\t\t".'<p>'.$lang_common['Not logged in'].'</p>'."\n\t\t".'</div>'; | 170: $tpl_temp = '<div id="brdwelcome" class="inbox">'."\n\t\t\t".'<p>'.$lang_common['Not logged in'].'</p>'."\n\t\t".'</div>'; |
155: else | 171: else |
156: { | 172: { |
157: $tpl_temp = '<div id="brdwelcome" class="inbox">'."\n\t\t\t".'<p class="conl">'.$lang_common['Logged in as'].' <strong>'.pun_htmlspecialchars($pun_user['username']).'</strong><br />'.$lang_common['Last visit'].': '.format_time($pun_user['last_visit']); | 173: $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>'; |
158: | 174: |
159: if ($pun_user['g_id'] < PUN_GUEST) | 175: if ($pun_user['g_id'] < PUN_GUEST) |
160: { | 176: { |
161: $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()); | 177: $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()); |
162: | 178: |
163: if ($db->result($result_header)) | 179: if ($db->result($result_header)) |
164: $tpl_temp .= '<br /><strong><a href="admin_reports.php">There are new reports</a></strong>'; | 180: $tpl_temp .= "\n\t\t\t\t".'<li class="reportlink"><strong><a href="admin_reports.php">There are new reports</a></strong></li>'; |
165: | 181: |
166: if ($pun_config['o_maintenance'] == '1') | 182: if ($pun_config['o_maintenance'] == '1') |
167: $tpl_temp .= '<br /><strong><a class="showhot" href="admin_options.php#maintenance">Maintenance mode is enabled!</a></strong>'; | 183: $tpl_temp .= "\n\t\t\t\t".'<li class="maintenancelink"><strong><a href="admin_options.php#maintenance">Maintenance mode is enabled!</a></strong></li>'; |
168: } | 184: } |
169: | 185: |
170: if (basename($_SERVER['PHP_SELF']) == 'index.php') | 186: if (in_array(basename($_SERVER['PHP_SELF']), array('index.php', 'search.php'))) |
171: $tpl_temp .= '</p>'."\n\t\t\t".'<p class="conr"><a href="search.php?action=show_new">'.$lang_common['Show new posts'].'</a><br /><a href="misc.php?action=markread">'.$lang_common['Mark all as read'].'</a></p>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>'; | 187: $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>'; |
172: else if ($_SERVER['QUERY_STRING'] == 'action=show_new') | |
173: $tpl_temp .= '</p>'."\n\t\t\t".'<p class="conr"><a href="misc.php?action=markread">'.$lang_common['Mark all as read'].'</a></p>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>'; | |
174: else | 188: else |
175: $tpl_temp .= '</p>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>'; | 189: $tpl_temp .= "\n\t\t\t".'</ul>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>'; |
176: } | 190: } |
177: | 191: |
178: $tpl_main = str_replace('<pun_status>', $tpl_temp, $tpl_main); | 192: $tpl_main = str_replace('<pun_status>', $tpl_temp, $tpl_main); |
punbb-1.2/upload/include/functions.php |
punbb-1.2.16/upload/include/functions.php |
27: // | 27: // |
28: function check_cookie(&$pun_user) | 28: function check_cookie(&$pun_user) |
29: { | 29: { |
30: global $db, $pun_config, $cookie_name, $cookie_seed; | 30: global $db, $db_type, $pun_config, $cookie_name, $cookie_seed; |
31: | 31: |
32: $now = time(); | 32: $now = time(); |
33: $expire = $now + 31536000; // The cookie expires after a year | 33: $expire = $now + 31536000; // The cookie expires after a year |
46: $pun_user = $db->fetch_assoc($result); | 46: $pun_user = $db->fetch_assoc($result); |
47: | 47: |
48: // If user authorisation failed | 48: // If user authorisation failed |
49: if (!isset($pun_user['id']) || md5($cookie_seed.$pun_user['password']) != $cookie['password_hash']) | 49: if (!isset($pun_user['id']) || md5($cookie_seed.$pun_user['password']) !== $cookie['password_hash']) |
50: { | 50: { |
51: pun_setcookie(0, random_pass(8), $expire); | 51: pun_setcookie(0, random_pass(8), $expire); |
52: set_default_user(); | 52: set_default_user(); |
75: { | 75: { |
76: // Update the online list | 76: // Update the online list |
77: if (!$pun_user['logged']) | 77: if (!$pun_user['logged']) |
78: $db->query('INSERT INTO '.$db->prefix.'online (user_id, ident, logged) VALUES('.$pun_user['id'].', \''.$db->escape($pun_user['username']).'\', '.$now.')') or error('Unable to insert into online list', __FILE__, __LINE__, $db->error()); | 78: { |
| 79: $pun_user['logged'] = $now; |
| 80: |
| 81: // With MySQL/MySQLi, REPLACE INTO avoids a user having two rows in the online table |
| 82: switch ($db_type) |
| 83: { |
| 84: case 'mysql': |
| 85: case 'mysqli': |
| 86: $db->query('REPLACE INTO '.$db->prefix.'online (user_id, ident, logged) VALUES('.$pun_user['id'].', \''.$db->escape($pun_user['username']).'\', '.$pun_user['logged'].')') or error('Unable to insert into online list', __FILE__, __LINE__, $db->error()); |
| 87: break; |
| 88: |
| 89: default: |
| 90: $db->query('INSERT INTO '.$db->prefix.'online (user_id, ident, logged) VALUES('.$pun_user['id'].', \''.$db->escape($pun_user['username']).'\', '.$pun_user['logged'].')') or error('Unable to insert into online list', __FILE__, __LINE__, $db->error()); |
| 91: break; |
| 92: } |
| 93: } |
79: else | 94: else |
80: { | 95: { |
81: // Special case: We've timed out, but no other user has browsed the forums since we timed out | 96: // Special case: We've timed out, but no other user has browsed the forums since we timed out |
102: // | 117: // |
103: function set_default_user() | 118: function set_default_user() |
104: { | 119: { |
105: global $db, $pun_user, $pun_config; | 120: global $db, $db_type, $pun_user, $pun_config; |
106: | 121: |
107: $remote_addr = get_remote_address(); | 122: $remote_addr = get_remote_address(); |
108: | 123: |
109: // Fetch guest user | 124: // Fetch guest user |
110: $result = $db->query('SELECT u.*, g.*, o.logged FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'groups AS g ON u.group_id=g.g_id LEFT JOIN '.$db->prefix.'online AS o ON o.ident=\''.$remote_addr.'\' WHERE u.id=1') or error('Unable to fetch guest information', __FILE__, __LINE__, $db->error()); | 125: $result = $db->query('SELECT u.*, g.*, o.logged FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'groups AS g ON u.group_id=g.g_id LEFT JOIN '.$db->prefix.'online AS o ON o.ident=\''.$remote_addr.'\' WHERE u.id=1') or error('Unable to fetch guest information', __FILE__, __LINE__, $db->error()); |
| 126: if (!$db->num_rows($result)) |
| 127: exit('Unable to fetch guest information. The table \''.$db->prefix.'users\' must contain an entry with id = 1 that represents anonymous users.'); |
| 128: |
111: $pun_user = $db->fetch_assoc($result); | 129: $pun_user = $db->fetch_assoc($result); |
112: | 130: |
113: // Update online list | 131: // Update online list |
114: if (!$pun_user['logged']) | 132: if (!$pun_user['logged']) |
115: $db->query('INSERT INTO '.$db->prefix.'online (user_id, ident, logged) VALUES(1, \''.$db->escape($remote_addr).'\', '.time().')') or error('Unable to insert into online list', __FILE__, __LINE__, $db->error()); | 133: { |
| 134: $pun_user['logged'] = time(); |
| 135: |
| 136: // With MySQL/MySQLi, REPLACE INTO avoids a user having two rows in the online table |
| 137: switch ($db_type) |
| 138: { |
| 139: case 'mysql': |
| 140: case 'mysqli': |
| 141: $db->query('REPLACE INTO '.$db->prefix.'online (user_id, ident, logged) VALUES(1, \''.$db->escape($remote_addr).'\', '.$pun_user['logged'].')') or error('Unable to insert into online list', __FILE__, __LINE__, $db->error()); |
| 142: break; |
| 143: |
| 144: default: |
| 145: $db->query('INSERT INTO '.$db->prefix.'online (user_id, ident, logged) VALUES(1, \''.$db->escape($remote_addr).'\', '.$pun_user['logged'].')') or error('Unable to insert into online list', __FILE__, __LINE__, $db->error()); |
| 146: break; |
| 147: } |
| 148: } |
116: else | 149: else |
117: $db->query('UPDATE '.$db->prefix.'online SET logged='.time().' WHERE ident=\''.$db->escape($remote_addr).'\'') or error('Unable to update online list', __FILE__, __LINE__, $db->error()); | 150: $db->query('UPDATE '.$db->prefix.'online SET logged='.time().' WHERE ident=\''.$db->escape($remote_addr).'\'') or error('Unable to update online list', __FILE__, __LINE__, $db->error()); |
118: | 151: |
135: // Enable sending of a P3P header by removing // from the following line (try this if login is failing in IE6) | 168: // Enable sending of a P3P header by removing // from the following line (try this if login is failing in IE6) |
136: // @header('P3P: CP="CUR ADM"'); | 169: // @header('P3P: CP="CUR ADM"'); |
137: | 170: |
138: setcookie($cookie_name, serialize(array($user_id, md5($cookie_seed.$password_hash))), $expire, $cookie_path, $cookie_domain, $cookie_secure); | 171: if (version_compare(PHP_VERSION, '5.2.0', '>=')) |
| 172: setcookie($cookie_name, serialize(array($user_id, md5($cookie_seed.$password_hash))), $expire, $cookie_path, $cookie_domain, $cookie_secure, true); |
| 173: else |
| 174: setcookie($cookie_name, serialize(array($user_id, md5($cookie_seed.$password_hash))), $expire, $cookie_path.'; HttpOnly', $cookie_domain, $cookie_secure); |
139: } | 175: } |
140: | 176: |
141: | 177: |
165: } | 201: } |
166: | 202: |
167: if ($cur_ban['username'] != '' && !strcasecmp($pun_user['username'], $cur_ban['username'])) | 203: if ($cur_ban['username'] != '' && !strcasecmp($pun_user['username'], $cur_ban['username'])) |
| 204: { |
| 205: $db->query('DELETE FROM '.$db->prefix.'online WHERE ident=\''.$db->escape($pun_user['username']).'\'') or error('Unable to delete from online list', __FILE__, __LINE__, $db->error()); |
168: message($lang_common['Ban message'].' '.(($cur_ban['expire'] != '') ? $lang_common['Ban message 2'].' '.strtolower(format_time($cur_ban['expire'], true)).'. ' : '').(($cur_ban['message'] != '') ? $lang_common['Ban message 3'].'<br /><br /><strong>'.pun_htmlspecialchars($cur_ban['message']).'</strong><br /><br />' : '<br /><br />').$lang_common['Ban message 4'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.', true); | 206: message($lang_common['Ban message'].' '.(($cur_ban['expire'] != '') ? $lang_common['Ban message 2'].' '.strtolower(format_time($cur_ban['expire'], true)).'. ' : '').(($cur_ban['message'] != '') ? $lang_common['Ban message 3'].'<br /><br /><strong>'.pun_htmlspecialchars($cur_ban['message']).'</strong><br /><br />' : '<br /><br />').$lang_common['Ban message 4'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.', true); |
| 207: } |
169: | 208: |
170: if ($cur_ban['ip'] != '') | 209: if ($cur_ban['ip'] != '') |
171: { | 210: { |
176: $cur_ban_ips[$i] = $cur_ban_ips[$i].'.'; | 215: $cur_ban_ips[$i] = $cur_ban_ips[$i].'.'; |
177: | 216: |
178: if (substr($user_ip, 0, strlen($cur_ban_ips[$i])) == $cur_ban_ips[$i]) | 217: if (substr($user_ip, 0, strlen($cur_ban_ips[$i])) == $cur_ban_ips[$i]) |
| 218: { |
| 219: $db->query('DELETE FROM '.$db->prefix.'online WHERE ident=\''.$db->escape($pun_user['username']).'\'') or error('Unable to delete from online list', __FILE__, __LINE__, $db->error()); |
179: message($lang_common['Ban message'].' '.(($cur_ban['expire'] != '') ? $lang_common['Ban message 2'].' '.strtolower(format_time($cur_ban['expire'], true)).'. ' : '').(($cur_ban['message'] != '') ? $lang_common['Ban message 3'].'<br /><br /><strong>'.pun_htmlspecialchars($cur_ban['message']).'</strong><br /><br />' : '<br /><br />').$lang_common['Ban message 4'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.', true); | 220: message($lang_common['Ban message'].' '.(($cur_ban['expire'] != '') ? $lang_common['Ban message 2'].' '.strtolower(format_time($cur_ban['expire'], true)).'. ' : '').(($cur_ban['message'] != '') ? $lang_common['Ban message 3'].'<br /><br /><strong>'.pun_htmlspecialchars($cur_ban['message']).'</strong><br /><br />' : '<br /><br />').$lang_common['Ban message 4'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.', true); |
| 221: } |
180: } | 222: } |
181: } | 223: } |
182: } | 224: } |
200: $now = time(); | 242: $now = time(); |
201: | 243: |
202: // Fetch all online list entries that are older than "o_timeout_online" | 244: // Fetch all online list entries that are older than "o_timeout_online" |
203: $result = $db->query('SELECT * FROM '.$db->prefix.'online WHERE logged<'.($now-$pun_config['o_timeout_online'])) or error('Unable to delete from online list', __FILE__, __LINE__, $db->error()); | 245: $result = $db->query('SELECT * FROM '.$db->prefix.'online WHERE logged<'.($now-$pun_config['o_timeout_online'])) or error('Unable to fetch old entries from online list', __FILE__, __LINE__, $db->error()); |
204: while ($cur_user = $db->fetch_assoc($result)) | 246: while ($cur_user = $db->fetch_assoc($result)) |
205: { | 247: { |
206: // If the entry is a guest, delete it | 248: // If the entry is a guest, delete it |
229: global $pun_config, $lang_common, $pun_user; | 271: global $pun_config, $lang_common, $pun_user; |
230: | 272: |
231: // Index and Userlist should always be displayed | 273: // Index and Userlist should always be displayed |
232: $links[] = '<li><a href="index.php">'.$lang_common['Index'].'</a>'; | 274: $links[] = '<li id="navindex"><a href="index.php">'.$lang_common['Index'].'</a>'; |
233: $links[] = '<li><a href="userlist.php">'.$lang_common['User list'].'</a>'; | 275: $links[] = '<li id="navuserlist"><a href="userlist.php">'.$lang_common['User list'].'</a>'; |
234: | 276: |
235: if ($pun_config['o_rules'] == '1') | 277: if ($pun_config['o_rules'] == '1') |
236: $links[] = '<li><a href="misc.php?action=rules">'.$lang_common['Rules'].'</a>'; | 278: $links[] = '<li id="navrules"><a href="misc.php?action=rules">'.$lang_common['Rules'].'</a>'; |
237: | 279: |
238: if ($pun_user['is_guest']) | 280: if ($pun_user['is_guest']) |
239: { | 281: { |
240: if ($pun_user['g_search'] == '1') | 282: if ($pun_user['g_search'] == '1') |
241: $links[] = '<li><a href="search.php">'.$lang_common['Search'].'</a>'; | 283: $links[] = '<li id="navsearch"><a href="search.php">'.$lang_common['Search'].'</a>'; |
242: | 284: |
243: $links[] = '<li><a href="register.php">'.$lang_common['Register'].'</a>'.$lang_common['Link separator'].'</li><li><a href="login.php">'.$lang_common['Login'].'</a>'; | 285: $links[] = '<li id="navregister"><a href="register.php">'.$lang_common['Register'].'</a>'; |
| 286: $links[] = '<li id="navlogin"><a href="login.php">'.$lang_common['Login'].'</a>'; |
244: | 287: |
245: $info = $lang_common['Not logged in']; | 288: $info = $lang_common['Not logged in']; |
246: } | 289: } |
249: if ($pun_user['g_id'] > PUN_MOD) | 292: if ($pun_user['g_id'] > PUN_MOD) |
250: { | 293: { |
251: if ($pun_user['g_search'] == '1') | 294: if ($pun_user['g_search'] == '1') |
252: $links[] = '<li><a href="search.php">'.$lang_common['Search'].'</a>'; | 295: $links[] = '<li id="navsearch"><a href="search.php">'.$lang_common['Search'].'</a>'; |
253: | 296: |
254: $links[] = '<li><a href="profile.php?id='.$pun_user['id'].'">'.$lang_common['Profile'].'</a>'; | 297: $links[] = '<li id="navprofile"><a href="profile.php?id='.$pun_user['id'].'">'.$lang_common['Profile'].'</a>'; |
255: $links[] = '<li><a href="login.php?action=out&id='.$pun_user['id'].'">'.$lang_common['Logout'].'</a>'; | 298: $links[] = '<li id="navlogout"><a href="login.php?action=out&id='.$pun_user['id'].'">'.$lang_common['Logout'].'</a>'; |
256: } | 299: } |
257: else | 300: else |
258: { | 301: { |
259: $links[] = '<li><a href="search.php">'.$lang_common['Search'].'</a>'; | 302: $links[] = '<li id="navsearch"><a href="search.php">'.$lang_common['Search'].'</a>'; |
260: $links[] = '<li><a href="profile.php?id='.$pun_user['id'].'">'.$lang_common['Profile'].'</a>'; | 303: $links[] = '<li id="navprofile"><a href="profile.php?id='.$pun_user['id'].'">'.$lang_common['Profile'].'</a>'; |
261: $links[] = '<li><a href="admin_index.php">'.$lang_common['Admin'].'</a>'; | 304: $links[] = '<li id="navadmin"><a href="admin_index.php">'.$lang_common['Admin'].'</a>'; |
262: $links[] = '<li><a href="login.php?action=out&id='.$pun_user['id'].'">'.$lang_common['Logout'].'</a>'; | 305: $links[] = '<li id="navlogout"><a href="login.php?action=out&id='.$pun_user['id'].'">'.$lang_common['Logout'].'</a>'; |
263: } | 306: } |
264: } | 307: } |
265: | 308: |
266: return '<ul>'.implode($lang_common['Link separator'].'</li>', $links).'</li></ul>'; | 309: // Are there any additional navlinks we should insert into the array before imploding it? |
| 310: if ($pun_config['o_additional_navlinks'] != '') |
| 311: { |
| 312: if (preg_match_all('#([0-9]+)\s*=\s*(.*?)\n#s', $pun_config['o_additional_navlinks']."\n", $extra_links)) |
| 313: { |
| 314: // Insert any additional links into the $links array (at the correct index) |
| 315: for ($i = 0; $i < count($extra_links[1]); ++$i) |
| 316: array_splice($links, $extra_links[1][$i], 0, array('<li id="navextra'.($i + 1).'">'.$extra_links[2][$i])); |
| 317: } |
| 318: } |
| 319: |
| 320: return '<ul>'."\n\t\t\t\t".implode($lang_common['Link separator'].'</li>'."\n\t\t\t\t", $links).'</li>'."\n\t\t\t".'</ul>'; |
267: } | 321: } |
268: | 322: |
269: | 323: |
298: | 352: |
299: | 353: |
300: // | 354: // |
301: // Update posts, topics, last_post, last_post_id and last_poster for a forum (redirect topics are not included) | 355: // Update posts, topics, last_post, last_post_id and last_poster for a forum |
302: // | 356: // |
303: function update_forum($forum_id) | 357: function update_forum($forum_id) |
304: { | 358: { |
305: global $db; | 359: global $db; |
306: | 360: |
307: $result = $db->query('SELECT COUNT(id), SUM(num_replies) FROM '.$db->prefix.'topics WHERE moved_to IS NULL AND forum_id='.$forum_id) or error('Unable to fetch forum topic count', __FILE__, __LINE__, $db->error()); | 361: $result = $db->query('SELECT COUNT(id), SUM(num_replies) FROM '.$db->prefix.'topics WHERE forum_id='.$forum_id) or error('Unable to fetch forum topic count', __FILE__, __LINE__, $db->error()); |
308: list($num_topics, $num_posts) = $db->fetch_row($result); | 362: list($num_topics, $num_posts) = $db->fetch_row($result); |
309: | 363: |
310: $num_posts = $num_posts + $num_topics; // $num_posts is only the sum of all replies (we have to add the topic posts) | 364: $num_posts = $num_posts + $num_topics; // $num_posts is only the sum of all replies (we have to add the topic posts) |
317: $db->query('UPDATE '.$db->prefix.'forums SET num_topics='.$num_topics.', num_posts='.$num_posts.', last_post='.$last_post.', last_post_id='.$last_post_id.', last_poster=\''.$db->escape($last_poster).'\' WHERE id='.$forum_id) or error('Unable to update last_post/last_post_id/last_poster', __FILE__, __LINE__, $db->error()); | 371: $db->query('UPDATE '.$db->prefix.'forums SET num_topics='.$num_topics.', num_posts='.$num_posts.', last_post='.$last_post.', last_post_id='.$last_post_id.', last_poster=\''.$db->escape($last_poster).'\' WHERE id='.$forum_id) or error('Unable to update last_post/last_post_id/last_poster', __FILE__, __LINE__, $db->error()); |
318: } | 372: } |
319: else // There are no topics | 373: else // There are no topics |
320: $db->query('UPDATE '.$db->prefix.'forums SET num_topics=0, num_posts=0, last_post=NULL, last_post_id=NULL, last_poster=NULL WHERE id='.$forum_id) or error('Unable to update last_post/last_post_id/last_poster', __FILE__, __LINE__, $db->error()); | 374: $db->query('UPDATE '.$db->prefix.'forums SET num_topics='.$num_topics.', num_posts='.$num_posts.', last_post=NULL, last_post_id=NULL, last_poster=NULL WHERE id='.$forum_id) or error('Unable to update last_post/last_post_id/last_poster', __FILE__, __LINE__, $db->error()); |
321: } | 375: } |
322: | 376: |
323: | 377: |
660: // | 714: // |
661: function get_remote_address() | 715: function get_remote_address() |
662: { | 716: { |
663: $remote_address = $_SERVER['REMOTE_ADDR']; | 717: return $_SERVER['REMOTE_ADDR']; |
664: | |
665: // If HTTP_X_FORWARDED_FOR is set, we try to grab the first non-LAN IP | |
666: if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) | |
667: { | |
668: if (preg_match_all('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $_SERVER['HTTP_X_FORWARDED_FOR'], $address_list)) | |
669: { | |
670: $lan_ips = array('/^0\./', '/^127\.0\.0\.1/', '/^192\.168\..*/', '/^172\.((1[6-9])|(2[0-9])|(3[0-1]))\..*/', '/^10\..*/', '/^224\..*/', '/^240\..*/'); | |
671: $address_list = preg_replace($lan_ips, null, $address_list[0]); | |
672: | |
673: while (list(, $cur_address) = each($address_list)) | |
674: { | |
675: if ($cur_address) | |
676: { | |
677: $remote_address = $cur_address; | |
678: break; | |
679: } | |
680: } | |
681: } | |
682: } | |
683: | |
684: return $remote_address; | |
685: } | 718: } |
686: | 719: |
687: | 720: |
720: // | 753: // |
721: function pun_trim($str) | 754: function pun_trim($str) |
722: { | 755: { |
723: $fishy_chars = array(chr(0x81), chr(0x8D), chr(0x8F), chr(0x90), chr(0x9D), chr(0xA0), chr(0xCA), ' '); | 756: global $lang_common; |
724: | 757: |
725: return trim(str_replace($fishy_chars, ' ', $str)); | 758: if (strpos($lang_common['lang_encoding'], '8859') !== false) |
| 759: { |
| 760: $fishy_chars = array(chr(0x81), chr(0x8D), chr(0x8F), chr(0x90), chr(0x9D), chr(0xA0)); |
| 761: return trim(str_replace($fishy_chars, ' ', $str)); |
| 762: } |
| 763: else |
| 764: return trim($str); |
726: } | 765: } |
727: | 766: |
728: | 767: |
743: $tpl_maint = trim(file_get_contents(PUN_ROOT.'include/template/maintenance.tpl')); | 782: $tpl_maint = trim(file_get_contents(PUN_ROOT.'include/template/maintenance.tpl')); |
744: | 783: |
745: | 784: |
| 785: // START SUBST - <pun_include "*"> |
| 786: while (preg_match('#<pun_include "([^/\\\\]*?)\.(php[45]?|inc|html?|txt)">#', $tpl_maint, $cur_include)) |
| 787: { |
| 788: if (!file_exists(PUN_ROOT.'include/user/'.$cur_include[1].'.'.$cur_include[2])) |
| 789: error('Unable to process user include '.htmlspecialchars($cur_include[0]).' from template maintenance.tpl. There is no such file in folder /include/user/'); |
| 790: |
| 791: ob_start(); |
| 792: include PUN_ROOT.'include/user/'.$cur_include[1].'.'.$cur_include[2]; |
| 793: $tpl_temp = ob_get_contents(); |
| 794: $tpl_maint = str_replace($cur_include[0], $tpl_temp, $tpl_maint); |
| 795: ob_end_clean(); |
| 796: } |
| 797: // END SUBST - <pun_include "*"> |
| 798: |
| 799: |
746: // START SUBST - <pun_content_direction> | 800: // START SUBST - <pun_content_direction> |
747: $tpl_maint = str_replace('<pun_content_direction>', $lang_common['lang_direction'], $tpl_maint); | 801: $tpl_maint = str_replace('<pun_content_direction>', $lang_common['lang_direction'], $tpl_maint); |
748: // END SUBST - <pun_content_direction> | 802: // END SUBST - <pun_content_direction> |
781: $db->end_transaction(); | 835: $db->end_transaction(); |
782: | 836: |
783: | 837: |
784: // START SUBST - <pun_include "*"> | |
785: while (preg_match('<pun_include "(.*?)">', $tpl_maint, $cur_include)) | |
786: { | |
787: ob_start(); | |
788: include PUN_ROOT.$cur_include[1]; | |
789: $tpl_temp = ob_get_contents(); | |
790: $tpl_maint = str_replace('<'.$cur_include[0].'>', $tpl_temp, $tpl_maint); | |
791: ob_end_clean(); | |
792: } | |
793: // END SUBST - <pun_include "*"> | |
794: | |
795: | |
796: // Close the db connection (and free up any result data) | 838: // Close the db connection (and free up any result data) |
797: $db->close(); | 839: $db->close(); |
798: | 840: |
807: { | 849: { |
808: global $db, $pun_config, $lang_common, $pun_user; | 850: global $db, $pun_config, $lang_common, $pun_user; |
809: | 851: |
810: if ($destination_url == '') | 852: // Prefix with o_base_url (unless it's there already) |
811: $destination_url = 'index.php'; | 853: if (strpos($destination_url, $pun_config['o_base_url']) !== 0) |
| 854: $destination_url = $pun_config['o_base_url'].'/'.$destination_url; |
| 855: |
| 856: // Do a little spring cleaning |
| 857: $destination_url = preg_replace('/([\r\n])|(%0[ad])|(;[\s]*data[\s]*:)/i', '', $destination_url); |
812: | 858: |
813: // If the delay is 0 seconds, we might as well skip the redirect all together | 859: // If the delay is 0 seconds, we might as well skip the redirect all together |
814: if ($pun_config['o_redirect_delay'] == '0') | 860: if ($pun_config['o_redirect_delay'] == '0') |
815: header('Location: '.$destination_url); | 861: header('Location: '.str_replace('&', '&', $destination_url)); |
816: | 862: |
817: | 863: |
818: // Load the redirect template | 864: // Load the redirect template |
819: $tpl_redir = trim(file_get_contents(PUN_ROOT.'include/template/redirect.tpl')); | 865: $tpl_redir = trim(file_get_contents(PUN_ROOT.'include/template/redirect.tpl')); |
820: | 866: |
821: | 867: |
| 868: // START SUBST - <pun_include "*"> |
| 869: while (preg_match('#<pun_include "([^/\\\\]*?)\.(php[45]?|inc|html?|txt)">#', $tpl_redir, $cur_include)) |
| 870: { |
| 871: if (!file_exists(PUN_ROOT.'include/user/'.$cur_include[1].'.'.$cur_include[2])) |
| 872: error('Unable to process user include '.htmlspecialchars($cur_include[0]).' from template redirect.tpl. There is no such file in folder /include/user/'); |
| 873: |
| 874: ob_start(); |
| 875: include PUN_ROOT.'include/user/'.$cur_include[1].'.'.$cur_include[2]; |
| 876: $tpl_temp = ob_get_contents(); |
| 877: $tpl_redir = str_replace($cur_include[0], $tpl_temp, $tpl_redir); |
| 878: ob_end_clean(); |
| 879: } |
| 880: // END SUBST - <pun_include "*"> |
| 881: |
| 882: |
822: // START SUBST - <pun_content_direction> | 883: // START SUBST - <pun_content_direction> |
823: $tpl_redir = str_replace('<pun_content_direction>', $lang_common['lang_direction'], $tpl_redir); | 884: $tpl_redir = str_replace('<pun_content_direction>', $lang_common['lang_direction'], $tpl_redir); |
824: // END SUBST - <pun_content_direction> | 885: // END SUBST - <pun_content_direction> |
833: ob_start(); | 894: ob_start(); |
834: | 895: |
835: ?> | 896: ?> |
836: <meta http-equiv="refresh" content="<?php echo $pun_config['o_redirect_delay'] ?>;URL=<?php echo $destination_url ?>" /> | 897: <meta http-equiv="refresh" content="<?php echo $pun_config['o_redirect_delay'] ?>;URL=<?php echo str_replace(array('<', '>', '"'), array('<', '>', '"'), $destination_url) ?>" /> |
837: <title><?php echo pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Redirecting'] ?></title> | 898: <title><?php echo pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Redirecting'] ?></title> |
838: <link rel="stylesheet" type="text/css" href="style/<?php echo $pun_user['style'].'.css' ?>" /> | 899: <link rel="stylesheet" type="text/css" href="style/<?php echo $pun_user['style'].'.css' ?>" /> |
839: <?php | 900: <?php |
871: // END SUBST - <pun_footer> | 932: // END SUBST - <pun_footer> |
872: | 933: |
873: | 934: |
874: // START SUBST - <pun_include "*"> | |
875: while (preg_match('<pun_include "(.*?)">', $tpl_redir, $cur_include)) | |
876: { | |
877: ob_start(); | |
878: include PUN_ROOT.$cur_include[1]; | |
879: $tpl_temp = ob_get_contents(); | |
880: $tpl_redir = str_replace('<'.$cur_include[0].'>', $tpl_temp, $tpl_redir); | |
881: ob_end_clean(); | |
882: } | |
883: // END SUBST - <pun_include "*"> | |
884: | |
885: | |
886: // Close the db connection (and free up any result data) | 935: // Close the db connection (and free up any result data) |
887: $db->close(); | 936: $db->close(); |
888: | 937: |
910: | 959: |
911: ?> | 960: ?> |
912: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | 961: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
913: <html dir="ltr"> | 962: <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr"> |
914: <head> | 963: <head> |
915: <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> | 964: <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> |
916: <title><?php echo pun_htmlspecialchars($pun_config['o_board_title']) ?> / Error</title> | 965: <title><?php echo pun_htmlspecialchars($pun_config['o_board_title']) ?> / Error</title> |
917: <style type="text/css"> | 966: <style type="text/css"> |
918: <!-- | 967: <!-- |
919: BODY {margin: 20px 20%; font: 10px Verdana, Arial, Helvetica, sans-serif;} | 968: BODY {MARGIN: 10% 20% auto 20%; font: 10px Verdana, Arial, Helvetica, sans-serif} |
920: #errorbox {border: 1px solid #000;} | 969: #errorbox {BORDER: 1px solid #B84623} |
921: H2 {margin: 0; color: #FFFFFF; background-color: #D25028; font-size: 1.1em; padding: 5px 4px; border-bottom: 1px solid #000;} | 970: H2 {MARGIN: 0; COLOR: #FFFFFF; BACKGROUND-COLOR: #B84623; FONT-SIZE: 1.1em; PADDING: 5px 4px} |
922: #errorbox DIV {padding: 6px 5px; background-color: #dedfdf} | 971: #errorbox DIV {PADDING: 6px 5px; BACKGROUND-COLOR: #F1F1F1} |
923: --> | 972: --> |
924: </style> | 973: </style> |
925: </head> | 974: </head> |
926: <body> | 975: <body> |
927: <div id="errorbox"> | 976: |
928: <h2>An error was encountered</h2> | 977: <div id="errorbox"> |
929: <div> | 978: <h2>An error was encountered</h2> |
| 979: <div> |
930: <?php | 980: <?php |
931: | 981: |
932: if (defined('PUN_DEBUG')) | 982: if (defined('PUN_DEBUG')) |
933: { | 983: { |
934: echo "\t\t\t".'<strong>File:</strong> '.$file.'<br />'."\n\t\t\t".'<strong>Line:</strong> '.$line.'<br /><br />'."\n\t\t\t".'<strong>PunBB reported</strong>: '.$message."\n"; | 984: echo "\t\t".'<strong>File:</strong> '.$file.'<br />'."\n\t\t".'<strong>Line:</strong> '.$line.'<br /><br />'."\n\t\t".'<strong>PunBB reported</strong>: '.$message."\n"; |
935: | 985: |
936: if ($db_error) | 986: if ($db_error) |
937: { | 987: { |
938: echo "\t\t\t".'<br /><br /><strong>Database reported:</strong> '.pun_htmlspecialchars($db_error['error_msg']).(($db_error['error_no']) ? ' (Errno: '.$db_error['error_no'].')' : '')."\n"; | 988: echo "\t\t".'<br /><br /><strong>Database reported:</strong> '.pun_htmlspecialchars($db_error['error_msg']).(($db_error['error_no']) ? ' (Errno: '.$db_error['error_no'].')' : '')."\n"; |
939: | 989: |
940: if ($db_error['error_sql'] != '') | 990: if ($db_error['error_sql'] != '') |
941: echo "\t\t\t".'<br /><br /><strong>Failed query:</strong> '.pun_htmlspecialchars($db_error['error_sql'])."\n"; | 991: echo "\t\t".'<br /><br /><strong>Failed query:</strong> '.pun_htmlspecialchars($db_error['error_sql'])."\n"; |
942: } | 992: } |
943: } | 993: } |
944: else | 994: else |
945: echo "\t\t\t".'Error: <strong>'.$message.'.</strong>'."\n"; | 995: echo "\t\t".'Error: <strong>'.$message.'.</strong>'."\n"; |
946: | 996: |
947: ?> | 997: ?> |
948: </div> | |
949: </div> | 998: </div> |
| 999: </div> |
| 1000: |
950: </body> | 1001: </body> |
951: </html> | 1002: </html> |
952: <?php | 1003: <?php |
1015: | 1066: |
1016: | 1067: |
1017: // | 1068: // |
| 1069: // Unset any variables instantiated as a result of register_globals being enabled |
| 1070: // |
| 1071: function unregister_globals() |
| 1072: { |
| 1073: $register_globals = @ini_get('register_globals'); |
| 1074: if ($register_globals === "" || $register_globals === "0" || strtolower($register_globals) === "off") |
| 1075: return; |
| 1076: |
| 1077: // Prevent script.php?GLOBALS[foo]=bar |
| 1078: if (isset($_REQUEST['GLOBALS']) || isset($_FILES['GLOBALS'])) |
| 1079: exit('I\'ll have a steak sandwich and... a steak sandwich.'); |
| 1080: |
| 1081: // Variables that shouldn't be unset |
| 1082: $no_unset = array('GLOBALS', '_GET', '_POST', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES'); |
| 1083: |
| 1084: // Remove elements in $GLOBALS that are present in any of the superglobals |
| 1085: $input = array_merge($_GET, $_POST, $_COOKIE, $_SERVER, $_ENV, $_FILES, isset($_SESSION) && is_array($_SESSION) ? $_SESSION : array()); |
| 1086: foreach ($input as $k => $v) |
| 1087: { |
| 1088: if (!in_array($k, $no_unset) && isset($GLOBALS[$k])) |
| 1089: { |
| 1090: unset($GLOBALS[$k]); |
| 1091: unset($GLOBALS[$k]); // Double unset to circumvent the zend_hash_del_key_or_index hole in PHP <4.4.3 and <5.1.4 |
| 1092: } |
| 1093: } |
| 1094: } |
| 1095: |
| 1096: |
| 1097: // |
1018: // Dump contents of variable(s) | 1098: // Dump contents of variable(s) |
1019: // | 1099: // |
1020: function dump() | 1100: function dump() |
punbb-1.2/upload/include/parser.php |
punbb-1.2.16/upload/include/parser.php |
45: $b = array('[b]', '[i]', '[u]', '[/b]', '[/i]', '[/u]'); | 45: $b = array('[b]', '[i]', '[u]', '[/b]', '[/i]', '[/u]'); |
46: $text = str_replace($a, $b, $text); | 46: $text = str_replace($a, $b, $text); |
47: | 47: |
48: // Do the more complex BBCodes (and strip excessive whitespace) | 48: // Do the more complex BBCodes (also strip excessive whitespace and useless quotes) |
49: $a = array( '#\[url=(.*?)\]\s*#i', | 49: $a = array( '#\[url=("|\'|)(.*?)\\1\]\s*#i', |
50: '#\[url\]\s*#i', | 50: '#\[url\]\s*#i', |
51: '#\s*\[/url\]#i', | 51: '#\s*\[/url\]#i', |
52: '#\[email=(.*?)\]\s*#i', | 52: '#\[email=("|\'|)(.*?)\\1\]\s*#i', |
53: '#\[email\]\s*#i', | 53: '#\[email\]\s*#i', |
54: '#\s*\[/email\]#i', | 54: '#\s*\[/email\]#i', |
55: '#\[img\]\s*(.*?)\s*\[/img\]#is', | 55: '#\[img\]\s*(.*?)\s*\[/img\]#is', |
56: '#\[colou?r=(.*?)\](.*?)\[/colou?r\]#is'); | 56: '#\[colou?r=("|\'|)(.*?)\\1\](.*?)\[/colou?r\]#is'); |
57: | 57: |
58: $b = array( '[url=$1]', | 58: $b = array( '[url=$2]', |
59: '[url]', | 59: '[url]', |
60: '[/url]', | 60: '[/url]', |
61: '[email=$1]', | 61: '[email=$2]', |
62: '[email]', | 62: '[email]', |
63: '[/email]', | 63: '[/email]', |
64: '[img]$1[/img]', | 64: '[img]$1[/img]', |
65: '[color=$1]$2[/color]'); | 65: '[color=$2]$3[/color]'); |
66: | 66: |
67: if (!$is_signature) | 67: if (!$is_signature) |
68: { | 68: { |
69: // For non-signatures, we have to do the quote and code tags as well | 69: // For non-signatures, we have to do the quote and code tags as well |
70: $a[] = '#\[quote=("|"|\'|)(.{2,25})\\1\]\s*#i'; | 70: $a[] = '#\[quote=("|"|\'|)(.*?)\\1\]\s*#i'; |
71: $a[] = '#\[quote\]\s*#i'; | 71: $a[] = '#\[quote\]\s*#i'; |
72: $a[] = '#\s*\[/quote\]\s*#i'; | 72: $a[] = '#\s*\[/quote\]\s*#i'; |
73: $a[] = '#\[code\][\r\n]*(.*?)\s*\[/code\]\s*#is'; | 73: $a[] = '#\[code\][\r\n]*(.*?)\s*\[/code\]\s*#is'; |
126: $q_end = strpos($text, '[/quote]'); | 126: $q_end = strpos($text, '[/quote]'); |
127: | 127: |
128: // Look for [quote=username] style quote tags | 128: // Look for [quote=username] style quote tags |
129: if (preg_match('#\[quote=("|"|\'|)(.{2,25})\\1\]#sU', $text, $matches)) | 129: if (preg_match('#\[quote=("|"|\'|)(.*)\\1\]#sU', $text, $matches)) |
130: $q2_start = strpos($text, $matches[0]); | 130: $q2_start = strpos($text, $matches[0]); |
131: else | 131: else |
132: $q2_start = 65536; | 132: $q2_start = 65536; |
182: // We found a [code] | 182: // We found a [code] |
183: else if ($c_start < min($c_end, $q_start, $q_end)) | 183: else if ($c_start < min($c_end, $q_start, $q_end)) |
184: { | 184: { |
| 185: // Make sure there's a [/code] and that any new [code] doesn't occur before the end tag |
185: $tmp = strpos($text, '[/code]'); | 186: $tmp = strpos($text, '[/code]'); |
186: if ($tmp === false) | 187: $tmp2 = strpos(substr($text, $c_start+6), '[code]'); |
| 188: if ($tmp2 !== false) |
| 189: $tmp2 += $c_start+6; |
| 190: |
| 191: if ($tmp === false || ($tmp2 !== false && $tmp2 < $tmp)) |
187: { | 192: { |
188: $error = $lang_common['BBCode error'].' '.$lang_common['BBCode error 2']; | 193: $error = $lang_common['BBCode error'].' '.$lang_common['BBCode error 2']; |
189: return; | 194: return; |
259: { | 264: { |
260: global $pun_user; | 265: global $pun_user; |
261: | 266: |
262: $full_url = str_replace(' ', '%20', $url); | 267: $full_url = str_replace(array(' ', '\'', '`', '"'), array('%20', '', '', ''), $url); |
263: if (strpos($url, 'www.') === 0) // If it starts with www, we add http:// | 268: if (strpos($url, 'www.') === 0) // If it starts with www, we add http:// |
264: $full_url = 'http://'.$full_url; | 269: $full_url = 'http://'.$full_url; |
265: else if (strpos($url, 'ftp.') === 0) // Else if it starts with ftp, we add ftp:// | 270: else if (strpos($url, 'ftp.') === 0) // Else if it starts with ftp, we add ftp:// |
280: function handle_img_tag($url, $is_signature = false) | 285: function handle_img_tag($url, $is_signature = false) |
281: { | 286: { |
282: global $lang_common, $pun_config, $pun_user; | 287: global $lang_common, $pun_config, $pun_user; |
283: | |
284: $img_tag = '<a href="'.$url.'"><'.$lang_common['Image link'].'></a>'; | |
285: | 288: |
286: if ($is_signature && $pun_user['show_img_sig'] != '0') | 289: $img_tag = '<a href="'.$url.'"><'.$lang_common['Image link'].'></a>'; |
287: $img_tag = '<img class="sigimage" src="'.$url.'" alt="'.htmlspecialchars($url).'" />'; | 290: |
288: else if (!$is_signature && $pun_user['show_img'] != '0') | 291: if ($is_signature && $pun_user['show_img_sig'] != '0') |
289: $img_tag = '</p><div class="imgbox"><div class="scrollbox"><img src="'.$url.'" alt="'.htmlspecialchars($url).'" /></div></div><p>'; | 292: $img_tag = '<img class="sigimage" src="'.$url.'" alt="'.htmlspecialchars($url).'" />'; |
290: | 293: else if (!$is_signature && $pun_user['show_img'] != '0') |
291: return $img_tag; | 294: $img_tag = '<img class="postimg" src="'.$url.'" alt="'.htmlspecialchars($url).'" />'; |
| 295: |
| 296: return $img_tag; |
292: } | 297: } |
293: | 298: |
294: | 299: |
299: { | 304: { |
300: global $lang_common, $pun_user; | 305: global $lang_common, $pun_user; |
301: | 306: |
| 307: if (strpos($text, 'quote') !== false) |
| 308: { |
| 309: $text = str_replace('[quote]', '</p><blockquote><div class="incqbox"><p>', $text); |
| 310: $text = preg_replace('#\[quote=("|"|\'|)(.*)\\1\]#seU', '"</p><blockquote><div class=\"incqbox\"><h4>".str_replace(array(\'[\', \'\\"\'), array(\'[\', \'"\'), \'$2\')." ".$lang_common[\'wrote\'].":</h4><p>"', $text); |
| 311: $text = preg_replace('#\[\/quote\]\s*#', '</p></div></blockquote><p>', $text); |
| 312: } |
| 313: |
302: $pattern = array('#\[b\](.*?)\[/b\]#s', | 314: $pattern = array('#\[b\](.*?)\[/b\]#s', |
303: '#\[i\](.*?)\[/i\]#s', | 315: '#\[i\](.*?)\[/i\]#s', |
304: '#\[u\](.*?)\[/u\]#s', | 316: '#\[u\](.*?)\[/u\]#s', |
305: '#\[url\](.*?)\[/url\]#e', | 317: '#\[url\]([^\[]*?)\[/url\]#e', |
306: '#\[url=(.*?)\](.*?)\[/url\]#e', | 318: '#\[url=([^\[]*?)\](.*?)\[/url\]#e', |
307: '#\[email\](.*?)\[/email\]#', | 319: '#\[email\]([^\[]*?)\[/email\]#', |
308: '#\[email=(.*?)\](.*?)\[/email\]#', | 320: '#\[email=([^\[]*?)\](.*?)\[/email\]#', |
309: '#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s'); | 321: '#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s'); |
310: | 322: |
311: $replace = array('<strong>$1</strong>', | 323: $replace = array('<strong>$1</strong>', |
320: // This thing takes a while! :) | 332: // This thing takes a while! :) |
321: $text = preg_replace($pattern, $replace, $text); | 333: $text = preg_replace($pattern, $replace, $text); |
322: | 334: |
323: if (strpos($text, 'quote') !== false) | |
324: { | |
325: $text = str_replace('[quote]', '</p><blockquote><div class="incqbox"><p>', $text); | |
326: $text = preg_replace('#\[quote=("|"|\'|)(.{2,25})\\1\]#seU', '"</p><blockquote><div class=\"incqbox\"><h4>".str_replace(\'[\', \'[\', \'$2\')." ".$lang_common[\'wrote\'].":</h4><p>"', $text); | |
327: $text = preg_replace('#\[\/quote\]\s*#', '</p></div></blockquote><p>', $text); | |
328: } | |
329: | |
330: return $text; | 335: return $text; |
331: } | 336: } |
332: | 337: |
punbb-1.2/upload/include/search_idx.php |
punbb-1.2.16/upload/include/search_idx.php |
43: | 43: |
44: if (empty($noise_match)) | 44: if (empty($noise_match)) |
45: { | 45: { |
46: $noise_match = array('quote', 'code', 'url', 'img', 'email', 'color', 'colour', '^', '$', '&', '(', ')', '<', '>', '`', '\'', '"', '|', ',', '@', '_', '?', '%', '~', '+', '[', ']', '{', '}', ':', '\\', '/', '=', '#', ';', '!', '*'); | 46: $noise_match = array('[quote', '[code', '[url', '[img', '[email', '[color', '[colour', 'quote]', 'code]', 'url]', 'img]', 'email]', 'color]', 'colour]', '^', '$', '&', '(', ')', '<', '>', '`', '\'', '"', '|', ',', '@', '_', '?', '%', '~', '+', '[', ']', '{', '}', ':', '\\', '/', '=', '#', ';', '!', '*'); |
47: $noise_replace = array('', '', '', '', '', '', '', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '', '', ' ', ' ', ' ', ' ', '', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '' , ' ', ' ', ' ', ' ', ' ', ' '); | 47: $noise_replace = array('', '', '', '', '', '', '', '', '', '', '', '', '', '', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '', '', ' ', ' ', ' ', ' ', '', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '' , ' ', ' ', ' ', ' ', ' ', ' '); |
48: | 48: |
49: $stopwords = (array)@file(PUN_ROOT.'lang/'.$pun_user['language'].'/stopwords.txt'); | 49: $stopwords = (array)@file(PUN_ROOT.'lang/'.$pun_user['language'].'/stopwords.txt'); |
50: $stopwords = array_map('trim', $stopwords); | 50: $stopwords = array_map('trim', $stopwords); |
69: { | 69: { |
70: while (list($i, $word) = @each($words)) | 70: while (list($i, $word) = @each($words)) |
71: { | 71: { |
| 72: $words[$i] = trim($word, '.'); |
72: $num_chars = pun_strlen($word); | 73: $num_chars = pun_strlen($word); |
73: | 74: |
74: if (strrpos($word, '.') == ($num_chars-1)) | |
75: $words[$i] = substr($word, 0, -1); | |
76: | |
77: if ($num_chars < 3 || $num_chars > 20 || in_array($word, $stopwords)) | 75: if ($num_chars < 3 || $num_chars > 20 || in_array($word, $stopwords)) |
78: unset($words[$i]); | 76: unset($words[$i]); |
79: } | 77: } |
147: switch ($db_type) | 145: switch ($db_type) |
148: { | 146: { |
149: case 'mysql': | 147: case 'mysql': |
| 148: case 'mysqli': |
150: $db->query('INSERT INTO '.$db->prefix.'search_words (word) VALUES'.implode(',', preg_replace('#^(.*)$#', '(\'\1\')', $new_words))) or error('Unable to insert search index words', __FILE__, __LINE__, $db->error()); | 149: $db->query('INSERT INTO '.$db->prefix.'search_words (word) VALUES'.implode(',', preg_replace('#^(.*)$#', '(\'\1\')', $new_words))) or error('Unable to insert search index words', __FILE__, __LINE__, $db->error()); |
151: break; | 150: break; |
152: | 151: |
198: switch ($db_type) | 197: switch ($db_type) |
199: { | 198: { |
200: case 'mysql': | 199: case 'mysql': |
| 200: case 'mysqli': |
201: { | 201: { |
202: $result = $db->query('SELECT word_id FROM '.$db->prefix.'search_matches WHERE post_id IN('.$post_ids.') GROUP BY word_id') or error('Unable to fetch search index word match', __FILE__, __LINE__, $db->error()); | 202: $result = $db->query('SELECT word_id FROM '.$db->prefix.'search_matches WHERE post_id IN('.$post_ids.') GROUP BY word_id') or error('Unable to fetch search index word match', __FILE__, __LINE__, $db->error()); |
203: | 203: |
punbb-1.2/upload/install.php |
punbb-1.2.16/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.2'; | 27: $punbb_version = '1.2.16'; |
28: | 28: |
29: | 29: |
30: define('PUN_ROOT', './'); | 30: define('PUN_ROOT', './'); |
31: if (file_exists(PUN_ROOT.'config.php')) | 31: if (file_exists(PUN_ROOT.'config.php')) |
32: exit('The file \'config.php\' already exists which would mean that PunBB is already installed. You should go <a href="index.php">here</a> instead.'); | 32: exit('The file \'config.php\' already exists which would mean that PunBB is already installed. You should go <a href="index.php">here</a> instead.'); |
33: | 33: |
| 34: |
34: // Make sure we are running at least PHP 4.1.0 | 35: // Make sure we are running at least PHP 4.1.0 |
35: if (intval(str_replace('.', '', phpversion())) < 410) | 36: if (intval(str_replace('.', '', phpversion())) < 410) |
36: exit('You are running PHP version '.phpversion().'. PunBB requires at least PHP 4.1.0 to run properly. You must upgrade your PHP installation before you can continue.'); | 37: exit('You are running PHP version '.PHP_VERSION.'. PunBB requires at least PHP 4.1.0 to run properly. You must upgrade your PHP installation before you can continue.'); |
37: | 38: |
38: // Disable error reporting for uninitialized variables | 39: // Disable error reporting for uninitialized variables |
39: error_reporting(E_ALL); | 40: error_reporting(E_ALL); |
164: <fieldset> | 165: <fieldset> |
165: <legend>Enter then name of your database</legend> | 166: <legend>Enter then name of your database</legend> |
166: <div class="infldset"> | 167: <div class="infldset"> |
167: <p>The name of the database that PunBB will be installed into. The database must exist. For SQLite, this is the relative path to the database file. If it doesn't exists, PunBB will attempt to create it.</p> | 168: <p>The name of the database that PunBB will be installed into. The database must exist. For SQLite, this is the relative path to the database file. If the SQLite database file does not exist, PunBB will attempt to create it.</p> |
168: <label for="req_db_name"><strong>Database name</strong><br /><input id="req_db_name" type="text" name="req_db_name" size="30" maxlength="50" /><br /></label> | 169: <label for="req_db_name"><strong>Database name</strong><br /><input id="req_db_name" type="text" name="req_db_name" size="30" maxlength="50" /><br /></label> |
169: </div> | 170: </div> |
170: </fieldset> | 171: </fieldset> |
323: if (preg_match('#\[b\]|\[/b\]|\[u\]|\[/u\]|\[i\]|\[/i\]|\[color|\[/color\]|\[quote\]|\[/quote\]|\[code\]|\[/code\]|\[img\]|\[/img\]|\[url|\[/url\]|\[email|\[/email\]#i', $username)) | 324: if (preg_match('#\[b\]|\[/b\]|\[u\]|\[/u\]|\[i\]|\[/i\]|\[color|\[/color\]|\[quote\]|\[/quote\]|\[code\]|\[/code\]|\[img\]|\[/img\]|\[url|\[/url\]|\[email|\[/email\]#i', $username)) |
324: error('Usernames may not contain any of the text formatting tags (BBCode) that the forum uses. Please go back and correct.'); | 325: error('Usernames may not contain any of the text formatting tags (BBCode) that the forum uses. Please go back and correct.'); |
325: | 326: |
326: if (!preg_match('/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/', $email)) | 327: if (strlen($email) > 50 || !preg_match('/^(([^<>()[\]\\.,;:\s@"\']+(\.[^<>()[\]\\.,;:\s@"\']+)*)|("[^"\']+"))@((\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\])|(([a-zA-Z\d\-]+\.)+[a-zA-Z]{2,}))$/', $email)) |
327: error('The administrator e-mail address you entered is invalid. Please go back and correct.'); | 328: error('The administrator e-mail address you entered is invalid. Please go back and correct.'); |
328: | 329: |
329: | 330: |
345: case 'sqlite': | 346: case 'sqlite': |
346: require PUN_ROOT.'include/dblayer/sqlite.php'; | 347: require PUN_ROOT.'include/dblayer/sqlite.php'; |
347: break; | 348: break; |
| 349: |
| 350: default: |
| 351: error('\''.$db_type.'\' is not a valid database type.'); |
348: } | 352: } |
349: | 353: |
350: // Create the database object (and connect/select db) | 354: // Create the database object (and connect/select db) |
360: | 364: |
361: case 'pgsql': | 365: case 'pgsql': |
362: // Make sure we are running at least PHP 4.3.0 (needed only for PostgreSQL) | 366: // Make sure we are running at least PHP 4.3.0 (needed only for PostgreSQL) |
363: if (intval(str_replace('.', '', phpversion())) < 430) | 367: if (version_compare(PHP_VERSION, '4.3.0', '<')) |
364: error('You are running PHP version '.phpversion().'. PunBB requires at least PHP 4.3.0 to run properly when using PostgreSQL. You must upgrade your PHP installation or use a different database before you can continue.'); | 368: error('You are running PHP version '.PHP_VERSION.'. PunBB requires at least PHP 4.3.0 to run properly when using PostgreSQL. You must upgrade your PHP installation or use a different database before you can continue.'); |
365: break; | 369: break; |
366: | 370: |
367: case 'sqlite': | 371: case 'sqlite': |
524: break; | 528: break; |
525: } | 529: } |
526: | 530: |
527: $db->query($sql) or error('Unable to create table '.$db_prefix.'online. Please check your settings and try again.', __FILE__, __LINE__, $db->error()); | 531: $db->query($sql) or error('Unable to create table '.$db_prefix.'config. Please check your settings and try again.', __FILE__, __LINE__, $db->error()); |
528: | 532: |
529: | 533: |
530: | 534: |
753: poster_id INT(10) UNSIGNED NOT NULL DEFAULT 1, | 757: poster_id INT(10) UNSIGNED NOT NULL DEFAULT 1, |
754: poster_ip VARCHAR(15), | 758: poster_ip VARCHAR(15), |
755: poster_email VARCHAR(50), | 759: poster_email VARCHAR(50), |
756: message TEXT NOT NULL DEFAULT '', | 760: message TEXT, |
757: hide_smilies TINYINT(1) NOT NULL DEFAULT 0, | 761: hide_smilies TINYINT(1) NOT NULL DEFAULT 0, |
758: posted INT(10) UNSIGNED NOT NULL DEFAULT 0, | 762: posted INT(10) UNSIGNED NOT NULL DEFAULT 0, |
759: edited INT(10) UNSIGNED, | 763: edited INT(10) UNSIGNED, |
770: poster_id INT NOT NULL DEFAULT 1, | 774: poster_id INT NOT NULL DEFAULT 1, |
771: poster_ip VARCHAR(15), | 775: poster_ip VARCHAR(15), |
772: poster_email VARCHAR(50), | 776: poster_email VARCHAR(50), |
773: message TEXT NOT NULL DEFAULT '', | 777: message TEXT, |
774: hide_smilies SMALLINT NOT NULL DEFAULT 0, | 778: hide_smilies SMALLINT NOT NULL DEFAULT 0, |
775: posted INT NOT NULL DEFAULT 0, | 779: posted INT NOT NULL DEFAULT 0, |
776: edited INT, | 780: edited INT, |
787: poster_id INTEGER NOT NULL DEFAULT 1, | 791: poster_id INTEGER NOT NULL DEFAULT 1, |
788: poster_ip VARCHAR(15), | 792: poster_ip VARCHAR(15), |
789: poster_email VARCHAR(50), | 793: poster_email VARCHAR(50), |
790: message TEXT NOT NULL DEFAULT '', | 794: message TEXT, |
791: hide_smilies INTEGER NOT NULL DEFAULT 0, | 795: hide_smilies INTEGER NOT NULL DEFAULT 0, |
792: posted INTEGER NOT NULL DEFAULT 0, | 796: posted INTEGER NOT NULL DEFAULT 0, |
793: edited INTEGER, | 797: edited INTEGER, |
848: forum_id INT(10) UNSIGNED NOT NULL DEFAULT 0, | 852: forum_id INT(10) UNSIGNED NOT NULL DEFAULT 0, |
849: reported_by INT(10) UNSIGNED NOT NULL DEFAULT 0, | 853: reported_by INT(10) UNSIGNED NOT NULL DEFAULT 0, |
850: created INT(10) UNSIGNED NOT NULL DEFAULT 0, | 854: created INT(10) UNSIGNED NOT NULL DEFAULT 0, |
851: message TEXT NOT NULL DEFAULT '', | 855: message TEXT, |
852: zapped INT(10) UNSIGNED, | 856: zapped INT(10) UNSIGNED, |
853: zapped_by INT(10) UNSIGNED, | 857: zapped_by INT(10) UNSIGNED, |
854: PRIMARY KEY (id) | 858: PRIMARY KEY (id) |
863: forum_id INT NOT NULL DEFAULT 0, | 867: forum_id INT NOT NULL DEFAULT 0, |
864: reported_by INT NOT NULL DEFAULT 0, | 868: reported_by INT NOT NULL DEFAULT 0, |
865: created INT NOT NULL DEFAULT 0, | 869: created INT NOT NULL DEFAULT 0, |
866: message TEXT NOT NULL DEFAULT '', | 870: message TEXT, |
867: zapped INT, | 871: zapped INT, |
868: zapped_by INT, | 872: zapped_by INT, |
869: PRIMARY KEY (id) | 873: PRIMARY KEY (id) |
878: forum_id INTEGER NOT NULL DEFAULT 0, | 882: forum_id INTEGER NOT NULL DEFAULT 0, |
879: reported_by INTEGER NOT NULL DEFAULT 0, | 883: reported_by INTEGER NOT NULL DEFAULT 0, |
880: created INTEGER NOT NULL DEFAULT 0, | 884: created INTEGER NOT NULL DEFAULT 0, |
881: message TEXT NOT NULL DEFAULT '', | 885: message TEXT, |
882: zapped INTEGER, | 886: zapped INTEGER, |
883: zapped_by INTEGER, | 887: zapped_by INTEGER, |
884: PRIMARY KEY (id) | 888: PRIMARY KEY (id) |
897: $sql = 'CREATE TABLE '.$db_prefix."search_cache ( | 901: $sql = 'CREATE TABLE '.$db_prefix."search_cache ( |
898: id INT(10) UNSIGNED NOT NULL DEFAULT 0, | 902: id INT(10) UNSIGNED NOT NULL DEFAULT 0, |
899: ident VARCHAR(200) NOT NULL DEFAULT '', | 903: ident VARCHAR(200) NOT NULL DEFAULT '', |
900: search_data TEXT NOT NULL DEFAULT '', | 904: search_data TEXT, |
901: PRIMARY KEY (id) | 905: PRIMARY KEY (id) |
902: ) TYPE=MyISAM;"; | 906: ) TYPE=MyISAM;"; |
903: break; | 907: break; |
906: $sql = 'CREATE TABLE '.$db_prefix."search_cache ( | 910: $sql = 'CREATE TABLE '.$db_prefix."search_cache ( |
907: id INT NOT NULL DEFAULT 0, | 911: id INT NOT NULL DEFAULT 0, |
908: ident VARCHAR(200) NOT NULL DEFAULT '', | 912: ident VARCHAR(200) NOT NULL DEFAULT '', |
909: search_data TEXT NOT NULL DEFAULT '', | 913: search_data TEXT, |
910: PRIMARY KEY (id) | 914: PRIMARY KEY (id) |
911: )"; | 915: )"; |
912: break; | 916: break; |
915: $sql = 'CREATE TABLE '.$db_prefix."search_cache ( | 919: $sql = 'CREATE TABLE '.$db_prefix."search_cache ( |
916: id INTEGER NOT NULL DEFAULT 0, | 920: id INTEGER NOT NULL DEFAULT 0, |
917: ident VARCHAR(200) NOT NULL DEFAULT '', | 921: ident VARCHAR(200) NOT NULL DEFAULT '', |
918: search_data TEXT NOT NULL DEFAULT '', | 922: search_data TEXT, |
919: PRIMARY KEY (id) | 923: PRIMARY KEY (id) |
920: )"; | 924: )"; |
921: break; | 925: break; |
1094: case 'mysqli': | 1098: case 'mysqli': |
1095: $sql = 'CREATE TABLE '.$db_prefix."users ( | 1099: $sql = 'CREATE TABLE '.$db_prefix."users ( |
1096: id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, | 1100: id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
1097: group_id INT(10) NOT NULL DEFAULT 4, | 1101: group_id INT(10) UNSIGNED NOT NULL DEFAULT 4, |
1098: username VARCHAR(200) NOT NULL DEFAULT '', | 1102: username VARCHAR(200) NOT NULL DEFAULT '', |
1099: password VARCHAR(40) NOT NULL DEFAULT '', | 1103: password VARCHAR(40) NOT NULL DEFAULT '', |
1100: email VARCHAR(50) NOT NULL DEFAULT '', | 1104: email VARCHAR(50) NOT NULL DEFAULT '', |
1230: case 'mysql': | 1234: case 'mysql': |
1231: case 'mysqli': | 1235: case 'mysqli': |
1232: // We use MySQL's ALTER TABLE ... ADD INDEX syntax instead of CREATE INDEX to avoid problems with users lacking the INDEX privilege | 1236: // We use MySQL's ALTER TABLE ... ADD INDEX syntax instead of CREATE INDEX to avoid problems with users lacking the INDEX privilege |
| 1237: $queries[] = 'ALTER TABLE '.$db_prefix.'online ADD UNIQUE INDEX '.$db_prefix.'online_user_id_ident_idx(user_id,ident)'; |
1233: $queries[] = 'ALTER TABLE '.$db_prefix.'online ADD INDEX '.$db_prefix.'online_user_id_idx(user_id)'; | 1238: $queries[] = 'ALTER TABLE '.$db_prefix.'online ADD INDEX '.$db_prefix.'online_user_id_idx(user_id)'; |
1234: $queries[] = 'ALTER TABLE '.$db_prefix.'posts ADD INDEX '.$db_prefix.'posts_topic_id_idx(topic_id)'; | 1239: $queries[] = 'ALTER TABLE '.$db_prefix.'posts ADD INDEX '.$db_prefix.'posts_topic_id_idx(topic_id)'; |
1235: $queries[] = 'ALTER TABLE '.$db_prefix.'posts ADD INDEX '.$db_prefix.'posts_multi_idx(poster_id, topic_id)'; | 1240: $queries[] = 'ALTER TABLE '.$db_prefix.'posts ADD INDEX '.$db_prefix.'posts_multi_idx(poster_id, topic_id)'; |
1311: 'o_show_dot' => "'0'", | 1316: 'o_show_dot' => "'0'", |
1312: 'o_quickjump' => "'1'", | 1317: 'o_quickjump' => "'1'", |
1313: 'o_gzip' => "'0'", | 1318: 'o_gzip' => "'0'", |
| 1319: 'o_additional_navlinks' => "''", |
1314: 'o_report_method' => "'0'", | 1320: 'o_report_method' => "'0'", |
1315: 'o_regs_report' => "'0'", | 1321: 'o_regs_report' => "'0'", |
1316: 'o_mailing_list' => "'$email'", | 1322: 'o_mailing_list' => "'$email'", |
1395: | 1401: |
1396: | 1402: |
1397: /// Display config.php and give further instructions | 1403: /// Display config.php and give further instructions |
1398: $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".'$cookie_seed = \''.substr(md5(time()), -8)."';\n\ndefine('PUN', 1);\n\n?>"; | 1404: $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".'$cookie_seed = \''.substr(md5(time()), -8)."';\n\ndefine('PUN', 1);"; |
1399: | 1405: |
1400: | 1406: |
1401: ?> | 1407: ?> |
1418: <div class="fakeform"> | 1424: <div class="fakeform"> |
1419: <div class="inform"> | 1425: <div class="inform"> |
1420: <div class="forminfo"> | 1426: <div class="forminfo"> |
1421: <p>To finalize the installation all you need to do is to <strong>copy and paste the text in the text box below into a file called config.php and then upload this file to the root directory of your PunBB installation</strong>. Make sure there are no linebreaks or spaces before <?php and after ?> in the file. You can later edit config.php if you reconfigure your setup (e.g. change the database password or ).</p> | 1427: <p>To finalize the installation all you need to do is to <strong>copy and paste the text in the text box below into a file called config.php and then upload this file to the root directory of your PunBB installation</strong>. Make sure there are no linebreaks or spaces before <?php. You can later edit config.php if you reconfigure your setup (e.g. change the database password or ).</p> |
1422: <?php if ($alerts != ''): ?> <?php echo $alerts."\n" ?> | 1428: <?php if ($alerts != ''): ?> <?php echo $alerts."\n" ?> |
1423: <?php endif; ?> </div> | 1429: <?php endif; ?> </div> |
1424: <fieldset> | 1430: <fieldset> |
punbb-1.2/upload/moderate.php |
punbb-1.2.16/upload/moderate.php |
35: message($lang_common['No permission']); | 35: message($lang_common['No permission']); |
36: | 36: |
37: // Is get_host an IP address or a post ID? | 37: // Is get_host an IP address or a post ID? |
38: if (preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $_GET['get_host'])) | 38: if (@preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $_GET['get_host'])) |
39: $ip = $_GET['get_host']; | 39: $ip = $_GET['get_host']; |
40: else | 40: else |
41: { | 41: { |
50: $ip = $db->result($result); | 50: $ip = $db->result($result); |
51: } | 51: } |
52: | 52: |
53: message('The IP address is: '.$ip.'<br />The host name is: '.gethostbyaddr($ip).'<br /><br /><a href="admin_users.php?show_users='.$ip.'">Show more users for this IP</a>'); | 53: message('The IP address is: '.$ip.'<br />The host name is: '.@gethostbyaddr($ip).'<br /><br /><a href="admin_users.php?show_users='.$ip.'">Show more users for this IP</a>'); |
54: } | 54: } |
55: | 55: |
56: | 56: |
98: { | 98: { |
99: confirm_referrer('moderate.php'); | 99: confirm_referrer('moderate.php'); |
100: | 100: |
| 101: if (@preg_match('/[^0-9,]/', $posts)) |
| 102: message($lang_common['Bad request']); |
| 103: |
| 104: // Verify that the post IDs are valid |
| 105: $result = $db->query('SELECT 1 FROM '.$db->prefix.'posts WHERE id IN('.$posts.') AND topic_id='.$tid) or error('Unable to check posts', __FILE__, __LINE__, $db->error()); |
| 106: |
| 107: if ($db->num_rows($result) != substr_count($posts, ',') + 1) |
| 108: message($lang_common['Bad request']); |
| 109: |
101: // Delete the posts | 110: // Delete the posts |
102: $db->query('DELETE FROM '.$db->prefix.'posts WHERE id IN('.$posts.')') or error('Unable to delete posts', __FILE__, __LINE__, $db->error()); | 111: $db->query('DELETE FROM '.$db->prefix.'posts WHERE id IN('.$posts.')') or error('Unable to delete posts', __FILE__, __LINE__, $db->error()); |
103: | 112: |
278: { | 287: { |
279: confirm_referrer('moderate.php'); | 288: confirm_referrer('moderate.php'); |
280: | 289: |
| 290: if (@preg_match('/[^0-9,]/', $_POST['topics'])) |
| 291: message($lang_common['Bad request']); |
| 292: |
281: $topics = explode(',', $_POST['topics']); | 293: $topics = explode(',', $_POST['topics']); |
282: $move_to_forum = intval($_POST['move_to_forum']); | 294: $move_to_forum = isset($_POST['move_to_forum']) ? intval($_POST['move_to_forum']) : 0; |
283: if (empty($topics) || $move_to_forum < 1) | 295: if (empty($topics) || $move_to_forum < 1) |
284: message($lang_common['Bad request']); | 296: message($lang_common['Bad request']); |
285: | 297: |
| 298: // Verify that the topic IDs are valid |
| 299: $result = $db->query('SELECT 1 FROM '.$db->prefix.'topics WHERE id IN('.implode(',',$topics).') AND forum_id='.$fid) or error('Unable to check topics', __FILE__, __LINE__, $db->error()); |
| 300: |
| 301: if ($db->num_rows($result) != count($topics)) |
| 302: message($lang_common['Bad request']); |
| 303: |
286: // Delete any redirect topics if there are any (only if we moved/copied the topic back to where it where it was once moved from) | 304: // Delete any redirect topics if there are any (only if we moved/copied the topic back to where it where it was once moved from) |
287: $db->query('DELETE FROM '.$db->prefix.'topics WHERE forum_id='.$move_to_forum.' AND moved_to IN('.implode(',',$topics).')') or error('Unable to delete redirect topics', __FILE__, __LINE__, $db->error()); | 305: $db->query('DELETE FROM '.$db->prefix.'topics WHERE forum_id='.$move_to_forum.' AND moved_to IN('.implode(',',$topics).')') or error('Unable to delete redirect topics', __FILE__, __LINE__, $db->error()); |
288: | 306: |
345: <br /><select name="move_to_forum"> | 363: <br /><select name="move_to_forum"> |
346: <?php | 364: <?php |
347: | 365: |
348: $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()); | 366: $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 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 f.redirect_url IS NULL ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error()); |
349: | 367: |
350: $cur_category = 0; | 368: $cur_category = 0; |
351: while ($cur_forum = $db->fetch_assoc($result)) | 369: while ($cur_forum = $db->fetch_assoc($result)) |
394: { | 412: { |
395: confirm_referrer('moderate.php'); | 413: confirm_referrer('moderate.php'); |
396: | 414: |
| 415: if (@preg_match('/[^0-9,]/', $topics)) |
| 416: message($lang_common['Bad request']); |
| 417: |
397: require PUN_ROOT.'include/search_idx.php'; | 418: require PUN_ROOT.'include/search_idx.php'; |
398: | 419: |
| 420: // Verify that the topic IDs are valid |
| 421: $result = $db->query('SELECT 1 FROM '.$db->prefix.'topics WHERE id IN('.$topics.') AND forum_id='.$fid) or error('Unable to check topics', __FILE__, __LINE__, $db->error()); |
| 422: |
| 423: if ($db->num_rows($result) != substr_count($topics, ',') + 1) |
| 424: message($lang_common['Bad request']); |
| 425: |
399: // Delete the topics and any redirect topics | 426: // Delete the topics and any redirect topics |
400: $db->query('DELETE FROM '.$db->prefix.'topics WHERE id IN('.$topics.') OR moved_to IN('.$topics.')') or error('Unable to delete topic', __FILE__, __LINE__, $db->error()); | 427: $db->query('DELETE FROM '.$db->prefix.'topics WHERE id IN('.$topics.') OR moved_to IN('.$topics.')') or error('Unable to delete topic', __FILE__, __LINE__, $db->error()); |
401: | 428: |
459: { | 486: { |
460: confirm_referrer('moderate.php'); | 487: confirm_referrer('moderate.php'); |
461: | 488: |
462: $topics = isset($_POST['topics']) ? $_POST['topics'] : array(); | 489: $topics = isset($_POST['topics']) ? @array_map('intval', @array_keys($_POST['topics'])) : array(); |
463: if (empty($topics)) | 490: if (empty($topics)) |
464: message($lang_misc['No topics selected']); | 491: message($lang_misc['No topics selected']); |
465: | 492: |
466: $db->query('UPDATE '.$db->prefix.'topics SET closed='.$action.' WHERE id IN('.implode(',', array_keys($topics)).')') or error('Unable to close topics', __FILE__, __LINE__, $db->error()); | 493: $db->query('UPDATE '.$db->prefix.'topics SET closed='.$action.' WHERE id IN('.implode(',', $topics).') AND forum_id='.$fid) or error('Unable to close topics', __FILE__, __LINE__, $db->error()); |
467: | 494: |
468: $redirect_msg = ($action) ? $lang_misc['Close topics redirect'] : $lang_misc['Open topics redirect']; | 495: $redirect_msg = ($action) ? $lang_misc['Close topics redirect'] : $lang_misc['Open topics redirect']; |
469: redirect('moderate.php?fid='.$fid, $redirect_msg); | 496: redirect('moderate.php?fid='.$fid, $redirect_msg); |
477: if ($topic_id < 1) | 504: if ($topic_id < 1) |
478: message($lang_common['Bad request']); | 505: message($lang_common['Bad request']); |
479: | 506: |
480: $db->query('UPDATE '.$db->prefix.'topics SET closed='.$action.' WHERE id='.$topic_id) or error('Unable to close topic', __FILE__, __LINE__, $db->error()); | 507: $db->query('UPDATE '.$db->prefix.'topics SET closed='.$action.' WHERE id='.$topic_id.' AND forum_id='.$fid) or error('Unable to close topic', __FILE__, __LINE__, $db->error()); |
481: | 508: |
482: $redirect_msg = ($action) ? $lang_misc['Close topic redirect'] : $lang_misc['Open topic redirect']; | 509: $redirect_msg = ($action) ? $lang_misc['Close topic redirect'] : $lang_misc['Open topic redirect']; |
483: redirect('viewtopic.php?id='.$topic_id, $redirect_msg); | 510: redirect('viewtopic.php?id='.$topic_id, $redirect_msg); |
494: if ($stick < 1) | 521: if ($stick < 1) |
495: message($lang_common['Bad request']); | 522: message($lang_common['Bad request']); |
496: | 523: |
497: $db->query('UPDATE '.$db->prefix.'topics SET sticky=\'1\' WHERE id='.$stick) or error('Unable to stick topic', __FILE__, __LINE__, $db->error()); | 524: $db->query('UPDATE '.$db->prefix.'topics SET sticky=\'1\' WHERE id='.$stick.' AND forum_id='.$fid) or error('Unable to stick topic', __FILE__, __LINE__, $db->error()); |
498: | 525: |
499: redirect('viewtopic.php?id='.$stick, $lang_misc['Stick topic redirect']); | 526: redirect('viewtopic.php?id='.$stick, $lang_misc['Stick topic redirect']); |
500: } | 527: } |
509: if ($unstick < 1) | 536: if ($unstick < 1) |
510: message($lang_common['Bad request']); | 537: message($lang_common['Bad request']); |
511: | 538: |
512: $db->query('UPDATE '.$db->prefix.'topics SET sticky=\'0\' WHERE id='.$unstick) or error('Unable to unstick topic', __FILE__, __LINE__, $db->error()); | 539: $db->query('UPDATE '.$db->prefix.'topics SET sticky=\'0\' WHERE id='.$unstick.' AND forum_id='.$fid) or error('Unable to unstick topic', __FILE__, __LINE__, $db->error()); |
513: | 540: |
514: redirect('viewtopic.php?id='.$unstick, $lang_misc['Unstick topic redirect']); | 541: redirect('viewtopic.php?id='.$unstick, $lang_misc['Unstick topic redirect']); |
515: } | 542: } |
560: <table cellspacing="0"> | 587: <table cellspacing="0"> |
561: <thead> | 588: <thead> |
562: <tr> | 589: <tr> |
563: <th class="tc1" scope="col"><?php echo $lang_common['Topic'] ?></th> | 590: <th class="tcl" scope="col"><?php echo $lang_common['Topic'] ?></th> |
564: <th class="tc2" scope="col"><?php echo $lang_common['Replies'] ?></th> | 591: <th class="tc2" scope="col"><?php echo $lang_common['Replies'] ?></th> |
565: <th class="tc3" scope="col"><?php echo $lang_forum['Views'] ?></th> | 592: <th class="tc3" scope="col"><?php echo $lang_forum['Views'] ?></th> |
566: <th class="tcr"><?php echo $lang_common['Last post'] ?></th> | 593: <th class="tcr"><?php echo $lang_common['Last post'] ?></th> |
580: | 607: |
581: while ($cur_topic = $db->fetch_assoc($result)) | 608: while ($cur_topic = $db->fetch_assoc($result)) |
582: { | 609: { |
583: $icon = '<div class="inormal"><div class="nosize">'.$lang_common['Normal icon'].'</div></div>'."\n"; | 610: |
| 611: $icon_text = $lang_common['Normal icon']; |
| 612: $item_status = ''; |
| 613: $icon_type = 'icon'; |
| 614: |
584: if ($cur_topic['moved_to'] == null) | 615: if ($cur_topic['moved_to'] == null) |
585: { | 616: { |
586: $last_post = '<a href="viewtopic.php?pid='.$cur_topic['last_post_id'].'#p'.$cur_topic['last_post_id'].'">'.format_time($cur_topic['last_post']).'</a> '.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['last_poster']); | 617: $last_post = '<a href="viewtopic.php?pid='.$cur_topic['last_post_id'].'#p'.$cur_topic['last_post_id'].'">'.format_time($cur_topic['last_post']).'</a> '.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['last_poster']); |
601: $subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span>'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>'; | 632: $subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span>'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>'; |
602: else | 633: else |
603: { | 634: { |
604: $subject = '<a class="showclosed" href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>'; | 635: $subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>'; |
605: $icon = '<div class="iclosed"><div class="nosize">'.$lang_common['Closed icon'].'</div></div>'."\n"; | 636: $icon_text = $lang_common['Closed icon']; |
| 637: $item_status = 'iclosed'; |
606: } | 638: } |
607: | 639: |
608: if ($cur_topic['last_post'] > $pun_user['last_visit'] && !$ghost_topic) | 640: if ($cur_topic['last_post'] > $pun_user['last_visit'] && !$ghost_topic) |
609: { | 641: { |
610: $icon = '<div class="inew"><div class="nosize">'.$lang_common['New icon'].'</div></div>'."\n"; | 642: $icon_text .= ' '.$lang_common['New icon']; |
611: | 643: $item_status .= ' inew'; |
| 644: $icon_type = 'icon inew'; |
612: $subject = '<strong>'.$subject.'</strong>'; | 645: $subject = '<strong>'.$subject.'</strong>'; |
613: $subject_new_posts = '[ <a href="viewtopic.php?id='.$cur_topic['id'].'&action=new" title="'.$lang_common['New posts info'].'">'.$lang_common['New posts'].'</a> ]'; | 646: $subject_new_posts = '<span class="newtext">[ <a href="viewtopic.php?id='.$cur_topic['id'].'&action=new" title="'.$lang_common['New posts info'].'">'.$lang_common['New posts'].'</a> ]</span>'; |
614: } | 647: } |
615: else | 648: else |
616: $subject_new_posts = null; | 649: $subject_new_posts = null; |
620: $subject = ' '.$subject; | 653: $subject = ' '.$subject; |
621: | 654: |
622: if ($cur_topic['sticky'] == '1') | 655: if ($cur_topic['sticky'] == '1') |
623: $subject = $lang_forum['Sticky'].': '.$subject; | 656: { |
624: | 657: $subject = '<span class="stickytext">'.$lang_forum['Sticky'].': </span>'.$subject; |
| 658: $item_status .= ' isticky'; |
| 659: $icon_text .= ' '.$lang_forum['Sticky']; |
| 660: } |
625: | 661: |
626: $num_pages_topic = ceil(($cur_topic['num_replies'] + 1) / $pun_user['disp_posts']); | 662: $num_pages_topic = ceil(($cur_topic['num_replies'] + 1) / $pun_user['disp_posts']); |
627: | 663: |
638: } | 674: } |
639: | 675: |
640: ?> | 676: ?> |
641: <tr> | 677: <tr<?php if ($item_status != '') echo ' class="'.trim($item_status).'"'; ?>> |
642: <td class="tcl"> | 678: <td class="tcl"> |
643: <?php echo $icon ?> | 679: <div class="<?php echo $icon_type ?>"><div class="nosize"><?php echo trim($icon_text) ?></div></div> |
644: <div class="tclcon"> | 680: <div class="tclcon"> |
645: <?php echo $subject."\n" ?> | 681: <?php echo $subject."\n" ?> |
646: </div> | 682: </div> |
punbb-1.2/upload/post.php |
punbb-1.2.16/upload/post.php |
33: | 33: |
34: $tid = isset($_GET['tid']) ? intval($_GET['tid']) : 0; | 34: $tid = isset($_GET['tid']) ? intval($_GET['tid']) : 0; |
35: $fid = isset($_GET['fid']) ? intval($_GET['fid']) : 0; | 35: $fid = isset($_GET['fid']) ? intval($_GET['fid']) : 0; |
36: if ($tid < 1 && $fid < 1) | 36: if ($tid < 1 && $fid < 1 || $tid > 0 && $fid > 0) |
37: message($lang_common['Bad request']); | 37: message($lang_common['Bad request']); |
38: | 38: |
39: // Fetch some info about the topic and/or the forum | 39: // Fetch some info about the topic and/or the forum |
128: $errors[] = $lang_register['Username censor']; | 128: $errors[] = $lang_register['Username censor']; |
129: | 129: |
130: // Check that the username (or a too similar username) is not already registered | 130: // Check that the username (or a too similar username) is not already registered |
131: $result = $db->query('SELECT username FROM '.$db->prefix.'users WHERE username=\''.$db->escape($username).'\' OR username=\''.$db->escape(preg_replace('/[^\w]/', '', $username)).'\'') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error()); | 131: $result = $db->query('SELECT username FROM '.$db->prefix.'users WHERE (username=\''.$db->escape($username).'\' OR username=\''.$db->escape(preg_replace('/[^\w]/', '', $username)).'\') AND id>1') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error()); |
132: if ($db->num_rows($result)) | 132: if ($db->num_rows($result)) |
133: { | 133: { |
134: $busy = $db->result($result); | 134: $busy = $db->result($result); |
207: | 207: |
208: update_forum($cur_posting['id']); | 208: update_forum($cur_posting['id']); |
209: | 209: |
210: | 210: // Should we send out notifications? |
211: // Get the post time for the previous post in this topic | 211: if ($pun_config['o_subscriptions'] == '1') |
212: $result = $db->query('SELECT posted FROM '.$db->prefix.'posts WHERE topic_id='.$tid.' ORDER BY id DESC LIMIT 1, 1') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error()); | |
213: $previous_post_time = $db->result($result); | |
214: | |
215: // Get any subscribed users that should be notified (banned users are excluded) | |
216: $result = $db->query('SELECT u.id, u.email, u.notify_with_post, u.language FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'subscriptions AS s ON u.id=s.user_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id='.$cur_posting['id'].' AND fp.group_id=u.group_id) LEFT JOIN '.$db->prefix.'online AS o ON u.id=o.user_id LEFT JOIN '.$db->prefix.'bans AS b ON u.username=b.username WHERE b.username IS NULL AND COALESCE(o.logged, u.last_visit)>'.$previous_post_time.' AND (fp.read_forum IS NULL OR fp.read_forum=1) AND s.topic_id='.$tid.' AND u.id!='.intval($pun_user['id'])) or error('Unable to fetch subscription info', __FILE__, __LINE__, $db->error()); | |
217: if ($db->num_rows($result)) | |
218: { | 212: { |
219: require_once PUN_ROOT.'include/email.php'; | 213: // Get the post time for the previous post in this topic |
| 214: $result = $db->query('SELECT posted FROM '.$db->prefix.'posts WHERE topic_id='.$tid.' ORDER BY id DESC LIMIT 1, 1') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error()); |
| 215: $previous_post_time = $db->result($result); |
| 216: |
| 217: // Get any subscribed users that should be notified (banned users are excluded) |
| 218: $result = $db->query('SELECT u.id, u.email, u.notify_with_post, u.language FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'subscriptions AS s ON u.id=s.user_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id='.$cur_posting['id'].' AND fp.group_id=u.group_id) LEFT JOIN '.$db->prefix.'online AS o ON u.id=o.user_id LEFT JOIN '.$db->prefix.'bans AS b ON u.username=b.username WHERE b.username IS NULL AND COALESCE(o.logged, u.last_visit)>'.$previous_post_time.' AND (fp.read_forum IS NULL OR fp.read_forum=1) AND s.topic_id='.$tid.' AND u.id!='.intval($pun_user['id'])) or error('Unable to fetch subscription info', __FILE__, __LINE__, $db->error()); |
| 219: if ($db->num_rows($result)) |
| 220: { |
| 221: require_once PUN_ROOT.'include/email.php'; |
220: | 222: |
221: $notification_emails = array(); | 223: $notification_emails = array(); |
222: | 224: |
223: // Loop through subscribed users and send e-mails | 225: // Loop through subscribed users and send e-mails |
224: while ($cur_subscriber = $db->fetch_assoc($result)) | 226: while ($cur_subscriber = $db->fetch_assoc($result)) |
225: { | |
226: // Is the subscription e-mail for $cur_subscriber['language'] cached or not? | |
227: if (!isset($notification_emails[$cur_subscriber['language']])) | |
228: { | 227: { |
229: if (file_exists(PUN_ROOT.'lang/'.$cur_subscriber['language'].'/mail_templates/new_reply.tpl')) | 228: // Is the subscription e-mail for $cur_subscriber['language'] cached or not? |
| 229: if (!isset($notification_emails[$cur_subscriber['language']])) |
230: { | 230: { |
231: // Load the "new reply" template | 231: if (file_exists(PUN_ROOT.'lang/'.$cur_subscriber['language'].'/mail_templates/new_reply.tpl')) |
232: $mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$cur_subscriber['language'].'/mail_templates/new_reply.tpl')); | 232: { |
233: | 233: // Load the "new reply" template |
234: // Load the "new reply full" template (with post included) | 234: $mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$cur_subscriber['language'].'/mail_templates/new_reply.tpl')); |
235: $mail_tpl_full = trim(file_get_contents(PUN_ROOT.'lang/'.$cur_subscriber['language'].'/mail_templates/new_reply_full.tpl')); | 235: |
236: | 236: // Load the "new reply full" template (with post included) |
237: // The first row contains the subject (it also starts with "Subject:") | 237: $mail_tpl_full = trim(file_get_contents(PUN_ROOT.'lang/'.$cur_subscriber['language'].'/mail_templates/new_reply_full.tpl')); |
238: $first_crlf = strpos($mail_tpl, "\n"); | 238: |
239: $mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8)); | 239: // The first row contains the subject (it also starts with "Subject:") |
240: $mail_message = trim(substr($mail_tpl, $first_crlf)); | 240: $first_crlf = strpos($mail_tpl, "\n"); |
241: | 241: $mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8)); |
242: $first_crlf = strpos($mail_tpl_full, "\n"); | 242: $mail_message = trim(substr($mail_tpl, $first_crlf)); |
243: $mail_subject_full = trim(substr($mail_tpl_full, 8, $first_crlf-8)); | 243: |
244: $mail_message_full = trim(substr($mail_tpl_full, $first_crlf)); | 244: $first_crlf = strpos($mail_tpl_full, "\n"); |
245: | 245: $mail_subject_full = trim(substr($mail_tpl_full, 8, $first_crlf-8)); |
246: $mail_subject = str_replace('<topic_subject>', '\''.$cur_posting['subject'].'\'', $mail_subject); | 246: $mail_message_full = trim(substr($mail_tpl_full, $first_crlf)); |
247: $mail_message = str_replace('<topic_subject>', '\''.$cur_posting['subject'].'\'', $mail_message); | 247: |
248: $mail_message = str_replace('<replier>', $username, $mail_message); | 248: $mail_subject = str_replace('<topic_subject>', '\''.$cur_posting['subject'].'\'', $mail_subject); |
249: $mail_message = str_replace('<post_url>', $pun_config['o_base_url'].'/viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $mail_message); | 249: $mail_message = str_replace('<topic_subject>', '\''.$cur_posting['subject'].'\'', $mail_message); |
250: $mail_message = str_replace('<unsubscribe_url>', $pun_config['o_base_url'].'/misc.php?unsubscribe='.$tid, $mail_message); | 250: $mail_message = str_replace('<replier>', $username, $mail_message); |
251: $mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'].' '.$lang_common['Mailer'], $mail_message); | 251: $mail_message = str_replace('<post_url>', $pun_config['o_base_url'].'/viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $mail_message); |
252: | 252: $mail_message = str_replace('<unsubscribe_url>', $pun_config['o_base_url'].'/misc.php?unsubscribe='.$tid, $mail_message); |
253: $mail_subject_full = str_replace('<topic_subject>', '\''.$cur_posting['subject'].'\'', $mail_subject_full); | 253: $mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'].' '.$lang_common['Mailer'], $mail_message); |
254: $mail_message_full = str_replace('<topic_subject>', '\''.$cur_posting['subject'].'\'', $mail_message_full); | 254: |
255: $mail_message_full = str_replace('<replier>', $username, $mail_message_full); | 255: $mail_subject_full = str_replace('<topic_subject>', '\''.$cur_posting['subject'].'\'', $mail_subject_full); |
256: $mail_message_full = str_replace('<message>', $message, $mail_message_full); | 256: $mail_message_full = str_replace('<topic_subject>', '\''.$cur_posting['subject'].'\'', $mail_message_full); |
257: $mail_message_full = str_replace('<post_url>', $pun_config['o_base_url'].'/viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $mail_message_full); | 257: $mail_message_full = str_replace('<replier>', $username, $mail_message_full); |
258: $mail_message_full = str_replace('<unsubscribe_url>', $pun_config['o_base_url'].'/misc.php?unsubscribe='.$tid, $mail_message_full); | 258: $mail_message_full = str_replace('<message>', $message, $mail_message_full); |
259: $mail_message_full = str_replace('<board_mailer>', $pun_config['o_board_title'].' '.$lang_common['Mailer'], $mail_message_full); | 259: $mail_message_full = str_replace('<post_url>', $pun_config['o_base_url'].'/viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $mail_message_full); |
260: | 260: $mail_message_full = str_replace('<unsubscribe_url>', $pun_config['o_base_url'].'/misc.php?unsubscribe='.$tid, $mail_message_full); |
261: $notification_emails[$cur_subscriber['language']][0] = $mail_subject; | 261: $mail_message_full = str_replace('<board_mailer>', $pun_config['o_board_title'].' '.$lang_common['Mailer'], $mail_message_full); |
262: $notification_emails[$cur_subscriber['language']][1] = $mail_message; | 262: |
263: $notification_emails[$cur_subscriber['language']][2] = $mail_subject_full; | 263: $notification_emails[$cur_subscriber['language']][0] = $mail_subject; |
264: $notification_emails[$cur_subscriber['language']][3] = $mail_message_full; | 264: $notification_emails[$cur_subscriber['language']][1] = $mail_message; |
| 265: $notification_emails[$cur_subscriber['language']][2] = $mail_subject_full; |
| 266: $notification_emails[$cur_subscriber['language']][3] = $mail_message_full; |
265: | 267: |
266: $mail_subject = $mail_message = $mail_subject_full = $mail_message_full = null; | 268: $mail_subject = $mail_message = $mail_subject_full = $mail_message_full = null; |
| 269: } |
267: } | 270: } |
268: } | |
269: | 271: |
270: // We have to double check here because the templates could be missing | 272: // We have to double check here because the templates could be missing |
271: if (isset($notification_emails[$cur_subscriber['language']])) | 273: if (isset($notification_emails[$cur_subscriber['language']])) |
272: { | 274: { |
273: if ($cur_subscriber['notify_with_post'] == '0') | 275: if ($cur_subscriber['notify_with_post'] == '0') |
274: pun_mail($cur_subscriber['email'], $notification_emails[$cur_subscriber['language']][0], $notification_emails[$cur_subscriber['language']][1]); | 276: pun_mail($cur_subscriber['email'], $notification_emails[$cur_subscriber['language']][0], $notification_emails[$cur_subscriber['language']][1]); |
275: else | 277: else |
276: pun_mail($cur_subscriber['email'], $notification_emails[$cur_subscriber['language']][2], $notification_emails[$cur_subscriber['language']][3]); | 278: pun_mail($cur_subscriber['email'], $notification_emails[$cur_subscriber['language']][2], $notification_emails[$cur_subscriber['language']][3]); |
| 279: } |
277: } | 280: } |
278: } | 281: } |
279: } | 282: } |
335: if ($qid < 1) | 338: if ($qid < 1) |
336: message($lang_common['Bad request']); | 339: message($lang_common['Bad request']); |
337: | 340: |
338: $result = $db->query('SELECT poster, message FROM '.$db->prefix.'posts WHERE id='.$qid) or error('Unable to fetch quote info', __FILE__, __LINE__, $db->error()); | 341: $result = $db->query('SELECT poster, message FROM '.$db->prefix.'posts WHERE id='.$qid.' AND topic_id='.$tid) or error('Unable to fetch quote info', __FILE__, __LINE__, $db->error()); |
339: if (!$db->num_rows($result)) | 342: if (!$db->num_rows($result)) |
340: message($lang_common['Bad request']); | 343: message($lang_common['Bad request']); |
341: | 344: |
437: else if (isset($_POST['preview'])) | 440: else if (isset($_POST['preview'])) |
438: { | 441: { |
439: require_once PUN_ROOT.'include/parser.php'; | 442: require_once PUN_ROOT.'include/parser.php'; |
440: $message = parse_message(trim($_POST['req_message']), $hide_smilies); | 443: $preview_message = parse_message($message, $hide_smilies); |
441: | 444: |
442: ?> | 445: ?> |
443: <div id="postpreview" class="blockpost"> | 446: <div id="postpreview" class="blockpost"> |
446: <div class="inbox"> | 449: <div class="inbox"> |
447: <div class="postright"> | 450: <div class="postright"> |
448: <div class="postmsg"> | 451: <div class="postmsg"> |
449: <?php echo $message."\n" ?> | 452: <?php echo $preview_message."\n" ?> |
450: </div> | 453: </div> |
451: </div> | 454: </div> |
452: </div> | 455: </div> |
488: if ($fid): ?> | 491: if ($fid): ?> |
489: <label><strong><?php echo $lang_common['Subject'] ?></strong><br /><input class="longinput" type="text" name="req_subject" value="<?php if (isset($_POST['req_subject'])) echo pun_htmlspecialchars($subject); ?>" size="80" maxlength="70" tabindex="<?php echo $cur_index++ ?>" /><br /></label> | 492: <label><strong><?php echo $lang_common['Subject'] ?></strong><br /><input class="longinput" type="text" name="req_subject" value="<?php if (isset($_POST['req_subject'])) echo pun_htmlspecialchars($subject); ?>" size="80" maxlength="70" tabindex="<?php echo $cur_index++ ?>" /><br /></label> |
490: <?php endif; ?> <label><strong><?php echo $lang_common['Message'] ?></strong><br /> | 493: <?php endif; ?> <label><strong><?php echo $lang_common['Message'] ?></strong><br /> |
491: <textarea name="req_message" rows="20" cols="95" tabindex="<?php echo $cur_index++ ?>"><?php echo isset($_POST['req_message']) ? pun_htmlspecialchars(trim($_POST['req_message'])) : (isset($quote) ? $quote : ''); ?></textarea><br /></label> | 494: <textarea name="req_message" rows="20" cols="95" tabindex="<?php echo $cur_index++ ?>"><?php echo isset($_POST['req_message']) ? pun_htmlspecialchars($message) : (isset($quote) ? $quote : ''); ?></textarea><br /></label> |
492: <ul class="bblinks"> | 495: <ul class="bblinks"> |
493: <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> | 496: <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> |
494: <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> | 497: <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> |
punbb-1.2/upload/profile.php |
punbb-1.2.16/upload/profile.php |
27: require PUN_ROOT.'include/common.php'; | 27: require PUN_ROOT.'include/common.php'; |
28: | 28: |
29: | 29: |
30: if ($pun_user['g_read_board'] == '0' && !isset($_GET['key'])) | |
31: message($lang_common['No view']); | |
32: | |
33: | |
34: $action = isset($_GET['action']) ? $_GET['action'] : null; | 30: $action = isset($_GET['action']) ? $_GET['action'] : null; |
35: $section = isset($_GET['section']) ? $_GET['section'] : null; | 31: $section = isset($_GET['section']) ? $_GET['section'] : null; |
36: $id = isset($_GET['id']) ? intval($_GET['id']) : 0; | 32: $id = isset($_GET['id']) ? intval($_GET['id']) : 0; |
37: if ($id < 2) | 33: if ($id < 2) |
38: message($lang_common['Bad request']); | 34: message($lang_common['Bad request']); |
39: | 35: |
| 36: if ($pun_user['g_read_board'] == '0' && ($action != 'change_pass' || !isset($_GET['key']))) |
| 37: message($lang_common['No view']); |
| 38: |
40: // Load the profile.php/register.php language file | 39: // Load the profile.php/register.php language file |
41: require PUN_ROOT.'lang/'.$pun_user['language'].'/prof_reg.php'; | 40: require PUN_ROOT.'lang/'.$pun_user['language'].'/prof_reg.php'; |
42: | 41: |
60: $result = $db->query('SELECT activate_string, activate_key FROM '.$db->prefix.'users WHERE id='.$id) or error('Unable to fetch new password', __FILE__, __LINE__, $db->error()); | 59: $result = $db->query('SELECT activate_string, activate_key FROM '.$db->prefix.'users WHERE id='.$id) or error('Unable to fetch new password', __FILE__, __LINE__, $db->error()); |
61: list($new_password_hash, $new_password_key) = $db->fetch_row($result); | 60: list($new_password_hash, $new_password_key) = $db->fetch_row($result); |
62: | 61: |
63: if ($key != $new_password_key) | 62: if ($key == '' || $key != $new_password_key) |
64: message($lang_profile['Pass key bad'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.'); | 63: message($lang_profile['Pass key bad'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.'); |
65: else | 64: else |
66: { | 65: { |
88: | 87: |
89: if (isset($_POST['form_sent'])) | 88: if (isset($_POST['form_sent'])) |
90: { | 89: { |
| 90: if ($pun_user['g_id'] < PUN_GUEST) |
| 91: confirm_referrer('profile.php'); |
| 92: |
91: $old_password = isset($_POST['req_old_password']) ? trim($_POST['req_old_password']) : ''; | 93: $old_password = isset($_POST['req_old_password']) ? trim($_POST['req_old_password']) : ''; |
92: $new_password1 = trim($_POST['req_new_password1']); | 94: $new_password1 = trim($_POST['req_new_password1']); |
93: $new_password2 = trim($_POST['req_new_password2']); | 95: $new_password2 = trim($_POST['req_new_password2']); |
191: $result = $db->query('SELECT activate_string, activate_key FROM '.$db->prefix.'users WHERE id='.$id) or error('Unable to fetch activation data', __FILE__, __LINE__, $db->error()); | 193: $result = $db->query('SELECT activate_string, activate_key FROM '.$db->prefix.'users WHERE id='.$id) or error('Unable to fetch activation data', __FILE__, __LINE__, $db->error()); |
192: list($new_email, $new_email_key) = $db->fetch_row($result); | 194: list($new_email, $new_email_key) = $db->fetch_row($result); |
193: | 195: |
194: if ($key != $new_email_key) | 196: if ($key == '' || $key != $new_email_key) |
195: message($lang_profile['E-mail key bad'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.'); | 197: message($lang_profile['E-mail key bad'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.'); |
196: else | 198: else |
197: { | 199: { |
198: $db->query('UPDATE '.$db->prefix.'users SET email=\''.$new_email.'\', activate_string=NULL, activate_key=NULL WHERE id='.$id) or error('Unable to update e-mail address', __FILE__, __LINE__, $db->error()); | 200: $db->query('UPDATE '.$db->prefix.'users SET email=activate_string, activate_string=NULL, activate_key=NULL WHERE id='.$id) or error('Unable to update e-mail address', __FILE__, __LINE__, $db->error()); |
199: | 201: |
200: message($lang_profile['E-mail updated'], true); | 202: message($lang_profile['E-mail updated'], true); |
201: } | 203: } |
202: } | 204: } |
203: else if (isset($_POST['form_sent'])) | 205: else if (isset($_POST['form_sent'])) |
204: { | 206: { |
| 207: if (pun_hash($_POST['req_password']) !== $pun_user['password']) |
| 208: message($lang_profile['Wrong pass']); |
| 209: |
205: require PUN_ROOT.'include/email.php'; | 210: require PUN_ROOT.'include/email.php'; |
206: | 211: |
207: // Validate the email-address | 212: // Validate the email-address |
224: } | 229: } |
225: | 230: |
226: // Check if someone else already has registered with that e-mail address | 231: // Check if someone else already has registered with that e-mail address |
227: $result = $db->query('SELECT id, username FROM '.$db->prefix.'users WHERE email=\''.$new_email.'\'') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error()); | 232: $result = $db->query('SELECT id, username FROM '.$db->prefix.'users WHERE email=\''.$db->escape($new_email).'\'') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error()); |
228: if ($db->num_rows($result)) | 233: if ($db->num_rows($result)) |
229: { | 234: { |
230: if ($pun_config['p_allow_dupe_email'] == '0') | 235: if ($pun_config['p_allow_dupe_email'] == '0') |
244: | 249: |
245: $new_email_key = random_pass(8); | 250: $new_email_key = random_pass(8); |
246: | 251: |
247: $db->query('UPDATE '.$db->prefix.'users SET activate_string=\''.$new_email.'\', activate_key=\''.$new_email_key.'\' WHERE id='.$id) or error('Unable to update activation data', __FILE__, __LINE__, $db->error()); | 252: $db->query('UPDATE '.$db->prefix.'users SET activate_string=\''.$db->escape($new_email).'\', activate_key=\''.$new_email_key.'\' WHERE id='.$id) or error('Unable to update activation data', __FILE__, __LINE__, $db->error()); |
248: | 253: |
249: // Load the "activate e-mail" template | 254: // Load the "activate e-mail" template |
250: $mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$pun_user['language'].'/mail_templates/activate_email.tpl')); | 255: $mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$pun_user['language'].'/mail_templates/activate_email.tpl')); |
265: } | 270: } |
266: | 271: |
267: $page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Profile']; | 272: $page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Profile']; |
268: $required_fields = array('req_new_email' => $lang_profile['New e-mail']); | 273: $required_fields = array('req_new_email' => $lang_profile['New e-mail'], 'req_password' => $lang_common['Password']); |
269: $focus_element = array('change_email', 'req_new_email'); | 274: $focus_element = array('change_email', 'req_new_email'); |
270: require PUN_ROOT.'header.php'; | 275: require PUN_ROOT.'header.php'; |
271: | 276: |
280: <div class="infldset"> | 285: <div class="infldset"> |
281: <input type="hidden" name="form_sent" value="1" /> | 286: <input type="hidden" name="form_sent" value="1" /> |
282: <label><strong><?php echo $lang_profile['New e-mail'] ?></strong><br /><input type="text" name="req_new_email" size="50" maxlength="50" /><br /></label> | 287: <label><strong><?php echo $lang_profile['New e-mail'] ?></strong><br /><input type="text" name="req_new_email" size="50" maxlength="50" /><br /></label> |
| 288: <label><strong><?php echo $lang_common['Password'] ?></strong><br /><input type="password" name="req_password" size="16" maxlength="16" /><br /></label> |
283: <p><?php echo $lang_profile['E-mail instructions'] ?></p> | 289: <p><?php echo $lang_profile['E-mail instructions'] ?></p> |
284: </div> | 290: </div> |
285: </fieldset> | 291: </fieldset> |
304: | 310: |
305: if (isset($_POST['form_sent'])) | 311: if (isset($_POST['form_sent'])) |
306: { | 312: { |
| 313: if (!isset($_FILES['req_file'])) |
| 314: message($lang_profile['No file']); |
| 315: |
307: $uploaded_file = $_FILES['req_file']; | 316: $uploaded_file = $_FILES['req_file']; |
308: | 317: |
309: // Make sure the upload went smooth | 318: // Make sure the upload went smooth |
324: message($lang_profile['No file']); | 333: message($lang_profile['No file']); |
325: break; | 334: break; |
326: | 335: |
| 336: case 6: // UPLOAD_ERR_NO_TMP_DIR |
| 337: message($lang_profile['No tmp directory']); |
| 338: break; |
| 339: |
327: default: | 340: default: |
328: // No error occured, but was something actually uploaded? | 341: // No error occured, but was something actually uploaded? |
329: if ($uploaded_file['size'] == 0) | 342: if ($uploaded_file['size'] == 0) |
356: message($lang_profile['Move failed'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.'); | 369: message($lang_profile['Move failed'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.'); |
357: | 370: |
358: // Now check the width/height | 371: // Now check the width/height |
359: list($width, $height, ,) = getimagesize($pun_config['o_avatars_dir'].'/'.$id.'.tmp'); | 372: list($width, $height, $type,) = getimagesize($pun_config['o_avatars_dir'].'/'.$id.'.tmp'); |
360: if ($width > $pun_config['o_avatars_width'] || $height > $pun_config['o_avatars_height']) | 373: if (empty($width) || empty($height) || $width > $pun_config['o_avatars_width'] || $height > $pun_config['o_avatars_height']) |
361: { | 374: { |
362: @unlink($pun_config['o_avatars_dir'].'/'.$id.'.tmp'); | 375: @unlink($pun_config['o_avatars_dir'].'/'.$id.'.tmp'); |
363: message($lang_profile['Too wide or high'].' '.$pun_config['o_avatars_width'].'x'.$pun_config['o_avatars_height'].' '.$lang_profile['pixels'].'.'); | 376: message($lang_profile['Too wide or high'].' '.$pun_config['o_avatars_width'].'x'.$pun_config['o_avatars_height'].' '.$lang_profile['pixels'].'.'); |
364: } | 377: } |
| 378: else if ($type == 1 && $uploaded_file['type'] != 'image/gif') // Prevent dodgy uploads |
| 379: { |
| 380: @unlink($pun_config['o_avatars_dir'].'/'.$id.'.tmp'); |
| 381: message($lang_profile['Bad type']); |
| 382: } |
365: | 383: |
366: // Delete any old avatars and put the new one in place | 384: // Delete any old avatars and put the new one in place |
367: @unlink($pun_config['o_avatars_dir'].'/'.$id.$extensions[0]); | 385: @unlink($pun_config['o_avatars_dir'].'/'.$id.$extensions[0]); |
395: <div class="infldset"> | 413: <div class="infldset"> |
396: <input type="hidden" name="form_sent" value="1" /> | 414: <input type="hidden" name="form_sent" value="1" /> |
397: <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $pun_config['o_avatars_size'] ?>" /> | 415: <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $pun_config['o_avatars_size'] ?>" /> |
398: <p><?php echo $lang_profile['Avatar desc'].' '.$pun_config['o_avatars_width'].' x '.$pun_config['o_avatars_height'].' '.$lang_profile['pixels'].' '.$lang_common['and'].' '.$pun_config['o_avatars_size'].' '.$lang_profile['bytes'].' ('.ceil($pun_config['o_avatars_size'] / 1024) ?> KB).</p> | |
399: <label><strong><?php echo $lang_profile['File'] ?></strong><br /><input name="req_file" type="file" size="40" /><br /></label> | 416: <label><strong><?php echo $lang_profile['File'] ?></strong><br /><input name="req_file" type="file" size="40" /><br /></label> |
| 417: <p><?php echo $lang_profile['Avatar desc'].' '.$pun_config['o_avatars_width'].' x '.$pun_config['o_avatars_height'].' '.$lang_profile['pixels'].' '.$lang_common['and'].' '.$pun_config['o_avatars_size'].' '.$lang_profile['bytes'].' ('.ceil($pun_config['o_avatars_size'] / 1024) ?> KB).</p> |
400: </div> | 418: </div> |
401: </fieldset> | 419: </fieldset> |
402: </div> | 420: </div> |
524: $result = $db->query('SELECT group_id, username FROM '.$db->prefix.'users WHERE id='.$id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error()); | 542: $result = $db->query('SELECT group_id, username FROM '.$db->prefix.'users WHERE id='.$id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error()); |
525: list($group_id, $username) = $db->fetch_row($result); | 543: list($group_id, $username) = $db->fetch_row($result); |
526: | 544: |
| 545: if ($group_id == PUN_ADMIN) |
| 546: message('Administrators cannot be deleted. In order to delete this user, you must first move him/her to a different user group.'); |
| 547: |
527: if (isset($_POST['delete_user_comply'])) | 548: if (isset($_POST['delete_user_comply'])) |
528: { | 549: { |
529: // If the user is a moderator or an administrator, we remove him/her from the moderator list in all forums as well | 550: // If the user is a moderator or an administrator, we remove him/her from the moderator list in all forums as well |
601: <div class="rbox"> | 622: <div class="rbox"> |
602: <label><input type="checkbox" name="delete_posts" value="1" checked="checked" /><?php echo $lang_profile['Delete posts'] ?><br /></label> | 623: <label><input type="checkbox" name="delete_posts" value="1" checked="checked" /><?php echo $lang_profile['Delete posts'] ?><br /></label> |
603: </div> | 624: </div> |
604: <p><strong class="showhot"><?php echo $lang_profile['Delete warning'] ?></strong></p> | 625: <p class="warntext"><strong><?php echo $lang_profile['Delete warning'] ?></strong></p> |
605: </div> | 626: </div> |
606: </fieldset> | 627: </fieldset> |
607: </div> | 628: </div> |
654: { | 675: { |
655: case 'essentials': | 676: case 'essentials': |
656: { | 677: { |
657: $form = extract_elements(array('timezone', 'language', 'style')); | 678: $form = extract_elements(array('timezone', 'language')); |
658: | 679: |
659: if ($pun_user['g_id'] < PUN_GUEST) | 680: if ($pun_user['g_id'] < PUN_GUEST) |
660: { | 681: { |
701: message($lang_common['Invalid e-mail']); | 722: message($lang_common['Invalid e-mail']); |
702: } | 723: } |
703: | 724: |
| 725: // Make sure we got a valid language string |
| 726: if (isset($form['language'])) |
| 727: { |
| 728: $form['language'] = preg_replace('#[\.\\\/]#', '', $form['language']); |
| 729: if (!file_exists(PUN_ROOT.'lang/'.$form['language'].'/common.php')) |
| 730: message($lang_common['Bad request']); |
| 731: } |
| 732: |
704: break; | 733: break; |
705: } | 734: } |
706: | 735: |
708: { | 737: { |
709: $form = extract_elements(array('realname', 'url', 'location')); | 738: $form = extract_elements(array('realname', 'url', 'location')); |
710: | 739: |
711: if ($pun_user['g_id'] < PUN_GUEST) | 740: if ($pun_user['g_id'] == PUN_ADMIN) |
712: $form['title'] = trim($_POST['title']); | 741: $form['title'] = trim($_POST['title']); |
713: else if ($pun_user['g_set_title'] == '1') | 742: else if ($pun_user['g_set_title'] == '1') |
714: { | 743: { |
726: } | 755: } |
727: | 756: |
728: // Add http:// if the URL doesn't contain it already | 757: // Add http:// if the URL doesn't contain it already |
729: if ($form['url'] != '' && !stristr($form['url'], 'http://')) | 758: if ($form['url'] != '' && strpos(strtolower($form['url']), 'http://') !== 0) |
730: $form['url'] = 'http://'.$form['url']; | 759: $form['url'] = 'http://'.$form['url']; |
731: | 760: |
732: break; | 761: break; |
737: $form = extract_elements(array('jabber', 'icq', 'msn', 'aim', 'yahoo')); | 766: $form = extract_elements(array('jabber', 'icq', 'msn', 'aim', 'yahoo')); |
738: | 767: |
739: // If the ICQ UIN contains anything other than digits it's invalid | 768: // If the ICQ UIN contains anything other than digits it's invalid |
740: if ($form['icq'] != '' && preg_match('/[^0-9]/', $form['icq'])) | 769: if ($form['icq'] != '' && @preg_match('/[^0-9]/', $form['icq'])) |
741: message($lang_prof_reg['Bad ICQ']); | 770: message($lang_prof_reg['Bad ICQ']); |
742: | 771: |
743: break; | 772: break; |
792: { | 821: { |
793: $form = extract_elements(array('email_setting', 'save_pass', 'notify_with_post')); | 822: $form = extract_elements(array('email_setting', 'save_pass', 'notify_with_post')); |
794: | 823: |
795: $form['email_setting'] == intval($form['email_setting']); | 824: $form['email_setting'] = intval($form['email_setting']); |
796: if ($form['email_setting'] < 0 && $form['email_setting'] > 2) $form['email_setting'] = 1; | 825: if ($form['email_setting'] < 0 && $form['email_setting'] > 2) $form['email_setting'] = 1; |
797: | 826: |
798: if (!isset($form['save_pass']) || $form['save_pass'] != '1') $form['save_pass'] = '0'; | 827: if (!isset($form['save_pass']) || $form['save_pass'] != '1') $form['save_pass'] = '0'; |
814: | 843: |
815: | 844: |
816: // Singlequotes around non-empty values and NULL for empty values | 845: // Singlequotes around non-empty values and NULL for empty values |
| 846: $temp = array(); |
817: while (list($key, $input) = @each($form)) | 847: while (list($key, $input) = @each($form)) |
818: { | 848: { |
819: $value = ($input != '') ? '\''.$db->escape($input).'\'' : 'NULL'; | 849: $value = ($input !== '') ? '\''.$db->escape($input).'\'' : 'NULL'; |
820: | 850: |
821: $temp[] = $key.'='.$value; | 851: $temp[] = $key.'='.$value; |
822: } | 852: } |
823: | 853: |
| 854: if (empty($temp)) |
| 855: message($lang_common['Bad request']); |
| 856: |
824: | 857: |
825: $db->query('UPDATE '.$db->prefix.'users SET '.implode(',', $temp).' WHERE id='.$id) or error('Unable to update profile', __FILE__, __LINE__, $db->error()); | 858: $db->query('UPDATE '.$db->prefix.'users SET '.implode(',', $temp).' WHERE id='.$id) or error('Unable to update profile', __FILE__, __LINE__, $db->error()); |
826: | 859: |
861: } | 894: } |
862: | 895: |
863: | 896: |
864: $result = $db->query('SELECT u.username, u.email, u.title, u.realname, u.url, u.jabber, u.icq, u.msn, u.aim, u.yahoo, u.location, u.use_avatar, u.signature, u.disp_topics, u.disp_posts, u.email_setting, u.save_pass, u.notify_with_post, u.show_smilies, u.show_img, u.show_img_sig, u.show_avatars, u.show_sig, u.timezone, u.style, u.num_posts, u.last_post, u.registered, u.registration_ip, 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='.$id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error()); | 897: $result = $db->query('SELECT u.username, u.email, u.title, u.realname, u.url, u.jabber, u.icq, u.msn, u.aim, u.yahoo, u.location, u.use_avatar, u.signature, u.disp_topics, u.disp_posts, u.email_setting, u.save_pass, u.notify_with_post, u.show_smilies, u.show_img, u.show_img_sig, u.show_avatars, u.show_sig, u.timezone, u.language, u.style, u.num_posts, u.last_post, u.registered, u.registration_ip, 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='.$id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error()); |
865: if (!$db->num_rows($result)) | 898: if (!$db->num_rows($result)) |
866: message($lang_common['Bad request']); | 899: message($lang_common['Bad request']); |
867: | 900: |
963: <div class="infldset"> | 996: <div class="infldset"> |
964: <dl> | 997: <dl> |
965: <dt><?php echo $lang_profile['Jabber'] ?>: </dt> | 998: <dt><?php echo $lang_profile['Jabber'] ?>: </dt> |
966: <dd><?php echo ($user['jabber'] !='') ? $user['jabber'] : $lang_profile['Unknown']; ?></dd> | 999: <dd><?php echo ($user['jabber'] !='') ? pun_htmlspecialchars($user['jabber']) : $lang_profile['Unknown']; ?></dd> |
967: <dt><?php echo $lang_profile['ICQ'] ?>: </dt> | 1000: <dt><?php echo $lang_profile['ICQ'] ?>: </dt> |
968: <dd><?php echo ($user['icq'] !='') ? $user['icq'] : $lang_profile['Unknown']; ?></dd> | 1001: <dd><?php echo ($user['icq'] !='') ? $user['icq'] : $lang_profile['Unknown']; ?></dd> |
969: <dt><?php echo $lang_profile['MSN'] ?>: </dt> | 1002: <dt><?php echo $lang_profile['MSN'] ?>: </dt> |
1125: $d = dir(PUN_ROOT.'lang'); | 1158: $d = dir(PUN_ROOT.'lang'); |
1126: while (($entry = $d->read()) !== false) | 1159: while (($entry = $d->read()) !== false) |
1127: { | 1160: { |
1128: if ($entry != '.' && $entry != '..' && is_dir(PUN_ROOT.'lang/'.$entry)) | 1161: if ($entry != '.' && $entry != '..' && is_dir(PUN_ROOT.'lang/'.$entry) && file_exists(PUN_ROOT.'lang/'.$entry.'/common.php')) |
1129: $languages[] = $entry; | 1162: $languages[] = $entry; |
1130: } | 1163: } |
1131: $d->close(); | 1164: $d->close(); |
1133: // Only display the language selection box if there's more than one language available | 1166: // Only display the language selection box if there's more than one language available |
1134: if (count($languages) > 1) | 1167: if (count($languages) > 1) |
1135: { | 1168: { |
| 1169: natsort($languages); |
1136: | 1170: |
1137: ?> | 1171: ?> |
1138: <label><?php echo $lang_prof_reg['Language'] ?>: <?php echo $lang_prof_reg['Language info'] ?> | 1172: <label><?php echo $lang_prof_reg['Language'] ?>: <?php echo $lang_prof_reg['Language info'] ?> |
1141: | 1175: |
1142: while (list(, $temp) = @each($languages)) | 1176: while (list(, $temp) = @each($languages)) |
1143: { | 1177: { |
1144: if ($pun_user['language'] == $temp) | 1178: if ($user['language'] == $temp) |
1145: echo "\t\t\t\t\t\t\t\t".'<option value="'.$temp.'" selected="selected">'.$temp.'</option>'."\n"; | 1179: echo "\t\t\t\t\t\t\t\t".'<option value="'.$temp.'" selected="selected">'.$temp.'</option>'."\n"; |
1146: else | 1180: else |
1147: echo "\t\t\t\t\t\t\t\t".'<option value="'.$temp.'">'.$temp.'</option>'."\n"; | 1181: echo "\t\t\t\t\t\t\t\t".'<option value="'.$temp.'">'.$temp.'</option>'."\n"; |
1179: } | 1213: } |
1180: else if ($section == 'personal') | 1214: else if ($section == 'personal') |
1181: { | 1215: { |
1182: if ($pun_user['g_set_title'] == '1' || $pun_user['g_id'] < PUN_GUEST) | 1216: if ($pun_user['g_set_title'] == '1') |
1183: $title_field = '<label>'.$lang_common['Title'].' (<em>'.$lang_profile['Leave blank'].'</em>)<br /><input type="text" name="title" value="'.pun_htmlspecialchars($user['title']).'" size="30" maxlength="50" /><br /></label>'."\n"; | 1217: $title_field = '<label>'.$lang_common['Title'].' (<em>'.$lang_profile['Leave blank'].'</em>)<br /><input type="text" name="title" value="'.pun_htmlspecialchars($user['title']).'" size="30" maxlength="50" /><br /></label>'."\n"; |
1184: | 1218: |
1185: $page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Profile']; | 1219: $page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Profile']; |
1229: <legend><?php echo $lang_profile['Contact details legend'] ?></legend> | 1263: <legend><?php echo $lang_profile['Contact details legend'] ?></legend> |
1230: <div class="infldset"> | 1264: <div class="infldset"> |
1231: <input type="hidden" name="form_sent" value="1" /> | 1265: <input type="hidden" name="form_sent" value="1" /> |
1232: <label><?php echo $lang_profile['Jabber'] ?><br /><input id="jabber" type="text" name="form[jabber]" value="<?php echo $user['jabber'] ?>" size="40" maxlength="75" /><br /></label> | 1266: <label><?php echo $lang_profile['Jabber'] ?><br /><input id="jabber" type="text" name="form[jabber]" value="<?php echo pun_htmlspecialchars($user['jabber']) ?>" size="40" maxlength="75" /><br /></label> |
1233: <label><?php echo $lang_profile['ICQ'] ?><br /><input id="icq" type="text" name="form[icq]" value="<?php echo $user['icq'] ?>" size="12" maxlength="12" /><br /></label> | 1267: <label><?php echo $lang_profile['ICQ'] ?><br /><input id="icq" type="text" name="form[icq]" value="<?php echo $user['icq'] ?>" size="12" maxlength="12" /><br /></label> |
1234: <label><?php echo $lang_profile['MSN'] ?><br /><input id="msn" type="text" name="form[msn]" value="<?php echo pun_htmlspecialchars($user['msn']) ?>" size="40" maxlength="50" /><br /></label> | 1268: <label><?php echo $lang_profile['MSN'] ?><br /><input id="msn" type="text" name="form[msn]" value="<?php echo pun_htmlspecialchars($user['msn']) ?>" size="40" maxlength="50" /><br /></label> |
1235: <label><?php echo $lang_profile['AOL IM'] ?><br /><input id="aim" type="text" name="form[aim]" value="<?php echo pun_htmlspecialchars($user['aim']) ?>" size="20" maxlength="30" /><br /></label> | 1269: <label><?php echo $lang_profile['AOL IM'] ?><br /><input id="aim" type="text" name="form[aim]" value="<?php echo pun_htmlspecialchars($user['aim']) ?>" size="20" maxlength="30" /><br /></label> |
1286: <div class="rbox"> | 1320: <div class="rbox"> |
1287: <label><input type="checkbox" name="form[use_avatar]" value="1"<?php if ($user['use_avatar'] == '1') echo ' checked="checked"' ?> /><?php echo $lang_profile['Use avatar'] ?><br /></label> | 1321: <label><input type="checkbox" name="form[use_avatar]" value="1"<?php if ($user['use_avatar'] == '1') echo ' checked="checked"' ?> /><?php echo $lang_profile['Use avatar'] ?><br /></label> |
1288: </div> | 1322: </div> |
1289: <p><?php echo $avatar_field ?></p> | 1323: <p class="clearb"><?php echo $avatar_field ?></p> |
1290: </div> | 1324: </div> |
1291: </fieldset> | 1325: </fieldset> |
1292: </div> | 1326: </div> |
1344: echo "\t\t\t".'<div><input type="hidden" name="form[style]" value="'.$styles[0].'" /></div>'."\n"; | 1378: echo "\t\t\t".'<div><input type="hidden" name="form[style]" value="'.$styles[0].'" /></div>'."\n"; |
1345: else if (count($styles) > 1) | 1379: else if (count($styles) > 1) |
1346: { | 1380: { |
| 1381: natsort($styles); |
1347: | 1382: |
1348: ?> | 1383: ?> |
1349: <div class="inform"> | 1384: <div class="inform"> |
1393: <fieldset> | 1428: <fieldset> |
1394: <legend><?php echo $lang_profile['Pagination legend'] ?></legend> | 1429: <legend><?php echo $lang_profile['Pagination legend'] ?></legend> |
1395: <div class="infldset"> | 1430: <div class="infldset"> |
1396: <p><?php echo $lang_profile['Paginate info'] ?> <?php echo $lang_profile['Leave blank'] ?></p> | |
1397: <label class="conl"><?php echo $lang_profile['Topics per page'] ?><br /><input type="text" name="form[disp_topics]" value="<?php echo $user['disp_topics'] ?>" size="6" maxlength="3" /><br /></label> | 1431: <label class="conl"><?php echo $lang_profile['Topics per page'] ?><br /><input type="text" name="form[disp_topics]" value="<?php echo $user['disp_topics'] ?>" size="6" maxlength="3" /><br /></label> |
1398: <label class="conl"><?php echo $lang_profile['Posts per page'] ?><br /><input type="text" name="form[disp_posts]" value="<?php echo $user['disp_posts'] ?>" size="6" maxlength="3" /><br /></label> | 1432: <label class="conl"><?php echo $lang_profile['Posts per page'] ?><br /><input type="text" name="form[disp_posts]" value="<?php echo $user['disp_posts'] ?>" size="6" maxlength="3" /><br /></label> |
1399: <div class="clearer"></div> | 1433: <p class="clearb"><?php echo $lang_profile['Paginate info'] ?> <?php echo $lang_profile['Leave blank'] ?></p> |
1400: </div> | 1434: </div> |
1401: </fieldset> | 1435: </fieldset> |
1402: </div> | 1436: </div> |
1483: } | 1517: } |
1484: else | 1518: else |
1485: { | 1519: { |
| 1520: if ($pun_user['id'] != $id) |
| 1521: { |
1486: | 1522: |
1487: ?> | 1523: ?> |
1488: <legend><?php echo $lang_profile['Group membership legend'] ?></legend> | 1524: <legend><?php echo $lang_profile['Group membership legend'] ?></legend> |
1490: <select id="group_id" name="group_id"> | 1526: <select id="group_id" name="group_id"> |
1491: <?php | 1527: <?php |
1492: | 1528: |
1493: $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()); | 1529: $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()); |
1494: | 1530: |
1495: while ($cur_group = $db->fetch_assoc($result)) | 1531: while ($cur_group = $db->fetch_assoc($result)) |
1496: { | 1532: { |
1497: if ($cur_group['g_id'] == $user['g_id'] || ($cur_group['g_id'] == $pun_config['o_default_user_group'] && $user['g_id'] == '')) | 1533: if ($cur_group['g_id'] == $user['g_id'] || ($cur_group['g_id'] == $pun_config['o_default_user_group'] && $user['g_id'] == '')) |
1498: echo "\t\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'" selected="selected">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n"; | 1534: echo "\t\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'" selected="selected">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n"; |
1499: else | 1535: else |
1500: echo "\t\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n"; | 1536: echo "\t\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n"; |
1501: } | 1537: } |
1502: | 1538: |
1503: ?> | 1539: ?> |
1504: </select> | 1540: </select> |
1508: </div> | 1544: </div> |
1509: <div class="inform"> | 1545: <div class="inform"> |
1510: <fieldset> | 1546: <fieldset> |
| 1547: <?php |
| 1548: |
| 1549: } |
| 1550: |
| 1551: ?> |
1511: <legend><?php echo $lang_profile['Delete ban legend'] ?></legend> | 1552: <legend><?php echo $lang_profile['Delete ban legend'] ?></legend> |
1512: <div class="infldset"> | 1553: <div class="infldset"> |
1513: <input type="submit" name="delete_user" value="<?php echo $lang_profile['Delete user'] ?>" /> <input type="submit" name="ban" value="<?php echo $lang_profile['Ban user'] ?>" /> | 1554: <input type="submit" name="delete_user" value="<?php echo $lang_profile['Delete user'] ?>" /> <input type="submit" name="ban" value="<?php echo $lang_profile['Ban user'] ?>" /> |
1516: </div> | 1557: </div> |
1517: <?php | 1558: <?php |
1518: | 1559: |
1519: if ($user['g_id'] < PUN_GUEST) | 1560: if ($user['g_id'] == PUN_MOD || $user['g_id'] == PUN_ADMIN) |
1520: { | 1561: { |
1521: | 1562: |
1522: ?> | 1563: ?> |
punbb-1.2/upload/search.php |
punbb-1.2.16/upload/search.php |
51: $action = (isset($_GET['action'])) ? $_GET['action'] : null; | 51: $action = (isset($_GET['action'])) ? $_GET['action'] : null; |
52: $forum = (isset($_GET['forum'])) ? intval($_GET['forum']) : -1; | 52: $forum = (isset($_GET['forum'])) ? intval($_GET['forum']) : -1; |
53: $sort_dir = (isset($_GET['sort_dir'])) ? (($_GET['sort_dir'] == 'DESC') ? 'DESC' : 'ASC') : 'DESC'; | 53: $sort_dir = (isset($_GET['sort_dir'])) ? (($_GET['sort_dir'] == 'DESC') ? 'DESC' : 'ASC') : 'DESC'; |
| 54: if (isset($search_id)) unset($search_id); |
54: | 55: |
55: // If a search_id was supplied | 56: // If a search_id was supplied |
56: if (isset($_GET['search_id'])) | 57: if (isset($_GET['search_id'])) |
62: // If it's a regular search (keywords and/or author) | 63: // If it's a regular search (keywords and/or author) |
63: else if ($action == 'search') | 64: else if ($action == 'search') |
64: { | 65: { |
65: $keywords = (isset($_GET['keywords'])) ? trim($_GET['keywords']) : null; | 66: $keywords = (isset($_GET['keywords'])) ? strtolower(trim($_GET['keywords'])) : null; |
66: $author = (isset($_GET['author'])) ? trim($_GET['author']) : null; | 67: $author = (isset($_GET['author'])) ? strtolower(trim($_GET['author'])) : null; |
| 68: |
| 69: if (preg_match('#^[\*%]+$#', $keywords) || strlen(str_replace(array('*', '%'), '', $keywords)) < 3) |
| 70: $keywords = ''; |
| 71: |
| 72: if (preg_match('#^[\*%]+$#', $author) || strlen(str_replace(array('*', '%'), '', $author)) < 3) |
| 73: $author = ''; |
67: | 74: |
68: if (!$keywords && !$author) | 75: if (!$keywords && !$author) |
69: message($lang_search['No terms']); | 76: message($lang_search['No terms']); |
115: $keyword_results = $author_results = array(); | 122: $keyword_results = $author_results = array(); |
116: | 123: |
117: // Search a specific forum? | 124: // Search a specific forum? |
118: $forum_sql = ($forum != -1) ? ' AND t.forum_id = '.$forum : ''; | 125: $forum_sql = ($forum != -1 || ($forum == -1 && $pun_config['o_search_all_forums'] == '0')) ? ' AND t.forum_id = '.$forum : ''; |
119: | 126: |
120: if (!empty($author) || !empty($keywords)) | 127: if (!empty($author) || !empty($keywords)) |
121: { | 128: { |
162: } | 169: } |
163: | 170: |
164: $word_count = 0; | 171: $word_count = 0; |
165: $match_type = 'or'; | 172: $match_type = 'and'; |
| 173: $result_list = array(); |
166: @reset($keywords_array); | 174: @reset($keywords_array); |
167: while (list(, $cur_word) = @each($keywords_array)) | 175: while (list(, $cur_word) = @each($keywords_array)) |
168: { | 176: { |
297: | 305: |
298: $num_hits = count($search_ids); | 306: $num_hits = count($search_ids); |
299: } | 307: } |
300: else if ($forum_sql != '') | 308: else |
301: { | 309: { |
302: $result = $db->query('SELECT p.id 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 IN('.implode(',', $search_ids).')'.$forum_sql, true) or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error()); | 310: $result = $db->query('SELECT p.id 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 IN('.implode(',', $search_ids).')'.$forum_sql, true) or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error()); |
303: | 311: |
318: if ($pun_user['is_guest']) | 326: if ($pun_user['is_guest']) |
319: message($lang_common['No permission']); | 327: message($lang_common['No permission']); |
320: | 328: |
321: $result = $db->query('SELECT t.id 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='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.last_post>'.$pun_user['last_visit']) or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error()); | 329: $result = $db->query('SELECT t.id 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='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.last_post>'.$pun_user['last_visit'].' AND t.moved_to IS NULL') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error()); |
322: $num_hits = $db->num_rows($result); | 330: $num_hits = $db->num_rows($result); |
323: | 331: |
324: if (!$num_hits) | 332: if (!$num_hits) |
327: // If it's a search for todays posts | 335: // If it's a search for todays posts |
328: else if ($action == 'show_24h') | 336: else if ($action == 'show_24h') |
329: { | 337: { |
330: $result = $db->query('SELECT t.id 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='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.last_post>'.(time() - 86400)) or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error()); | 338: $result = $db->query('SELECT t.id 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='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.last_post>'.(time() - 86400).' AND t.moved_to IS NULL') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error()); |
331: $num_hits = $db->num_rows($result); | 339: $num_hits = $db->num_rows($result); |
332: | 340: |
333: if (!$num_hits) | 341: if (!$num_hits) |
380: | 388: |
381: | 389: |
382: // Prune "old" search results | 390: // Prune "old" search results |
| 391: $old_searches = array(); |
383: $result = $db->query('SELECT ident FROM '.$db->prefix.'online') or error('Unable to fetch online list', __FILE__, __LINE__, $db->error()); | 392: $result = $db->query('SELECT ident FROM '.$db->prefix.'online') or error('Unable to fetch online list', __FILE__, __LINE__, $db->error()); |
384: | 393: |
385: if ($db->num_rows($result)) | 394: if ($db->num_rows($result)) |
421: // Fetch results to display | 430: // Fetch results to display |
422: if ($search_results != '') | 431: if ($search_results != '') |
423: { | 432: { |
424: $group_by_sql = ''; | |
425: switch ($sort_by) | 433: switch ($sort_by) |
426: { | 434: { |
427: case 1: | 435: case 1: |
441: break; | 449: break; |
442: | 450: |
443: default: | 451: default: |
444: { | |
445: $sort_by_sql = ($show_as == 'topics') ? 't.posted' : 'p.posted'; | 452: $sort_by_sql = ($show_as == 'topics') ? 't.posted' : 'p.posted'; |
446: | |
447: if ($show_as == 'topics') | |
448: $group_by_sql = ', t.posted'; | |
449: | |
450: break; | 453: break; |
451: } | |
452: } | 454: } |
453: | 455: |
454: if ($show_as == 'posts') | 456: if ($show_as == 'posts') |
457: $sql = 'SELECT p.id AS pid, p.poster AS pposter, p.posted AS pposted, p.poster_id, '.$substr_sql.'(p.message, 1, 1000) AS message, t.id AS tid, t.poster, t.subject, t.last_post, t.last_post_id, t.last_poster, t.num_replies, t.forum_id FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id WHERE p.id IN('.$search_results.') ORDER BY '.$sort_by_sql; | 459: $sql = 'SELECT p.id AS pid, p.poster AS pposter, p.posted AS pposted, p.poster_id, '.$substr_sql.'(p.message, 1, 1000) AS message, t.id AS tid, t.poster, t.subject, t.last_post, t.last_post_id, t.last_poster, t.num_replies, t.forum_id FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id WHERE p.id IN('.$search_results.') ORDER BY '.$sort_by_sql; |
458: } | 460: } |
459: else | 461: else |
460: $sql = 'SELECT t.id AS tid, t.poster, t.subject, t.last_post, t.last_post_id, t.last_poster, t.num_replies, t.closed, t.forum_id FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id WHERE t.id IN('.$search_results.') GROUP BY t.id, t.poster, t.subject, t.last_post, t.last_post_id, t.last_poster, t.num_replies, t.closed, t.forum_id'.$group_by_sql.' ORDER BY '.$sort_by_sql; | 462: $sql = 'SELECT t.id AS tid, t.poster, t.subject, t.last_post, t.last_post_id, t.last_poster, t.num_replies, t.closed, t.forum_id FROM '.$db->prefix.'topics AS t WHERE t.id IN('.$search_results.') ORDER BY '.$sort_by_sql; |
461: | 463: |
462: | 464: |
463: // Determine the topic or post offset (based on $_GET['p']) | 465: // Determine the topic or post offset (based on $_GET['p']) |
506: <div class="box"> | 508: <div class="box"> |
507: <div class="inbox"> | 509: <div class="inbox"> |
508: <table cellspacing="0"> | 510: <table cellspacing="0"> |
509: <colgroup> | |
510: <col class="tcl" /> | |
511: <col class="tc2" /> | |
512: <col class="tc3" /> | |
513: <col class="tcr" /> | |
514: </colgroup> | |
515: <thead> | 511: <thead> |
516: <tr> | 512: <tr> |
517: <th class="tcl" scope="col"><?php echo $lang_common['Topic']; ?></th> | 513: <th class="tcl" scope="col"><?php echo $lang_common['Topic']; ?></th> |
548: | 544: |
549: if ($show_as == 'posts') | 545: if ($show_as == 'posts') |
550: { | 546: { |
551: $icon = '<div class="inormal"><div class="nosize">'.$lang_common['Normal icon'].'</div></div>'."\n"; | 547: $icon = '<div class="icon"><div class="nosize">'.$lang_common['Normal icon'].'</div></div>'."\n"; |
552: $subject = '<a href="viewtopic.php?id='.$search_set[$i]['tid'].'">'.pun_htmlspecialchars($search_set[$i]['subject']).'</a>'; | 548: $subject = '<a href="viewtopic.php?id='.$search_set[$i]['tid'].'">'.pun_htmlspecialchars($search_set[$i]['subject']).'</a>'; |
553: | 549: |
554: if (!$pun_user['is_guest'] && $search_set[$i]['last_post'] > $pun_user['last_visit']) | 550: if (!$pun_user['is_guest'] && $search_set[$i]['last_post'] > $pun_user['last_visit']) |
555: $icon = '<div class="inew"><div class="nosize">'.$lang_common['New icon'].'</div></div>'."\n"; | 551: $icon = '<div class="icon inew"><div class="nosize">'.$lang_common['New icon'].'</div></div>'."\n"; |
556: | 552: |
557: | 553: |
558: if ($pun_config['o_censoring'] == '1') | 554: if ($pun_config['o_censoring'] == '1') |
601: } | 597: } |
602: else | 598: else |
603: { | 599: { |
604: $icon = '<div class="inormal"><div class="nosize">'.$lang_common['Normal icon'].'</div></div>'."\n"; | 600: $icon = '<div class="icon"><div class="nosize">'.$lang_common['Normal icon'].'</div></div>'."\n"; |
| 601: |
| 602: $icon_text = $lang_common['Normal icon']; |
| 603: $item_status = ''; |
| 604: $icon_type = 'icon'; |
605: | 605: |
606: if ($search_set[$i]['closed'] != '1') | 606: |
607: $subject = '<a href="viewtopic.php?id='.$search_set[$i]['tid'].'">'.pun_htmlspecialchars($search_set[$i]['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($search_set[$i]['poster']).'</span>'; | 607: $subject = '<a href="viewtopic.php?id='.$search_set[$i]['tid'].'">'.pun_htmlspecialchars($search_set[$i]['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($search_set[$i]['poster']).'</span>'; |
608: else | 608: |
609: $subject = '<a class="showclosed" href="viewtopic.php?id='.$search_set[$i]['tid'].'">'.pun_htmlspecialchars($search_set[$i]['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($search_set[$i]['poster']).'</span>'; | 609: if ($search_set[$i]['closed'] != '0') |
| 610: { |
| 611: $icon_text = $lang_common['Closed icon']; |
| 612: $item_status = 'iclosed'; |
| 613: } |
610: | 614: |
611: if (!$pun_user['is_guest'] && $search_set[$i]['last_post'] > $pun_user['last_visit']) | 615: if (!$pun_user['is_guest'] && $search_set[$i]['last_post'] > $pun_user['last_visit']) |
612: { | 616: { |
613: $icon = '<div class="inew"><div class="nosize">'.$lang_common['New icon'].'</div></div>'."\n"; | 617: $icon_text .= ' '.$lang_common['New icon']; |
| 618: $item_status .= ' inew'; |
| 619: $icon_type = 'icon inew'; |
614: $subject = '<strong>'.$subject.'</strong>'; | 620: $subject = '<strong>'.$subject.'</strong>'; |
615: $subject_new_posts = '[ <a href="viewtopic.php?id='.$search_set[$i]['tid'].'&action=new" title="'.$lang_common['New posts info'].'">'.$lang_common['New posts'].'</a> ]'; | 621: $subject_new_posts = '<span class="newtext">[ <a href="viewtopic.php?id='.$search_set[$i]['tid'].'&action=new" title="'.$lang_common['New posts info'].'">'.$lang_common['New posts'].'</a> ]</span>'; |
616: } | 622: } |
617: else | 623: else |
618: $subject_new_posts = null; | 624: $subject_new_posts = null; |
632: } | 638: } |
633: | 639: |
634: ?> | 640: ?> |
635: <tr> | 641: <tr<?php if ($item_status != '') echo ' class="'.trim($item_status).'"'; ?>> |
636: <td class="tcl"> | 642: <td class="tcl"> |
637: <div class="intd"> | 643: <div class="intd"> |
638: <?php echo $icon ?> | 644: <div class="<?php echo $icon_type ?>"><div class="nosize"><?php echo trim($icon_text) ?></div></div> |
639: <div class="tclcon"> | 645: <div class="tclcon"> |
640: <?php echo $subject."\n" ?> | 646: <?php echo $subject."\n" ?> |
641: </div> | 647: </div> |
683: <legend><?php echo $lang_search['Search criteria legend'] ?></legend> | 689: <legend><?php echo $lang_search['Search criteria legend'] ?></legend> |
684: <div class="infldset"> | 690: <div class="infldset"> |
685: <input type="hidden" name="action" value="search" /> | 691: <input type="hidden" name="action" value="search" /> |
686: <p><?php echo $lang_search['Search info'] ?></p> | |
687: <label class="conl"><?php echo $lang_search['Keyword search'] ?><br /><input type="text" name="keywords" size="40" maxlength="100" /><br /></label> | 692: <label class="conl"><?php echo $lang_search['Keyword search'] ?><br /><input type="text" name="keywords" size="40" maxlength="100" /><br /></label> |
688: <label class="conl"><?php echo $lang_search['Author search'] ?><br /><input id="author" type="text" name="author" size="25" maxlength="25" /><br /></label> | 693: <label class="conl"><?php echo $lang_search['Author search'] ?><br /><input id="author" type="text" name="author" size="25" maxlength="25" /><br /></label> |
689: <div class="clearer"></div> | 694: <p class="clearb"><?php echo $lang_search['Search info'] ?></p> |
690: </div> | 695: </div> |
691: </fieldset> | 696: </fieldset> |
692: </div> | 697: </div> |
694: <fieldset> | 699: <fieldset> |
695: <legend><?php echo $lang_search['Search in legend'] ?></legend> | 700: <legend><?php echo $lang_search['Search in legend'] ?></legend> |
696: <div class="infldset"> | 701: <div class="infldset"> |
697: <p><?php echo $lang_search['Search in info'] ?></p> | |
698: <label class="conl"><?php echo $lang_search['Forum search'] ?> | 702: <label class="conl"><?php echo $lang_search['Forum search'] ?> |
699: <br /><select id="forum" name="forum"> | 703: <br /><select id="forum" name="forum"> |
700: <?php | 704: <?php |
702: if ($pun_config['o_search_all_forums'] == '1' || $pun_user['g_id'] < PUN_GUEST) | 706: if ($pun_config['o_search_all_forums'] == '1' || $pun_user['g_id'] < PUN_GUEST) |
703: echo "\t\t\t\t\t\t\t".'<option value="-1">'.$lang_search['All forums'].'</option>'."\n"; | 707: echo "\t\t\t\t\t\t\t".'<option value="-1">'.$lang_search['All forums'].'</option>'."\n"; |
704: | 708: |
705: $result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.redirect_url FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['group_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.redirect_url IS NULL ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error()); | 709: $result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.redirect_url FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.redirect_url IS NULL ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error()); |
706: | 710: |
707: $cur_category = 0; | 711: $cur_category = 0; |
708: while ($cur_forum = $db->fetch_assoc($result)) | 712: while ($cur_forum = $db->fetch_assoc($result)) |
730: <option value="topic"><?php echo $lang_search['Topic only'] ?></option> | 734: <option value="topic"><?php echo $lang_search['Topic only'] ?></option> |
731: </select> | 735: </select> |
732: <br /></label> | 736: <br /></label> |
733: <div class="clearer"></div> | 737: <p class="clearb"><?php echo $lang_search['Search in info'] ?></p> |
734: </div> | 738: </div> |
735: </fieldset> | 739: </fieldset> |
736: </div> | 740: </div> |
738: <fieldset> | 742: <fieldset> |
739: <legend><?php echo $lang_search['Search results legend'] ?></legend> | 743: <legend><?php echo $lang_search['Search results legend'] ?></legend> |
740: <div class="infldset"> | 744: <div class="infldset"> |
741: <p><?php echo $lang_search['Search results info'] ?></p> | |
742: <label class="conl"><?php echo $lang_search['Sort by'] ?> | 745: <label class="conl"><?php echo $lang_search['Sort by'] ?> |
743: <br /><select name="sort_by"> | 746: <br /><select name="sort_by"> |
744: <option value="0"><?php echo $lang_search['Sort by post time'] ?></option> | 747: <option value="0"><?php echo $lang_search['Sort by post time'] ?></option> |
759: <option value="posts"><?php echo $lang_search['Show as posts'] ?></option> | 762: <option value="posts"><?php echo $lang_search['Show as posts'] ?></option> |
760: </select> | 763: </select> |
761: <br /></label> | 764: <br /></label> |
762: <div class="clearer"></div> | 765: <p class="clearb"><?php echo $lang_search['Search results info'] ?></p> |
763: </div> | 766: </div> |
764: </fieldset> | 767: </fieldset> |
765: </div> | 768: </div> |
punbb-1.2/upload/style/Cobalt.css |
punbb-1.2.16/upload/style/Cobalt.css |
7: /* Import the colour scheme */ | 7: /* Import the colour scheme */ |
8: @import url(imports/Cobalt_cs.css); | 8: @import url(imports/Cobalt_cs.css); |
9: | 9: |
10: /****************************************************************/ | 10: /****************************************************************/ |
11: /* 2. TEXT SETTINGS */ | 11: /* 2. TEXT SETTINGS */ |
12: /****************************************************************/ | 12: /****************************************************************/ |
13: | 13: |
14: /* 2.1 This sets the default Font Group */ | 14: /* 2.1 This sets the default Font Group */ |
15: | 15: |
16: .pun, .pun INPUT, .pun SELECT, .pun TEXTAREA, .pun OPTGROUP { | 16: .pun, .pun INPUT, .pun SELECT, .pun TEXTAREA, .pun OPTGROUP { |
17: FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif | 17: FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif |
18: } | 18: } |
19: | 19: |
20: .pun {FONT-SIZE: 10px} | 20: .pun {FONT-SIZE: 11px; LINE-HEIGHT: normal} |
21: | 21: |
22: /* IEWin Font Size only - to allow IEWin to zoom. Do not remove comments \*/ | 22: /* IEWin Font Size only - to allow IEWin to zoom. Do not remove comments \*/ |
23: * HTML BODY .pun {FONT-SIZE: 62.5%} | 23: * HTML .pun {FONT-SIZE: 68.75%} |
24: /* End IE Win Font Size */ | 24: /* End IE Win Font Size */ |
25: | 25: |
26: /* Set font size for tables for IE5 */ | 26: /* Set font size for tables because IE requires it */ |
27: * HTML .pun TABLE {FONT-SIZE: 1em} | 27: .pun TABLE, .pun INPUT, .pun SELECT, .pun OPTGROUP, .pun TEXTAREA, DIV.postmsg P.postedit {FONT-SIZE: 1em} |
28: | 28: |
29: /* 2.2 Set the font-size for preformatted text i.e in code boxes */ | 29: /* 2.2 Set the font-size for preformatted text i.e in code boxes */ |
30: | 30: |
31: .pun PRE {FONT-FAMILY: monaco, "Bitstream Vera Sans Mono", "Courier New", courier, monospace} | 31: .pun PRE {FONT-FAMILY: monaco, "Bitstream Vera Sans Mono", "Courier New", courier, monospace} |
32: | 32: |
33: /* 2.3 Font size for board title */ | 33: /* 2.3 Font size for headers */ |
34: | 34: |
35: #brdtitle H1 {FONT-SIZE: 1.5em} | 35: .pun H2, .pun H4 {FONT-SIZE: 1em} |
36: | 36: .pun H3 {FONT-SIZE: 1.1em} |
37: /* 2.4 Larger text for particular items */ | 37: #brdtitle H1 {FONT-SIZE: 1.4em} |
38: | 38: |
39: .pun H2, #viewprofile DL, #brdmenu, DIV.postmsg P, DIV.forminfo P, #puninstall DIV.block P, DIV.postsignature, | 39: /* 2.4 Larger text for particular items */ |
40: DIV.linkst LI, P.postlink, DIV.postmsg H4 {FONT-SIZE: 1.1em} | 40: DIV.postmsg P {LINE-HEIGHT: 1.4} |
41: | 41: DIV.postleft DT {FONT-SIZE: 1.1em} |
42: .pun H3, .pun PRE, DIV.postleft DT {FONT-SIZE: 1.2em} | 42: .pun PRE {FONT-SIZE: 1.2em} |
43: | 43: |
44: /* 2.5 Font sizes for form elements. */ | 44: /* 2.5 Bold text */ |
45: | 45: |
46: .pun TEXTAREA, .pun LEGEND, .pun LABEL, .pun INPUT, .pun SELECT, .pun OPTGROUP {FONT-SIZE: 1.1em} | 46: DIV.postleft DT, DIV.postmsg H4, TD.tcl H3, DIV.forminfo H3, P.postlink, DIV.linkst LI, |
47: .pun LABEL INPUT, .pun LABEL TEXTAREA, .pun LABEL SELECT, .pun LABEL OPTGROUP {font-size: 1em} | 47: DIV.linksb LI, DIV.postlinksb LI, .blockmenu LI, #brdtitle H1, .pun SPAN.warntext, .pun P.warntext {FONT-WEIGHT: bold} |
48: | 48: |
49: /* 2.6 Bold text */ | |
50: | |
51: DIV.postleft DT, DIV.postmsg H4, TD.tcl H3, DIV.forminfo H3, P.postlink, DIV.linkst LI, | |
52: .blockmenu LI, #brdtitle H1 {FONT-WEIGHT: bold} | |
53: | |
54: | |
55: /****************************************************************/ | 49: /****************************************************************/ |
56: /* 3. LINKS */ | 50: /* 3. LINKS */ |
57: /****************************************************************/ | 51: /****************************************************************/ |
58: | 52: |
59: /* 3.1 Remove underlining for main menu, post header links, post links and vertical menus */ | 53: /* 3.1 Remove underlining for main menu, post header links, post links and vertical menus */ |
60: | 54: |
61: #brdmenu A:link, #brdmenu A:visited, | 55: #brdmenu A:link, #brdmenu A:visited, .blockpost DT A:link, .blockpost DT A:visited, .blockpost H2 A:link, |
62: .blockpost DT A:link, .blockpost DT A:visited, .blockpost H2 A:link, .blockpost H2 A:visited, | 56: .blockpost H2 A:visited, .postlink A:link, .postlink A:visited, .postfootright A:link, .postfootright A:visited, |
63: .postlink A:link, .postlink A:visited, .postfootright A:link, .postfootright A:visited, .blockmenu A:link, .blockmenu A:visited | 57: .blockmenu A:link, .blockmenu A:visited { |
64: {TEXT-DECORATION: none} | 58: TEXT-DECORATION: none |
| 59: } |
65: | 60: |
66: /* 3.2 Underline on hover for links in headers and main menu */ | 61: /* 3.2 Underline on hover for links in headers and main menu */ |
67: | 62: |
97: BORDER-STYLE: solid; | 92: BORDER-STYLE: solid; |
98: BORDER-WIDTH: 1px | 93: BORDER-WIDTH: 1px |
99: } | 94: } |
100: | 95: |
101: /****************************************************************/ | 96: /****************************************************************/ |
102: /* 5. VERTICAL AND PAGE SPACING */ | 97: /* 5. VERTICAL AND PAGE SPACING */ |
103: /****************************************************************/ | 98: /****************************************************************/ |
187: } | 182: } |
188: | 183: |
189: P.multidelete { | 184: P.multidelete { |
190: PADDING-TOP: 10px; | 185: PADDING-TOP: 15px; |
191: PADDING-BOTTOM: 5px | 186: PADDING-BOTTOM: 5px |
192: } | 187: } |
193: | 188: |
226: /* 9.5 Horizontal positioning for the submit button on forms */ | 221: /* 9.5 Horizontal positioning for the submit button on forms */ |
227: | 222: |
228: DIV.blockform P INPUT {MARGIN-LEFT: 12px} | 223: DIV.blockform P INPUT {MARGIN-LEFT: 12px} |
229: | 224: |
| 225: /****************************************************************/ |
| 226: /* 10. POST STATUS INDICATORS */ |
| 227: /****************************************************************/ |
| 228: |
| 229: /* 10.1 These are the post status indicators which appear at the left of some tables. |
| 230: .inew = new posts, .iredirect = redirect forums, .iclosed = closed topics and |
| 231: .isticky = sticky topics. By default only .inew is different from the default.*/ |
| 232: |
| 233: DIV.icon { |
| 234: FLOAT: left; |
| 235: MARGIN-TOP: 0.1em; |
| 236: MARGIN-LEFT: 0.2em; |
| 237: DISPLAY: block; |
| 238: BORDER-WIDTH: 0.6em 0.6em 0.6em 0.6em; |
| 239: BORDER-STYLE: solid |
| 240: } |
| 241: |
| 242: DIV.searchposts DIV.icon {MARGIN-LEFT: 0} |
| 243: |
| 244: /* 10.2 Class .tclcon is a div inside the first column of tables with post indicators. The |
| 245: margin creates space for the post status indicator */ |
| 246: |
| 247: TD DIV.tclcon {MARGIN-LEFT: 2.3em} |
| 248: |
| 249: |
230: | 250: |
231: | 251: |
232: | 252: |
punbb-1.2/upload/style/Lithium.css |
punbb-1.2.16/upload/style/Lithium.css |
6: @import url(imports/base.css); | 6: @import url(imports/base.css); |
7: /* Import the colour scheme */ | 7: /* Import the colour scheme */ |
8: @import url(imports/Lithium_cs.css); | 8: @import url(imports/Lithium_cs.css); |
9: | 9: |
10: /****************************************************************/ | 10: /****************************************************************/ |
11: /* 2. TEXT SETTINGS */ | 11: /* 2. TEXT SETTINGS */ |
12: /****************************************************************/ | 12: /****************************************************************/ |
13: | 13: |
14: /* 2.1 This sets the default Font Group */ | 14: /* 2.1 This sets the default Font Group */ |
15: | 15: |
16: .pun, .pun INPUT, .pun SELECT, .pun TEXTAREA, .pun OPTGROUP { | 16: .pun, .pun INPUT, .pun SELECT, .pun TEXTAREA, .pun OPTGROUP { |
17: FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif | 17: FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif |
18: } | 18: } |
19: | 19: |
20: .pun {FONT-SIZE: 10px} | 20: .pun {FONT-SIZE: 11px; LINE-HEIGHT: normal} |
21: | 21: |
22: /* IEWin Font Size only - to allow IEWin to zoom. Do not remove comments \*/ | 22: /* IEWin Font Size only - to allow IEWin to zoom. Do not remove comments \*/ |
23: * HTML BODY .pun {FONT-SIZE: 62.5%} | 23: * HTML .pun {FONT-SIZE: 68.75%} |
24: /* End IE Win Font Size */ | 24: /* End IE Win Font Size */ |
25: | 25: |
26: /* Set font size for tables for IE5 */ | 26: /* Set font size for tables because IE requires it */ |
27: * HTML .pun TABLE {FONT-SIZE: 1em} | 27: .pun TABLE, .pun INPUT, .pun SELECT, .pun OPTGROUP, .pun TEXTAREA, DIV.postmsg P.postedit {FONT-SIZE: 1em} |
28: | 28: |
29: /* 2.2 Set the font-size for preformatted text i.e in code boxes */ | 29: /* 2.2 Set the font-size for preformatted text i.e in code boxes */ |
30: | 30: |
31: .pun PRE {FONT-FAMILY: monaco, "Bitstream Vera Sans Mono", "Courier New", courier, monospace} | 31: .pun PRE {FONT-FAMILY: monaco, "Bitstream Vera Sans Mono", "Courier New", courier, monospace} |
32: | 32: |
33: /* 2.3 Font size for board title */ | 33: /* 2.3 Font size for headers */ |
34: | 34: |
35: #brdtitle H1 {FONT-SIZE: 1.5em} | 35: .pun H2, .pun H4 {FONT-SIZE: 1em} |
36: | 36: .pun H3 {FONT-SIZE: 1.1em} |
37: /* 2.4 Larger text for particular items */ | 37: #brdtitle H1 {FONT-SIZE: 1.4em} |
38: | 38: |
39: .pun H2, #viewprofile DL, #brdmenu, DIV.postmsg P, DIV.forminfo P, #puninstall DIV.block P, DIV.postsignature, | 39: /* 2.4 Larger text for particular items */ |
40: DIV.linkst LI, P.postlink, DIV.postmsg H4 {FONT-SIZE: 1.1em} | 40: DIV.postmsg P {LINE-HEIGHT: 1.4} |
41: | 41: DIV.postleft DT {FONT-SIZE: 1.1em} |
42: .pun H3, .pun PRE, DIV.postleft DT {FONT-SIZE: 1.2em} | 42: .pun PRE {FONT-SIZE: 1.2em} |
43: | 43: |
44: /* 2.5 Font sizes for form elements. */ | 44: /* 2.5 Bold text */ |
45: | 45: |
46: .pun TEXTAREA, .pun LEGEND, .pun LABEL, .pun INPUT, .pun SELECT, .pun OPTGROUP {FONT-SIZE: 1.1em} | 46: DIV.postleft DT, DIV.postmsg H4, TD.tcl H3, DIV.forminfo H3, P.postlink, DIV.linkst LI, |
47: .pun LABEL INPUT, .pun LABEL TEXTAREA, .pun LABEL SELECT, .pun LABEL OPTGROUP {font-size: 1em} | 47: DIV.linksb LI, DIV.postlinksb LI, .blockmenu LI, #brdtitle H1, .pun SPAN.warntext, .pun P.warntext {FONT-WEIGHT: bold} |
48: | |
49: /* 2.6 Bold text */ | |
50: | |
51: DIV.postleft DT, DIV.postmsg H4, TD.tcl H3, DIV.forminfo H3, P.postlink, DIV.linkst LI, | |
52: .blockmenu LI, #brdtitle H1 {FONT-WEIGHT: bold} | |
53: | |
54: | 48: |
55: /****************************************************************/ | 49: /****************************************************************/ |
56: /* 3. LINKS */ | 50: /* 3. LINKS */ |
58: | 52: |
59: /* 3.1 Remove underlining for main menu, post header links, post links and vertical menus */ | 53: /* 3.1 Remove underlining for main menu, post header links, post links and vertical menus */ |
60: | 54: |
61: #brdmenu A:link, #brdmenu A:visited, | 55: #brdmenu A:link, #brdmenu A:visited, .blockpost DT A:link, .blockpost DT A:visited, .blockpost H2 A:link, |
62: .blockpost DT A:link, .blockpost DT A:visited, .blockpost H2 A:link, .blockpost H2 A:visited, | 56: .blockpost H2 A:visited, .postlink A:link, .postlink A:visited, .postfootright A:link, .postfootright A:visited, |
63: .postlink A:link, .postlink A:visited, .postfootright A:link, .postfootright A:visited, .blockmenu A:link, .blockmenu A:visited | 57: .blockmenu A:link, .blockmenu A:visited { |
64: {TEXT-DECORATION: none} | 58: TEXT-DECORATION: none |
| 59: } |
65: | 60: |
66: /* 3.2 Underline on hover for links in headers and main menu */ | 61: /* 3.2 Underline on hover for links in headers and main menu */ |
67: | 62: |
97: BORDER-STYLE: solid; | 92: BORDER-STYLE: solid; |
98: BORDER-WIDTH: 1px | 93: BORDER-WIDTH: 1px |
99: } | 94: } |
100: | 95: |
101: /****************************************************************/ | 96: /****************************************************************/ |
102: /* 5. VERTICAL AND PAGE SPACING */ | 97: /* 5. VERTICAL AND PAGE SPACING */ |
103: /****************************************************************/ | 98: /****************************************************************/ |
187: } | 182: } |
188: | 183: |
189: P.multidelete { | 184: P.multidelete { |
190: PADDING-TOP: 10px; | 185: PADDING-TOP: 15px; |
191: PADDING-BOTTOM: 5px | 186: PADDING-BOTTOM: 5px |
192: } | 187: } |
193: | 188: |
226: /* 9.5 Horizontal positioning for the submit button on forms */ | 221: /* 9.5 Horizontal positioning for the submit button on forms */ |
227: | 222: |
228: DIV.blockform P INPUT {MARGIN-LEFT: 12px} | 223: DIV.blockform P INPUT {MARGIN-LEFT: 12px} |
229: | 224: |
| 225: /****************************************************************/ |
| 226: /* 10. POST STATUS INDICATORS */ |
| 227: /****************************************************************/ |
| 228: |
| 229: /* 10.1 These are the post status indicators which appear at the left of some tables. |
| 230: .inew = new posts, .iredirect = redirect forums, .iclosed = closed topics and |
| 231: .isticky = sticky topics. By default only .inew is different from the default.*/ |
| 232: |
| 233: DIV.icon { |
| 234: FLOAT: left; |
| 235: MARGIN-TOP: 0.1em; |
| 236: MARGIN-LEFT: 0.2em; |
| 237: DISPLAY: block; |
| 238: BORDER-WIDTH: 0.6em 0.6em 0.6em 0.6em; |
| 239: BORDER-STYLE: solid |
| 240: } |
| 241: |
| 242: DIV.searchposts DIV.icon {MARGIN-LEFT: 0} |
| 243: |
| 244: /* 10.2 Class .tclcon is a div inside the first column of tables with post indicators. The |
| 245: margin creates space for the post status indicator */ |
| 246: |
| 247: TD DIV.tclcon {MARGIN-LEFT: 2.3em} |
| 248: |
| 249: |
230: | 250: |
231: | 251: |
232: | 252: |
punbb-1.2/upload/style/Mercury.css |
punbb-1.2.16/upload/style/Mercury.css |
7: /* Import the colour scheme */ | 7: /* Import the colour scheme */ |
8: @import url(imports/Mercury_cs.css); | 8: @import url(imports/Mercury_cs.css); |
9: | 9: |
10: /****************************************************************/ | 10: /****************************************************************/ |
11: /* 2. TEXT SETTINGS */ | 11: /* 2. TEXT SETTINGS */ |
12: /****************************************************************/ | 12: /****************************************************************/ |
13: | 13: |
14: /* 2.1 This sets the default Font Group */ | 14: /* 2.1 This sets the default Font Group */ |
15: | 15: |
16: .pun, .pun INPUT, .pun SELECT, .pun TEXTAREA, .pun OPTGROUP { | 16: .pun, .pun INPUT, .pun SELECT, .pun TEXTAREA, .pun OPTGROUP { |
17: FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif | 17: FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif |
18: } | 18: } |
19: | 19: |
20: .pun {FONT-SIZE: 10px} | 20: .pun {FONT-SIZE: 11px; LINE-HEIGHT: normal} |
21: | 21: |
22: /* IEWin Font Size only - to allow IEWin to zoom. Do not remove comments \*/ | 22: /* IEWin Font Size only - to allow IEWin to zoom. Do not remove comments \*/ |
23: * HTML BODY .pun {FONT-SIZE: 62.5%} | 23: * HTML .pun {FONT-SIZE: 68.75%} |
24: /* End IE Win Font Size */ | 24: /* End IE Win Font Size */ |
25: | 25: |
26: /* Set font size for tables for IE5 */ | 26: /* Set font size for tables because IE requires it */ |
27: * HTML .pun TABLE {FONT-SIZE: 1em} | 27: .pun TABLE, .pun INPUT, .pun SELECT, .pun OPTGROUP, .pun TEXTAREA, DIV.postmsg P.postedit {FONT-SIZE: 1em} |
28: | 28: |
29: /* 2.2 Set the font-size for preformatted text i.e in code boxes */ | 29: /* 2.2 Set the font-size for preformatted text i.e in code boxes */ |
30: | 30: |
31: .pun PRE {FONT-FAMILY: monaco, "Bitstream Vera Sans Mono", "Courier New", courier, monospace} | 31: .pun PRE {FONT-FAMILY: monaco, "Bitstream Vera Sans Mono", "Courier New", courier, monospace} |
32: | 32: |
33: /* 2.3 Font size for board title */ | 33: /* 2.3 Font size for headers */ |
34: | 34: |
35: #brdtitle H1 {FONT-SIZE: 1.5em} | 35: .pun H2, .pun H4 {FONT-SIZE: 1em} |
36: | 36: .pun H3 {FONT-SIZE: 1.1em} |
37: /* 2.4 Larger text for particular items */ | 37: #brdtitle H1 {FONT-SIZE: 1.4em} |
38: | 38: |
39: .pun H2, #viewprofile DL, #brdmenu, DIV.postmsg P, DIV.forminfo P, #puninstall DIV.block P, DIV.postsignature, | 39: /* 2.4 Larger text for particular items */ |
40: DIV.linkst LI, P.postlink, DIV.postmsg H4 {FONT-SIZE: 1.1em} | 40: DIV.postmsg P {LINE-HEIGHT: 1.4} |
41: | 41: DIV.postleft DT {FONT-SIZE: 1.1em} |
42: .pun H3, .pun PRE, DIV.postleft DT {FONT-SIZE: 1.2em} | 42: .pun PRE {FONT-SIZE: 1.2em} |
43: | 43: |
44: /* 2.5 Font sizes for form elements. */ | 44: /* 2.5 Bold text */ |
45: | 45: |
46: .pun TEXTAREA, .pun LEGEND, .pun LABEL, .pun INPUT, .pun SELECT, .pun OPTGROUP {FONT-SIZE: 1.1em} | 46: DIV.postleft DT, DIV.postmsg H4, TD.tcl H3, DIV.forminfo H3, P.postlink, DIV.linkst LI, |
47: .pun LABEL INPUT, .pun LABEL TEXTAREA, .pun LABEL SELECT, .pun LABEL OPTGROUP {font-size: 1em} | 47: DIV.linksb LI, DIV.postlinksb LI, .blockmenu LI, #brdtitle H1, .pun SPAN.warntext, .pun P.warntext {FONT-WEIGHT: bold} |
48: | 48: |
49: /* 2.6 Bold text */ | |
50: | |
51: DIV.postleft DT, DIV.postmsg H4, TD.tcl H3, DIV.forminfo H3, P.postlink, DIV.linkst LI, | |
52: .blockmenu LI, #brdtitle H1 {FONT-WEIGHT: bold} | |
53: | |
54: | |
55: /****************************************************************/ | 49: /****************************************************************/ |
56: /* 3. LINKS */ | 50: /* 3. LINKS */ |
57: /****************************************************************/ | 51: /****************************************************************/ |
58: | 52: |
59: /* 3.1 Remove underlining for main menu, post header links, post links and vertical menus */ | 53: /* 3.1 Remove underlining for main menu, post header links, post links and vertical menus */ |
60: | 54: |
61: #brdmenu A:link, #brdmenu A:visited, | 55: #brdmenu A:link, #brdmenu A:visited, .blockpost DT A:link, .blockpost DT A:visited, .blockpost H2 A:link, |
62: .blockpost DT A:link, .blockpost DT A:visited, .blockpost H2 A:link, .blockpost H2 A:visited, | 56: .blockpost H2 A:visited, .postlink A:link, .postlink A:visited, .postfootright A:link, .postfootright A:visited, |
63: .postlink A:link, .postlink A:visited, .postfootright A:link, .postfootright A:visited, .blockmenu A:link, .blockmenu A:visited | 57: .blockmenu A:link, .blockmenu A:visited { |
64: {TEXT-DECORATION: none} | 58: TEXT-DECORATION: none |
| 59: } |
65: | 60: |
66: /* 3.2 Underline on hover for links in headers and main menu */ | 61: /* 3.2 Underline on hover for links in headers and main menu */ |
67: | 62: |
97: BORDER-STYLE: solid; | 92: BORDER-STYLE: solid; |
98: BORDER-WIDTH: 1px | 93: BORDER-WIDTH: 1px |
99: } | 94: } |
100: | 95: |
101: /****************************************************************/ | 96: /****************************************************************/ |
102: /* 5. VERTICAL AND PAGE SPACING */ | 97: /* 5. VERTICAL AND PAGE SPACING */ |
103: /****************************************************************/ | 98: /****************************************************************/ |
187: } | 182: } |
188: | 183: |
189: P.multidelete { | 184: P.multidelete { |
190: PADDING-TOP: 10px; | 185: PADDING-TOP: 15px; |
191: PADDING-BOTTOM: 5px | 186: PADDING-BOTTOM: 5px |
192: } | 187: } |
193: | 188: |
226: /* 9.5 Horizontal positioning for the submit button on forms */ | 221: /* 9.5 Horizontal positioning for the submit button on forms */ |
227: | 222: |
228: DIV.blockform P INPUT {MARGIN-LEFT: 12px} | 223: DIV.blockform P INPUT {MARGIN-LEFT: 12px} |
229: | 224: |
| 225: /****************************************************************/ |
| 226: /* 10. POST STATUS INDICATORS */ |
| 227: /****************************************************************/ |
| 228: |
| 229: /* 10.1 These are the post status indicators which appear at the left of some tables. |
| 230: .inew = new posts, .iredirect = redirect forums, .iclosed = closed topics and |
| 231: .isticky = sticky topics. By default only .inew is different from the default.*/ |
| 232: |
| 233: DIV.icon { |
| 234: FLOAT: left; |
| 235: MARGIN-TOP: 0.1em; |
| 236: MARGIN-LEFT: 0.2em; |
| 237: DISPLAY: block; |
| 238: BORDER-WIDTH: 0.6em 0.6em 0.6em 0.6em; |
| 239: BORDER-STYLE: solid |
| 240: } |
| 241: |
| 242: DIV.searchposts DIV.icon {MARGIN-LEFT: 0} |
| 243: |
| 244: /* 10.2 Class .tclcon is a div inside the first column of tables with post indicators. The |
| 245: margin creates space for the post status indicator */ |
| 246: |
| 247: TD DIV.tclcon {MARGIN-LEFT: 2.3em} |
| 248: |
| 249: |
230: | 250: |
231: | 251: |
232: | 252: |
punbb-1.2/upload/style/Oxygen.css |
punbb-1.2.16/upload/style/Oxygen.css |
17: FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif | 17: FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif |
18: } | 18: } |
19: | 19: |
20: .pun {FONT-SIZE: 10px} | 20: .pun {FONT-SIZE: 11px; LINE-HEIGHT: normal} |
21: | 21: |
22: /* IEWin Font Size only - to allow IEWin to zoom. Do not remove comments \*/ | 22: /* IEWin Font Size only - to allow IEWin to zoom. Do not remove comments \*/ |
23: * HTML BODY .pun {FONT-SIZE: 62.5%} | 23: * HTML .pun {FONT-SIZE: 68.75%} |
24: /* End IE Win Font Size */ | 24: /* End IE Win Font Size */ |
25: | 25: |
26: /* Set font size for tables for IE5 */ | 26: /* Set font size for tables because IE requires it */ |
27: * HTML .pun TABLE {FONT-SIZE: 1em} | 27: .pun TABLE, .pun INPUT, .pun SELECT, .pun OPTGROUP, .pun TEXTAREA, DIV.postmsg P.postedit {FONT-SIZE: 1em} |
28: | 28: |
29: /* 2.2 Set the font-size for preformatted text i.e in code boxes */ | 29: /* 2.2 Set the font-size for preformatted text i.e in code boxes */ |
30: | 30: |
31: .pun PRE {FONT-FAMILY: monaco, "Bitstream Vera Sans Mono", "Courier New", courier, monospace} | 31: .pun PRE {FONT-FAMILY: monaco, "Bitstream Vera Sans Mono", "Courier New", courier, monospace} |
32: | 32: |
33: /* 2.3 Font size for board title */ | 33: /* 2.3 Font size for headers */ |
34: | 34: |
35: #brdtitle H1 {FONT-SIZE: 1.5em} | 35: .pun H2, .pun H4 {FONT-SIZE: 1em} |
| 36: .pun H3 {FONT-SIZE: 1.1em} |
| 37: #brdtitle H1 {FONT-SIZE: 1.4em} |
36: | 38: |
37: /* 2.4 Larger text for particular items */ | 39: /* 2.4 Larger text for particular items */ |
| 40:
DIV.postmsg P {LINE-HEIGHT: 1.4} |
| 41: DIV.postleft DT {FONT-SIZE: 1.1em} |
| 42: .pun PRE {FONT-SIZE: 1.2em} |
38: | 43: |
39: .pun H2, #viewprofile DL, #brdmenu, DIV.postmsg P, DIV.forminfo P, #puninstall DIV.block P, DIV.postsignature, | 44: /* 2.5 Bold text */ |
40: DIV.linkst LI, P.postlink, DIV.postmsg H4 {FONT-SIZE: 1.1em} | |
41: | |
42: .pun H3, .pun PRE, DIV.postleft DT {FONT-SIZE: 1.2em} | |
43: | |
44: /* 2.5 Font sizes for form elements. */ | |
45: | |
46: .pun TEXTAREA, .pun LEGEND, .pun LABEL, .pun INPUT, .pun SELECT, .pun OPTGROUP {FONT-SIZE: 1.1em} | |
47: .pun LABEL INPUT, .pun LABEL TEXTAREA, .pun LABEL SELECT, .pun LABEL OPTGROUP {font-size: 1em} | |
48: | |
49: /* 2.6 Bold text */ | |
50: | |
51: DIV.postleft DT, DIV.postmsg H4, TD.tcl H3, DIV.forminfo H3, P.postlink, DIV.linkst LI, | |
52: .blockmenu LI, #brdtitle H1 {FONT-WEIGHT: bold} | |
53: | 45: |
| 46: DIV.postleft DT, DIV.postmsg H4, TD.tcl H3, DIV.forminfo H3, P.postlink, DIV.linkst LI, |
| 47: DIV.linksb LI, DIV.postlinksb LI, .blockmenu LI, #brdtitle H1, .pun SPAN.warntext, .pun P.warntext {FONT-WEIGHT: bold} |
54: | 48: |
55: /****************************************************************/ | 49: /****************************************************************/ |
56: /* 3. LINKS */ | 50: /* 3. LINKS */ |
58: | 52: |
59: /* 3.1 Remove underlining for main menu, post header links, post links and vertical menus */ | 53: /* 3.1 Remove underlining for main menu, post header links, post links and vertical menus */ |
60: | 54: |
61: #brdmenu A:link, #brdmenu A:visited, | 55: #brdmenu A:link, #brdmenu A:visited, .blockpost DT A:link, .blockpost DT A:visited, .blockpost H2 A:link, |
62: .blockpost DT A:link, .blockpost DT A:visited, .blockpost H2 A:link, .blockpost H2 A:visited, | 56: .blockpost H2 A:visited, .postlink A:link, .postlink A:visited, .postfootright A:link, .postfootright A:visited, |
63: .postlink A:link, .postlink A:visited, .postfootright A:link, .postfootright A:visited, .blockmenu A:link, .blockmenu A:visited | 57: .blockmenu A:link, .blockmenu A:visited { |
64: {TEXT-DECORATION: none} | 58: TEXT-DECORATION: none |
| 59: } |
65: | 60: |
66: /* 3.2 Underline on hover for links in headers and main menu */ | 61: /* 3.2 Underline on hover for links in headers and main menu */ |
67: | 62: |
97: BORDER-STYLE: solid; | 92: BORDER-STYLE: solid; |
98: BORDER-WIDTH: 1px | 93: BORDER-WIDTH: 1px |
99: } | 94: } |
100: | 95: |
101: /****************************************************************/ | 96: /****************************************************************/ |
102: /* 5. VERTICAL AND PAGE SPACING */ | 97: /* 5. VERTICAL AND PAGE SPACING */ |
103: /****************************************************************/ | 98: /****************************************************************/ |
226: /* 9.5 Horizontal positioning for the submit button on forms */ | 221: /* 9.5 Horizontal positioning for the submit button on forms */ |
227: | 222: |
228: DIV.blockform P INPUT {MARGIN-LEFT: 12px} | 223: DIV.blockform P INPUT {MARGIN-LEFT: 12px} |
229: | 224: |
| 225: /****************************************************************/ |
| 226: /* 10. POST STATUS INDICATORS */ |
| 227: /****************************************************************/ |
| 228: |
| 229: /* 10.1 These are the post status indicators which appear at the left of some tables. |
| 230: .inew = new posts, .iredirect = redirect forums, .iclosed = closed topics and |
| 231: .isticky = sticky topics. By default only .inew is different from the default.*/ |
| 232: |
| 233: DIV.icon { |
| 234: FLOAT: left; |
| 235: MARGIN-TOP: 0.1em; |
| 236: MARGIN-LEFT: 0.2em; |
| 237: DISPLAY: block; |
| 238: BORDER-WIDTH: 0.6em 0.6em 0.6em 0.6em; |
| 239: BORDER-STYLE: solid |
| 240: } |
| 241: |
| 242: DIV.searchposts DIV.icon {MARGIN-LEFT: 0} |
| 243: |
| 244: /* 10.2 Class .tclcon is a div inside the first column of tables with post indicators. The |
| 245: margin creates space for the post status indicator */ |
| 246: |
| 247: TD DIV.tclcon {MARGIN-LEFT: 2.3em} |
| 248: |
| 249: |
230: | 250: |
231: | 251: |
232: | 252: |
punbb-1.2/upload/style/Radium.css |
punbb-1.2.16/upload/style/Radium.css |
7: /* Import the colour scheme */ | 7: /* Import the colour scheme */ |
8: @import url(imports/Radium_cs.css); | 8: @import url(imports/Radium_cs.css); |
9: | 9: |
10: /****************************************************************/ | 10: /****************************************************************/ |
11: /* 2. TEXT SETTINGS */ | 11: /* 2. TEXT SETTINGS */ |
12: /****************************************************************/ | 12: /****************************************************************/ |
13: | 13: |
14: /* 2.1 This sets the default Font Group */ | 14: /* 2.1 This sets the default Font Group */ |
15: | 15: |
16: .pun, .pun INPUT, .pun SELECT, .pun TEXTAREA, .pun OPTGROUP { | 16: .pun, .pun INPUT, .pun SELECT, .pun TEXTAREA, .pun OPTGROUP { |
17: FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif | 17: FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif |
18: } | 18: } |
19: | 19: |
20: .pun {FONT-SIZE: 10px} | 20: .pun {FONT-SIZE: 11px; LINE-HEIGHT: normal} |
21: | 21: |
22: /* IEWin Font Size only - to allow IEWin to zoom. Do not remove comments \*/ | 22: /* IEWin Font Size only - to allow IEWin to zoom. Do not remove comments \*/ |
23: * HTML BODY .pun {FONT-SIZE: 62.5%} | 23: * HTML .pun {FONT-SIZE: 68.75%} |
24: /* End IE Win Font Size */ | 24: /* End IE Win Font Size */ |
25: | 25: |
26: /* Set font size for tables for IE5 */ | 26: /* Set font size for tables because IE requires it */ |
27: * HTML .pun TABLE {FONT-SIZE: 1em} | 27: .pun TABLE, .pun INPUT, .pun SELECT, .pun OPTGROUP, .pun TEXTAREA, DIV.postmsg P.postedit {FONT-SIZE: 1em} |
28: | 28: |
29: /* 2.2 Set the font-size for preformatted text i.e in code boxes */ | 29: /* 2.2 Set the font-size for preformatted text i.e in code boxes */ |
30: | 30: |
31: .pun PRE {FONT-FAMILY: monaco, "Bitstream Vera Sans Mono", "Courier New", courier, monospace} | 31: .pun PRE {FONT-FAMILY: monaco, "Bitstream Vera Sans Mono", "Courier New", courier, monospace} |
32: | 32: |
33: /* 2.3 Font size for board title */ | 33: /* 2.3 Font size for headers */ |
34: | 34: |
35: #brdtitle H1 {FONT-SIZE: 1.5em} | 35: .pun H2, .pun H4 {FONT-SIZE: 1em} |
36: | 36: .pun H3 {FONT-SIZE: 1.1em} |
37: /* 2.4 Larger text for particular items */ | 37: #brdtitle H1 {FONT-SIZE: 1.4em} |
38: | 38: |
39: .pun H2, #viewprofile DL, #brdmenu, DIV.postmsg P, DIV.forminfo P, #puninstall DIV.block P, DIV.postsignature, | 39: /* 2.4 Larger text for particular items */ |
40: DIV.linkst LI, P.postlink, DIV.postmsg H4 {FONT-SIZE: 1.1em} | 40: DIV.postmsg P {LINE-HEIGHT: 1.4} |
41: | 41: DIV.postleft DT {FONT-SIZE: 1.1em} |
42: .pun H3, .pun PRE, DIV.postleft DT {FONT-SIZE: 1.2em} | 42: .pun PRE {FONT-SIZE: 1.2em} |
43: | 43: |
44: /* 2.5 Font sizes for form elements. */ | 44: /* 2.5 Bold text */ |
45: | 45: |
46: .pun TEXTAREA, .pun LEGEND, .pun LABEL, .pun INPUT, .pun SELECT, .pun OPTGROUP {FONT-SIZE: 1.1em} | 46: DIV.postleft DT, DIV.postmsg H4, TD.tcl H3, DIV.forminfo H3, P.postlink, DIV.linkst LI, |
47: .pun LABEL INPUT, .pun LABEL TEXTAREA, .pun LABEL SELECT, .pun LABEL OPTGROUP {font-size: 1em} | 47: DIV.linksb LI, DIV.postlinksb LI, .blockmenu LI, #brdtitle H1, .pun SPAN.warntext, .pun P.warntext {FONT-WEIGHT: bold} |
48: | 48: |
49: /* 2.6 Bold text */ | |
50: | |
51: DIV.postleft DT, DIV.postmsg H4, TD.tcl H3, DIV.forminfo H3, P.postlink, DIV.linkst LI, | |
52: .blockmenu LI, #brdtitle H1 {FONT-WEIGHT: bold} | |
53: | |
54: | |
55: /****************************************************************/ | 49: /****************************************************************/ |
56: /* 3. LINKS */ | 50: /* 3. LINKS */ |
57: /****************************************************************/ | 51: /****************************************************************/ |
58: | 52: |
59: /* 3.1 Remove underlining for main menu, post header links, post links and vertical menus */ | 53: /* 3.1 Remove underlining for main menu, post header links, post links and vertical menus */ |
60: | 54: |
61: #brdmenu A:link, #brdmenu A:visited, | 55: #brdmenu A:link, #brdmenu A:visited, .blockpost DT A:link, .blockpost DT A:visited, .blockpost H2 A:link, |
62: .blockpost DT A:link, .blockpost DT A:visited, .blockpost H2 A:link, .blockpost H2 A:visited, | 56: .blockpost H2 A:visited, .postlink A:link, .postlink A:visited, .postfootright A:link, .postfootright A:visited, |
63: .postlink A:link, .postlink A:visited, .postfootright A:link, .postfootright A:visited, .blockmenu A:link, .blockmenu A:visited | 57: .blockmenu A:link, .blockmenu A:visited { |
64: {TEXT-DECORATION: none} | 58: TEXT-DECORATION: none |
| 59: } |
65: | 60: |
66: /* 3.2 Underline on hover for links in headers and main menu */ | 61: /* 3.2 Underline on hover for links in headers and main menu */ |
67: | 62: |
97: BORDER-STYLE: solid; | 92: BORDER-STYLE: solid; |
98: BORDER-WIDTH: 1px | 93: BORDER-WIDTH: 1px |
99: } | 94: } |
100: | 95: |
101: /****************************************************************/ | 96: /****************************************************************/ |
102: /* 5. VERTICAL AND PAGE SPACING */ | 97: /* 5. VERTICAL AND PAGE SPACING */ |
103: /****************************************************************/ | 98: /****************************************************************/ |
187: } | 182: } |
188: | 183: |
189: P.multidelete { | 184: P.multidelete { |
190: PADDING-TOP: 10px; | 185: PADDING-TOP: 15px; |
191: PADDING-BOTTOM: 5px | 186: PADDING-BOTTOM: 5px |
192: } | 187: } |
193: | 188: |
226: /* 9.5 Horizontal positioning for the submit button on forms */ | 221: /* 9.5 Horizontal positioning for the submit button on forms */ |
227: | 222: |
228: DIV.blockform P INPUT {MARGIN-LEFT: 12px} | 223: DIV.blockform P INPUT {MARGIN-LEFT: 12px} |
229: | 224: |
| 225: /****************************************************************/ |
| 226: /* 10. POST STATUS INDICATORS */ |
| 227: /****************************************************************/ |
| 228: |
| 229: /* 10.1 These are the post status indicators which appear at the left of some tables. |
| 230: .inew = new posts, .iredirect = redirect forums, .iclosed = closed topics and |
| 231: .isticky = sticky topics. By default only .inew is different from the default.*/ |
| 232: |
| 233: DIV.icon { |
| 234: FLOAT: left; |
| 235: MARGIN-TOP: 0.1em; |
| 236: MARGIN-LEFT: 0.2em; |
| 237: DISPLAY: block; |
| 238: BORDER-WIDTH: 0.6em 0.6em 0.6em 0.6em; |
| 239: BORDER-STYLE: solid |
| 240: } |
| 241: |
| 242: DIV.searchposts DIV.icon {MARGIN-LEFT: 0} |
| 243: |
| 244: /* 10.2 Class .tclcon is a div inside the first column of tables with post indicators. The |
| 245: margin creates space for the post status indicator */ |
| 246: |
| 247: TD DIV.tclcon {MARGIN-LEFT: 2.3em} |
| 248: |
| 249: |
230: | 250: |
231: | 251: |
232: | 252: |
punbb-1.2/upload/style/Sulfur.css |
punbb-1.2.16/upload/style/Sulfur.css |
7: /* Import the colour scheme */ | 7: /* Import the colour scheme */ |
8: @import url(imports/Sulfur_cs.css); | 8: @import url(imports/Sulfur_cs.css); |
9: | 9: |
10: /****************************************************************/ | 10: /****************************************************************/ |
11: /* 2. TEXT SETTINGS */ | 11: /* 2. TEXT SETTINGS */ |
12: /****************************************************************/ | 12: /****************************************************************/ |
13: | 13: |
14: /* 2.1 This sets the default Font Group */ | 14: /* 2.1 This sets the default Font Group */ |
15: | 15: |
16: .pun, .pun INPUT, .pun SELECT, .pun TEXTAREA, .pun OPTGROUP { | 16: .pun, .pun INPUT, .pun SELECT, .pun TEXTAREA, .pun OPTGROUP { |
17: FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif | 17: FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif |
18: } | 18: } |
19: | 19: |
20: .pun {FONT-SIZE: 10px} | 20: .pun {FONT-SIZE: 11px; LINE-HEIGHT: normal} |
21: | 21: |
22: /* IEWin Font Size only - to allow IEWin to zoom. Do not remove comments \*/ | 22: /* IEWin Font Size only - to allow IEWin to zoom. Do not remove comments \*/ |
23: * HTML BODY .pun {FONT-SIZE: 62.5%} | 23: * HTML .pun {FONT-SIZE: 68.75%} |
24: /* End IE Win Font Size */ | 24: /* End IE Win Font Size */ |
25: | 25: |
26: /* Set font size for tables for IE5 */ | 26: /* Set font size for tables because IE requires it */ |
27: * HTML .pun TABLE {FONT-SIZE: 1em} | 27: .pun TABLE, .pun INPUT, .pun SELECT, .pun OPTGROUP, .pun TEXTAREA, DIV.postmsg P.postedit {FONT-SIZE: 1em} |
28: | 28: |
29: /* 2.2 Set the font-size for preformatted text i.e in code boxes */ | 29: /* 2.2 Set the font-size for preformatted text i.e in code boxes */ |
30: | 30: |
31: .pun PRE {FONT-FAMILY: monaco, "Bitstream Vera Sans Mono", "Courier New", courier, monospace} | 31: .pun PRE {FONT-FAMILY: monaco, "Bitstream Vera Sans Mono", "Courier New", courier, monospace} |
32: | 32: |
33: /* 2.3 Font size for board title */ | 33: /* 2.3 Font size for headers */ |
34: | 34: |
35: #brdtitle H1 {FONT-SIZE: 1.5em} | 35: .pun H2, .pun H4 {FONT-SIZE: 1em} |
36: | 36: .pun H3 {FONT-SIZE: 1.1em} |
37: /* 2.4 Larger text for particular items */ | 37: #brdtitle H1 {FONT-SIZE: 1.4em} |
38: | 38: |
39: .pun H2, #viewprofile DL, #brdmenu, DIV.postmsg P, DIV.forminfo P, #puninstall DIV.block P, DIV.postsignature, | 39: /* 2.4 Larger text for particular items */ |
40: DIV.linkst LI, P.postlink, DIV.postmsg H4 {FONT-SIZE: 1.1em} | 40: DIV.postmsg P {LINE-HEIGHT: 1.4} |
41: | 41: DIV.postleft DT {FONT-SIZE: 1.1em} |
42: .pun H3, .pun PRE, DIV.postleft DT {FONT-SIZE: 1.2em} | 42: .pun PRE {FONT-SIZE: 1.2em} |
43: | 43: |
44: /* 2.5 Font sizes for form elements. */ | 44: /* 2.5 Bold text */ |
45: | 45: |
46: .pun TEXTAREA, .pun LEGEND, .pun LABEL, .pun INPUT, .pun SELECT, .pun OPTGROUP {FONT-SIZE: 1.1em} | 46: DIV.postleft DT, DIV.postmsg H4, TD.tcl H3, DIV.forminfo H3, P.postlink, DIV.linkst LI, |
47: .pun LABEL INPUT, .pun LABEL TEXTAREA, .pun LABEL SELECT, .pun LABEL OPTGROUP {font-size: 1em} | 47: DIV.linksb LI, DIV.postlinksb LI, .blockmenu LI, #brdtitle H1, .pun SPAN.warntext, .pun P.warntext {FONT-WEIGHT: bold} |
48: | 48: |
49: /* 2.6 Bold text */ | |
50: | |
51: DIV.postleft DT, DIV.postmsg H4, TD.tcl H3, DIV.forminfo H3, P.postlink, DIV.linkst LI, | |
52: .blockmenu LI, #brdtitle H1 {FONT-WEIGHT: bold} | |
53: | |
54: | |
55: /****************************************************************/ | 49: /****************************************************************/ |
56: /* 3. LINKS */ | 50: /* 3. LINKS */ |
57: /****************************************************************/ | 51: /****************************************************************/ |
58: | 52: |
59: /* 3.1 Remove underlining for main menu, post header links, post links and vertical menus */ | 53: /* 3.1 Remove underlining for main menu, post header links, post links and vertical menus */ |
60: | 54: |
61: #brdmenu A:link, #brdmenu A:visited, | 55: #brdmenu A:link, #brdmenu A:visited, .blockpost DT A:link, .blockpost DT A:visited, .blockpost H2 A:link, |
62: .blockpost DT A:link, .blockpost DT A:visited, .blockpost H2 A:link, .blockpost H2 A:visited, | 56: .blockpost H2 A:visited, .postlink A:link, .postlink A:visited, .postfootright A:link, .postfootright A:visited, |
63: .postlink A:link, .postlink A:visited, .postfootright A:link, .postfootright A:visited, .blockmenu A:link, .blockmenu A:visited | 57: .blockmenu A:link, .blockmenu A:visited { |
64: {TEXT-DECORATION: none} | 58: TEXT-DECORATION: none |
| 59: } |
65: | 60: |
66: /* 3.2 Underline on hover for links in headers and main menu */ | 61: /* 3.2 Underline on hover for links in headers and main menu */ |
67: | 62: |
97: BORDER-STYLE: solid; | 92: BORDER-STYLE: solid; |
98: BORDER-WIDTH: 1px | 93: BORDER-WIDTH: 1px |
99: } | 94: } |
100: | 95: |
101: /****************************************************************/ | 96: /****************************************************************/ |
102: /* 5. VERTICAL AND PAGE SPACING */ | 97: /* 5. VERTICAL AND PAGE SPACING */ |
103: /****************************************************************/ | 98: /****************************************************************/ |
226: /* 9.5 Horizontal positioning for the submit button on forms */ | 221: /* 9.5 Horizontal positioning for the submit button on forms */ |
227: | 222: |
228: DIV.blockform P INPUT {MARGIN-LEFT: 12px} | 223: DIV.blockform P INPUT {MARGIN-LEFT: 12px} |
229: | 224: |
| 225: /****************************************************************/ |
| 226: /* 10. POST STATUS INDICATORS */ |
| 227: /****************************************************************/ |
| 228: |
| 229: /* 10.1 These are the post status indicators which appear at the left of some tables. |
| 230: .inew = new posts, .iredirect = redirect forums, .iclosed = closed topics and |
| 231: .isticky = sticky topics. By default only .inew is different from the default.*/ |
| 232: |
| 233: DIV.icon { |
| 234: FLOAT: left; |
| 235: MARGIN-TOP: 0.1em; |
| 236: MARGIN-LEFT: 0.2em; |
| 237: DISPLAY: block; |
| 238: BORDER-WIDTH: 0.6em 0.6em 0.6em 0.6em; |
| 239: BORDER-STYLE: solid |
| 240: } |
| 241: |
| 242: DIV.searchposts DIV.icon {MARGIN-LEFT: 0} |
| 243: |
| 244: /* 10.2 Class .tclcon is a div inside the first column of tables with post indicators. The |
| 245: margin creates space for the post status indicator */ |
| 246: |
| 247: TD DIV.tclcon {MARGIN-LEFT: 2.3em} |
| 248: |
| 249: |
230: | 250: |
231: | 251: |
232: | 252: |
punbb-1.2/upload/style/imports/base.css |
punbb-1.2.16/upload/style/imports/base.css |
18: /****************************************************************/ | 18: /****************************************************************/ |
19: /* 2. STRUCTURAL SETTINGS - VERY IMPORTANT - DO NOT CHANGE */ | 19: /* 2. STRUCTURAL SETTINGS - VERY IMPORTANT - DO NOT CHANGE */ |
20: /****************************************************************/ | 20: /****************************************************************/ |
21: | 21: |
| 22: /* 2.1 Clearing floats and invisible items */ |
22: .pun .clearer, .pun .nosize { | 23: .pun .clearer, .pun .nosize { |
23: HEIGHT: 0; | 24: HEIGHT: 0; |
24: WIDTH: 0; | 25: WIDTH: 0; |
29: | 30: |
30: .pun .clearer, .pun .clearb {CLEAR: both} | 31: .pun .clearer, .pun .clearb {CLEAR: both} |
31: .pun .nosize {POSITION: absolute; LEFT: -10000px} | 32: .pun .nosize {POSITION: absolute; LEFT: -10000px} |
| 33: |
| 34: /* 2.2 Overflow settings for posts */ |
| 35: |
| 36: DIV.blockpost DIV.box, DIV.postleft, DIV.postsignature, DIV.postmsg {OVERFLOW: hidden} |
32: | 37: |
33: /****************************************************************/ | 38: /****************************************************************/ |
34: /* 3. BUG FIXES - VERY IMPORTANT - DO NOT CHANGE */ | 39: /* 3. BUG FIXES - VERY IMPORTANT - DO NOT CHANGE */ |
35: /****************************************************************/ | 40: /****************************************************************/ |
36: | 41: |
37: /* 3.1 This fixes bugs in Gecko browsers. */ | 42: /* 3.1 This attempts to eliminate rounding errors in Gecko browsers. */ |
38: | 43: |
39: DIV>DIV>DIV.inbox , DIV>DIV>DIV.block2col {BORDER-BOTTOM: 1px solid transparent} | |
40: DIV>DIV>DIV.postfootleft, DIV>DIV>DIV.postfootright {PADDING-TOP: 1px; MARGIN-TOP: -1px} | 44: DIV>DIV>DIV.postfootleft, DIV>DIV>DIV.postfootright {PADDING-TOP: 1px; MARGIN-TOP: -1px} |
41: | 45: |
42: /* 3.2 This is only visible to IE Windows and cures various bugs. Do not alter comments */ | 46: /* 3.2 This is only visible to IE6 Windows and cures various bugs. Do not alter comments */ |
43: | 47: |
44: /* Begin IEWin Fix \*/ | 48: /* Begin IE6Win Fix \*/ |
45: * HTML .inbox, * HTML .inform, * HTML .pun, * HTML .intd, * HTML .tclcon {HEIGHT: 1px} | 49: * HTML .inbox, * HTML .inform, * HTML .pun, * HTML .intd, * HTML .tclcon {HEIGHT: 1px} |
46: * HTML .inbox DIV.postmsg {WIDTH: 98%} | 50: * HTML .inbox DIV.postmsg {WIDTH: 98%} |
47: /* End of IEWin Fix */ | 51: /* End of IE6Win Fix */ |
| 52: |
| 53: /* 3.3 This is the equivelant of 3.2 but for IE7. It is visible to other browsers |
| 54: but does no harm */ |
| 55: |
| 56: /*Begin IE7Win Fix */ |
| 57: .pun, .pun .inbox, .pun .inform, .pun .intd, .pun .tclcon {min-height: 1px} |
| 58: /* End of IE7Win Fix */ |
48: | 59: |
49: /****************************************************************/ | 60: /****************************************************************/ |
50: /* 4. HIDDEN ELEMENTS */ | 61: /* 4. HIDDEN ELEMENTS */ |
97: | 108: |
98: /* 5.3 Keep breadcrumbs from shifting to the right when wrapping */ | 109: /* 5.3 Keep breadcrumbs from shifting to the right when wrapping */ |
99: | 110: |
100: .linkst UL {MARGIN-LEFT: 18em} | 111: .linkst UL, linksb UL, .postlinksb UL {MARGIN-LEFT: 18em} |
101: | 112: |
102: /* 5.4 Settings for Profile and Admin interface.*/ | 113: /* 5.4 Settings for Profile and Admin interface.*/ |
| 114: |
| 115: DIV.block2col {PADDING-BOTTOM: 1px} |
103: | 116: |
104: DIV.block2col DIV.blockform, DIV.block2col DIV.block, #viewprofile DD {MARGIN-LEFT: 14em} | 117: DIV.block2col DIV.blockform, DIV.block2col DIV.block, #viewprofile DD {MARGIN-LEFT: 14em} |
105: | 118: |
133: | 146: |
134: .tcr {WIDTH: 32%; TEXT-ALIGN: left} | 147: .tcr {WIDTH: 32%; TEXT-ALIGN: left} |
135: | 148: |
136: #punsearch #vf .tcl {WIDTH: 41%} | 149: #punsearch #vf .tcl, #punmoderate #vf .tcl {WIDTH: 41%} |
137: | 150: |
138: #punsearch #vf .tc2 {WIDTH: 18%; TEXT-ALIGN: left} | 151: #punsearch #vf .tc2 {WIDTH: 18%; TEXT-ALIGN: left} |
139: | 152: |
151: | 164: |
152: #debug .tcr {WIDTH: 85%; WHITE-SPACE: normal} | 165: #debug .tcr {WIDTH: 85%; WHITE-SPACE: normal} |
153: | 166: |
154: /* 6.4 Give a little more height to table rows other than index */ | 167: #punindex TD.tcr SPAN.byuser {DISPLAY: block} |
155: | |
156: #vf TD, #users1 TD, #users2 TD {LINE-HEIGHT: 1.5em} | |
157: | 168: |
158: /****************************************************************/ | 169: /****************************************************************/ |
159: /* 7. VIEWTOPIC SETUP */ | 170: /* 7. VIEWTOPIC SETUP */ |
164: DIV.postleft, DIV.postfootleft { | 175: DIV.postleft, DIV.postfootleft { |
165: FLOAT:left; | 176: FLOAT:left; |
166: WIDTH: 18em; | 177: WIDTH: 18em; |
167: OVERFLOW: hidden | 178: OVERFLOW: hidden; |
| 179: POSITION: relative; |
168: } | 180: } |
169: | 181: |
170: DIV.postright, DIV.postfootright { | 182: DIV.postright, DIV.postfootright { |
173: } | 185: } |
174: | 186: |
175: DIV.postfootright, P.multidelete {TEXT-ALIGN: right} | 187: DIV.postfootright, P.multidelete {TEXT-ALIGN: right} |
| 188: |
| 189: DIV.blockpost>DIV>DIV.inbox {PADDING-BOTTOM: 1px} |
176: | 190: |
177: /* 7.3 This is the div which actually contains the post and is inside .postright */ | 191: /* 7.3 This is the div which actually contains the post and is inside .postright */ |
178: | 192: |
180: | 194: |
181: /* 7.4 These items control overflow and scrolling within posts. */ | 195: /* 7.4 These items control overflow and scrolling within posts. */ |
182: | 196: |
183: DIV.blockpost, DIV.postleft, DIV.postsignature, DIV.postmsg {OVERFLOW: hidden} | |
184: DIV.incqbox {WIDTH: 100%; OVERFLOW: hidden} | 197: DIV.incqbox {WIDTH: 100%; OVERFLOW: hidden} |
185: DIV.scrollbox {WIDTH: 100%; OVERFLOW: auto} | 198: DIV.scrollbox {WIDTH: 100%; OVERFLOW: auto} |
186: * HTML .imgbox {WIDTH: auto} | 199: IMG.postimg {max-width: 100%} |
| 200: A .postimg {max-width: 100%} |
187: | 201: |
188: /* 7.5 Turn off the poster information column for preview */ | 202: /* 7.5 Turn off the poster information column for preview */ |
189: | 203: |
199: BORDER:none | 213: BORDER:none |
200: } | 214: } |
201: | 215: |
202: /* 7.7 Vertical alignment of smilies in posts and signatures */ | 216: /* 7.7 Maximum height for search results as posts. Position go to post link */ |
203: | |
204: DIV.postsignature IMG, DIV.postmsg IMG {VERTICAL-ALIGN: middle;} | |
205: | |
206: /* 7.8 Maximum height for search results as posts. Position go to post link */ | |
207: | 217: |
208: DIV.searchposts DIV.postmsg {HEIGHT: 8em} | 218: DIV.searchposts DIV.postmsg {HEIGHT: 8em} |
209: DIV.searchposts DD P {PADDING-TOP: 3em} | 219: DIV.searchposts DD P {PADDING-TOP: 3em} |
210: | 220: |
211: /* 7.9 Class for bbcode [u] */ | 221: /* 7.8 Class for bbcode [u] */ |
212: | 222: |
213: SPAN.bbu {TEXT-DECORATION: underline} | 223: SPAN.bbu {TEXT-DECORATION: underline} |
214: | 224: |
218: | 228: |
219: /* 8.1 Horizontal display of online list, main navigation menu and breadcrumbs */ | 229: /* 8.1 Horizontal display of online list, main navigation menu and breadcrumbs */ |
220: | 230: |
221: #onlinelist DD, #onlinelist DT, #brdmenu LI, DIV.linkst LI, DIV.postfootright LI, UL.bblinks LI { | 231: #onlinelist DD, #onlinelist DT, #brdmenu LI, DIV.linkst LI, DIV.linksb LI, DIV.postlinksb LI, |
| 232: DIV.postfootright LI, UL.bblinks LI { |
222: DISPLAY: inline; | 233: DISPLAY: inline; |
223: HEIGHT: 0 | 234: HEIGHT: 0 |
224: } | 235: } |
punbb-1.2/upload/viewforum.php |
punbb-1.2.16/upload/viewforum.php |
55: // Sort out who the moderators are and if we are currently a moderator (or an admin) | 55: // Sort out who the moderators are and if we are currently a moderator (or an admin) |
56: $mods_array = array(); | 56: $mods_array = array(); |
57: if ($cur_forum['moderators'] != '') | 57: if ($cur_forum['moderators'] != '') |
58: { | |
59: $mods_array = unserialize($cur_forum['moderators']); | 58: $mods_array = unserialize($cur_forum['moderators']); |
60: | 59: |
61: while (list($mod_username, $mod_id) = @each($mods_array)) | |
62: $temp_array[] = '<a href="profile.php?id='.$mod_id.'">'.pun_htmlspecialchars($mod_username).'</a>'; | |
63: | |
64: $mods_string = implode(', ', $temp_array); | |
65: } | |
66: | |
67: $is_admmod = ($pun_user['g_id'] == PUN_ADMIN || ($pun_user['g_id'] == PUN_MOD && array_key_exists($pun_user['username'], $mods_array))) ? true : false; | 60: $is_admmod = ($pun_user['g_id'] == PUN_ADMIN || ($pun_user['g_id'] == PUN_MOD && array_key_exists($pun_user['username'], $mods_array))) ? true : false; |
68: | 61: |
69: // Can we or can we not post new topics? | 62: // Can we or can we not post new topics? |
70: if (($cur_forum['post_topics'] == '' && $pun_user['g_post_topics'] == '1') || $cur_forum['post_topics'] == '1' || $is_admmod) | 63: if (($cur_forum['post_topics'] == '' && $pun_user['g_post_topics'] == '1') || $cur_forum['post_topics'] == '1' || $is_admmod) |
71: $post_link = '<a href="post.php?fid='.$id.'">'.$lang_forum['Post topic'].'</a>'; | 64: $post_link = "\t\t".'<p class="postlink conr"><a href="post.php?fid='.$id.'">'.$lang_forum['Post topic'].'</a></p>'."\n"; |
72: else | 65: else |
73: $post_link = ' '; | 66: $post_link = ''; |
74: | 67: |
75: | 68: |
76: // Determine the topic offset (based on $_GET['p']) | 69: // Determine the topic offset (based on $_GET['p']) |
91: <div class="linkst"> | 84: <div class="linkst"> |
92: <div class="inbox"> | 85: <div class="inbox"> |
93: <p class="pagelink conl"><?php echo $paging_links ?></p> | 86: <p class="pagelink conl"><?php echo $paging_links ?></p> |
94: <p class="postlink conr"><?php echo $post_link ?></p> | 87: <?php echo $post_link ?> |
95: <ul><li><a href="index.php"><?php echo $lang_common['Index'] ?></a> </li><li>» <?php echo pun_htmlspecialchars($cur_forum['forum_name']) ?></li></ul> | 88: <ul><li><a href="index.php"><?php echo $lang_common['Index'] ?></a> </li><li>» <?php echo pun_htmlspecialchars($cur_forum['forum_name']) ?></li></ul> |
96: <div class="clearer"></div> | 89: <div class="clearer"></div> |
97: </div> | 90: </div> |
102: <div class="box"> | 95: <div class="box"> |
103: <div class="inbox"> | 96: <div class="inbox"> |
104: <table cellspacing="0"> | 97: <table cellspacing="0"> |
105: <colgroup> | |
106: <col class="tcl" /> | |
107: <col class="tc2" /> | |
108: <col class="tc3" /> | |
109: <col class="tcr" /> | |
110: </colgroup> | |
111: <thead> | 98: <thead> |
112: <tr> | 99: <tr> |
113: <th class="tcl" scope="col"><?php echo $lang_common['Topic'] ?></th> | 100: <th class="tcl" scope="col"><?php echo $lang_common['Topic'] ?></th> |
131: switch ($db_type) | 118: switch ($db_type) |
132: { | 119: { |
133: case 'mysql': | 120: case 'mysql': |
| 121: case 'mysqli': |
134: $sql = 'SELECT p.poster_id AS has_posted, t.id, t.subject, t.poster, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.num_replies, t.closed, t.sticky, t.moved_to FROM '.$db->prefix.'topics AS t LEFT JOIN '.$db->prefix.'posts AS p ON t.id=p.topic_id AND p.poster_id='.$pun_user['id'].' WHERE t.forum_id='.$id.' GROUP BY t.id ORDER BY sticky DESC, '.(($cur_forum['sort_by'] == '1') ? 'posted' : 'last_post').' DESC LIMIT '.$start_from.', '.$pun_user['disp_topics']; | 122: $sql = 'SELECT p.poster_id AS has_posted, t.id, t.subject, t.poster, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.num_replies, t.closed, t.sticky, t.moved_to FROM '.$db->prefix.'topics AS t LEFT JOIN '.$db->prefix.'posts AS p ON t.id=p.topic_id AND p.poster_id='.$pun_user['id'].' WHERE t.forum_id='.$id.' GROUP BY t.id ORDER BY sticky DESC, '.(($cur_forum['sort_by'] == '1') ? 'posted' : 'last_post').' DESC LIMIT '.$start_from.', '.$pun_user['disp_topics']; |
135: break; | 123: break; |
136: | 124: |
152: { | 140: { |
153: while ($cur_topic = $db->fetch_assoc($result)) | 141: while ($cur_topic = $db->fetch_assoc($result)) |
154: { | 142: { |
155: $icon = '<div class="inormal"><div class="nosize">'.$lang_common['Normal icon'].'</div></div>'."\n"; | 143: $icon_text = $lang_common['Normal icon']; |
| 144: $item_status = ''; |
| 145: $icon_type = 'icon'; |
156: | 146: |
157: if ($cur_topic['moved_to'] == null) | 147: if ($cur_topic['moved_to'] == null) |
158: $last_post = '<a href="viewtopic.php?pid='.$cur_topic['last_post_id'].'#p'.$cur_topic['last_post_id'].'">'.format_time($cur_topic['last_post']).'</a> '.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['last_poster']); | 148: $last_post = '<a href="viewtopic.php?pid='.$cur_topic['last_post_id'].'#p'.$cur_topic['last_post_id'].'">'.format_time($cur_topic['last_post']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['last_poster']).'</span>'; |
159: else | 149: else |
160: $last_post = ' '; | 150: $last_post = ' '; |
161: | 151: |
168: $subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>'; | 158: $subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>'; |
169: else | 159: else |
170: { | 160: { |
171: $subject = '<a class="showclosed" href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>'; | 161: $subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>'; |
172: $icon = '<div class="iclosed"><div class="nosize">'.$lang_common['Closed icon'].'</div></div>'."\n"; | 162: $icon_text = $lang_common['Closed icon']; |
| 163: $item_status = 'iclosed'; |
173: } | 164: } |
174: | 165: |
175: if (!$pun_user['is_guest'] && $cur_topic['last_post'] > $pun_user['last_visit'] && $cur_topic['moved_to'] == null) | 166: if (!$pun_user['is_guest'] && $cur_topic['last_post'] > $pun_user['last_visit'] && $cur_topic['moved_to'] == null) |
176: { | 167: { |
177: $icon = '<div class="inew"><div class="nosize">'.$lang_common['New icon'].'</div></div>'."\n"; | 168: $icon_text .= ' '.$lang_common['New icon']; |
178: | 169: $item_status .= ' inew'; |
| 170: $icon_type = 'icon inew'; |
179: $subject = '<strong>'.$subject.'</strong>'; | 171: $subject = '<strong>'.$subject.'</strong>'; |
180: $subject_new_posts = '[ <a href="viewtopic.php?id='.$cur_topic['id'].'&action=new" title="'.$lang_common['New posts info'].'">'.$lang_common['New posts'].'</a> ]'; | 172: $subject_new_posts = '<span class="newtext">[ <a href="viewtopic.php?id='.$cur_topic['id'].'&action=new" title="'.$lang_common['New posts info'].'">'.$lang_common['New posts'].'</a> ]</span>'; |
181: } | 173: } |
182: else | 174: else |
183: $subject_new_posts = null; | 175: $subject_new_posts = null; |
192: } | 184: } |
193: | 185: |
194: if ($cur_topic['sticky'] == '1') | 186: if ($cur_topic['sticky'] == '1') |
195: $subject = $lang_forum['Sticky'].': '.$subject; | 187: { |
196: | 188: $subject = '<span class="stickytext">'.$lang_forum['Sticky'].': </span>'.$subject; |
| 189: $item_status .= ' isticky'; |
| 190: $icon_text .= ' '.$lang_forum['Sticky']; |
| 191: } |
197: | 192: |
198: $num_pages_topic = ceil(($cur_topic['num_replies'] + 1) / $pun_user['disp_posts']); | 193: $num_pages_topic = ceil(($cur_topic['num_replies'] + 1) / $pun_user['disp_posts']); |
199: | 194: |
210: } | 205: } |
211: | 206: |
212: ?> | 207: ?> |
213: <tr> | 208: <tr<?php if ($item_status != '') echo ' class="'.trim($item_status).'"'; ?>> |
214: <td class="tcl"> | 209: <td class="tcl"> |
215: <div class="intd"> | 210: <div class="intd"> |
216: <?php echo $icon ?> | 211: <div class="<?php echo $icon_type ?>"><div class="nosize"><?php echo trim($icon_text) ?></div></div> |
217: <div class="tclcon"> | 212: <div class="tclcon"> |
218: <?php echo $subject."\n" ?> | 213: <?php echo $subject."\n" ?> |
219: </div> | 214: </div> |
247: | 242: |
248: <div class="linksb"> | 243: <div class="linksb"> |
249: <div class="inbox"> | 244: <div class="inbox"> |
250: <p class="pagelink conl"><?php echo $lang_common['Pages'].': '.paginate($num_pages, $p, 'viewforum.php?id='.$id) ?></p> | 245: <p class="pagelink conl"><?php echo $paging_links ?></p> |
251: <p class="postlink conr"><?php echo $post_link ?></p> | 246: <?php echo $post_link ?> |
252: <p><?php echo (!empty($mods_array)) ? $lang_common['Moderated by'].' '.$mods_string : ' ' ?></p> | 247: <ul><li><a href="index.php"><?php echo $lang_common['Index'] ?></a> </li><li>» <?php echo pun_htmlspecialchars($cur_forum['forum_name']) ?></li></ul> |
253: <div class="clearer"></div> | 248: <div class="clearer"></div> |
254: </div> | 249: </div> |
255: </div> | 250: </div> |
punbb-1.2/upload/viewtopic.php |
punbb-1.2.16/upload/viewtopic.php |
139: $cur_topic['subject'] = censor_words($cur_topic['subject']); | 139: $cur_topic['subject'] = censor_words($cur_topic['subject']); |
140: | 140: |
141: | 141: |
142: $page_title = pun_htmlspecialchars($pun_config['o_board_title'].' / '.$cur_topic['subject']); | |
143: | |
144: $quickpost = false; | 142: $quickpost = false; |
145: if ($pun_config['o_quickpost'] == '1' && | 143: if ($pun_config['o_quickpost'] == '1' && |
146: $is_admmod || | 144: !$pun_user['is_guest'] && |
147: (!$pun_user['is_guest'] && | |
148: ($cur_topic['post_replies'] == '1' || ($cur_topic['post_replies'] == '' && $pun_user['g_post_replies'] == '1')) && | 145: ($cur_topic['post_replies'] == '1' || ($cur_topic['post_replies'] == '' && $pun_user['g_post_replies'] == '1')) && |
149: $cur_topic['closed'] == '0')) | 146: ($cur_topic['closed'] == '0' || $is_admmod)) |
150: { | 147: { |
151: $required_fields = array('req_message' => $lang_common['Message']); | 148: $required_fields = array('req_message' => $lang_common['Message']); |
152: $quickpost = true; | 149: $quickpost = true; |
156: { | 153: { |
157: if ($cur_topic['is_subscribed']) | 154: if ($cur_topic['is_subscribed']) |
158: // I apologize for the variable naming here. It's a mix of subscription and action I guess :-) | 155: // I apologize for the variable naming here. It's a mix of subscription and action I guess :-) |
159: $subscraction = $lang_topic['Is subscribed'].' - <a href="misc.php?unsubscribe='.$id.'">'.$lang_topic['Unsubscribe'].'</a>'; | 156: $subscraction = '<p class="subscribelink clearb">'.$lang_topic['Is subscribed'].' - <a href="misc.php?unsubscribe='.$id.'">'.$lang_topic['Unsubscribe'].'</a></p>'."\n"; |
160: else | 157: else |
161: $subscraction = '<a href="misc.php?subscribe='.$id.'">'.$lang_topic['Subscribe'].'</a>'; | 158: $subscraction = '<p class="subscribelink clearb"><a href="misc.php?subscribe='.$id.'">'.$lang_topic['Subscribe'].'</a></p>'."\n"; |
162: } | 159: } |
163: else | 160: else |
164: $subscraction = ' '; | 161: $subscraction = '<div class="clearer"></div>'."\n"; |
165: | 162: |
| 163: $page_title = pun_htmlspecialchars($pun_config['o_board_title'].' / '.$cur_topic['subject']); |
166: define('PUN_ALLOW_INDEX', 1); | 164: define('PUN_ALLOW_INDEX', 1); |
167: require PUN_ROOT.'header.php'; | 165: require PUN_ROOT.'header.php'; |
168: | 166: |
185: $post_count = 0; // Keep track of post numbers | 183: $post_count = 0; // Keep track of post numbers |
186: | 184: |
187: // Retrieve the posts (and their respective poster/online status) | 185: // Retrieve the posts (and their respective poster/online status) |
188: $result = $db->query('SELECT DISTINCT u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id LEFT JOIN '.$db->prefix.'online AS o ON (o.user_id=u.id AND o.idle=0) WHERE p.topic_id='.$id.' ORDER BY p.id LIMIT '.$start_from.','.$pun_user['disp_posts'], true) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error()); | 186: $result = $db->query('SELECT u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id LEFT JOIN '.$db->prefix.'online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.topic_id='.$id.' ORDER BY p.id LIMIT '.$start_from.','.$pun_user['disp_posts'], true) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error()); |
189: while ($cur_post = $db->fetch_assoc($result)) | 187: while ($cur_post = $db->fetch_assoc($result)) |
190: { | 188: { |
191: $post_count++; | 189: $post_count++; |
206: $user_title = censor_words($user_title); | 204: $user_title = censor_words($user_title); |
207: | 205: |
208: // Format the online indicator | 206: // Format the online indicator |
209: $is_online = ($cur_post['is_online'] == $cur_post['poster_id']) ? '<strong class="showhot">'.$lang_topic['Online'].'</strong>' : $lang_topic['Offline']; | 207: $is_online = ($cur_post['is_online'] == $cur_post['poster_id']) ? '<strong>'.$lang_topic['Online'].'</strong>' : $lang_topic['Offline']; |
210: | 208: |
211: if ($pun_config['o_avatars'] == '1' && $cur_post['use_avatar'] == '1' && $pun_user['show_avatars'] != '0') | 209: if ($pun_config['o_avatars'] == '1' && $cur_post['use_avatar'] == '1' && $pun_user['show_avatars'] != '0') |
212: { | 210: { |
271: if (!$is_admmod) | 269: if (!$is_admmod) |
272: { | 270: { |
273: if (!$pun_user['is_guest']) | 271: if (!$pun_user['is_guest']) |
274: $post_actions[] = '<li><a class="showclosed" href="misc.php?report='.$cur_post['id'].'">'.$lang_topic['Report'].'</a>'; | 272: $post_actions[] = '<li class="postreport"><a href="misc.php?report='.$cur_post['id'].'">'.$lang_topic['Report'].'</a>'; |
275: | 273: |
276: if ($cur_topic['closed'] == '0') | 274: if ($cur_topic['closed'] == '0') |
277: { | 275: { |
278: if ($cur_post['poster_id'] == $pun_user['id']) | 276: if ($cur_post['poster_id'] == $pun_user['id']) |
279: { | 277: { |
280: if ((($start_from + $post_count) == 1 && $pun_user['g_delete_topics'] == '1') || (($start_from + $post_count) > 1 && $pun_user['g_delete_posts'] == '1')) | 278: if ((($start_from + $post_count) == 1 && $pun_user['g_delete_topics'] == '1') || (($start_from + $post_count) > 1 && $pun_user['g_delete_posts'] == '1')) |
281: $post_actions[] = '<li><a href="delete.php?id='.$cur_post['id'].'">'.$lang_topic['Delete'].'</a>'; | 279: $post_actions[] = '<li class="postdelete"><a href="delete.php?id='.$cur_post['id'].'">'.$lang_topic['Delete'].'</a>'; |
282: if ($pun_user['g_edit_posts'] == '1') | 280: if ($pun_user['g_edit_posts'] == '1') |
283: $post_actions[] = '<li><a href="edit.php?id='.$cur_post['id'].'">'.$lang_topic['Edit'].'</a>'; | 281: $post_actions[] = '<li class="postedit"><a href="edit.php?id='.$cur_post['id'].'">'.$lang_topic['Edit'].'</a>'; |
284: } | 282: } |
285: | 283: |
286: if (($cur_topic['post_replies'] == '' && $pun_user['g_post_replies'] == '1') || $cur_topic['post_replies'] == '1') | 284: if (($cur_topic['post_replies'] == '' && $pun_user['g_post_replies'] == '1') || $cur_topic['post_replies'] == '1') |
287: $post_actions[] = '<li><a href="post.php?tid='.$id.'&qid='.$cur_post['id'].'">'.$lang_topic['Quote'].'</a>'; | 285: $post_actions[] = '<li class="postquote"><a href="post.php?tid='.$id.'&qid='.$cur_post['id'].'">'.$lang_topic['Quote'].'</a>'; |
288: } | 286: } |
289: } | 287: } |
290: else | 288: else |
291: $post_actions[] = '<li><a class="showclosed" href="misc.php?report='.$cur_post['id'].'">'.$lang_topic['Report'].'</a>'.$lang_topic['Link separator'].'</li><li><a href="delete.php?id='.$cur_post['id'].'">'.$lang_topic['Delete'].'</a>'.$lang_topic['Link separator'].'</li><li><a href="edit.php?id='.$cur_post['id'].'">'.$lang_topic['Edit'].'</a>'.$lang_topic['Link separator'].'</li><li><a href="post.php?tid='.$id.'&qid='.$cur_post['id'].'">'.$lang_topic['Quote'].'</a>'; | 289: $post_actions[] = '<li class="postreport"><a href="misc.php?report='.$cur_post['id'].'">'.$lang_topic['Report'].'</a>'.$lang_topic['Link separator'].'</li><li class="postdelete"><a href="delete.php?id='.$cur_post['id'].'">'.$lang_topic['Delete'].'</a>'.$lang_topic['Link separator'].'</li><li class="postedit"><a href="edit.php?id='.$cur_post['id'].'">'.$lang_topic['Edit'].'</a>'.$lang_topic['Link separator'].'</li><li class="postquote"><a href="post.php?tid='.$id.'&qid='.$cur_post['id'].'">'.$lang_topic['Quote'].'</a>'; |
292: | 290: |
293: | 291: |
294: // Switch the background color for every message. | 292: // Switch the background color for every message. |
330: <div class="postmsg"> | 328: <div class="postmsg"> |
331: <?php echo $cur_post['message']."\n" ?> | 329: <?php echo $cur_post['message']."\n" ?> |
332: <?php if ($cur_post['edited'] != '') echo "\t\t\t\t\t".'<p class="postedit"><em>'.$lang_topic['Last edit'].' '.pun_htmlspecialchars($cur_post['edited_by']).' ('.format_time($cur_post['edited']).')</em></p>'."\n"; ?> | 330: <?php if ($cur_post['edited'] != '') echo "\t\t\t\t\t".'<p class="postedit"><em>'.$lang_topic['Last edit'].' '.pun_htmlspecialchars($cur_post['edited_by']).' ('.format_time($cur_post['edited']).')</em></p>'."\n"; ?> |
333: <?php if ($signature != '') echo "\t\t\t\t\t".'<div class="postsignature"><hr />'.$signature.'</div>'."\n"; ?> | |
334: </div> | 331: </div> |
| 332: <?php if ($signature != '') echo "\t\t\t\t".'<div class="postsignature"><hr />'.$signature.'</div>'."\n"; ?> |
335: </div> | 333: </div> |
336: <div class="clearer"></div> | 334: <div class="clearer"></div> |
337: <div class="postfootleft"><?php if ($cur_post['poster_id'] > 1) echo '<p>'.$is_online.'</p>'; ?></div> | 335: <div class="postfootleft"><?php if ($cur_post['poster_id'] > 1) echo '<p>'.$is_online.'</p>'; ?></div> |
349: <div class="inbox"> | 347: <div class="inbox"> |
350: <p class="postlink conr"><?php echo $post_link ?></p> | 348: <p class="postlink conr"><?php echo $post_link ?></p> |
351: <p class="pagelink conl"><?php echo $paging_links ?></p> | 349: <p class="pagelink conl"><?php echo $paging_links ?></p> |
352: <p><?php echo $subscraction ?></p> | 350: <ul><li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li><li> » <a href="viewforum.php?id=<?php echo $cur_topic['forum_id'] ?>"><?php echo pun_htmlspecialchars($cur_topic['forum_name']) ?></a></li><li> » <?php echo pun_htmlspecialchars($cur_topic['subject']) ?></li></ul> |
353: <div class="clearer"></div> | 351: <?php echo $subscraction ?> |
354: </div> | 352: </div> |
355: </div> | 353: </div> |
356: | 354: |