Viewing file: ax5.inc (8.07 KB) -rwxrwxr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
ob_start("ob_gzhandler"); // compress HTML output if possible, to conserve bandwidth
//ini_set('include_path',ini_get('include_path').':/www/advertise.axkickboxing.com/public_html'); //require_once('adlib.inc.php');
function my_error_handler($errno, $errstring, $errfile, $errline, $errcontext) { if (!($errno & error_reporting())) return;
ob_start(); print_r($GLOBALS); $globals=ob_get_contents(); ob_end_clean();
ob_start(); print_r($errcontext); $context=ob_get_contents(); ob_end_clean();
$uzenet=''; $uzenet="The following error occured:\r\n"; $uzenet.="errno: ".$errno."\r\n"; $uzenet.="errstring: ".$errstring."\r\n"; $uzenet.="errfile: ".$errfile."\r\n"; $uzenet.="errline: ".$errline."\r\n"; $uzenet.="errcontext:\r\n"; $uzenet.=$context; $uzenet.="\r\n"; $uzenet.="GLOBALS:\r\n"; $uzenet.=$globals; $uzenet.="\r\n";
error_log($uzenet,1,'hostmaster@axkickboxing.com'); #echo "<pre>".htmlspecialchars($uzenet)."</pre>"; }
set_error_handler("my_error_handler");
function error($message) { echo $message."<br>"; echo "We would be glad, if you could <a href=\"./contact\">contact us</a> if the problem persists.<br>\n"; ob_start(); print_r($GLOBALS); $env=ob_get_contents(); ob_end_clean(); //mail("moderation@axkickboxing.com","new server msgboard automated error reporting","The following error occured: ".$message."\r\n\r\n".$env); }
function psqltime($psqltimestampstring) { return mktime(substr($psqltimestampstring,11,2),substr($psqltimestampstring,14,2), substr($psqltimestampstring,17,2),substr($psqltimestampstring,5,2), substr($psqltimestampstring,8,2),substr($psqltimestampstring,0,4)); }
function lastmodified($datestring) { header("Last-Modified: " . gmdate("D, d M Y H:i:s",psqltime($datestring)) . " GMT"); header("Cache-Control: must-revalidate"); }
function disp_preamble($title1,$title2="") {
require('_header.inc.php'); global $action;
/*switch($title1) { case 'Message Board': $ad_zone='message.axkickboxing.com/topic_topad'; break; case 'Profiles section': $ad_zone='message.axkickboxing.com/profiles'; break; }*/
//if ($action=="") header("Refresh: 300"); /*if ($action=="") { echo "<p>Meta goes: <meta http-equiv=\"refresh\" content=\"300\" /> </p>\n"; echo '<p>this is the topic list</p>'."\n"; }*/ //include('/www/message.axkickboxing.com/public_html/newdesign/_htmlheader.inc.php'); /* This was used to display the graphic at the top of the thread display switch($graphic) { case 0: //include('_newheadergraphic.inc.php'); //include('/www/www.axkickboxing.com/public_html/_graphic.inc.php'); if ($ad) echo '<p align=center>'.insert_ad_here($ad_zone).'</p>'; break; default: echo '<div align=center><img src="axtopnew.gif" alt="AX Kickboxing" align="middle" border="0" vspace="0"></div>'; if ($ad) echo '<p align=center>'.insert_ad_here($ad_zone).'</p>'; break; } */ /*if ($title1!="" and ($graphic==0 and $title1!="Message Board")) echo "<h2>------------TEST 1------------</h2>\n"; echo '<p align=center><font size=6><b>'.$title1.'</b></font></p>'; */ if ($title2!="") { echo "<div id=\"forumHeading\">\n"; /*<div id="loginLogout"> Logged in : Dave Jackson : <a href="">Logout</a> </div> */ echo " <div id=\"topicTitle\">\n"; if ($_REQUEST['action'] == "browse") echo " ".$title2."\n"; else echo " Topic:".$title2."\n"; echo " </div>\n";
/* <div id="textAd"> <span>Sponsor:</span> <a href="">Wolfslair 'New Blood' Show - Warrington 27th September</a> </div> */
echo "<div id=\"textAd\"> <span>Sponsor:</span> <script type='text/javascript'><!--//<![CDATA[ var m3_u = (location.protocol=='https:'?'https://fightadvertisements.com/adserver/www/delivery/ajs.php':'http://fightadvertisements.com/adserver/www/delivery/ajs.php'); var m3_r = Math.floor(Math.random()*99999999999); if (!document.MAX_used) document.MAX_used = ','; document.write (\"<scr\"+\"ipt type='text/javascript' src='\"+m3_u); document.write (\"?zoneid=2&target=_blank&charset=UTF-8\"); document.write ('&cb=' + m3_r); if (document.MAX_used != ',') document.write (\"&exclude=\" + document.MAX_used); document.write ('&charset=UTF-8'); document.write (\"&loc=\" + escape(window.location)); if (document.referrer) document.write (\"&referer=\" + escape(document.referrer)); if (document.context) document.write (\"&context=\" + escape(document.context)); if (document.mmm_fo) document.write (\"&mmm_fo=1\"); document.write (\"'><\/scr\"+\"ipt>\"); //]]>--></script> </div>";
echo " <div class=\"returnLink\">\n"; if ($_REQUEST['action'] == "display") echo ' <a href="./profiles?action=browse"> Back to : '.$title1."</a>\n"; elseif ($_REQUEST['action'] != "browse") { echo ' <a href="'; switch($_REQUEST['topicgroup']) { case '': echo "."; break; case 'axmain': echo "."; break; case 'mma': echo "?topicgroup=mma"; break; case 'axsportscience': echo "?topicgroup=axsportscience"; break; case 'axofftopic': echo "?topicgroup=axofftopic"; break; } echo '"> Back to : '.$title1."</a>\n"; } echo " </div>\n"; echo "</div>\n"; /* echo "<h2></h2>\n"; echo '<p align=center><font size=5><b>'.$title2.'</b></font></p>'; */ } }
function bbcode($input){ //$input = strip_tags($input); //$input = htmlentities($input); $search = array( '/\[b\](.*?)\[\/b\]/is', '/\[i\](.*?)\[\/i\]/is', '/\[u\](.*?)\[\/u\]/is', '/\[img\](.*?)\[\/img\]/is', '/\[url=(.*?)\](.*?)\[\/url\]/is', '/\[font color=(.*?) size=(.*?) face=(.*?)\](.*?)\[\/font\]/is', '/\[h1\](.*?)\[\/h1\]/is', '/\[h2\](.*?)\[\/h2\]/is', '/\[h3\](.*?)\[\/h3\]/is' ); $replace = array( '<b>$1</b>', '<i>$1</i>', '<u>$1</u>', '<img src="$1" />', '<a href="$1" rel="nofollow" target="_blank">$2</a>', '<font style="color:$1;font-size:$2;font-face:$3">$4</font>', '<h1>$1</h1>', '<h2>$1</h2>', '<h3>$1</h3>' ); return preg_replace($search,$replace,$input); }
function strip_only($str, $tags) { if(!is_array($tags)) { $tags = (strpos($str, '>') !== false ? explode('>', str_replace('<', '', $tags)) : array($tags)); if(end($tags) == '') array_pop($tags); } foreach($tags as $tag) $str = preg_replace('#</?'.$tag.'[^>]*>#is', '', $str); return $str; }
function filterpost($input){
$bbdecoded = bbcode($input);
$remove_attributes = array( '/onclick/is', '/onmousehover/is', '/ondblclick/is', '/onmousedown/is', '/onmouseup/is', '/onmousemove/is', '/onmouseout/is', '/onmouseover/is', '/onkeydown/is', '/onkeyup/is', '/onkeypress/is', '/onfocus/is', '/onblur/is', '/onchange/is', '/javascript:/is' ); $replace_attributes = array( '', '', '', '', '', '', '', '', '', '', '', '', '', '', '' ); //$ok_tags = array('p', 'h1', 'h2', 'h3', 'table', 'td', 'tr', 'hr', 'em', 'i', 'strong', 'b', 'ul', 'ol', 'li', 'center', 'span', 'font', 'object', 'embed'); $ok_tags = '<p><img><a><h1><h2><h3><table><td><tr><hr><em><i><strong><b><ul><ol><li><center><span><font><object><embed>'; $tags_removed = strip_tags($bbdecoded, $ok_tags); $filtered = preg_replace($remove_attributes,$replace_attributes,$tags_removed); //return $filtered; //return $bbdecoded; return $filtered; }
function disp_tail() { global $PHP_SELF; /*<p align="center"><font color="#FEFFD2">AX name and logo copyright Brian Ritchie - </font><a href="mailto:axteam@axkickboxing.com"><font color="#408080">axteam@axkickboxing.com</font></a></p> </body> </html>*/
}
|