children() as $row1) { switch($row1->getName()) { case("NewsItem"): { foreach($row1->children() as $row2) { switch($row2->getName()) { case("Identification"): { foreach($row2->children() as $row3) { switch($row3->getName()) { case("NewsIdentifier"): { foreach($row3->children() as $row4) { switch($row4->getName()) { case("NewsItemId"): { $return[$i]["id"]=$row4; $return[$i]["link"]=url(array("url"=>$vars["destination"],"query"=>array("xid"=>$row4))); break; } } } break; } } } break; } case("NewsComponent"): { foreach($row2->children() as $row3) { switch($row3->getName()) { case("NewsComponent"): { $j=0; foreach($row3->children() as $row4) { switch($row4->getName()) { case("NewsComponent"): { switch($j) { case(0): { foreach($row4->children() as $row5) { switch($row5->getName()) { case("NewsLines"): { foreach($row5->children() as $row6) { switch($row6->getName()) { case("HeadLine"): { $return[$i]["title"]=$row6; break; } case("SlugLine"): { $return[$i]["summary"]=strip_tags($row6); break; } } } } case("ContentItem"): { foreach($row5->children() as $row6) { switch($row6->getName()) { case("DataContent"): { $return[$i]["text"]=$row6; break; } } } } } } break; } case(1): { foreach($row4->children() as $row5) { switch($row5->getName()) { case("ContentItem"): { $result=0; foreach($row5->children() as $row6) { switch($row6->getName()) { case("Characteristics"): { foreach($row6->children() as $row7) { switch($row7->getName()) { case("Property"): { $attributes7=$row7->attributes(); if(($attributes7[0]=="PixelWidth")&&($attributes7[1]==$vars["imagesize"][0])) { $result++; } if(($attributes7[0]=="PixelHeight")&&($attributes7[1]==$vars["imagesize"][1])) { $result++; } break; } } } break; } } } if($result==2) { $attributes5=$row5->attributes(); $return[$i]["image"]=$attributes5[0]; } } } } break; } case(2): { $k=0; foreach($row4->children() as $row5) { switch($row5->getName()) { case("ContentItem"): { if($k==0) { $a6=$row5->attributes(); $return[$i]["video"] .= $a6[0]; } if($k==1) { $a6=$row5->attributes(); $return[$i]["videopic"] .= $a6[0]; } $k++; } } } break; } } $j++; } } } } } } } } } } } $i++; } } } return($return); } function category() { global $config; $return=null; $return.=title(array("title"=>"News")); $return.=grid(array("sql"=>"SELECT article.article AS id, CONCAT(\"".$config["pathimage"]."article_image-\", article.article, \"-3.\", article.article_image) AS image, article.article_title AS title, article.article_text AS summary FROM article WHERE article.article_category = '1' AND article.article_expire > CURDATE() AND article.sys_account = '".$config["account"]."' ORDER BY article.article_date DESC")); return($return); } function title($vars) { global $config; $return=null; $return.="

".$vars["title"]."

"; return($return); } function heading($vars) { global $config; if(!isset($vars["style"])) { $vars["style"]="fill"; } $return=null; $return.="

"; if(!empty($vars["link"])) { $return.=""; } $return.=$vars["text"]; if(!empty($vars["link"])) { $return.=""; } $return.="

"; return($return); } function article($vars) { global $config,$location,$output; $return=null; if(empty($vars["source"])) { $vars["source"]="database"; } if(empty($vars["image"])) { $vars["image"]=true; } if(empty($vars["noimage"])) { $vars["noimage"]=false; } // if(empty($vars["imagesize"])) { // $vars["imagesize"]="300x225"; // } $vars["imagesize"]=explode("x",$vars["imagesize"]); $vars["imagewidth"]=$vars["imagesize"][0]; $vars["imageheight"]=$vars["imagesize"][1]; // if(!isset($vars["advert"])) { // $vars["advert"]=true; // } // if(empty($vars["title"])) { // $vars["title"]=true; // } if(!isset($vars["summary"])) { $vars["summary"]=true; } if(!isset($vars["summarylength"])) { $vars["summarylength"]=null; } if(empty($vars["link"])) { $vars["link"]=true; } if($vars["source"]=="database") { $query=database($vars["sql"]); if(mysql_num_rows($query)>0) { while($data=mysql_fetch_array($query)) { $output["title"]=clean($data["title"]); if($config["lowbandwidth"]==false) { for($i=1;$i<=3;$i++) { $data["image".$i]=exists(array("src"=>$data["image".$i])); } for($i=1;$i<=2;$i++) { $data["link".$i]=exists(array("src"=>$data["link".$i])); } } if($vars["title"]==true) { $return.=title(array("title"=>$location["label"])); } $return.="
"; $return.="
"; if((((!empty($data["image1"]))||(!empty($data["image2"]))||(!empty($data["image3"])))||($vars["noimage"]==true)||($vars["advert"]==true))) { $current["count"]=0; for($i=0;$i<=99;$i++) { if(!empty($data["image".$i])) { $current["count"]++; } } $return.="
"; for($i=1;$i<=$current["count"];$i++) { $return.="
"; $return.="
"; $return.=image(array("src"=>$data["image".$i],"alt"=>clean($data["title"]),"container"=>implode("x",$vars["imagesize"]),"noimage"=>true)); $return.="
"; $return.="
"; } if($vars["advert"]==true) { $return.="
"; $return.="
"; $return.=file_get_contents("include.advert.d300x250.php"); $return.=mask(array("width"=>300,"height"=>250)); $return.="
"; $return.="
"; } $return.="
"; } if(!empty($data["title"])) { $return.="

".clean($data["title"])."

"; } if(($vars["summary"]==true)&&(!empty($data["summary"]))) { $return.="

"; if(empty($vars["summarylength"])) { $return.=clean($data["summary"]); } else { $data["summary"]=clean($data["summary"]); preg_match("/^([^.!?\s]*[\.!?\s]+){0,".$vars["summarylength"]."}/",$data["summary"],$data["summary2"]); $return.=$data["summary2"][0]; if(strlen($data["summary"])!=strlen($data["summary2"][0])) { $return.="..."; } } $return.="

"; } if(!empty($data["text"])) { $return.=cleanhtml($data["text"]); } if(!empty($vars["link"])) { $current["link"]=null; for($i=1;$i<=3;$i++) { if(!empty($data["link".$i])) { if($i<=2) { $current["link"].="
  • "; if(!empty($data["link".$i."label"])) { $current["link"].=$data["link".$i."label"]; } else { $current["link"].="Click here"; } $current["link"].="
  • "; } else { $current["link"].="
  • "; $current["link"].="Right Click And Click 'Select Target As' To Download Audio"; $current["audiolink"].="
    \n"; $current["audiolink"].=""; $current["audiolink"].="
    "; } } } if(!empty($current["audiolink"])) { $return.="

    ".$current["audiolink"]."

    "; } if(!empty($current["link"])) { $return.="

    Links & Downloads

      ".$current["link"]."
    "; } } $return.="
  • "; $return.="
    "; } } } if($vars["source"]=="xml") { $query=xml(array("url"=>$vars["url"],"imagesize"=>implode("x",$vars["imagesize"]))); if(sizeof($query)>0) { foreach($query as $data) { if($data["id"]==$vars["xid"]) { $output["title"]=clean($data["title"]); if($config["lowbandwidth"]==false) { $data["image"]=exists(array("src"=>$data["image"])); } $return.=title(array("title"=>$location["label"])); $return.="
    "; $return.="
    "; if((!empty($data["image"]))||($vars["noimage"]==true)||($vars["advert"]==true)) { $current["count"]=0; $return.="
    "; if(!empty($data["image"])) { $return.="
    "; $return.="
    "; $return.=image(array("src"=>$data["image"],"alt"=>clean($data["title"]),"container"=>implode("x",$vars["imagesize"]),"noimage"=>true)); $return.="
    "; $return.="
    "; } if($vars["advert"]==true) { $return.="
    "; $return.="
    "; $return.=file_get_contents("include.advert.d300x250.php"); $return.=mask(array("width"=>300,"height"=>250)); $return.="
    "; $return.="
    "; } $return.="
    "; } if(!empty($data["title"])) { $return.="

    ".clean($data["title"])."

    "; } if(($vars["summary"]==true)&&(!empty($data["summary"]))) { $return.="

    "; if(empty($vars["summarylength"])) { $return.=clean($data["summary"]); } else { $data["summary"]=clean($data["summary"]); preg_match("/^([^.!?\s]*[\.!?\s]+){0,".$vars["summarylength"]."}/",$data["summary"],$data["summary2"]); $return.=$data["summary2"][0]; if(strlen($data["summary"])!=strlen($data["summary2"][0])) { $return.="..."; } } $return.="

    "; } if(!empty($data["text"])) { $return.=cleanhtml($data["text"]); } if(!empty($data["video"])) { $return.="
    "; } $return.="
    "; $return.="
    "; } } } } return($return); } function grid($vars) { global $config; $return=null; if(empty($vars["source"])) { $vars["source"]="database"; } if(!isset($vars["rows"])) { $vars["rows"]=99; } if(!isset($vars["cols"])) { $vars["cols"]=4; } if(!isset($vars["image"])) { $vars["image"]=true; } if(!isset($vars["imagesize"])) { $vars["imagesize"]="144x96"; } $vars["imagesize"]=explode("x",$vars["imagesize"]); $vars["imagewidth"]=$vars["imagesize"][0]; $vars["imageheight"]=$vars["imagesize"][1]; if(!isset($vars["title"])) { $vars["title"]=true; } if(!isset($vars["summary"])) { $vars["summary"]=true; } if(!isset($vars["summarylength"])) { $vars["summarylength"]=30; } if(!isset($vars["more"])) { $vars["more"]=true; } if(!isset($vars["moretext"])) { $vars["moretext"]="more"; } $current["rows"]=0; $current["cols"]=0; if($vars["source"]=="database") { $query=database($vars["sql"]); if(mysql_num_rows($query)>0) { while($data=mysql_fetch_array($query)) { if($config["lowbandwidth"]==false) { $data["image"]=exists(array("src"=>$data["image"])); } if($current["cols"]%$vars["cols"]==0) { if($current["cols"]>0) { $return.=""; $current["rows"]++; if($current["rows"]>=$vars["rows"]) { break; } } $return.="
    "; } $return.="
    "; if($vars["image"]==true) { $return.=image(array("src"=>$data["image"],"alt"=>clean($data["title"]),"link"=>$data["link"],"target"=>$data["target"],"container"=>implode("x",$vars["imagesize"]),"noimage"=>true)); } if(($vars["title"]==true)&&(!empty($data["title"]))) { $return.="

    "; if(!empty($data["link"])) { $return.="".$vars["moretext"].""; } $return.="

    "; } $return.="

    "; $current["cols"]++; if($current["cols"]==mysql_num_rows($query)) { $return.="
    "; } } } } if($vars["source"]=="xml") { $query=xml(array("url"=>$vars["url"],"imagesize"=>implode("x",$vars["imagesize"]))); if(sizeof($query)>0) { foreach($query as $data) { if($config["lowbandwidth"]==false) { $data["image"]=exists(array("src"=>$data["image"])); } if($current["cols"]%$vars["cols"]==0) { if($current["cols"]>0) { $return.=""; $current["rows"]++; if($current["rows"]>=$vars["rows"]) { break; } } $return.="
    "; } $return.="
    "; if($vars["image"]==true) { $return.=image(array("src"=>$data["image"],"alt"=>clean($data["title"]),"link"=>$data["link"],"container"=>implode("x",$vars["imagesize"]),"noimage"=>true)); } if(($vars["title"]==true)&&(!empty($data["title"]))) { $return.="

    "; if(!empty($data["link"])) { $return.=""; } $return.=clean($data["title"]); if(!empty($data["link"])) { $return.=""; } $return.="

    "; } if(($vars["summary"]==true)&&(!empty($data["summary"]))) { $data["summary"]=clean($data["summary"]); preg_match("/^([^.!?\s]*[\.!?\s]+){0,".$vars["summarylength"]."}/",$data["summary"],$data["summary2"]); $return.="

    ".$data["summary2"][0]; if(strlen($data["summary"])!=strlen($data["summary2"][0])) { $return.="..."; } if(($vars["more"]==true)&&(!empty($data["link"]))) { $return.=" ".$vars["moretext"].""; } $return.="

    "; } $return.="
    "; $current["cols"]++; if($current["cols"]==sizeof($query)) { $return.="
    "; } } } } return($return); } function listing($vars) { global $config; $return=null; if(empty($vars["source"])) { $vars["source"]="database"; } if(!isset($vars["rows"])) { $vars["rows"]=99; } if(!isset($vars["image"])) { $vars["image"]=true; } if(!isset($vars["imagesize"])) { $vars["imagesize"]="144x96"; } $vars["imagesize"]=explode("x",$vars["imagesize"]); $vars["imagewidth"]=$vars["imagesize"][0]; $vars["imageheight"]=$vars["imagesize"][1]; if(!isset($vars["preamble"])) { $vars["preamble"]=false; } if(!isset($vars["title"])) { $vars["title"]=true; } if(!isset($vars["summary"])) { $vars["summary"]=true; } if(!isset($vars["summarylength"])) { $vars["summarylength"]=30; } if(!isset($vars["more"])) { $vars["more"]=true; } if(!isset($vars["moretext"])) { $vars["moretext"]="more"; } if($vars["source"]=="database") { $query=database($vars["sql"]); if(mysql_num_rows($query)>0) { $current["rows"]=0; $return.="
    "; while($data=mysql_fetch_array($query)) { if($config["lowbandwidth"]==false) { $data["image"]=exists(array("src"=>$data["image"])); } if($current["rows"]>=$vars["rows"]) { break; } $return.="
    "; if($vars["image"]==true) { $return.=image(array("src"=>$data["image"],"alt"=>clean($data["title"]),"link"=>$data["link"],"container"=>implode("x",$vars["imagesize"]),"noimage"=>true)); } $return.="
    "; if(($vars["title"]==true)&&(!empty($data["title"]))) { $return.="

    "; if(($vars["preamble"]==true)&&(!empty($data["preamble"]))) { $return.=clean($data["preamble"]); } if(!empty($data["link"])) { $return.=""; } $return.=clean($data["title"]); if(!empty($data["link"])) { $return.=""; } $return.="

    "; } if(($vars["summary"]==true)&&(!empty($data["summary"]))) { $data["summary"]=clean($data["summary"]); preg_match("/^([^.!?\s]*[\.!?\s]+){0,".$vars["summarylength"]."}/",$data["summary"],$data["summary2"]); $return.="

    ".$data["summary2"][0]; if(strlen($data["summary"])!=strlen($data["summary2"][0])) { $return.="..."; } if(($vars["more"]==true)&&(!empty($data["link"]))) { $return.=" ".$vars["moretext"].""; } $return.="

    "; } $return.="
    "; $return.="
    "; $current["rows"]++; } $return.="
    "; } } if($vars["source"]=="xml") { $query=xml(array("url"=>$vars["url"],"destination"=>$vars["destination"],"imagesize"=>implode("x",$vars["imagesize"]))); if(sizeof($query)>0) { $return.="
    "; foreach($query as $data) { if($config["lowbandwidth"]==false) { $data["image"]=exists(array("src"=>$data["image"])); } if($current["rows"]>=$vars["rows"]) { break; } $return.="
    "; if($vars["image"]==true) { $return.=image(array("src"=>$data["image"],"alt"=>clean($data["title"]),"link"=>$data["link"],"container"=>implode("x",$vars["imagesize"]),"noimage"=>true)); } $return.="
    "; if(($vars["title"]==true)&&(!empty($data["title"]))) { $return.="

    "; if(($vars["preamble"]==true)&&(!empty($data["preamble"]))) { $return.=clean($data["preamble"]); } if(!empty($data["link"])) { $return.=""; } $return.=clean($data["title"]); if(!empty($data["link"])) { $return.=""; } $return.="

    "; } if(($vars["summary"]==true)&&(!empty($data["summary"]))) { $data["summary"]=clean($data["summary"]); preg_match("/^([^.!?\s]*[\.!?\s]+){0,".$vars["summarylength"]."}/",$data["summary"],$data["summary2"]); $return.="

    ".$data["summary2"][0]; if(strlen($data["summary"])!=strlen($data["summary2"][0])) { $return.="..."; } if(($vars["more"]==true)&&(!empty($data["link"]))) { $return.=" ".$vars["moretext"].""; } $return.="

    "; } $return.="
    "; $return.="
    "; $current["rows"]++; } $return.="
    "; } } return($return); } function exists($vars) { $return=null; if($config["lowbandwidth"]==false) { if((!empty($vars["src"]))&&(file($vars["src"]))) { $return=$vars["src"]; } } return($return); } function image($vars) { $return=null; if($config["lowbandwidth"]==false) { if(!empty($vars["src"])) { if(empty($vars["container"])) { $imagesize=getimagesize($vars["src"]); } } if((empty($vars["src"]))&&($vars["noimage"]==true)&&(!empty($vars["container"]))) { $vars["src"]=$config["pathhttp"]."style/".$vars["container"].".jpg"; } if(!empty($vars["src"])) { if(!empty($vars["container"])) { $vars["container"]=explode("x",$vars["container"]); } $return.="
    "; if(empty($vars["container"])) { if(!empty($vars["link"])) { $return.=""; if(!empty($vars["link"])) { $return.=""; } $return.=mask(array("src"=>$vars["src"])); } else { $return.=""; if(!empty($vars["link"])) { $return.="$vars["container"][0],"height"=>$vars["container"][1])); } $return.="
    "; } } return($return); } function mask($vars) { global $config; $return=null; if($config["lowbandwidth"]==false) { if((empty($vars["width"]))||(empty($vars["height"]))) { list($vars["width"],$vars["height"])=getimagesize($src); } $return.="
    "; } return($return); } function hyperlink($vars) { global $config, $location; if(empty($vars["target"])) { $vars["target"]=$config["pathtarget"]; } $return="
    $value) { if($key=="form") { $modal=true; } $return.=$key."=".$value."&"; } if(($modal==true)&&(!empty($_GET))) { foreach($_GET as $key => $value) { $return.="&".$key."=".$value; } $return.="&"; } $return=substr($return,0,-5); } } } else { $return.=$config["pathhttp"]."index.php?url="; if(empty($vars["url"])) { $return.=$location["name"]; } else { $return.=$vars["url"]; } if($vars["target"]!=$config["pathtarget"]) { $return.="&target=".$vars["target"]; } if(!empty($vars["query"])) { foreach($vars["query"] as $key => $value) { $return.="&".$key."=".$value; } } } return($return); } function clean($str=null) { $return=null; if(strlen($str)!=strlen(strip_tags($str))) { $return.=trim(strip_tags($str)); } else { $return.=trim(htmlentities($str)); } $return=str_replace(" "," ",$return); return($return); } function cleanhtml($str=null) { $return=null; if(strlen($str)!=strlen(strip_tags($str))) { $str=str_replace(array("

    ","

    ","

    ","

    ","

    ","

    ","

    ","

    "),"
    ",trim($str)); $str="

    ".trim(str_replace(array("\r","\n"),"",$str))."

    "; $str=str_replace("
    ","

    ",$str); $str=str_replace(array("

    ","

    ","

     

    "),"",$str); $return.=$str; } else { $return.="

    ".nl2br(trim(htmlentities($str)))."

    "; } $return=str_replace(" "," ",$return); return($return); } foreach($_GET as $key => $value) { if(!isset($_POST[$key])) { $_POST[$key]=$value; } } $output["feed"] .=""; function poll() { global $config; if (isset($_POST['poll'])) { $output["poll"]=null; $hmm1 =database("SELECT * FROM poll WHERE sys_account=".$config["account"]." ORDER BY poll DESC LIMIT 1"); while($row = mysql_fetch_array($hmm1)) { for ($i=1; $i<=20; $i++) { if ($_POST['poll_option_']==$i) { mysql_query("UPDATE poll SET poll_count_".$i."=".($row['poll_count_'.$i]+1)." WHERE poll=".$_POST['poll']); } } } $pollvalsf = mysql_query("SELECT * FROM poll WHERE sys_account=".$config["account"]." ORDER BY poll DESC LIMIT 1"); while($row = mysql_fetch_array($pollvalsf)) { $tally=0; $height=0; for ($i=1; $i<=20; $i++) { if(!empty($row["poll_count_".$i])) { $tally=($tally+$row["poll_count_".$i]); $height=($height+22); } } $output["poll"].="
    \n"; $output["poll"].="
    \n"; $output["poll"].="

    ".$row["poll_title"]."

    \n"; $output["poll"].="
    \n"; $output["poll"].="
    \n"; for ($i=1; $i<=20; $i++) { if(!is_null($row["poll_count_".$i])) { $output["poll"].="
    \n"; $output["poll"].="\n"; $output["poll"].=round((($row["poll_count_".$i]/$tally)*100))."% ".$row["poll_option_".$i]; $output["poll"].="\n"; $output["poll"].="
    \n"; } } $output["poll"].="
    \n"; $output["poll"].="
    \n"; } } else { $output["poll"]=null; $hmm2 =database("SELECT * FROM poll WHERE sys_account=".$config["account"]." ORDER BY poll DESC LIMIT 1"); while($row = mysql_fetch_array($hmm2)) { $output["poll"].="

    ".$row['poll_title']."

    "; $output["poll"].="
    "; $output["poll"].="
    "; $output["poll"].=""; $output["poll"].=""; $output["poll"].=""; $output["poll"].="
    "; } } if (isset($output["poll"])) { return($output["poll"]); } else { $output["poll"]=false; return($output["poll"]); } } function calendar() { $output["calendar"] = null; global $output; global $config; $output["calendar"] .= ""; $output["calendar"] .= "
    "; $output["calendar"] .= "
    "; $output["calendar"] .= "
    "; $output["calendar"] .= "
    "; $output["calendar"] .= "
    "; $output["calendar"] .= " "; $output["calendar"] .= "

    ".date("D jS M", strtotime("+".(($_GET["week"]*7))." days"))." to ".date("D jS M", strtotime("+".(($_GET["week"]*7)+7)." days"))."

    "; $output["calendar"] .= "
    "; $output["calendar"] .= " "; $output["calendar"] .= " "; $output["calendar"] .= " "; $output["calendar"] .= "
    "; $output["calendar"] .= "
    "; $output["calendar"] .= "
    "; $output["calendar"] .= "
    "; $output["calendar"] .= "
    "; $output["calendar"] .= "
    "; $output["calendar"] .= "
    "; $output["calendar"] .= "
    "; } $output["calendar"] .= " "; $output["calendar"] .= "
    "; $output["calendar"] .= "
    "; $output["calendar"] .= "
    \n"; $output["calendar"] .= "
    \n"; $output["calendar"] .= "
    "; $days = ($_GET["week"]*7)+7; $query = "SELECT * FROM calendar WHERE calendar_date<=\"".date("Y-m-d", strtotime("+".(($_GET["week"]*7)+7)." days"))."\" AND calendar_date>=\"".date("Y-m-d", strtotime("+".($_GET["week"]*7)." days"))."\" AND calendar_status=1 AND sys_account=".$config["account"]." ORDER BY calendar_date ASC"; $result = database($query); while($row = mysql_fetch_array($result)) { $output["calendar"] .= "
    \n"; if (!empty($row["calendar_image"])) { $output["calendar"] .= ""; } $search = array('

    ','

    ', '

    ','

    ', ' '); $replace = array('', ' ', '', ' ', ''); $descunsplit = str_replace($search, $replace, $row["calendar_text"]); $descarray = str_split(str_replace($search, $replace, $row["calendar_text"]), 125); $desc = strip_tags($descarray[0], '')." ...read more"; $output["calendar"] .= "".$row["calendar_title"]."
    ".date("jS M Y", strtotime($row["calendar_date"]))."
    ".$desc."
    \n"; } $output["calendar"] .= "
    "; $output["calendar"] .= "
    "; $output["calendar"] .= "
    "; $output["calendar"] .= ""; $output["calendar"] .= "
    "; } function submiteventform() { global $config; $output["submitform"] = null; global $output; // profile $profile_query=database("SELECT profile.* FROM profile WHERE profile.sys_account = '".$config["account"]."'"); if(mysql_num_rows($profile_query)!=1) { exit("Profile for sys_account (".$config["account"].") does not exist"); } else { $profile_data=mysql_fetch_array($profile_query); } if(isset($_POST["calendar_submit"])) { $result=true; $error=array(); if ($_FILES["calendar_image"]["name"]!=""){ if ((($_FILES["calendar_image"]["type"] != "image/gif") && ($_FILES["calendar_image"]["type"] != "image/jpeg") && ($_FILES["calendar_image"]["type"] != "image/pjpeg")) || ($_FILES["calendar_image"]["size"] > 2000000)) { $result=false; $error["image"]="
    Image: Please choose a valid image."; } } if(empty($_POST["calendar_fname"])) { $result=false; $error["calendar_fname"]="Please enter your first name"; } if(empty($_POST["calendar_lname"])) { $result=false; $error["calendar_lname"].="Please enter your last name"; } if(empty($_POST["calendar_telephone"])) { $result=false; $error["calendar_telephone"]="Please enter a valid telephone number"; } if((empty($_POST["calendar_email"])) || (!preg_match("/^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$/i", $_POST["calendar_email"]))) { $result=false; $error["calendar_email"]="Please enter a valid email address"; } if(empty($_POST["calendar_addr1"])) { $result=false; $error["calendar_addr1"]="Please give the first line of your address"; } if(empty($_POST["calendar_title"])) { $result=false; $error["title"]="
    What: Please tell as what the event is."; } if(empty($_POST["calendar_email"])) { $result=false; $error["calendar_email"]="
    Email: Please provide your email address."; } if(empty($_POST["calendar_date_day"])) { $result=false; $error["date"].="
    Start Day: Please tell us the starting day for the event."; } if(empty($_POST["calendar_date_month"])) { $result=false; $error["date"].="
    Start Month: Please tell us the starting month for the event."; } if(empty($_POST["calendar_date_year"])) { $result=false; $error["date"].="
    Start year: Please tell us the starting year for the event."; } if(empty($_POST["calendar_text"])) { $result=false; $error["text"]="
    Description: Please describe the event."; } if($result==false) { } else { $_POST["calendar_date"] = date("Y-m-d", strtotime($_POST["calendar_date_year"]."-".$_POST["calendar_date_month"]."-".$_POST["calendar_date_day"])); if($_FILES["calendar_image"]["name"]!=""){ $img = "jpg"; } else { $img = NULL; } if ($_POST["calendar_uri"]=="http://") { $_POST["calendar_uri"] = ""; } $address_string=$_POST["calendar_addr1"]." ".$_POST["calendar_addr2"]." ".$_POST["calendar_addr3"]." ".$_POST["calendar_addr4"]." ".$_POST["calendar_postcode"]; $name_string=$_POST["calendar_fname"]." ".$_POST["calendar_lname"]; if ($_POST["event_data"]==true) { $query_subnewsletter="INSERT INTO newsletter (newsletter.newsletter_title, newsletter.newsletter_email, newsletter.newsletter_telephone, newsletter.newsletter_address, newsletter.newsletter_stamp, newsletter.newsletter_source, newsletter.sys_account) VALUES ('".$name_string."', '".$_POST["calendar_email"]."', '".$_POST["calendar_telephone"]."', '".$address_string."', '".date("Y-m-d H:i:s")."', 'Event Submission', '".$config["account"]."')"; database($query_subnewsletter); } $query1 = "INSERT INTO calendar ( calendar_title, calendar_date, calendar_text, calendar_uri, calendar_image, calendar_status, calendar_time, sys_user, sys_account) VALUES ( \"".strip_tags($_POST["calendar_title"])."\", \"".$_POST["calendar_date"]."\", \"".strip_tags($_POST["calendar_text"])."\", \"".strip_tags($_POST["calendar_uri"])."\", \"".$img."\", 0, \"".date("H:i:s")."\", \"000\", \"".$config["account"]."\" )"; database($query1); $query2 = "SELECT * FROM calendar ORDER BY calendar DESC LIMIT 1"; $query=database($query2); while($row = mysql_fetch_array($query)) { $eventid = $row["calendar"]; } if ($_FILES["calendar_image"]["name"]!="") { if ($_FILES["calendar_image"]["error"] > 0) { echo "Error: " . $_FILES["calendar_image"]["error"] . "
    "; } else { $name = explode(".", $_FILES["calendar_image"]["name"]); $filetype = end($name); $filename = $config["pathimageabsolute"]."calendar_image-" . $eventid.".".$filetype; if (file_exists($filename)) { echo $filename . " already exists. "; } else { move_uploaded_file($_FILES["calendar_image"]["tmp_name"],$filename); $widtharray = array(300, 36, 84, 116, 132, 144, 300, 612, 120, 300, 434); $heightarray = array(225, 27, 63, 87, 99, 108, 225, 459, 90, 225, 325); for ($i=0; $i<=10; $i++) { list($owidth, $oheight, $image_type) = getimagesize($filename); if( $image_type == IMAGETYPE_JPEG ) { $image = imagecreatefromjpeg($filename); } elseif( $image_type == IMAGETYPE_GIF ) { $image = imagecreatefromgif($filename); } $nwidth = $widtharray[$i]; $nheight = $heightarray[$i]; $nratio = $nwidth/$nheight; $oratio = $owidth/$oheight; $hsizeratio = $nheight/$oheight; $wsizeratio = $nwidth/$owidth; if ($nratio<$oratio) { $owidth = $nwidth/$hsizeratio; } else { $oheight = $nheight/$wsizeratio; } $image_dest = imagecreatetruecolor($nwidth, $nheight); imagecopyresampled($image_dest, $image, 0, 0, 0, 0, $nwidth, $nheight, $owidth, $oheight); if($i==0) { imagejpeg($image_dest, $config["pathimageabsolute"]."calendar_image-".$eventid.".jpg", 75); } else { imagejpeg($image_dest, $config["pathimageabsolute"]."calendar_image-".$eventid."-".$i.".jpg", 75); } } } } } $to = $profile_data["email_sales"]; $subject = "New Event Submitted To Website"; $message = "*** NEW EVENT *** A new event has been submitted via the event form (details below). Event Title : ".strip_tags($_POST["calendar_title"])." Event Start : ".$_POST["calendar_date"]." Event Description : ".strip_tags($_POST["calendar_text"])." Event Website : ".strip_tags($_POST["calendar_uri"])." Here's the Details of the person who submitted the event:- Name : ".$name_string." Address : ".$address_string." Telephone : ".strip_tags($_POST["calendar_telephone"])." Email : ".strip_tags($_POST["calendar_email"])." Please check the details of the event carefully and choose whether to accept or reject the submission: Accept: ".$config["pathhttp"]."api.php?key=".$config["apikey"]."&action=event-submit-accept&id=".$eventid." Reject: ".$config["pathhttp"]."api.php?key=".$config["apikey"]."&action=event-submit-reject&id=".$eventid." OR go here to view the event with image before accepting/rejecting: ".$config["pathhttp"]."events?id=".$eventid." This email been sent from ".$profile_data["station_url"]; $from = $_POST["calendar_email"]; $headers = "From: $from"; mail($to,$subject,$message,$headers); $output["submitform"] .= "

    Thank you for submitting your event

    It has been submitted for approval and should appear on the site shortly if it complies with our editorial guidelines

    "; } } $output["submitform"] .= "

    Submit an Event

    All fields marked * are required

    Event Title
    "; $output["submitform"] .= $error["title"]; $output["submitform"] .= "
    "; $output["submitform"] .= "
    Your Email *
    "; $output["submitform"] .= $error["calendar_email"]; $output["submitform"] .= "
    "; $output["submitform"] .= "
    First Name * (will not appear online)
    "; $output["submitform"] .= $error["calendar_fname"]; $output["submitform"] .= "
    "; $output["submitform"] .= "
    Last Name * (will not appear online)
    "; $output["submitform"] .= $error["calendar_lname"]; $output["submitform"] .= "
    "; $output["submitform"] .= "
    Your Telephone * (will not appear online)
    "; $output["submitform"] .= $error["calendar_telephone"]; $output["submitform"] .= "
    "; $output["submitform"] .= "
    Your Address * (will not appear online)
    "; $output["submitform"] .= $error["calendar_addr1"]; $output["submitform"] .= "
    "; $output["submitform"].="
    Town/City
    "; $output["submitform"].="
    "; $output["submitform"].="
    County
    "; $output["submitform"].="
    "; $output["submitform"] .= "
    Post Code
    "; $output["submitform"] .= $error["calendar_postcode"]; $output["submitform"] .= "
    "; $output["submitform"] .= "
    Event Date * (D/M/Y)
    "; $output["submitform"] .= $error["date"] ; $output["submitform"] .= "
    Description *
    "; $output["submitform"] .= $error["text"]; $output["submitform"] .= "
    Event Website (if known)
    "; $output["submitform"] .= $error["website"]; $output["submitform"] .= "
    Image
    "; $output["submitform"] .= $error["image"]; $output["submitform"] .= "
    "; $output["submitform"].="
    "; } function submitbusinessform() { global $config; $output["submitbusiness"] = null; global $output; // profile $profile_query=database("SELECT profile.* FROM profile WHERE profile.sys_account = '".$config["account"]."'"); if(mysql_num_rows($profile_query)!=1) { exit("Profile for sys_account (".$config["account"].") does not exist"); } else { $profile_data=mysql_fetch_array($profile_query); } if(isset($_POST["local_listing_submit"])) { $result=true; $error=array(); if ($_FILES["local_listing_image"]["name"]!=""){ if ((($_FILES["local_listing_image"]["type"] != "image/gif") && ($_FILES["local_listing_image"]["type"] != "image/jpeg") && ($_FILES["local_listing_image"]["type"] != "image/pjpeg")) || ($_FILES["local_listing_image"]["size"] > 2000000)) { $result=false; $error["image"]="
    Image: Please choose a valid image."; } } if(empty($_POST["local_listing_fname"])) { $result=false; $error["local_listing_fname"]="Please enter your first name"; } if(empty($_POST["local_listing_lname"])) { $result=false; $error["local_listing_lname"].="Please enter your last name"; } if(empty($_POST["local_listing_telephone"])) { $result=false; $error["local_listing_telephone"]="Please enter a valid telephone number"; } if((empty($_POST["local_listing_email"])) || (!preg_match("/^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$/i", $_POST["local_listing_email"]))) { $result=false; $error["local_listing_email"]="Please enter a valid email address"; } if(empty($_POST["local_listing_addr1"])) { $result=false; $error["local_listing_addr1"]="Please give the first line of your address"; } if(empty($_POST["local_listing_title"])) { $result=false; $error["title"]="
    What: Please tell as what the business is called"; } if(empty($_POST["local_listing_email"])) { $result=false; $error["local_listing_email"]="
    Email: Please provide your email address."; } if(empty($_POST["local_listing_text"])) { $result=false; $error["text"]="
    Description: Please describe the business."; } if($result==false) { } else { if($_FILES["local_listing_image"]["name"]!=""){ $img = "jpg"; } else { $img = NULL; } if ($_POST["local_listing_uri"]=="http://") { $_POST["local_listing_uri"] = ""; } $address_string=$_POST["local_listing_addr1"].", ".$_POST["local_listing_addr2"].", ".$_POST["local_listing_addr3"].", ".$_POST["local_listing_addr4"].", ".$_POST["local_listing_postcode"]; $name_string=$_POST["local_listing_fname"]." ".$_POST["local_listing_lname"]; if ($_POST["local_listing_data"]==true) { $query_subnewsletter="INSERT INTO newsletter (newsletter.newsletter_title, newsletter.newsletter_email, newsletter.newsletter_telephone, newsletter.newsletter_address, newsletter.newsletter_stamp, newsletter.newsletter_source, newsletter.sys_account) VALUES ('".$name_string."', '".$_POST["local_listing_email"]."', '".$_POST["local_listing_telephone"]."', '".$address_string."', '".date("Y-m-d H:i:s")."', 'Business Submission', '".$config["account"]."')"; database($query_subnewsletter); } $query1 = "INSERT INTO local_listing ( local_listing_title, local_listing_text, local_listing_uri, local_listing_image, local_listing_email, local_listing_telephone, local_listing_contact, local_listing_address, local_listing_postcode, local_listing_boolean, sys_user, sys_account) VALUES ( \"".strip_tags($_POST["local_listing_title"])."\", \"".strip_tags($_POST["local_listing_text"])."\", \"".strip_tags($_POST["local_listing_uri"])."\", \"".$img."\", \"".strip_tags($_POST["local_listing_email"])."\", \"".strip_tags($_POST["local_listing_telephone"])."\", \"".$name_string."\", \"".$address_string."\", \"".strip_tags($_POST["local_listing_postcode"])."\", 0, \"000\", \"".$config["account"]."\" )"; database($query1); $query2 = "SELECT * FROM local_listing ORDER BY local_listing DESC LIMIT 1"; $query=database($query2); while($row = mysql_fetch_array($query)) { $eventid = $row["local_listing"]; } if ($_FILES["local_listing_image"]["name"]!="") { if ($_FILES["local_listing_image"]["error"] > 0) { echo "Error: " . $_FILES["local_listing_image"]["error"] . "
    "; } else { $name = explode(".", $_FILES["local_listing_image"]["name"]); $filetype = end($name); $filename = $config["pathimageabsolute"]."local_listing_image-" . $eventid.".".$filetype; if (file_exists($filename)) { echo $filename . " already exists. "; } else { move_uploaded_file($_FILES["local_listing_image"]["tmp_name"],$filename); $widtharray = array(300, 36, 84, 116, 132, 144, 300, 612, 120, 300, 434); $heightarray = array(225, 27, 63, 87, 99, 108, 225, 459, 90, 225, 325); for ($i=0; $i<=10; $i++) { list($owidth, $oheight, $image_type) = getimagesize($filename); if( $image_type == IMAGETYPE_JPEG ) { $image = imagecreatefromjpeg($filename); } elseif( $image_type == IMAGETYPE_GIF ) { $image = imagecreatefromgif($filename); } $nwidth = $widtharray[$i]; $nheight = $heightarray[$i]; $nratio = $nwidth/$nheight; $oratio = $owidth/$oheight; $hsizeratio = $nheight/$oheight; $wsizeratio = $nwidth/$owidth; if ($nratio<$oratio) { $owidth = $nwidth/$hsizeratio; } else { $oheight = $nheight/$wsizeratio; } $image_dest = imagecreatetruecolor($nwidth, $nheight); imagecopyresampled($image_dest, $image, 0, 0, 0, 0, $nwidth, $nheight, $owidth, $oheight); if($i==0) { imagejpeg($image_dest, $config["pathimageabsolute"]."local_listing_image-".$eventid.".jpg", 75); } else { imagejpeg($image_dest, $config["pathimageabsolute"]."local_listing_image-".$eventid."-".$i.".jpg", 75); } } } } } $to = $profile_data["email_sales"]; $subject = "New Business Submitted To Directory"; $message = "*** NEW BUSINESS LISTING *** A new event has been submitted via the event form (details below). Business Title : ".strip_tags($_POST["local_listing_title"])." Business Start : ".$_POST["local_listing_date"]." Business Description : ".strip_tags($_POST["local_listing_text"])." Business Website : ".strip_tags($_POST["local_listing_uri"])." Here's the Details of the person who submitted the business listing:- Name : ".$name_string." Address : ".$address_string." Telephone : ".strip_tags($_POST["local_listing_telephone"])." Email : ".strip_tags($_POST["local_listing_email"])." Please check the details of the business carefully and choose whether to accept or reject the submission: Accept: ".$config["pathhttp"]."api.php?key=".$config["apikey"]."&action=event-submit-accept&id=".$eventid." Reject: ".$config["pathhttp"]."api.php?key=".$config["apikey"]."&action=event-submit-reject&id=".$eventid." OR go here to view the business with image before accepting/rejecting: ".$config["pathhttp"]."localdirectory?id=".$eventid." This email been sent from ".$profile_data["station_url"]; $from = $_POST["local_listing_email"]; $headers = "From: $from"; mail($to,$subject,$message,$headers); $output["submitbusiness"] .= "

    Thank you for submitting your business

    It has been submitted for approval and one of our client management team will be in touch about your listing options shortly.

    "; } } $output["submitbusiness"] .= "

    Submit Your Business To Our Directory

    Get your free business listing in our 'Proud to be local' directory. Fill in the form below, hit submit and your business will receive a free standard listing in our local directory.

    All fields marked * are required

    Business Name
    "; $output["submitbusiness"] .= $error["title"]; $output["submitbusiness"] .= "
    "; $output["submitbusiness"] .= "
    Your Email *
    "; $output["submitbusiness"] .= $error["local_listing_email"]; $output["submitbusiness"] .= "
    "; $output["submitbusiness"] .= "
    First Name * (will not appear online)
    "; $output["submitbusiness"] .= $error["local_listing_fname"]; $output["submitbusiness"] .= "
    "; $output["submitbusiness"] .= "
    Last Name * (will not appear online)
    "; $output["submitbusiness"] .= $error["local_listing_lname"]; $output["submitbusiness"] .= "
    "; $output["submitbusiness"] .= "
    Telephone
    "; $output["submitbusiness"] .= $error["local_listing_telephone"]; $output["submitbusiness"] .= "
    "; $output["submitbusiness"] .= "
    Address
    "; $output["submitbusiness"] .= $error["local_listing_addr1"]; $output["submitbusiness"] .= "
    "; $output["submitbusiness"].="
    Town/City
    "; $output["submitbusiness"].="
    "; $output["submitbusiness"].="
    County
    "; $output["submitbusiness"].="
    "; $output["submitbusiness"] .= "
    Post Code
    "; $output["submitbusiness"] .= $error["local_listing_postcode"]; $output["submitbusiness"] .= "
    "; $output["submitbusiness"] .= "
    Description *
    "; $output["submitbusiness"] .= $error["text"]; $output["submitbusiness"] .= "
    Web Address
    "; $output["submitbusiness"] .= $error["website"]; $output["submitbusiness"] .= "
    Logo Upload
    "; $output["submitbusiness"] .= $error["image"]; $output["submitbusiness"] .= "
    "; $output["submitbusiness"].="
    "; } function competitionform($answer=false) { global $config; $accepted=false; // profile $profile_query=database("SELECT profile.* FROM profile WHERE profile.sys_account = '".$config["account"]."'"); if(mysql_num_rows($profile_query)!=1) { exit("Profile for sys_account (".$config["account"].") does not exist"); } else { $profile_data=mysql_fetch_array($profile_query); } if ($_POST["comp_submitted"]==true) { $result=true; $error=array(); if(empty($_POST["comp_fname"])) { $result=false; $error["comp_fname"]="Please enter your first name"; } if(empty($_POST["comp_lname"])) { $result=false; $error["comp_lname"].="Please enter your last name"; } if((empty($_POST["comp_telephone"])) || (!preg_match("^(((\+44\s?\d{4}|\(?0\d{4}\)?)\s?\d{3}\s?\d{3})|((\+44\s?\d{3}|\(?0\d{3}\)?)\s?\d{3}\s?\d{4})|((\+44\s?\d{2}|\(?0\d{2}\)?)\s?\d{4}\s?\d{4}))(\s?\#(\d{4}|\d{3}))?$^", $_POST["comp_telephone"]))) { $result=false; $error["comp_telephone"]="Please enter a valid telephone number"; } if((empty($_POST["comp_email"])) || (!preg_match("/^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$/i", $_POST["comp_email"]))) { $result=false; $error["comp_email"]="Please enter a valid email address"; } if(empty($_POST["comp_addr1"])) { $result=false; $error["comp_addr1"]="Please give the first line of your address"; } if(empty($_POST["comp_postcode"])) { $result=false; $error["comp_postcode"]="Please a valid postcode"; } if(empty($_POST["comp_answer"]) && ($answer==true)) { $result=false; $error["comp_answer"]="Please give your answer here"; } if($result==false) { } else { $accepted=true; $address_string=$_POST["comp_addr1"]." ".$_POST["comp_addr3"]." ".$_POST["comp_addr4"]; $name_string=$_POST["comp_fname"]." ".$_POST["comp_lname"]; $query="SELECT promo.promo_title, promo.promo_email_title, promo.promo_email FROM promo WHERE sys_account=".$config["account"]." AND promo.promo=".$_GET["id"]." LIMIT 1"; $result=database($query); while($row=mysql_fetch_array($result)) { $to = $row["promo_email"].", win@hitmusicradio.co.uk.co.uk"; $subj1 = $row["promo_title"]; $subj2 = $result["promo_email_title"]; } $subject = "Competition Submission: ".$subj1.$subj2; $message = "Someone has submitted a competition entry form:\r\n\r\nName: ".$name_string."\r\nAddress: ".$address_string."\r\nD.O.B (DD/MM/YYYY): ".$_POST["comp_dob"]."\r\nTelephone: ".$_POST["comp_telephone"]."\r\nEmail: ".$_POST["comp_email"]."\r\nOK To Share Details With Client: ".$_POST["comp_data_client"]."\r\n"; if ($answer==true) { $message .= "Answer: ".$_POST["comp_answer"]."\r\n"; } $message .= "\r\nThank you\r\n\r\nThis email been sent from ".$profile_data["full_name"]; $from = $_POST["comp_email"]; $headers = "From: $from"; mail($to,$subject,$message,$headers); if ($_POST["comp_data"]==true) { $query1="INSERT INTO newsletter (newsletter.newsletter_title, newsletter.newsletter_email, newsletter.newsletter_telephone, newsletter.newsletter_address, newsletter.newsletter_stamp, newsletter.newsletter_source, newsletter.sys_account, newsletter.newsletter_postcode, newsletter.newsletter_dob) VALUES ('".$name_string."', '".$_POST["comp_email"]."', '".$_POST["comp_telephone"]."', '".$address_string."', '".date("Y-m-d H:i:s")."', 'Competition - ".$subj1."', '".$config["account"].", '".$_POST["comp_postcode"]."', '".$_POST["comp_dob"]."')"; database($query1); } if ($_POST["comp_data_client"]==true) { $query2="INSERT INTO comp_client_data (comp_client_data.comp_client_data_title, comp_client_data.comp_client_data_email, comp_client_data.comp_client_data_telephone, comp_client_data.comp_client_data_address, comp_client_data.comp_client_data_stamp, comp_client_data.comp_client_data_source, comp_client_data.sys_account, comp_client_data.comp_client_data_postcode, comp_client_data.comp_client_data_dob) VALUES ('".$name_string."', '".$_POST["comp_email"]."', '".$_POST["comp_telephone"]."', '".$address_string."', '".date("Y-m-d H:i:s")."', '".$subj1."', '".$config["account"]."', '".$_POST["comp_postcode"]."', '".$_POST["comp_dob"]."')"; database($query2); } } } $query="SELECT promo.promo_email, promo.promo_email_title FROM promo WHERE sys_account=".$config["account"]." AND promo.promo=".$_GET["id"]." LIMIT 1"; $result=database($query); $shdform=null; while($row=mysql_fetch_array($result)) { $shdform=$row["promo_email_title"]; $semform=$row["promo_email"]; } if ((!empty($semform)) && ($accepted==false)) { $output["form"].=""; $output["form"].="
    "; $output["form"].="

    Fill in our online email form:



    "; $output["form"].="

    ".$shdform."

    "; if(!empty($error)) { $output["form"].="
    There were errors:
    "; } $output["form"].="
    "; $output["form"].=" "; $output["form"].=" "; $output["form"].="
    "; $output["form"].="
    First Name"; if (!empty($error["comp_fname"])) { $output["form"].=""; } $output["form"].="
    "; $output["form"].="
    "; $output["form"].="
    Last Name"; if (!empty($error["comp_lname"])) { $output["form"].=""; } $output["form"].="
    "; $output["form"].="
    "; $output["form"].="
    Telephone"; if (!empty($error["comp_telephone"])) { $output["form"].=""; } $output["form"].="
    "; $output["form"].="
    "; $output["form"].="
    Email"; if (!empty($error["comp_email"])) { $output["form"].=""; } $output["form"].="
    "; $output["form"].="
    "; $output["form"].="
    DOB (DD-MM-YYYY)"; if (!empty($error["comp_dob"])) { $output["form"].=""; } $output["form"].="
    "; $output["form"].="
    "; $output["form"].="
    "; $output["form"].="
    "; $output["form"].="
    Address line 1"; if (!empty($error["comp_addr1"])) { $output["form"].=""; } $output["form"].="
    "; $output["form"].="
    "; $output["form"].="
    Address line 2
    "; $output["form"].="
    "; $output["form"].="
    Town/City
    "; $output["form"].="
    "; $output["form"].="
    County
    "; $output["form"].="
    "; $output["form"].="
    Postcode"; if (!empty($error["comp_postcode"])) { $output["form"].=""; } $output["form"].="
    "; $output["form"].="
    "; $output["form"].="
    "; if ($answer==true) { if (!empty($shdform)) { $output["form"].="
    Answer"; } else { $output["form"].="
    Message"; } if (!empty($error["comp_answer"])) { $output["form"].=""; } $output["form"].="
    "; $output["form"].="
    "; $output["form"].=" "; $output["form"].="
    "; $output["form"].="
    Sign up to our VIPmail for the latest news and exclusive offers.
    "; } $output["form"].="
    Yes, I would like to become a VIPmail Member
    "; $output["form"].="
    "; $output["form"].="
    "; $output["form"].="
    Would you like to receive information from our promotion partners
    "; $output["form"].="
    Yes, I give my permission to share my details
    "; $output["form"].="
    "; $output["form"].="
    "; $output["form"].="
    "; $output["form"].=" "; $output["form"].="
    "; $output["form"].="
    "; } elseif ($accepted==true) { $output["form"].="

    Thank you, your email has been sent

    "; } return $output["form"]; } function relatednews($a_id) { global $config; $query="SELECT * FROM article WHERE article=".$a_id; $result=database($query); while($row=mysql_fetch_array($result)) { $commonWords = array('a','able','about','above','abroad','according','accordingly','across','actually','adj','after','afterwards','again','against','ago','ahead','ain\'t','all','allow','allows','almost','alone','along','alongside','already','also','although','always','am','amid','amidst','among','amongst','an','and','another','any','anybody','anyhow','anyone','anything','anyway','anyways','anywhere','apart','appear','appreciate','appropriate','are','aren\'t','around','as','a\'s','aside','ask','asking','associated','at','available','away','awfully','b','back','backward','backwards','be','became','because','become','becomes','becoming','been','before','beforehand','begin','behind','being','believe','below','beside','besides','best','better','between','beyond','both','brief','but','by','c','came','can','cannot','cant','can\'t','caption','cause','causes','certain','certainly','changes','clearly','c\'mon','co','co.','com','come','comes','concerning','consequently','consider','considering','contain','containing','contains','corresponding','could','couldn\'t','course','c\'s','currently','d','dare','daren\'t','definitely','described','despite','did','didn\'t','different','directly','do','does','doesn\'t','doing','done','don\'t','down','downwards','during','e','each','edu','eg','eight','eighty','either','else','elsewhere','end','ending','enough','entirely','especially','et','etc','even','ever','evermore','every','everybody','everyone','everything','everywhere','ex','exactly','example','except','f','fairly','far','farther','few','fewer','fifth','first','five','followed','following','follows','for','forever','former','formerly','forth','forward','found','four','from','further','furthermore','g','get','gets','getting','given','gives','go','goes','going','gone','got','gotten','greetings','h','had','hadn\'t','half','happens','hardly','has','hasn\'t','have','haven\'t','having','he','he\'d','he\'ll','hello','help','hence','her','here','hereafter','hereby','herein','here\'s','hereupon','hers','herself','he\'s','hi','him','himself','his','hither','hopefully','how','howbeit','however','hundred','i','i\'d','ie','if','ignored','i\'ll','i\'m','immediate','in','inasmuch','inc','inc.','indeed','indicate','indicated','indicates','inner','inside','insofar','instead','into','inward','is','isn\'t','it','it\'d','it\'ll','its','it\'s','itself','i\'ve','j','just','k','keep','keeps','kept','know','known','knows','l','last','lately','later','latter','latterly','least','less','lest','let','let\'s','like','liked','likely','likewise','little','look','looking','looks','low','lower','ltd','m','made','mainly','make','makes','many','may','maybe','mayn\'t','me','mean','meantime','meanwhile','merely','might','mightn\'t','mine','minus','miss','more','moreover','most','mostly','mr','mrs','much','must','mustn\'t','my','myself','n','name','namely','nd','near','nearly','necessary','need','needn\'t','needs','neither','never','neverf','neverless','nevertheless','new','next','nine','ninety','no','nobody','non','none','nonetheless','noone','no-one','nor','normally','not','nothing','notwithstanding','novel','now','nowhere','o','obviously','of','off','often','oh','ok','okay','old','on','once','one','ones','one\'s','only','onto','opposite','or','other','others','otherwise','ought','oughtn\'t','our','ours','ourselves','out','outside','over','overall','own','p','particular','particularly','past','per','perhaps','placed','please','plus','possible','presumably','probably','provided','provides','q','que','quite','qv','r','rather','rd','re','really','reasonably','recent','recently','regarding','regardless','regards','relatively','respectively','right','round','s','said','same','saw','say','saying','says','second','secondly','see','seeing','seem','seemed','seeming','seems','seen','self','selves','sensible','sent','serious','seriously','seven','several','shall','shan\'t','she','she\'d','she\'ll','she\'s','should','shouldn\'t','since','six','so','some','somebody','someday','somehow','someone','something','sometime','sometimes','somewhat','somewhere','soon','sorry','specified','specify','specifying','still','sub','such','sup','sure','t','take','taken','taking','tell','tends','th','than','thank','thanks','thanx','that','that\'ll','thats','that\'s','that\'ve','the','their','theirs','them','themselves','then','thence','there','thereafter','thereby','there\'d','therefore','therein','there\'ll','there\'re','theres','there\'s','thereupon','there\'ve','these','they','they\'d','they\'ll','they\'re','they\'ve','thing','things','think','third','thirty','this','thorough','thoroughly','those','though','three','through','throughout','thru','thus','till','to','together','too','took','toward','towards','tried','tries','truly','try','trying','t\'s','twice','two','u','un','under','underneath','undoing','unfortunately','unless','unlike','unlikely','until','unto','up','upon','upwards','us','use','used','useful','uses','using','usually','v','value','various','versus','very','via','viz','vs','w','want','wants','was','wasn\'t','way','we','we\'d','welcome','well','we\'ll','went','were','we\'re','weren\'t','we\'ve','what','whatever','what\'ll','what\'s','what\'ve','when','whence','whenever','where','whereafter','whereas','whereby','wherein','where\'s','whereupon','wherever','whether','which','whichever','while','whilst','whither','who','who\'d','whoever','whole','who\'ll','whom','whomever','who\'s','whose','why','will','willing','wish','with','within','without','wonder','won\'t','would','wouldn\'t','x','y','yes','yet','you','you\'d','you\'ll','your','you\'re','yours','yourself','yourselves','you\'ve','z','zero'); $searchterm=$row["article_title"]; $searchterm=preg_replace('/\b('.implode('|',$commonWords).')\b/','',$searchterm); $searchterm=trim($searchterm); $searchterm=preg_replace('/\s\s+/', ' ', $searchterm); $searchterms=explode(" ",$searchterm); $searchcat=$row["article_category"]; } $querysearch="AND (article.article_title LIKE "; $reps=count($searchterms); $i=1; foreach($searchterms as $term) { $querysearch.=" \"%".$term."%\""; if($i<$reps){ $querysearch.=" OR article.article_title LIKE "; } else { $querysearch.=")"; } $i++; } $query="SELECT article.article AS id, CONCAT(\"".$config["pathimage"]."article_image-\", article.article, \"-5.\", article.article_image) AS image, article.article_title AS title, article.article_text AS summary, CONCAT('".url(array("url"=>$location["name"],"query"=>array("id"=>null)))."', article.article) AS link FROM article WHERE article.article_category = '".$searchcat."' AND article.article!='".$a_id."' AND article.article_expire > CURDATE() AND article.sys_account = '".$config["news_account"]."' ".$querysearch." ORDER BY article.article_date DESC, article.article_headline DESC LIMIT 0, 4"; return($query); } // profile // $profile_query=database("SELECT profile.* FROM profile WHERE profile.sys_account = '".$config["account"]."'"); // if(mysql_num_rows($profile_query)!=1) { // exit("Profile for sys_account (".$config["account"].") does not exist"); // } else { // $profile_data=mysql_fetch_array($profile_query); // } // location $location=array(); if($config["htaccess"]==true) { $location["name"]=$_SERVER["REQUEST_URI"]; $location["name"]=explode("?",$location["name"]); $location["name"]=$location["name"][0]; if(substr($location["name"],-1)=="/") { $location["name"]=substr($location["name"],0,-1); } $location["name"]=explode("/",$location["name"]); if(sizeof($location["name"])==1) { $location["name"]=null; } else { $location["name"]=$location["name"][sizeof($location["name"])-1]; } } else { if(!empty($_GET["url"])) { $location["name"]=$_GET["url"]; } } if(empty($location["name"])) { $location["name"]="home"; } foreach($pages as $page) { if($page["name"]==$location["name"]) { $location=$page; } } if(empty($location["parent"])) { $location["parent"]=$location["name"]; } $location["uri"]=explode("/",$_SERVER["REQUEST_URI"]); $location["uri"]=$config["pathhttp"].$location["uri"][sizeof($location["uri"])-1]; // output - title $output["title"]=$location["label"]; // output - cufon $output["cufon"]=null; if($config["cufon"]==true) { $output["cufon"].=""; $output["cufon"].=""; $output["cufon"].=""; } // output - script $output["script"]=null; if($config["lowbandwidth"]==false) { $output["script"].=""; $output["script"].=""; } // output - logo $output["logo"]=null; switch($location["template"]) { case("homepage"): { } case("internal"): { } default: { $output["logo"].="

    ".htmlentities($profile_data["short_name"])."

    ".htmlentities($profile_data["strap_line"])."

    "; } } // output - dropdown $output["dropdown"]=null; switch($location["template"]) { case("homepage"): { } case("internal"): { } default: { $output["dropdown"].=""; } } // output - live $output["live"]=null; switch($location["template"]) { case("homepage"): { } case("internal"): { } default: { if (!fopen($config["path"]["schedulefeed"],"r")) { // failed to load XML file echo"Failed To Load On Air Data"; } else { $xml = simplexml_load_file($config["path"]["schedulefeed"]); $scheduledata = $xml->schedule; $schedule_start_time = $scheduledata->schedule_start_time; $schedule_end_time = $scheduledata->schedule_end_time; $schedule_title = $scheduledata->schedule_title; $pids = $scheduledata->pid; $exists = $pids->length > 0; if (!$pids) { $output["live"]="

    ".htmlentities(date("g:ia",strtotime($schedule_start_time)))." - ".htmlentities(date("g:ia",strtotime($schedule_end_time)))."

    ".htmlentities($schedule_title)."

    "; } else { $pid = $scheduledata->pid; $output["liveemail"]=$pid ; $output["live"]="

    ".htmlentities(date("g:ia",strtotime($schedule_start_time)))." - ".htmlentities(date("g:ia",strtotime($schedule_end_time)))."

    "presenters","query"=>array("id"=>$pid)))."\">".htmlentities($schedule_title)."

    "; } } break; } } // output - submenu $output["submenu"]=null; switch($location["template"]) { case("homepage"): { break; } case("internal"): { } default: { $current["count"]=0; $output["submenuitems"]=null; foreach($pages as $page) { if(($page["name"]==$location["parent"])||($page["parent"]==$location["parent"])) { if($page["menu"]==true) { if($current["count"]==0) { $output["submenu"].="
    "; $output["submenu"].="
    "; $output["submenu"].="
    "; $output["submenu"].="
    "; $output["submenu"].="
    "; $output["submenu"].="
    "; $output["submenu"].="

    ".$page["label"]."

    "; $output["submenu"].="
    "; $output["submenu"].="
    "; $output["submenu"].="
      "; } else { $output["submenuitems"].="
    • ".hyperlink(array("url"=>$page["name"],"label"=>$page["label"],"query"=>$page["query"]))."
    • "; } $current["count"]++; } } } if(!empty($output["submenuitems"])) { $output["submenu"].=$output["submenuitems"]; $output["submenu"].="
    "; $output["submenu"].="
    "; $output["submenu"].="
    "; $output["submenu"].="
    "; $output["submenu"].="
    "; $output["submenu"].="
    "; } else { $output["submenu"]=null; } } } // output - quicklinks $output["quicklinks"]=null; switch($location["template"]) { case("homepage"): { } case("internal"): { } default: { $query=database("SELECT quicklink.* FROM quicklink WHERE quicklink.sys_account = '".$config["account"]."' ORDER BY quicklink.quicklink_position ASC"); if(mysql_num_rows($query)>0) { $output["quicklinks"].="
    "; $output["quicklinks"].="
    "; $output["quicklinks"].="
    "; $output["quicklinks"].="
    "; $output["quicklinks"].="
    "; $output["quicklinks"].="
    "; $output["quicklinks"].="

    Quicklinks

    "; $output["quicklinks"].="
    "; $output["quicklinks"].="
    "; $output["quicklinks"].=""; $output["quicklinks"].="
    "; $output["quicklinks"].="
    "; $output["quicklinks"].="
    "; $output["quicklinks"].="
    "; $output["quicklinks"].="
    "; } } } // output - breadcrumbs $output["breadcrumbs"]=null; switch($location["template"]) { case("homepage"): { } case("internal"): { } default: { $output["breadcrumbs"].="

    "; if(!empty($location["parent"])) { foreach($pages as $page) { if(($page["name"]==$location["parent"])&&($location["name"]!=$location["parent"])) { $output["breadcrumbs"].=hyperlink(array("url"=>$page["name"],"label"=>$page["label"]))." - "; } } } $output["breadcrumbs"].=hyperlink(array("url"=>$location["name"],"label"=>$location["label"])); $output["breadcrumbs"].="

    "; } } // output - location name include("include.".$location["name"].".php"); // output - scroller $output["scroller"]=null; switch($location["template"]) { case("homepage"): { } case("internal"): { } default: { $query=database("SELECT hotspot.* FROM hotspot WHERE hotspot.hotspot_start <= CURDATE() AND hotspot.hotspot_end >= CURDATE() AND hotspot.sys_account = '".$config["account"]."' OR hotspot.sys_account = '".$config["hotspot_account"]."'"); if(mysql_num_rows($query)>0) { $output["scroller"].="
    "; } } } if(!empty($_POST["form"])) { $output["form"].="
    $location["name"],"query"=>$_GET))."\" method=\"post\" enctype=\"multipart/form-data\">"; $output["form"].=""; switch($_POST["form"]) { case("message"): { $output["form"].=heading(array("text"=>"Contact the Show")); $output["form"].="

    Simply complete this form to get in touch with the show.

    "; break; } case("enquiry"): { $output["form"].=heading(array("text"=>"Advertising Enquiry")); $output["form"].="

    Simply complete this form and a member of our advertising team will call you back as soon as possible.

    "; break; } case("contact"): { $output["form"].=heading(array("text"=>"Contact Us")); $output["form"].="

    Simply complete this form to contact us.

    "; break; } } $output["form"].="
    "; $output["form"].="
    "; $output["form"].="
    "; $output["form"].="
    "; $output["form"].="
    "; $output["form"].="
    "; $output["form"].="
    "; switch($_POST["form"]) { case("message"): { $output["form"].="
    "; $output["form"].="
    "; break; } case("enquiry"): { $output["form"].="
    "; $output["form"].="
    "; break; } case("contact"): { $output["form"].="
    "; $output["form"].="
    "; break; } } switch($_POST["form"]) { case("message"): { $output["form"].="
    "; $output["form"].="
    "; break; } } $output["form"].="
    "; $output["form"].="

    I am happy to receive information from ".$profile_data["short_name"]." and partners via ("privacy"))."\" target=\"_blank\">Privacy Policy):

      "; $output["form"].="
    • "; $output["form"].="
    "; $output["form"].=""; $output["form"].="
    "; $output["form"].=""; $output["form"].="
    "; $output["form"].=""; $output["form"].="
    "; $output["form"].=""; } // submit if(!empty($_POST["submit"])) { if(empty($_POST["dc_name"])) { $output["error"].="
  • Please enter your name
  • "; } if(empty($_POST["dc_email"])) { $output["error"].="
  • Please enter your email
  • "; } else { if(!preg_match("/^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$/i",$_POST["dc_email"])) { $output["error"].="
  • Please enter a valid email
  • "; } } switch($_POST["submit"]) { case("message"): { break; } } switch($_POST["submit"]) { case("message"): { if(empty($_POST["dc_file"])) { if($_FILES["dc_file"]["size"]>41943040) { $output["error"].="
  • Please ensure your attachment is less than 5Mb
  • "; } } break; } } if(!empty($output["error"])) { $output["error"]=heading(array("text"=>"Oops! Please check the following..."))."
      ".$output["error"]."
    "; } else { $email=true; switch($_POST["submit"]) { case("message"): { $subject="Instant Message - ".($profile_data["full_name"]); $output["notify"]=heading(array("text"=>"Thanks"))."

    We receive hundreds of messages every day, but we try to reply to every message we get. Keep listening!

    "; break; } case("enquiry"): { $subject="Enquiry - ".($profile_data["full_name"]); $output["notify"]=heading(array("text"=>"Thanks"))."

    Thanks for your enquiry. A member of our sales team will contact you as soon as possible.

    "; break; } case("contact"): { $subject="Contact us - ".($profile_data["full_name"]); $output["notify"]=heading(array("text"=>"Thanks"))."

    Your message has been sent successfully, thank you.

    "; break; } } if($email==true) { $html.=""; $html.="

    ".htmlentities($subject)."

    \n"; $html.="

    Name: ".htmlentities($_POST["dc_name"])."

    \n"; $html.="

    Email: ".htmlentities($_POST["dc_email"])."

    \n"; $html.="

    Mobile: ".htmlentities($_POST["dc_mobile"])."

    \n"; $html.="

    Message: ".htmlentities($_POST["dc_message"])."

    \n"; if(!empty($_FILES["dc_file"])) { $html.="

    Attachment: ".$_FILES["dc_file"]["type"]."

    \n"; $html.="

    File Error: ".$_FILES["dc_file"]["error"]."

    \n"; } $html.="
    "; include("email.php"); $email=new email(); if(!empty($_GET["presenter"])) { $query=database("SELECT presenter.presenter_email, presenter.presenter_cc FROM presenter WHERE presenter.presenter = '".$_GET["presenter"]."'"); if(mysql_num_rows($query)==1) { $data=mysql_fetch_array($query); if(!empty($data["presenter_email"])) { $email=new email(); $email->to($data["presenter_email"]); if(!empty($data["presenter_cc"])) { $email->cc($data["presenter_cc"]); } $email->subject($subject); $email->from($_POST["dc_email"]); $email->body($html); if(empty($_FILES["dc_file"])) { $email->body($html); } else { $email->body($html,$_FILES["dc_file"]); } $email->send(); } } } else { switch($_POST["submit"]) { case("enquiry"): { $email->to("wayne@hitmusicradio.co.uk"); break; } case("contact"): { $email->to("info@hitmusicradio.co.uk"); break; } } $email->subject($subject); $email->from($_POST["dc_email"]); $email->body($html); if(empty($_FILES["dc_file"])) { $email->body($html); } else { $email->body($html,$_FILES["dc_file"]); } $email->send(); } } // insert if(empty($_POST["dc_marketing_email"])) { $_POST["dc_marketing_email"]="NULL"; } $sql="INSERT INTO newsletter (newsletter_title, newsletter_email, newsletter_telephone, newsletter_stamp, sys_account) VALUES ('".str_replace("'","",$_POST["dc_name"])."', '".str_replace("'","",$_POST["dc_email"])."', '".str_replace("'","",$_POST["dc_mobile"])."', NOW(), '".$config["account"]."')"; $query=database($sql); } } // image $output["image"]=null; if(!empty($_GET["image"])) { if(empty($_GET["title"])) { $output["image"].=image(array("src"=>$_GET["image"],"container"=>"612x408")); } else { $output["image"].=image(array("src"=>$_GET["image"],"title"=>$_GET["title"],"container"=>"612x408")); $output["image"].="

    ".clean($_GET["title"])."

    "; } } // modal $output["modal"]=null; if((!empty($output["form"]))||(!empty($output["error"]))||(!empty($output["notify"]))||(!empty($output["image"]))) { $output["lock"]=" lock"; $output["modal"]="
    "; $output["modal"].="
    "; $output["modal"].="
    "; $output["modal"].="
    "; $output["modal"].="
    "; if(!empty($output["notify"])) { $output["modal"].="
    $location["name"]))."\" method=\"post\">"; $output["modal"].=$output["notify"]; $output["modal"].="
    "; $output["modal"].=""; $output["modal"].="
    "; $output["modal"].="
    "; $output["modal"].="
    "; } elseif(!empty($output["error"])) { $output["modal"].="
    $location["name"],"query"=>$_GET))."\" method=\"post\">"; foreach($_POST as $key => $value) { if($key!="submit") { $output["modal"].=""; } } $output["modal"].=$output["error"]; $output["modal"].="
    "; $output["modal"].=""; $output["modal"].="
    "; $output["modal"].="
    "; } elseif(!empty($output["form"])) { $output["modal"].=$output["form"]; } if(!empty($output["image"])) { unset($_GET["image"]); unset($_GET["imagetitle"]); $output["modal"].="
    $location["name"],"query"=>$_GET))."\" method=\"post\">"; $output["modal"].=$output["image"]; $output["modal"].=""; $output["modal"].="
    "; $output["modal"].=""; $output["modal"].="
    "; $output["modal"].="
    "; } $output["modal"].="
    "; $output["modal"].="
    "; $output["modal"].="
    "; $output["modal"].="
    "; $output["modal"].="
    "; } // template include("template.".$location["template"].".php"); ?>