ob_start( 'ob_gzhandler' ); ############################################################ # Page Includes ############################################################ $titlemain = "Pro Wrestling Canada ::"; $bodymain = " bgcolor='#6E1C1E' text='#FFFFFF' link='#FFCC00' vlink='#FFCC00' alink='#FF0000' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'"; ############################################################ # DB Config ############################################################ $DBhost = "localhost"; $DBuser = "moondog_pwc"; $DBpass = "b3153d9"; $DBdb = "moondog_pwc"; $DBTABLE1 = "pwc_emails"; $DBTABLE2 = "pwc_expenses"; $DBTABLE3 = "pwc_gallery"; $DBTABLE4 = "pwc_gallery_sections"; $DBTABLE5 = "pwc_heroes"; $DBTABLE6 = "pwc_jobs"; $DBTABLE7 = "pwc_links"; $DBTABLE8 = "pwc_news"; $DBTABLE9 = "pwc_phones"; $DBTABLE10 = "pwc_ranking"; $DBTABLE11 = "pwc_roster"; $DBTABLE12 = "pwc_school"; $DBTABLE13 = "pwc_shows_info"; $DBTABLE14 = "pwc_shows_links"; $DBTABLE15 = "pwc_shows_main"; $DBTABLE16 = "pwc_shows_outlets"; $DBTABLE17 = "pwc_shows_tickets"; $DBTABLE18 = "pwc_sponsors"; $DBTABLE19 = "pwc_sponsors_provinces"; $DBTABLE20 = "pwc_street_team"; $DBTABLE21 = "pwc_checklist"; $DBTABLE22 = "pwc_checklist_task"; $DBTABLE23 = "pwc_checklist_type"; ############################################################ # Settings ############################################################ $website = "http://www.prowrestlingcanada.com"; $home = "/var/www/vhosts/prowrestlingcanada.com/httpdocs"; $convert = "/usr/bin/convert"; $composite = "/usr/bin/composite"; $watermark = "$home/gfx/gallery/watermark.png"; $c_max = 200; $c_photos = "$home/gfx/v1/company"; $g_max = 100; $g_bigmax = 560; $g_photos = "$home/gfx/v1/gallery"; $l_max = 200; $l_bigmax = 450; $l_photos = "$home/gfx/v1/links"; $n_max = 120; $n_photos = "$home/gfx/v1/news"; $h_max = 100; $h_bigmax = 450; $h_photos = "$home/gfx/v1/heroes"; $st_photos = "$home/gfx/v1/students"; ############################################################ # DB Connect ############################################################ function SQLconnect() { global $DBhost, $DBdb, $DBuser, $DBpass; $DBlink = @mysql_connect("$DBhost", "$DBuser", "$DBpass"); if (!$DBlink) { exit("Error: Can't connect to database"); } $result = mysql_select_db($DBdb, $DBlink); if (!$result) { exit("Error: Database doesn't exist."); } $GLOBALS[DBlink] = $DBlink; return $GLOBALS[DBlink]; } function SQLdisconnect() { global $DBlink; if (!@mysql_close($DBlink)) { exit("Error: Database link specified for closing doesn't exist."); } } function check($id) { if (ereg('^[0-9]{1,10}$', $id)) return "TRUE"; } function check_id($id) { global $DBlink, $DBTABLE; if (ereg('^[0-9]{1,10}$', $id)) { $sql = "SELECT lid FROM $DBTABLE WHERE lid=$id"; $result = mysqli_query($DBlink, $sql) or die(mysql_error()); if (mysql_num_rows($result) > 0) return "TRUE"; } } SQLconnect(); global $DBlink; ############################################################ # Functions ############################################################ function display_Html($message, $type = "", $back = "") { if ($type) print '
Error
'; print '$message
'; if ($back) print 'Click Back to fix error and resubmit.
'; exit(); } function formatPhone($phone) { if (empty($phone)) return "N/A"; if (strlen($phone) == 7) sscanf($phone, "%3s%4s", $prefix, $exchange); else if (strlen($phone) == 10) sscanf($phone, "%3s%3s%4s", $area, $prefix, $exchange); else if (strlen($phone) == 11) sscanf($phone, "%1s%3s%3s%4s", $country, $area, $prefix, $exchange); else if (strlen($phone) > 11) sscanf($phone, "%3s%3s%4s%s", $area, $prefix, $exchange, $extension); else return "unknown phone format: $phone"; $out = ""; $out .= isset($country) ? $country . ' ' : ""; $out .= isset($area) ? '(' . $area . ') ' : ""; $out .= $prefix . '-' . $exchange; $out .= isset($extension) ? ' ext.' . $extension : ""; return $out; } function link_urls($string) { //change single to double quotes (only necessary if you work with databases) $string = ereg_replace("\'", "\"", $string); //change full stops and question marks that don't need to be linked $string = ereg_replace("\? ", " question_mark ", $string); $string = ereg_replace("\?\r\n"," question_mark_new_line ", $string); $string = ereg_replace("\. ", " full_stop ", $string); $string = ereg_replace("\.\r\n"," full_stop_new_line ", $string); $string = eregi_replace("((ftp://)|(http://)|(www))(([a-z0-9.\-])*)(@)?(([a-z0-9\.])*)(([:/])?)((([a-z0-9]*)(@?)/*)+([.a-z]{2,4}){1})?((\??[a-z0-9\=]*)?)((\&[a-z0-9\=]*)?)(([\.a-z]){2,4})?", "\\0", $string); //change back dots and question marks $string = ereg_replace(" full_stop_new_line ", "\.\r\n", $string); $string = ereg_replace(" full_stop", "\.", $string); $string = ereg_replace(" question_mark_new_line ", "\?\r\n", $string); $string = ereg_replace(" question_mark", "\?", $string); return $string; } $month_name = array('01' => 'January', '02' => 'February', '03' => 'March', '04' => 'April', '05' => 'May', '06' => 'June', '07' => 'July', '08' => 'August', '09' => 'September', '10' => 'October', '11' => 'November', '12' => 'December', ); $day_array = array('01' => '1st', '02' => '2nd', '03' => '3rd', '04' => '4th', '05' => '5th', '06' => '6th', '07' => '7th', '08' => '8th', '09' => '9th', '10' => '10th', '11' => '11th', '12' => '12th', '13' => '13th', '14' => '14th', '15' => '15th', '16' => '16th', '17' => '17th', '18' => '18th', '19' => '19th', '20' => '20th', '21' => '21st', '22' => '22nd', '23' => '23rd', '24' => '24th', '25' => '25th', '26' => '26th', '27' => '27th', '28' => '28th', '29' => '29th', '30' => '30th', '31' => '31st' ); function getMonthList() { print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; } function getDayList() { for ($i = 1, $max = 31; $i <= $max; $i++) { if ($i <= 9) { print " \n"; } else { print " \n"; } } } function getYearList() { for ($i = 1970; $i <= date('Y'); $i++) { print " \n"; } } function clean_userinput($value, $allowed = "") { $value = stripslashes($value); $value = strip_tags($value); $value = preg_replace("*[^0-9a-zA-Z $allowed]*", "", $value); $value = addslashes($value); return $value; } function numbers_only($value, $allowed = "") { $value = stripslashes($value); $value = strip_tags($value); $value = preg_replace("*[^0-9$allowed]*", "", $value); return addslashes($value); } function clean_value($val) { if ($val == "") { return ""; } $val = str_replace( " ", " ", $val ); $val = str_replace( "&" , "&" , $val ); $val = str_replace( "" , "-->" , $val ); $val = preg_replace( "/