| punbb-1.2/upload/admin_index.php |
punbb-1.2.2/upload/admin_index.php |
| 66: // Show phpinfo() output | 66: // Show phpinfo() output |
| 67: else if ($action == 'phpinfo') | 67: else if ($action == 'phpinfo') |
| 68: { | 68: { |
| | 69: // Is phpinfo() a disabled function? |
| | 70: if (strpos(strtolower((string)@ini_get('disable_functions')), 'phpinfo') !== false) |
| | 71: message('The PHP function phpinfo() has been disabled on this server.'); |
| | 72: |
| 69: phpinfo(); | 73: phpinfo(); |
| 70: exit; | 74: exit; |
| 71: } | 75: } |
| 72: | 76: |
| 73: | 77: |
| 74: // Get the server load averages (if possible) | 78: // Get the server load averages (if possible) |
| 75: if (@file_exists('/proc/loadavg')) | 79: if (@file_exists('/proc/loadavg') && is_readable('/proc/loadavg')) |
| 76: { | 80: { |
| 77: // We use @ just in case | 81: // We use @ just in case |
| 78: $fh = @fopen('/proc/loadavg', 'r'); | 82: $fh = @fopen('/proc/loadavg', 'r'); |
| 80: @fclose($fh); | 84: @fclose($fh); |
| 81: | 85: |
| 82: $load_averages = @explode(' ', $load_averages); | 86: $load_averages = @explode(' ', $load_averages); |
| 83: $server_load = isset($load_averages[0]) ? $load_averages[0].' '.$load_averages[1].' '.$load_averages[2] : 'Not available'; | 87: $server_load = isset($load_averages[2]) ? $load_averages[0].' '.$load_averages[1].' '.$load_averages[2] : 'Not available'; |
| 84: } | 88: } |
| 85: else if (preg_match('/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/i', @exec('uptime'), $load_averages)) | 89: else if (preg_match('/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/i', @exec('uptime'), $load_averages)) |
| 86: $server_load = $load_averages[1].' '.$load_averages[2].' '.$load_averages[3]; | 90: $server_load = $load_averages[1].' '.$load_averages[2].' '.$load_averages[3]; |
| punbb-1.2/upload/admin_options.php |
punbb-1.2.2/upload/admin_options.php |
| 67: if (substr($form['avatars_dir'], -1) == '/') | 67: if (substr($form['avatars_dir'], -1) == '/') |
| 68: $form['avatars_dir'] = substr($form['avatars_dir'], 0, -1); | 68: $form['avatars_dir'] = substr($form['avatars_dir'], 0, -1); |
| 69: | 69: |
| | 70: if ($form['additional_navlinks'] != '') |
| | 71: $form['additional_navlinks'] = trim(pun_linebreaks($form['additional_navlinks'])); |
| | 72: |
| 70: if ($form['announcement_message'] != '') | 73: if ($form['announcement_message'] != '') |
| 71: $form['announcement_message'] = pun_linebreaks($form['announcement_message']); | 74: $form['announcement_message'] = pun_linebreaks($form['announcement_message']); |
| 72: else | 75: else |
| 166: </td> | 169: </td> |
| 167: </tr> | 170: </tr> |
| 168: <tr> | 171: <tr> |
| | 172: <th scope="row">Base URL</th> |
| | 173: <td> |
| | 174: <input type="text" name="form[base_url]" size="50" maxlength="100" value="<?php echo $pun_config['o_base_url'] ?>" /> |
| | 175: <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> |
| | 176: </td> |
| | 177: </tr> |
| | 178: <tr> |
| 169: <th scope="row">Server timezone</th> | 179: <th scope="row">Server timezone</th> |
| 170: <td> | 180: <td> |
| 171: <select name="form[server_timezone]"> | 181: <select name="form[server_timezone]"> |
| 264: </select> | 274: </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> | 275: <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> | 276: </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> | 277: </table> |
| 275: </div> | 278: </div> |
| 276: </fieldset> | 279: </fieldset> |
| 457: <td> | 460: <td> |
| 458: <input type="radio" name="form[search_all_forums]" value="1"<?php if ($pun_config['o_search_all_forums'] == '1') echo ' checked="checked"' ?> /> <strong>Yes</strong> <input type="radio" name="form[search_all_forums]" value="0"<?php if ($pun_config['o_search_all_forums'] == '0') echo ' checked="checked"' ?> /> <strong>No</strong> | 461: <input type="radio" name="form[search_all_forums]" value="1"<?php if ($pun_config['o_search_all_forums'] == '1') echo ' checked="checked"' ?> /> <strong>Yes</strong> <input type="radio" name="form[search_all_forums]" value="0"<?php if ($pun_config['o_search_all_forums'] == '0') echo ' checked="checked"' ?> /> <strong>No</strong> |
| 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> | 462: <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> |
| | 463: </td> |
| | 464: </tr> |
| | 465: <tr> |
| | 466: <th scope="row">Additional menu items</th> |
| | 467: <td> |
| | 468: <textarea name="form[additional_navlinks]" rows="3" cols="55"><?php echo pun_htmlspecialchars($pun_config['o_additional_navlinks']) ?></textarea> |
| | 469: <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> |
| 460: </td> | 470: </td> |
| 461: </tr> | 471: </tr> |
| 462: </table> | 472: </table> |
| punbb-1.2/upload/header.php |
punbb-1.2.2/upload/header.php |
| 114: | 114: |
| 115: } | 115: } |
| 116: | 116: |
| | 117: $user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? strtolower($_SERVER['HTTP_USER_AGENT']) : ''; |
| | 118: if (strpos($user_agent, 'msie') !== false && strpos($user_agent, 'windows') !== false && strpos($user_agent, 'opera') === false) |
| | 119: echo '<script type="text/javascript" src="style/imports/minmax.js"></script>'; |
| | 120: |
| 117: $tpl_temp = trim(ob_get_contents()); | 121: $tpl_temp = trim(ob_get_contents()); |
| 118: $tpl_main = str_replace('<pun_head>', $tpl_temp, $tpl_main); | 122: $tpl_main = str_replace('<pun_head>', $tpl_temp, $tpl_main); |
| 119: ob_end_clean(); | 123: ob_end_clean(); |
| 123: // START SUBST - <body> | 127: // START SUBST - <body> |
| 124: if (isset($focus_element)) | 128: if (isset($focus_element)) |
| 125: { | 129: { |
| 126: $tpl_main = str_replace('<body onload="', '<body onload="document.getElementById(\''.$focus_element[0].'\').'.$focus_element[1].'.focus();', $tpl_main); | 130: $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); | 131: $tpl_main = str_replace('<body>', '<body onload="document.getElementById(\''.$focus_element[0].'\').'.$focus_element[1].'.focus()">', $tpl_main); |
| 128: } | 132: } |
| 129: // END SUBST - <body> | 133: // END SUBST - <body> |
| 154: $tpl_temp = '<div id="brdwelcome" class="inbox">'."\n\t\t\t".'<p>'.$lang_common['Not logged in'].'</p>'."\n\t\t".'</div>'; | 158: $tpl_temp = '<div id="brdwelcome" class="inbox">'."\n\t\t\t".'<p>'.$lang_common['Not logged in'].'</p>'."\n\t\t".'</div>'; |
| 155: else | 159: else |
| 156: { | 160: { |
| 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']); | 161: $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: | 162: |
| 159: if ($pun_user['g_id'] < PUN_GUEST) | 163: if ($pun_user['g_id'] < PUN_GUEST) |
| 160: { | 164: { |
| 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()); | 165: $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: | 166: |
| 163: if ($db->result($result_header)) | 167: if ($db->result($result_header)) |
| 164: $tpl_temp .= '<br /><strong><a href="admin_reports.php">There are new reports</a></strong>'; | 168: $tpl_temp .= "\n\t\t\t\t".'<li class="reportlink"><strong><a href="admin_reports.php">There are new reports</a></strong></li>'; |
| 165: | 169: |
| 166: if ($pun_config['o_maintenance'] == '1') | 170: 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>'; | 171: $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: } | 172: } |
| 169: | 173: |
| 170: if (basename($_SERVER['PHP_SELF']) == 'index.php') | 174: if (basename($_SERVER['PHP_SELF']) == 'index.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>'; | 175: $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') | 176: else if (isset($_SERVER['QUERY_STRING']) && $_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>'; | 177: $tpl_temp .= "\n\t\t\t".'</ul>'."\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 | 178: else |
| 175: $tpl_temp .= '</p>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>'; | 179: $tpl_temp .= "\n\t\t\t".'</ul>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>'; |
| 176: } | 180: } |
| 177: | 181: |
| 178: $tpl_main = str_replace('<pun_status>', $tpl_temp, $tpl_main); | 182: $tpl_main = str_replace('<pun_status>', $tpl_temp, $tpl_main); |
| punbb-1.2/upload/help.php |
punbb-1.2.2/upload/help.php |
| 37: // Load the help.php language file | 37: // Load the help.php language file |
| 38: require PUN_ROOT.'lang/'.$pun_user['language'].'/help.php'; | 38: require PUN_ROOT.'lang/'.$pun_user['language'].'/help.php'; |
| 39: | 39: |
| 40: // Determine what style to use (for the [img] example) | |
| 41: if ($pun_user['style'] != '' && @file_exists(PUN_ROOT.'style/'.$pun_user['style'].'.css')) | |
| 42: $img_url = $pun_config['o_base_url'].'/img/'.$pun_user['style'].'_new.png'; | |
| 43: else | |
| 44: $img_url = $pun_config['o_base_url'].'/img/'.$pun_config['o_default_style'].'_new.png'; | |
| 45: | |
| 46: | 40: |
| 47: $page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_help['Help']; | 41: $page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_help['Help']; |
| 48: require PUN_ROOT.'header.php'; | 42: require PUN_ROOT.'header.php'; |
| 76: [email=myname@mydomain.com]<?php echo $lang_help['My e-mail address'] ?>[/email] <?php echo $lang_help['produces'] ?> <a href="mailto:myname@mydomain.com"><?php echo $lang_help['My e-mail address'] ?></a><br /><br /> | 70: [email=myname@mydomain.com]<?php echo $lang_help['My e-mail address'] ?>[/email] <?php echo $lang_help['produces'] ?> <a href="mailto:myname@mydomain.com"><?php echo $lang_help['My e-mail address'] ?></a><br /><br /> |
| 77: </div> | 71: </div> |
| 78: <p><a name="img"></a><?php echo $lang_help['Images info'] ?></p> | 72: <p><a name="img"></a><?php echo $lang_help['Images info'] ?></p> |
| 79: <div>[img]<?php echo $img_url ?>[/img] <?php echo $lang_help['produces'] ?> <img src="<?php echo $img_url ?>" alt="" /></div> | 73: <div>[img]http://www.punbb.org/img/small_logo.png[/img] <?php echo $lang_help['produces'] ?> <img src="http://www.punbb.org/img/small_logo.png" alt="http://www.punbb.org/img/small_logo.png" /></div> |
| 80: </div> | 74: </div> |
| 81: <h2><?php echo $lang_help['Quotes'] ?></h2> | 75: <h2><?php echo $lang_help['Quotes'] ?></h2> |
| 82: <div class="box"> | 76: <div class="box"> |
| 141: for ($next = $i + 1; $next < $num_smilies; ++$next) | 135: for ($next = $i + 1; $next < $num_smilies; ++$next) |
| 142: { | 136: { |
| 143: // Did we find a dupe? | 137: // Did we find a dupe? |
| 144: if ($smiley_img[$i] == $smiley_img[$next]) | 138: if (isset($smiley_img[$next]) && $smiley_img[$i] == $smiley_img[$next]) |
| 145: { | 139: { |
| 146: echo ' '.$lang_common['and'].' '.$smiley_text[$next]; | 140: echo ' '.$lang_common['and'].' '.$smiley_text[$next]; |
| 147: | 141: |
| punbb-1.2/upload/include/functions.php |
punbb-1.2.2/upload/include/functions.php |
| 108: | 108: |
| 109: // Fetch guest user | 109: // 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()); | 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()); |
| | 111: if (!$db->num_rows($result)) |
| | 112: exit('Unable to fetch guest information. The table \''.$db->prefix.'users\' must contain an entry with id = 1 that represents anonymous users.'); |
| | 113: |
| 111: $pun_user = $db->fetch_assoc($result); | 114: $pun_user = $db->fetch_assoc($result); |
| 112: | 115: |
| 113: // Update online list | 116: // Update online list |
| 229: global $pun_config, $lang_common, $pun_user; | 232: global $pun_config, $lang_common, $pun_user; |
| 230: | 233: |
| 231: // Index and Userlist should always be displayed | 234: // Index and Userlist should always be displayed |
| 232: $links[] = '<li><a href="index.php">'.$lang_common['Index'].'</a>'; | 235: $links[] = '<li id="navindex"><a href="index.php">'.$lang_common['Index'].'</a>'; |
| 233: $links[] = '<li><a href="userlist.php">'.$lang_common['User list'].'</a>'; | 236: $links[] = '<li id="navuserlist"><a href="userlist.php">'.$lang_common['User list'].'</a>'; |
| 234: | 237: |
| 235: if ($pun_config['o_rules'] == '1') | 238: if ($pun_config['o_rules'] == '1') |
| 236: $links[] = '<li><a href="misc.php?action=rules">'.$lang_common['Rules'].'</a>'; | 239: $links[] = '<li id="navrules"><a href="misc.php?action=rules">'.$lang_common['Rules'].'</a>'; |
| 237: | 240: |
| 238: if ($pun_user['is_guest']) | 241: if ($pun_user['is_guest']) |
| 239: { | 242: { |
| 240: if ($pun_user['g_search'] == '1') | 243: if ($pun_user['g_search'] == '1') |
| 241: $links[] = '<li><a href="search.php">'.$lang_common['Search'].'</a>'; | 244: $links[] = '<li id="navsearch"><a href="search.php">'.$lang_common['Search'].'</a>'; |
| 242: | 245: |
| 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>'; | 246: $links[] = '<li id="navregister"><a href="register.php">'.$lang_common['Register'].'</a>'; |
| | 247: $links[] = '<li id="navlogin"><a href="login.php">'.$lang_common['Login'].'</a>'; |
| 244: | 248: |
| 245: $info = $lang_common['Not logged in']; | 249: $info = $lang_common['Not logged in']; |
| 246: } | 250: } |
| 249: if ($pun_user['g_id'] > PUN_MOD) | 253: if ($pun_user['g_id'] > PUN_MOD) |
| 250: { | 254: { |
| 251: if ($pun_user['g_search'] == '1') | 255: if ($pun_user['g_search'] == '1') |
| 252: $links[] = '<li><a href="search.php">'.$lang_common['Search'].'</a>'; | 256: $links[] = '<li id="navsearch"><a href="search.php">'.$lang_common['Search'].'</a>'; |
| 253: | 257: |
| 254: $links[] = '<li><a href="profile.php?id='.$pun_user['id'].'">'.$lang_common['Profile'].'</a>'; | 258: $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>'; | 259: $links[] = '<li id="navlogout"><a href="login.php?action=out&id='.$pun_user['id'].'">'.$lang_common['Logout'].'</a>'; |
| 256: } | 260: } |
| 257: else | 261: else |
| 258: { | 262: { |
| 259: $links[] = '<li><a href="search.php">'.$lang_common['Search'].'</a>'; | 263: $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>'; | 264: $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>'; | 265: $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>'; | 266: $links[] = '<li id="navlogout"><a href="login.php?action=out&id='.$pun_user['id'].'">'.$lang_common['Logout'].'</a>'; |
| 263: } | 267: } |
| 264: } | 268: } |
| 265: | 269: |
| 266: return '<ul>'.implode($lang_common['Link separator'].'</li>', $links).'</li></ul>'; | 270: // Are there any additional navlinks we should insert into the array before imploding it? |
| | 271: if ($pun_config['o_additional_navlinks'] != '') |
| | 272: { |
| | 273: if (preg_match_all('#([0-9]+)\s*=\s*(.*?)\n#s', $pun_config['o_additional_navlinks']."\n", $extra_links)) |
| | 274: { |
| | 275: // Insert any additional links into the $links array (at the correct index) |
| | 276: for ($i = 0; $i < count($extra_links[1]); ++$i) |
| | 277: array_splice($links, $extra_links[1][$i], 0, array('<li id="navextra'.($i + 1).'">'.$extra_links[2][$i])); |
| | 278: } |
| | 279: } |
| | 280: |
| | 281: 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: } | 282: } |
| 268: | 283: |
| 269: | 284: |
| 720: // | 735: // |
| 721: function pun_trim($str) | 736: function pun_trim($str) |
| 722: { | 737: { |
| 723: $fishy_chars = array(chr(0x81), chr(0x8D), chr(0x8F), chr(0x90), chr(0x9D), chr(0xA0), chr(0xCA), ' '); | 738: global $lang_common; |
| 724: | 739: |
| 725: return trim(str_replace($fishy_chars, ' ', $str)); | 740: if (strpos($lang_common['lang_encoding'], '8859') !== false) |
| | 741: { |
| | 742: $fishy_chars = array(chr(0x81), chr(0x8D), chr(0x8F), chr(0x90), chr(0x9D), chr(0xA0), chr(0xCA)); |
| | 743: return trim(str_replace($fishy_chars, ' ', $str)); |
| | 744: } |
| | 745: else |
| | 746: return trim($str); |
| 726: } | 747: } |
| 727: | 748: |
| 728: | 749: |
| 812: | 833: |
| 813: // If the delay is 0 seconds, we might as well skip the redirect all together | 834: // If the delay is 0 seconds, we might as well skip the redirect all together |
| 814: if ($pun_config['o_redirect_delay'] == '0') | 835: if ($pun_config['o_redirect_delay'] == '0') |
| 815: header('Location: '.$destination_url); | 836: header('Location: '.str_replace('&', '&', $destination_url)); |
| 816: | 837: |
| 817: | 838: |
| 818: // Load the redirect template | 839: // Load the redirect template |
| 916: <title><?php echo pun_htmlspecialchars($pun_config['o_board_title']) ?> / Error</title> | 937: <title><?php echo pun_htmlspecialchars($pun_config['o_board_title']) ?> / Error</title> |
| 917: <style type="text/css"> | 938: <style type="text/css"> |
| 918: <!-- | 939: <!-- |
| 919: BODY {margin: 20px 20%; font: 10px Verdana, Arial, Helvetica, sans-serif;} | 940: BODY {MARGIN: 10% 20% auto 20%; font: 10px Verdana, Arial, Helvetica, sans-serif} |
| 920: #errorbox {border: 1px solid #000;} | 941: #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;} | 942: H2 {MARGIN: 0; COLOR: #FFFFFF; BACKGROUND-COLOR: #B84623; FONT-SIZE: 1.1em; PADDING: 5px 4px} |
| 922: #errorbox DIV {padding: 6px 5px; background-color: #dedfdf} | 943: #errorbox DIV {PADDING: 6px 5px; BACKGROUND-COLOR: #F1F1F1} |
| 923: --> | 944: --> |
| 924: </style> | 945: </style> |
| 925: </head> | 946: </head> |
| 926: <body> | 947: <body> |
| 927: <div id="errorbox"> | 948: |
| 928: <h2>An error was encountered</h2> | 949: <div id="errorbox"> |
| 929: <div> | 950: <h2>An error was encountered</h2> |
| | 951: <div> |
| 930: <?php | 952: <?php |
| 931: | 953: |
| 932: if (defined('PUN_DEBUG')) | 954: if (defined('PUN_DEBUG')) |
| 933: { | 955: { |
| 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"; | 956: 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: | 957: |
| 936: if ($db_error) | 958: if ($db_error) |
| 937: { | 959: { |
| 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"; | 960: 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: | 961: |
| 940: if ($db_error['error_sql'] != '') | 962: if ($db_error['error_sql'] != '') |
| 941: echo "\t\t\t".'<br /><br /><strong>Failed query:</strong> '.pun_htmlspecialchars($db_error['error_sql'])."\n"; | 963: echo "\t\t".'<br /><br /><strong>Failed query:</strong> '.pun_htmlspecialchars($db_error['error_sql'])."\n"; |
| 942: } | 964: } |
| 943: } | 965: } |
| 944: else | 966: else |
| 945: echo "\t\t\t".'Error: <strong>'.$message.'.</strong>'."\n"; | 967: echo "\t\t".'Error: <strong>'.$message.'.</strong>'."\n"; |
| 946: | 968: |
| 947: ?> | 969: ?> |
| 948: </div> | |
| 949: </div> | 970: </div> |
| | 971: </div> |
| | 972: |
| 950: </body> | 973: </body> |
| 951: </html> | 974: </html> |
| 952: <?php | 975: <?php |
| punbb-1.2/upload/include/parser.php |
punbb-1.2.2/upload/include/parser.php |
| 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; |
| 280: function handle_img_tag($url, $is_signature = false) | 280: function handle_img_tag($url, $is_signature = false) |
| 281: { | 281: { |
| 282: global $lang_common, $pun_config, $pun_user; | 282: global $lang_common, $pun_config, $pun_user; |
| 283: | |
| 284: $img_tag = '<a href="'.$url.'"><'.$lang_common['Image link'].'></a>'; | |
| 285: | 283: |
| 286: if ($is_signature && $pun_user['show_img_sig'] != '0') | 284: $img_tag = '<a href="'.$url.'"><'.$lang_common['Image link'].'></a>'; |
| 287: $img_tag = '<img class="sigimage" src="'.$url.'" alt="'.htmlspecialchars($url).'" />'; | 285: |
| 288: else if (!$is_signature && $pun_user['show_img'] != '0') | 286: 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>'; | 287: $img_tag = '<img class="sigimage" src="'.$url.'" alt="'.htmlspecialchars($url).'" />'; |
| 290: | 288: else if (!$is_signature && $pun_user['show_img'] != '0') |
| 291: return $img_tag; | 289: $img_tag = '<img class="postimg" src="'.$url.'" alt="'.htmlspecialchars($url).'" />'; |
| | 290: |
| | 291: return $img_tag; |
| 292: } | 292: } |
| 293: | 293: |
| 294: | 294: |
| 323: if (strpos($text, 'quote') !== false) | 323: if (strpos($text, 'quote') !== false) |
| 324: { | 324: { |
| 325: $text = str_replace('[quote]', '</p><blockquote><div class="incqbox"><p>', $text); | 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); | 326: $text = preg_replace('#\[quote=("|"|\'|)(.*)\\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); | 327: $text = preg_replace('#\[\/quote\]\s*#', '</p></div></blockquote><p>', $text); |
| 328: } | 328: } |
| 329: | 329: |
| punbb-1.2/upload/index.php |
punbb-1.2.2/upload/index.php |
| 60: <div class="box"> | 60: <div class="box"> |
| 61: <div class="inbox"> | 61: <div class="inbox"> |
| 62: <table cellspacing="0"> | 62: <table cellspacing="0"> |
| 63: <colgroup> | |
| 64: <col class="tcl" /> | |
| 65: <col class="tc2" /> | |
| 66: <col class="tc3" /> | |
| 67: <col class="tcr" /> | |
| 68: </colgroup> | |
| 69: <thead> | 63: <thead> |
| 70: <tr> | 64: <tr> |
| 71: <th class="tcl" scope="col"><?php echo $lang_common['Forum'] ?></th> | 65: <th class="tcl" scope="col"><?php echo $lang_common['Forum'] ?></th> |
| 80: $cur_category = $cur_forum['cid']; | 74: $cur_category = $cur_forum['cid']; |
| 81: } | 75: } |
| 82: | 76: |
| 83: $icon = '<div class="inormal"><div class="nosize">'.$lang_common['Normal icon'].'</div></div>'."\n"; | 77: $item_status = ''; |
| | 78: $icon_text = $lang_common['Normal icon']; |
| | 79: $icon_type = 'icon'; |
| 84: | 80: |
| 85: // Are there new posts? | 81: // Are there new posts? |
| 86: if (!$pun_user['is_guest'] && $cur_forum['last_post'] > $pun_user['last_visit']) | 82: if (!$pun_user['is_guest'] && $cur_forum['last_post'] > $pun_user['last_visit']) |
| 87: $icon = '<div class="inew"><div class="nosize">'.$lang_common['New icon'].'</div></div>'."\n"; | 83: { |
| | 84: $item_status = 'inew'; |
| | 85: $icon_text = $lang_common['New icon']; |
| | 86: $icon_type = 'icon inew'; |
| | 87: } |
| 88: | 88: |
| 89: // Is this a redirect forum? | 89: // Is this a redirect forum? |
| 90: if ($cur_forum['redirect_url'] != '') | 90: if ($cur_forum['redirect_url'] != '') |
| 91: { | 91: { |
| 92: $forum_field = '<h3><a href="'.pun_htmlspecialchars($cur_forum['redirect_url']).'" title="'.$lang_index['Link to'].' '.pun_htmlspecialchars($cur_forum['redirect_url']).'">'.pun_htmlspecialchars($cur_forum['forum_name']).'</a></h3>'; | 92: $forum_field = '<h3><a href="'.pun_htmlspecialchars($cur_forum['redirect_url']).'" title="'.$lang_index['Link to'].' '.pun_htmlspecialchars($cur_forum['redirect_url']).'">'.pun_htmlspecialchars($cur_forum['forum_name']).'</a></h3>'; |
| 93: $num_topics = $num_posts = ' '; | 93: $num_topics = $num_posts = ' '; |
| 94: $icon = '<div class="iredirect"><div class="nosize">'.$lang_common['Redirect icon'].'</div></div>'."\n"; | 94: $item_statu |