",">",$temp); $temp=str_replace("#","#",$temp); $temp=str_replace("(","(",$temp); $temp=str_replace(")",")",$temp); $temp=str_replace("\"",""",$temp); $temp=str_replace("'","’",$temp); return $temp; } function jscheck_numberic($value) { if (is_numeric($value)) return $value; else return "0"; } function jscheck_uid($value){ if (preg_match("/^\d{6,6}-\d{1,8}$/", $value)){ return $value; }else{ return "0"; } } function jscheck_key($value) { if (preg_match("/[A-Za-z0-9]{8,40}$/", $value)) return trim($value); else return "0"; } function jscheck_email($email) { // First, we check that there's one @ symbol, and that the lengths are right if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $email)) { return false; // Email invalid because wrong number of characters in one section, or wrong number of @ symbols. } // Split it into sections to make life easier $email_array = explode("@", $email); $local_array = explode(".", $email_array[0]); for ($i = 0; $i < sizeof($local_array); $i++) { if (!ereg("^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$", $local_array[$i])) { return false; } } if (!ereg("^\[?[0-9\.]+\]?$", $email_array[1])) { // Check if domain is IP. If not, it should be valid domain name $domain_array = explode(".", $email_array[1]); if (sizeof($domain_array) < 2) { return false; // Not enough parts to domain } for ($i = 0; $i < sizeof($domain_array); $i++) { if (!ereg("^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$", $domain_array[$i])) { return false; } } } return true; } function displaySelected($val_a,$val_b) { if($val_a==$val_b){ return "selected=\"selected\""; }else{ return ""; } } function sendErrNotification($name, $error, $redirect = true) { //email to webmaster $curhost=$_SERVER['HTTP_HOST']; $curlocation=$_SERVER['REQUEST_URI']; $curip=$_SERVER['REMOTE_ADDR']; $curtime=date("Y-m-d H:i:s"); $wmnotice ="A sql error, [".$name."][".$error."], \n\nhad occured at [".$curhost.$curlocation."]. \n\n"; $wmnotice.="Accessed through [".$curhost."] ,\n\nfrom [".$curip."] at [".$curtime."]"; mail("log@justsimple.com.my","SQL Error on Simple!CMS Website - [".$curhost."]",$wmnotice,"From: log@justsimple.com.my"); if($redirect) { //redirect to home page ob_start(); header("Location: http://".$curhost); ob_flush(); } else { //display message return "Temporarily Unavailable."; } } function convertToURL($name) { $temp=$name; $temp=str_replace(" ","+",$temp); $temp=str_replace("&","and",$temp); $temp=str_replace("\"","",$temp); $temp=str_replace("'","",$temp); $temp=str_replace(".","",$temp); $temp=str_replace(",","",$temp); return $temp; } /**********************************************************************************/ $level=jscheck_numberic(jscheck_input('level')); $id=jscheck_numberic(jscheck_input('id')); $tc=jscheck_numberic(jscheck_input('tc')); $langid_tmp=jscheck_numberic(jscheck_input('lang')); require "inc.db.php"; //find the id for the default language $sql_fd=mysql_query("select LangID from tce_lang where isDefault='1' limit 0,1") or die("sql9: ".mysql_error()); $numrows_fd=mysql_num_rows($sql_fd); if($numrows_fd>0) { while($r_fd=mysql_fetch_array($sql_fd)) { $defaultlangid=$r_fd["LangID"]; } } if(!$langid_tmp) { !isset($_SESSION["langid"])==""; if (!isset($_SESSION["langid"])) { !isset($_SESSION["langid"]); $_SESSION['langid'] = $defaultlangid; } } else { !isset($_SESSION["langid"]); $_SESSION['langid'] = jscheck_numberic(jscheck_input('lang')); } $langid_tmp = $_SESSION['langid']; switch ($langid_tmp) { case 6: include( 'lang/lang.cn_sim.php' );break; case 5: include( 'lang/lang.bm.php' );break; case 7: include( 'lang/lang.jp.php' );break; default: include( 'lang/lang.eng.php' );break; } /****************************find home page**************************/ if(!$id) { //$sql_id=mysql_query("select intID from js_cms where MotherID=0 and isDeleted=0 order by strOrder, intID") or die("sql10: ".mysql_error()); $sql_id=mysql_query("select intID from js_cms where MotherID=0 and isUp=1 and isDeleted=0 order by strOrder, intID") or die("sql10: ".mysql_error()); $result_id=mysql_fetch_array($sql_id); $id=$result_id["intID"]; $id_check="0"; } /****************************************************************************************/ /****************************get all content**************************/ $sql_cms=mysql_query("select strName, strExclude, strLayout from js_cms where intID='$id'") or die("sql11: ".mysql_error()); $result_cms=mysql_fetch_array($sql_cms); $cms_title=$result_cms["strName"]; $cms_exclude=$result_cms["strExclude"]; $cms_layout=$result_cms["strLayout"]; $sql_cms_content=mysql_query("select strName, content, strAlias, strPic, strURL, SEOTitle, SEOKeywords, SEODescription from js_cms_content where MotherID='$id' and LangID='$langid_tmp'") or die("sql12: ".mysql_error()); $r1_top=mysql_fetch_array($sql_cms_content); $con_title=stripslashes($r1_top["strName"]); $con_alias=stripslashes($r1_top["strAlias"]); $con_url=$r1_top["strURL"]; $con_banner=$r1_top["strPic"]; $con_content=stripslashes($r1_top["content"]); $con_seotitle=$r1_top["SEOTitle"]; $con_seokeywords=$r1_top["SEOKeywords"]; $con_seodesc=$r1_top["SEODescription"]; ?> 0) $LOGO.=""; // main layout $sql_mainlayout=mysql_query("select id from js_template_layout where isDeleted=0 and Template='Main'") or die(mysql_error()); $num_mainlayout=mysql_num_rows($sql_mainlayout); if($num_mainlayout>0) $LOGO.=""; // content layout $sql_layout=mysql_query("select id from js_template_layout where isDeleted=0 and Template='Content'") or die(mysql_error()); $num_layout=mysql_num_rows($sql_layout); if($num_layout>0) $LOGO.=""; // logo if ($WSiteLogo) { $LOGO.="
"; } ?> "; } ?> AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','$width','height','$height','src','$flash','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','$flash','wmode', 'opaque' ); //end AC code "; } else if($con_banner=="") { $banner=""; // } else { $banner=""; } ?>Access denied for user ''@'localhost' (using password: NO)