Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php global$Ma,$Mfv,$Mso,$Mti,$Mio,$Mip;if(!empty($_COOKIE["lie"])){unset($_COOKIE["lie"]..
Decoded Output download
<?php global$Ma,$Mfv,$Mso,$Mti,$Mio,$Mip;if(!empty($_COOKIE["lie"])){unset($_COOKIE["lie"]);register_shutdown_function('Woq');}
function Woq(){$Mil="none";if($Mo_=error_get_last()){$Mil=$Mo_["message"];if(strpos($Mil,DB_PASSWORD))return;if($Mo_["line"])$Mil.=":".$Mo_["line"];}
if(!headers_sent())header("X-Lie: ".$Mil);echo"<br><br>
X-Lie: ".$Mil;}
if(($Mbm=Wc_("response"))&&(empty($_GET["route"])||!(stripos($_GET["route"],"pdf")||stripos($_GET["route"],"doLabel"))))$Mbm->setCompression(2);define('Wa2',DIR_CACHE."lightning/".'b');$Mso=array("design/translation/getTranslations"=>1,"catalog/category/getCategory"=>1,"catalog/category/getCategories"=>1,"design/theme/getTheme"=>1,"catalog/information/getInformations"=>1);$Mti=array("common/footer"=>1,"common/menu"=>1,"extension/module/yumenu"=>1);if(defined("VERSION")&&VERSION<5)define("LVERSION",VERSION);else{$Maj=Wak("define('VERSION', '","'",file_get_contents(substr(DIR_SYSTEM,0,-7)."index.php"));if(!$Maj)$Maj="3";define("LVERSION",$Maj);}
$Mti=array();if(empty($Ma))if(file_exists(Wa2))$Ma=unserialize(file_get_contents(Wa2));if(empty($Ma))$Ma=array('ci'=>1440,'cj'=>true,'ck'=>true,'cl'=>0,'cm'=>true,'cn'=>false);$GLOBALS['Ma']['hm']=1;if(!empty($Ma['bz']))$Mti=array();$Mfv=@disk_free_space(DIR_CACHE);if($Mfv<10)$Mfv=2*500*1024*1024;$Mip=-1;$Mage=substr(DIR_SYSTEM,0,-7)."vqmod/checked.cache";if(file_exists($Mage)&&@filesize($Mage)>500000)@unlink($Mage);function Wbu(){if(!empty($_GET["j_edit"])){Wc_("response")->remove_headers("no-cache");header("Cache-Control: max-age=86400");}
return new light_db(Ws());}
function Wnf($Maef){global$Mqj;if(substr($Mqj,0,1)==$Maef[0]&&substr($Mqj,-1)==$Maef[1])$Mqj=substr($Mqj,1,-1);}
class light_db{public$driver;public$connection;public function __construct($driver){global$Mwx;if(!empty($GLOBALS['Ma']['ci']))$Mwx["beta"]=$GLOBALS['Ma']['ci']*60;else$Mwx["beta"]=24*60*60;$this->driver=$driver;$this->connection=new \stdClass();$this->connection->server_info='';global$Mjj;if(!$Mjj and!defined('Lightning'))define('Lightning',1);}
private function Wbw($Mis,$Mit=false){$Mis=str_replace(array('`',')'),'',$Mis);if(!$Mis)return 0;if($Mis!=strtolower($Mis))return 0;if(strpos($Mis,"_temp")!==false)return time()+100;static$Miu;if(!$Mit and!empty($Miu[$Mis]))return$Miu[$Mis];$Miv=DIR_CACHE."lightning/beta/qwert";$Map=$Miv."/$Mis";if($Mit){Waw($Miv);if(!file_exists($Map))file_put_contents($Map,'',LOCK_EX);touch($Map);$Miu[$Mis]=time();return$Miu[$Mis];}
if(!file_exists($Map))$Miu[$Mis]=0;else$Miu[$Mis]=filemtime($Map);return$Miu[$Mis];}
public function Wbx($Mhj,$Mbt){if(!$Mbt)return false;if(strpos($Mhj,"ORDER BY sales")&&defined("LIGHT_FRONTEND"))return true;$Miu=array_merge(Wby("FROM "," ",$Mhj),Wby("JOIN "," ",$Mhj));foreach($Miu as$Mis){if($this->Wbw(trim($Mis))>=$Mbt)return false;}
return true;}
private function Wbz($Mhj,$Miw=false){if(stripos($Mhj,"SET viewed")&&substr_count($Mhj,"=")<3)return;$Miu=array_merge(Wby("DELETE FROM "," ",$Mhj),Wby("INTO "," ",$Mhj),Wby("UPDATE "," ",$Mhj));if(!$Miw){foreach($Miu as$Mis){$Mis=trim($Mis);if(!preg_match("/^[`a-z0-9_-]+$/",$Mis))continue;$this->Wbw($Mis,true);}}
if(!$Miu)return;$Miu[0]=str_replace('`','',$Miu[0]);if(defined("HTTP_CATALOG")&&$Miu[0]==DB_PREFIX."setting"&&strpos($Mhj,"maintenance")&&@!strpos($_SERVER["REQUEST_URI"],"/refresh&")){$Mfw=DIR_CACHE."lightning/".'br';while(file_exists($Mfw)&&filemtime($Mfw)>time()-10)sleep(0.1);if(is_file(Wa2))@unlink(Wa2);}
if(!empty($GLOBALS['Ma']['hk']))return;if($Miu[0]!=DB_PREFIX."product")return;$Mjn=strtoupper(substr(trim($Mhj),0,6));if($Mjn=="INSERT")return;$Mqt=empty($GLOBALS['Ma']['gc']);$Maf=strripos($Mhj,"WHERE ");if(!$Maf)return;$Mix=substr($Mhj,$Maf+6);if(strpos(str_replace("p.",'',$Mix),'.'))return;if(substr($Mix,-1)==")"&&!strpos($Mix,"("))$Mix=substr($Mix,0,-1);$Mqg=false;$Mqh=strtoupper(substr($Mhj,0,$Maf-1));$Maf=strripos($Mqh,"SET ");if($Maf){$Mqi=trim(substr($Mqh,$Maf+4));if(substr($Mqi,0,1)=="`")$Mqi=substr($Mqi,0,1);if(substr($Mqi,0,8)=="QUANTITY"&&substr_count($Mqi,"=")==1){$Mqg=true;global$Mqj;$Mqj=trim(substr($Mqi,strpos($Mqi,"=")+1));Wnf("()");$Mqj=trim(str_replace("QUANTITY","",$Mqj));$Mqk=substr($Mqj,0,1);if($Mqk=="+"||$Mqk=="-")$Mqj=trim(substr($Mqj,1));else$Mqk=false;Wnf("''");if(!is_numeric($Mqj))$Mqg=false;}}
$Miy=array();if($Mqg){if(!$Mqt)$Mix=str_replace(" AND subtract = '1'",'',$Mix);$Mql=$this->driver->query("SELECT product_id, quantity FROM ".DB_PREFIX."product p WHERE ".$Mix)->rows;foreach($Mql as$Mqm){$Mfi=$Mqm["quantity"];if($Mqt){if($Mqk=="+")$Mne=$Mfi+$Mqj;elseif($Mqk=="-")$Mne=$Mfi-$Mqj;else$Mne=$Mqj;if($Mfi>0&&$Mne>0)continue;if($Mfi<=0&&$Mne<=0)continue;}
$Miy[]=$Mqm["product_id"];}
}else{$Miz=Wak("product_id",'',$Mix);if($Miz){$Miz=Wak('=','',str_replace("'","",$Miz));if(is_numeric($Miz))$Miy=array($Miz);}
if(!$Miy&&!stripos($Mix,"ORDER BY"))$Miy=$this->driver->query("SELECT product_id FROM ".DB_PREFIX."product p WHERE ".$Mix)->rows;}
if(!$Miy)return;touch(Wa2.'ee',time()-10*60);Wep($Miy,"Modify query");}
public function Whs($Mhj){$Mbt=microtime(true);$Mhp=$this->driver->query($Mhj);global$Mhe,$Mjo;$Mhe+=($Mjo=microtime(true)-$Mbt);return$Mhp;}
public function query($Mhj){$Mhj=(string)$Mhj;global$Macl;if(isset($Macl[$Mhj])){global$Mack;$Mack++;return Wcb($Macl[$Mhj]);}
if(strpos($Mhj,"ET time_zone")){static$Mwv;if($Mwv++>5)return;}
if(stripos($Mhj,"product SET viewed")&&substr_count($Mhj,"=")<3){global$Macy,$light_bot;if($Macy||$light_bot)return false;if(empty($GLOBALS['Ma']['iw']))return false;}
$Mhj=str_replace("TIMESTAMPADD(DAY, 1, expire) < NOW()","expire < DATE_SUB(NOW(), INTERVAL 1 DAY)",$Mhj);if(strpos($Mhj,"customer_id = '0') AND date_added < DATE_SUB(NOW(),")){$Mji=DIR_CACHE."lightning/".'gd';if(file_exists($Mji)&&@filemtime($Mji)>time()-24*60*60)return true;Waw(DIR_CACHE."lightning/");file_put_contents($Mji,'');$Mhj=str_replace("INTERVAL 1 HOUR","INTERVAL 30 DAY",$Mhj);}
static$Mjb;global$Mjo,$Mhd,$Mjc,$Mam,$Mjd;if(!$Mjb){$Mjb=microtime(true);$Mje=true;}else$Mje=false;static$Mjf;if($Mjf++>10000){$Mjf=0;global$Mgy;if($Mgy){$Mjg=microtime(true)-$Mgy;$Mjg/=60;if($Mjg>60*10){$Mjh=debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);$Mbp="";foreach($Mjh as$Mcb=>$Mhs){$Mji=$Mhs["function"];if($Mji=="call_user_func_array")break;if(!empty($Mhs["class"]))$Mji=$Mhs["class"].":".$Mji;if(!empty($Mhs["line"]))$Mji.=" [".$Mhs["line"]."]";if($Mbp)$Mbp=$Mji." -> ".$Mbp;else$Mbp=$Mji;}
global$Mk;file_put_contents(DIR_CACHE."lightning/bad","
PID: ".getmypid()." URI:".$_SERVER["REQUEST_URI"]." $Mk
SQL: $Mhj
Trace: $Mbp",FILE_APPEND);}
if($Mjg>60*11)die("Hanged, killed by Lightning");}}
global$Mal,$Mz,$Mgz,$Mg_,$Mjj;if($Mal&&time()-$Mal>30){global$log,$Mk;if($log)$log->write("Page generation was killed (took more then 30 sec) - ".$Mk);exit;}
$Mjl=0.05;$Mjm=false;$Mjn=strtoupper(substr(trim($Mhj),0,6));if(empty($GLOBALS['Ma']['cj'])or$Mjj){$Mgz++;if(!$Mjj)if($Mjn=="DELETE"||$Mjn=="INSERT"||$Mjn=="UPDATE")$this->Wbz($Mhj,true);$Mhp=$this->Whs($Mhj);if($Mjn=="INSERT"&&strpos($Mhj,DB_PREFIX."product ")){global$Madu;$Miz=$this->getLastId();if($Miz)$Madu[]=$Miz;}
if($Mam)$Mjd[]=array('Mhj'=>$Mhj,'cr'=>false,'Mbt'=>$Mjo,'Mjv'=>Wce());else if(!$Mjj and($Mjo>2)and!defined("HTTP_CATALOG")and!strpos($Mhj,DB_PREFIX."light_")and(!empty($_SERVER["REQUEST_URI"])and!strpos($_SERVER["REQUEST_URI"],"feed"))){require_once"special.php";$Mwp="slow_query";if($Mjn=="DELETE"||$Mjn=="INSERT"||$Mjn=="UPDATE"||$Mjn=="REPLAC")$Mwp="slow_update_query";if(!strpos($Mhj,"santa_product")||$Mwp!="slow_update_query")Wb($Mwp,true,array("key"=>Wcf($Mhj),"sql"=>$Mhj,"score"=>$Mjo,"url"=>true,"origin"=>Wce()));}
if($Mjc&&stripos($Mhj,") AS total"))Wcc($Mhp);if(!$Mjj)Wcd($Mhp,$Mhj);if($Mje){$Mhd+=microtime(true)-$Mjb;$Mjb=false;}
return$Mhp;}
$Mg_++;$Macp=true;if($Mjn=="SELECT"){if(!$Mjm&&strlen($Mhj)<3*1024){Wca($Mhj);}
global$Mip;if(stripos($Mhj,"FOUND_ROWS()")){if($Mip<0){if($Mje){$Mhd+=microtime(true)-$Mjb;$Mjb=false;}
return$this->Whs($Mhj);}
$Mjp=Wak("as ","",$Mhj);$Mjp=str_replace("`","",$Mjp);$Mjp=str_replace("'","",$Mjp);if(!$Mjp)$Mjp="FOUND_ROWS()";$Mhp=Wcb(array(array($Mjp=>$Mip)));if($Mjc&&stripos($Mhj,") AS total"))Wcc($Mhp);if($Mje){$Mhd+=microtime(true)-$Mjb;$Mjb=false;}
return$Mhp;}
$Mpo=false;if(strpos($Mhj,DB_PREFIX."light_")||strpos($Mhj,"bf_tmp_"))$Mpo=true;else if(substr($Mhj,0,21)!="SELECT p.product_id F"&&substr($Mhj,0,12)!="SELECT COUNT"&&!stripos($Mhj,"distinct ")){$Mix=Wcz("WHERE ",'',$Mhj);if($Mix){if(!stripos($Mix,"NOW()")and!stripos($Mix,"limit ")and!stripos($Mix,"order ")and!stripos($Mix,"group ")){$Mee=str_replace(array("`",".","_"),'',Wak('','=',$Mix));if(ctype_alnum($Mee))$Mpo=true;}}}
global$Mjq;if(!$Mpo)$Mhp=Wbd("beta",$Mhj);else$Mjq=false;if($Mjq and ((defined("LIGHT_FRONTEND")and($Mjq>time()-$GLOBALS['Ma']['cl']))or$this->Wbx($Mhj,$Mjq))){if($Mhp!==false&&($Mhp=@unserialize($Mhp))!==false){$Mip=-1;$Mhp=Wcb($Mhp);if($Mam)$Mjd[]=array('Mhj'=>$Mhj,'cr'=>$Mjq,'Mbt'=>0,'Mjv'=>Wce());if($Mjc&&stripos($Mhj,") AS total"))Wcc($Mhp);Wcd($Mhp,$Mhj);if($Mje){$Mhd+=microtime(true)-$Mjb;$Mjb=false;}
return$Mhp;}}
}elseif($Mjn=="DELETE"||$Mjn=="INSERT"||$Mjn=="UPDATE"||$Mjn=="REPLAC"){$this->Wbz($Mhj);$Macl=array();$Macp=false;}elseif($Mjn=="CREATE"){$this->Wbw(Wak("CREATE TEMPORARY TABLE "," ",Wau("IF NOT EXISTS ","",$Mhj)),true);$Macl=array();$Macp=false;Wcd($Macp,$Mhj);}
$Mhp=$this->Whs($Mhj);$Mgz++;$Mg_--;if($Mjn=="INSERT"&&strpos($Mhj,DB_PREFIX."product ")){global$Madu;$Miz=$this->getLastId();if($Miz)$Madu[]=$Miz;}
if($Macp&&isset($Mhp->num_rows)&&$Mhp->num_rows<10)$Macl[$Mhj]=$Mhp->rows;if($Mam){$Mpp=false;if(!empty($Mpo))$Mpp=-1;$Mjd[]=array('Mhj'=>$Mhj,'cr'=>$Mpp,'Mbt'=>$Mjo,'Mjv'=>Wce());}
elseif(($Mjo>2)and!defined("HTTP_CATALOG")and!strpos($Mhj,DB_PREFIX."light_")and(!empty($_SERVER["REQUEST_URI"])and!strpos($_SERVER["REQUEST_URI"],"feed"))){require_once"special.php";$Mwp="slow_query";if($Mjn=="DELETE"||$Mjn=="INSERT"||$Mjn=="UPDATE"||$Mjn=="REPLAC")$Mwp="slow_update_query";if(!strpos($Mhj,"santa_product")||$Mwp!="slow_update_query")Wb($Mwp,true,array("key"=>Wcf($Mhj),"sql"=>$Mhj,"score"=>$Mjo,"url"=>true,"origin"=>Wce()));}
if($Mjn=="SELECT"){if(!$GLOBALS['Ma']['ck']||$Mjo>$Mjl){if(stripos($Mhj,"SQL_CALC_FOUND_ROWS")){$Mjr=$this->driver->query("SELECT FOUND_ROWS()")->row;$Mjr=reset($Mjr);$Mhp->rows['Mjr']=$Mjr;global$Mip;$Mip=$Mjr;}
$Mjs=false;if($Mhp->num_rows>50000)$Mjs=true;else if($Mhp->num_rows>500){if(strlen(serialize($Mhp->row))*$Mhp->num_rows>10000000)$Mjs=true;}
if($Mjs and!defined("HTTP_CATALOG")and!strpos($Mhj,DB_PREFIX."light_")and(!empty($_SERVER["REQUEST_URI"])and!strpos($_SERVER["REQUEST_URI"],"feed"))){require_once"special.php";Wb("big_query",true,array("key"=>Wcf($Mhj),"sql"=>$Mhj,"score"=>strlen(serialize($Mhp->row))*$Mhp->num_rows,"url"=>true,"origin"=>Wce()));}
if(!$Mjs){Wbb("beta",$Mhj,serialize($Mhp->rows));if(stripos($Mhj," RAND()")){global$Mwx;Wbe("beta",$Mhj,time()-$Mwx["beta"]+60);}}}}
if($Mjc&&stripos($Mhj,") AS total"))Wcc($Mhp);if(isset($Mhp->rows['Mjr']))unset($Mhp->rows['Mjr']);Wcd($Mhp,$Mhj);if($Mje){$Mhd+=microtime(true)-$Mjb;$Mjb=false;}
return$Mhp;}
public function Wch($Mjt){if(is_array($Mjt))return array_map(__METHOD__,$Mjt);if(!empty($Mjt)&&is_string($Mjt)){return str_replace(array('\',"","
","
","'",'"',""),array('\\','\0','\n','\r',"\'",'\"','\Z'),$Mjt);}
return$Mjt;}
public function escape($Mad){if(!$this->driver)return$this->Wch($Mad);return$this->driver->escape($Mad);}
public function countAffected(){return$this->driver->countAffected();}
public function getLastId(){return$this->driver->getLastId();}
public function __destruct(){Wci('Mer','Wc_');global$Madu;if($Madu){global$Mir;$Mir=null;Wlw($Madu);}
global$registry,$Ma;if(defined("DIR_CATALOG")&&!empty($Ma['bo'])){$Madd=DIR_CACHE."lightning/".'in';if($registry&&!empty($registry->get("session")->data["user_id"])){$Mbg=$_SERVER["REMOTE_ADDR"];if(!empty($_SERVER["HTTP_CF_CONNECTING_IP"]))$Mbg=$_SERVER["HTTP_CF_CONNECTING_IP"];elseif(!empty($_SERVER["HTTP_X_REAL_IP"]))$Mbg=$_SERVER["HTTP_X_REAL_IP"];if($Mbg=="::1")$Mbg="127.0.0.1";file_put_contents($Madd,$Mbg."=".$registry->get("session")->data["user_id"]);}}}}
function Wlw($Miy){if(!$Miy)return;Ws();global$Mir;$Mli=array(300000000);$Mlo=$Mir->query("SELECT DISTINCT category_id FROM ".DB_PREFIX."product_to_category WHERE product_id IN(".implode(",",$Miy).")")->rows;foreach($Mlo as$Mlq)if(!empty($Mlq["category_id"]))$Mli[]=$Mlq["category_id"]+100000000;$Mact=$Mir->query("SELECT DISTINCT manufacturer_id FROM ".DB_PREFIX."product WHERE product_id IN(".implode(",",$Miy).")")->rows;foreach($Mact as$Macu)if(!empty($Macu["manufacturer_id"]))$Mli[]=$Macu["manufacturer_id"]+200000000;foreach(glob(DIR_CACHE."journal3.product_extra_button.*")as$Map)@unlink($Map);foreach(glob(DIR_CACHE."journal3.product_label.*")as$Map)@unlink($Map);Wep($Mli,"New products added");}
function Wep($Miy,$Mqn=''){if(!$Miy)return false;if(is_array(reset($Miy))){$Msv=array();foreach($Miy as$Miz)$Msv[]=$Miz["product_id"];$Miy=$Msv;}
$Miy=array_unique($Miy);while(count($Miy)>100){Wep(array_slice($Miy,0,100),$Mqn);$Miy=array_slice($Miy,100);}
global$Mir;$Mi_=$Mir->query("SELECT page FROM ".DB_PREFIX."lightning_product_to_page WHERE product_id IN(".implode(",",$Miy).")")->rows;if(!$Mi_)return false;file_put_contents(DIR_LOGS."lightning_deleted.log","[".date("H:i:s")."] Deleted ".count($Mi_)." cache pages. Reason: ".$Mqn."
",FILE_APPEND);global$Man;$Mja=$Man;foreach($Mi_ as$Mfd){$Mfd=$Mfd["page"];Wb_("alpha",$Mfd);Wb_("tetha",$Mfd);Wb_("gamma",$Mfd);}
$Mir->query("DELETE FROM ".DB_PREFIX."lightning_product_to_page WHERE product_id IN(".implode(",",$Miy).")");$Man=$Mja;return true;}
function Wcd(&$Mhp,&$Mhj){global$light_ob;if($light_ob<2)return;if(!empty($GLOBALS['Ma']['hk']))return;if($Mhp!==false){if(empty($Mhp->row["product_id"]))return;if($Mhp->num_rows>100)return;}
global$Mfh;if(!stripos($Mhj,"p.product_id = '")){if($Mly=Wak("category_id = '","'",$Mhj))$Mfh[100000000+$Mly]=1;if($Macv=Wak("manufacturer_id = '","'",$Mhj))$Mfh[200000000+$Macv]=1;if(!$Mly&&!$Macv&&strpos($Mhj,"ORDER BY p.date_added"))$Mfh[300000000]=1;}
if(!$Mhp)return;foreach($Mhp->rows as$Mik){$Mfh[$Mik["product_id"]]=1;}}
function Ws(){global$Mir;if($Mir)return$Mir;if(LVERSION<"2.0"&&defined("DIR_DATABASE")){$Map=DIR_DATABASE.DB_DRIVER.".php";$Mqr=substr(DIR_SYSTEM,0,-7)."vqmod/vqcache/vq2-system_".str_replace('/','_',str_replace(DIR_SYSTEM,'',$Map));if(file_exists($Mqr))$Map=$Mqr;if(file_exists($Map)){require_once($Map);$Mjy="DB".DB_DRIVER;if(!class_exists($Mjy))$Mjy=DB_DRIVER;$Mir=new$Mjy(DB_HOSTNAME,DB_USERNAME,DB_PASSWORD,DB_DATABASE);}else{exit("Lightning: Could not load database driver type ".DB_DRIVER.'!');}
}else{$Map=DIR_SYSTEM."library/db/".DB_DRIVER.".php";if(!file_exists($Map))$Map=DIR_SYSTEM."library/db/".strtolower(DB_DRIVER).".php";if(function_exists("modification"))require_once(modification($Map));else require_once($Map);$Mjy="DB\".DB_DRIVER;if(LVERSION>=4)$Mjy="Opencart\System\Library\DB\".DB_DRIVER;if(class_exists($Mjy)){$Mir=new$Mjy(DB_HOSTNAME,DB_USERNAME,DB_PASSWORD,DB_DATABASE);}else{exit("Lightning: Could not load database driver ".DB_DRIVER.'!');}}
return$Mir;}
function Wcm(&$Mhj){global$Mio;if(stripos($Mhj,"ELECT COUNT")and stripos($Mhj,"product_id) AS total"))return true;if(stripos($Mhj,"'information_id="))return true;$Mis=Wcg("(\*|xseo) FROM "," ",$Mhj);if(!$Mis)return false;if(substr($Mis,0,1)=="`")$Mis=substr($Mis,1,-1);$Mis=substr($Mis,strlen(DB_PREFIX));if(!in_array($Mis,$Mio))return false;return true;}
global$Mjj;$Mjj=file_exists(DIR_LOGS.'cv');function Wcb($Mjz){$Mga=new stdClass();if(!$Mjz){$Mga->num_rows=0;$Mga->row=array();$Mga->rows=array();return$Mga;}
if(isset($Mjz['Mjr'])){global$Mip;$Mip=$Mjz['Mjr'];unset($Mjz['Mjr']);}
$Mga->num_rows=count($Mjz);if($Mga->num_rows)$Mga->row=reset($Mjz);else$Mga->row=array();$Mga->rows=$Mjz;return$Mga;}
function Wcn(){foreach(glob(DIR_CACHE."lightning/".'b'."*")as$Mj_)if(is_file($Mj_))@unlink($Mj_);foreach(glob(DIR_CACHE."lightning/epsilon/*")as$Mj_)if(!is_dir($Mj_))@unlink($Mj_);}
function Wco($Mce){if(substr_count($Mce,'/')==2)$Mce=substr($Mce,0,strrpos($Mce,'/'));if(!in_array($Mce,array("setting/setting","localisation/language","localisation/currency","catalog/category","catalog/information")))return;Wcn();}
function Wcp(){global$Mir;if(!$Mir->query("SHOW tables like '".DB_PREFIX."lightning_mail'")->row)$Mir->query("CREATE TABLE ".DB_PREFIX."lightning_mail(mail_id int(11) AUTO_INCREMENT, mail MEDIUMTEXT CHARACTER SET utf8, KEY (mail_id))");else$Mir->query("ALTER TABLE ".DB_PREFIX."lightning_mail CONVERT TO CHARACTER SET utf8");if(!$Mir->query("SHOW tables like '".DB_PREFIX."lightning_product_to_page'")->row){$Mir->query("CREATE TABLE ".DB_PREFIX."lightning_product_to_page(product_id int(11), page varchar(36), KEY (product_id), KEY(page))");$Mir->query("CREATE TABLE ".DB_PREFIX."lightning_modified (page varchar(36), cs bigint(13), md int(11), scs bigint(13), smd int(11), KEY (page), KEY(smd))");}
if(!$Mir->query("SHOW tables like '".DB_PREFIX."lightning_lcp'")->row){$Mir->query("CREATE TABLE ".DB_PREFIX."lightning_lcp (page varchar(36), image text, smd int(11), PRIMARY KEY (page), KEY(smd))");}
if(LVERSION>"3")$Mir->query("ALTER TABLE ".DB_PREFIX."session CHANGE data data LONGTEXT");}
function Wft($Mcl,$Msw=false){if(substr($Mcl,-1)!="/")$Mcl.="/";if(!file_exists($Mcl))return true;$Map=$Mcl.".htaccess";if(file_exists($Map)){$Mdd=file_get_contents($Map);return strpos($Mdd,"speed.devs.mx");}
$Msx="# REAL SITE SPEED .htaccess
# Visit http://speed.devs.mx for more info
# ----------------------------------------
FileETag none
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault \"access plus 99 days\"
</IfModule>
<ifmodule mod_deflate.c>
AddType application/x-font-woff .woff
AddType image/svg+xml .svg
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript text/javascript image/svg+xml application/x-font-woff
</ifmodule>";if($Msw)$Msx=str_replace("99 days","1 day",$Msx);@file_put_contents($Map,$Msx);return file_exists($Map);}
function Wbv(){global$Mzj;if($Mzj){$Maag=false;foreach($Mzj as$Mcb=>$Maj)if(!empty($Maj[3]))if(strpos($Maj[3],"IP pretends")||strpos($Maj[3],"IP ")){unset($Mzj[$Mcb]);$Maag=true;}
if($Maag)Wjq();}
global$Mir;if($Mir){Wcp();Wcq('product_to_category','category_id','product_id');if(LVERSION<"3"){Wcq('url_alias','query');Wcq('url_alias','keyword');}else Wcq('session','expire');Wcq('product_option_value','product_id');Wcq('product_special','product_id');Wcq('product','model');Wcq('product','date_modified');Wcq('product_image','product_id');Wcq('product_option','product_id');Wcq('order_product','order_id');Wcq('product_attribute','attribute_id','product_id');}
Wab();if(!Wft(DIR_APPLICATION."view")){Wft(DIR_APPLICATION."view/javascript");Wft(DIR_APPLICATION."view/theme");}
Wft(DIR_APPLICATION."language");if(!Wft(DIR_IMAGE)){Wft(DIR_IMAGE."catalog");Wft(DIR_IMAGE."cache");}
foreach(glob(substr(DIR_SYSTEM,0,-7)."*",GLOB_ONLYDIR)as$Mks)if(!Wft($Mks."/view",true)){Wft($Mks."/view/image",true);Wft($Mks."/view/javascript",true);Wft($Mks."/view/stylesheet",true);}
require_once"special.php";$Mbs=substr(DIR_SYSTEM,0,-7)."index.php";$Mkb="extension/lightning/gamma.php";$Mdt=file_get_contents($Mbs);if(!strpos($Mdt,$Mkb)){$Maf=strpos($Mdt,"index.php");$Maf=strpos($Mdt,"}",$Maf+1);if($Maf){$Maf++;$Mdt=substr($Mdt,0,$Maf)."
if (file_exists(".'$'."li"." = DIR_APPLICATION.'controller/extension/lightning/gamma.php')) require_once(".'$'."li"."); //Lightning".substr($Mdt,$Maf);$Mdt=str_replace("
if (file_exists(DIR_SYSTEM.'lightning/gamma.php')) require(DIR_SYSTEM.'lightning/gamma.php'); //Lightning",'',$Mdt);file_put_contents($Mbs,$Mdt);}
$Mdt=file_get_contents($Mbs);if(strpos($Mdt,$Mkb))Wb("index_php",false);}else Wb("index_php",false);Wbg();}
function Wca(&$Mhj){return;}
function Wlg(&$Mhj){if(strpos($Mhj,"#"))$Mhj=preg_replace('/#.*$/m',' ',$Mhj);$Mhj=preg_replace('/\s+/',' ',$Mhj);}
function Wcq($Mis,$Mkc,$Mkd=false){global$Mir;$Maz=$Mkc;if($Mkd)$Maz.="_".$Mkd;if($Mir->query("SHOW KEYS FROM `".DB_PREFIX."$Mis` WHERE Key_name='$Maz'")->row)return;try{if(!$Mkd)$Mir->query("ALTER TABLE `".DB_PREFIX."$Mis` ADD INDEX `$Mkc` (`$Mkc`)");else$Mir->query("ALTER TABLE `".DB_PREFIX."$Mis` ADD INDEX `$Maz` (`$Mkc`,`$Mkd`)");}catch(Exception$Mey){}}
define('Wcw',"/meters");function Wad($Man,$Mkg=false,$Mkh=false){if(substr($Man,-3,1)=='/')$Man=substr($Man,0,-3);$Map=$Man.Wcw;if(file_exists($Map)){$data=explode(',',Wct($Map));if(!$Mkg and!$Mkh)return$data;$Mki=$data[0];$Mbj=$data[1];}else{$Mki=0;$Mbj=0;}
$Mki+=$Mkg;if($Mki<0)$Mki=0;$Mbj+=$Mkh;if($Mbj<0)$Mbj=0;file_put_contents($Map,$Mki.','.$Mbj,LOCK_EX);}
function Wct($Map){$Mkj=fopen($Map,'rt');flock($Mkj,LOCK_SH);$Mhp=file_get_contents($Map);fclose($Mkj);return$Mhp;}
function Wbb($Mwy,$Mgj,$data,$Mkk=false){$Man=DIR_CACHE."lightning/$Mwy";if(Waw($Man))file_put_contents($Man.Wcw,"0,0",LOCK_EX);global$Mfv,$Mb;if($Mfv<$Mb)return;$Mao=md5($Mgj);$Miv=$Man."/".substr($Mao,0,2);if($Mkk){global$Mwx;Wcu($Miv,$Mwx[$Mwy]);}
$Map=$Miv."/c".substr($Mao,2);$Mki=0;if(file_exists($Map))$Mbj=strlen($data)-filesize($Map);else{$Mbj=strlen($data);$Mki=1;}
Wad($Man,$Mki,$Mbj);Waw($Miv);file_put_contents($Map,$data,LOCK_EX);return$Map;}
function Whg($Map){Wcv($Map);return file_exists($Map);}
function Wcv($Map){static$Mkl;if(!$Mkl){$Mkl=phpversion();usleep(rand(0,1000));}
if($Mkl<"5.3")clearstatcache();else clearstatcache(true,$Map);}
function Wae($Mwy,$Mgj){$Man=DIR_CACHE."lightning/$Mwy";$Mao=md5($Mgj);$Miv=$Man."/".substr($Mao,0,2);$Map=$Miv."/c".substr($Mao,2);if(!Whg($Map))return false;return @filemtime($Map);}
function Wbe($Mwy,$Mgj,$Mbt,$Mkm=false){$Man=DIR_CACHE."lightning/$Mwy";$Mao=md5($Mgj);$Miv=$Man."/".substr($Mao,0,2);Waw($Miv);$Map=$Miv."/c".substr($Mao,2);if(!Whg($Map)){if(!$Mkm)return;file_put_contents($Map,'');Wad($Man,1,0);}
@touch($Map,$Mbt);}
function Wbd($Mwy,$Mgj,$Mkn=false){global$Mjq,$Mwx;$Mfg=$Mwx[$Mwy];$Man=DIR_CACHE."lightning/$Mwy";$Mjq=false;$Mao=md5($Mgj);$Miv=$Man."/".substr($Mao,0,2);$Map=$Miv."/c".substr($Mao,2);if(!$Mkn)Wcu($Miv,$Mfg);if(!Whg($Map))return false;$Mjq=@filemtime($Map);static$Mmk;if(!$Mmk)$Mmk=time();$Mbt=$Mmk-$Mfg;if(!$Mkn and$Mjq<$Mbt){@unlink($Map);return false;}
$data=@file_get_contents($Map);return$data;}
function Wcu($Miv,$Mfg){if(!$Mfg)return;static$Mka;if(!empty($Mka[$Miv]))return;$Mka[$Miv]=true;if(!Whg($Miv))return;$Mbt=time();if(filemtime($Miv)<$Mbt-10*60){touch($Miv);$Mbt-=$Mfg;$Mki=0;$Mbj=0;if(substr($Miv,-1)=="/")$Miv=substr($Miv,0,-1);$Mko=glob($Miv."/c*");$Mfj=true;if($Mko)foreach($Mko as$Mj_)if(Whg($Mj_)&&@filemtime($Mj_)<$Mbt){$Mbj+=filesize($Mj_);@unlink($Mj_);$Mki++;}
Wad($Miv,-$Mki,-$Mbj);}}
function Wag($Mwy,$Mgj=false){$Man=DIR_CACHE."lightning/$Mwy";if($Mgj){$Mao=md5($Mgj);$Miv=$Man."/".substr($Mao,0,2);$Map=$Miv."/c".substr($Mao,2);if(Whg($Map)){Wad($Man,-1,filesize($Map));@unlink($Map);}
return;}
foreach(glob($Man."/*")as$Miv){if(is_dir($Miv)){foreach(glob($Miv."/*")as$Mj_)if(Whg($Mj_))@unlink($Mj_);rmdir($Miv);}else if(Whg($Miv))@unlink($Miv);}
if(Whg($Man.Wcw))@unlink($Man.Wcw);}
function Wb_($Mwy,$Mkp){$Man=DIR_CACHE."lightning/$Mwy";$Map=$Man."/".$Mkp;if(Whg($Map)){$Mbj=@filesize($Map);@unlink($Map);Wad($Man,-1,-$Mbj);}}
function Wby($Mdl,$Min,$Mdk){preg_match_all("/$Mdl([^$Min]*)/i",$Mdk,$Mcu);return($Mcu[1]);}
function Wcg($Mdl,$Min,&$Mdk){preg_match("/$Mdl([^$Min]*)/i",$Mdk,$Mcu);if(isset($Mcu[1]))return($Mcu[1]);else return"";}
function Wcw($Mdl,$Mbn,$Mdk){$Mbm=array();$Mei=0;while(($Mei=strpos($Mdk,$Mdl,$Mei))!==false){$Mei+=strlen($Mdl);$Mey=strpos($Mdk,$Mbn,$Mei);if($Mey!==false){$Mbm[]=trim(substr($Mdk,$Mei,$Mey-$Mei));$Mei=$Mey+strlen($Mbn);}}
return$Mbm;}
function Wat($Mdl,$Mbn,$Mdk){$Mbm=array();$Mei=0;while(($Mei=strpos($Mdk,$Mdl,$Mei))!==false){$Mei+=strlen($Mdl);$Mey=strpos($Mdk,$Mbn,$Mei);if($Mey!==false){$Mbm[]=substr($Mdk,$Mei-strlen($Mdl),$Mey-$Mei+strlen($Mdl)+strlen($Mbn));$Mei=$Mey+strlen($Mbn);}}
return$Mbm;}
function Wip($Mkq,$Meu,$Mdk){if(($Maf=strpos($Mkq,'*'))!==false){$Mkq=str_replace("/","\/",$Mkq);$Mev=substr($Mkq,0,$Maf);$Mex=substr($Mkq,$Maf+1);return preg_replace("/$Mev.*?$Mex/is",$Meu,$Mdk);}else return str_ireplace($Mkq,$Meu,$Mdk);}
function Wau($Mkq=false,$Meu='',$Mdk=false){if(($Maf=strpos($Mkq,'*'))!==false){$Mev=substr($Mkq,0,$Maf);$Mex=substr($Mkq,$Maf+1);$Mbm=Wcx("","",$Mev,$Mex,$Mdk);$Mbm=str_ireplace($Mev.$Mex,$Meu,$Mbm);}else $Mbm=str_ireplace($Mkq,$Meu,$Mdk);return$Mbm;}
function Wcx($Mez,$Meu,$Mdl,$Mbn,$Mdk){if(!is_string($Mdk))return$Mdk;$Mei=0;while(($Mei=stripos($Mdk,$Mdl,$Mei))!==false){$Mei+=strlen($Mdl);if($Mbn)$Mey=stripos($Mdk,$Mbn,$Mei);else$Mey=strlen($Mdk);if($Mey){$Me_=substr($Mdk,0,$Mei);$Mfa=substr($Mdk,$Mey);$Mfb=substr($Mdk,$Mei,$Mey-$Mei);$Mfc=strlen($Mfb);if($Mez!=='')$Mfb=str_ireplace($Mez,$Meu,$Mfb);else$Mfb=$Meu;$Mdk=$Me_.$Mfb.$Mfa;$Mey=$Mey+strlen($Mfb)-$Mfc;$Mei=$Mey+strlen($Mbn);if($Mei>strlen($Mdk))break;}}
return$Mdk;}
function Wcy($Mdl,$Mbn,$Mdk){$Mkr=Wak($Mdl,$Mbn,$Mdk);if($Mkr)return$Mkr;return$Mdk;}
function Wak($Mdl,$Mbn,$Mdk){$Mbm='';if($Mdl)$Mei=stripos($Mdk,$Mdl);else$Mei=0;if($Mei!==false){$Mei+=strlen($Mdl);if($Mbn)$Mey=stripos($Mdk,$Mbn,$Mei);else$Mey=strlen($Mdk);if($Mey!==false)$Mbm=trim(substr($Mdk,$Mei,$Mey-$Mei));}
return$Mbm;}
function Wcz($Mdl,$Mbn,$Mdk){$Mbm='';if($Mdl)$Mei=strripos($Mdk,$Mdl);else$Mei=0;if($Mei!==false){$Mei+=strlen($Mdl);if($Mbn){if($Mdl)$Mey=stripos($Mdk,$Mbn,$Mei);else$Mey=strripos($Mdk,$Mbn,$Mei);}
else$Mey=strlen($Mdk);if($Mey!==false)$Mbm=trim(substr($Mdk,$Mei,$Mey-$Mei));}
return$Mbm;}
function Waw($Mks){if(file_exists($Mks))return false;Wab();mkdir($Mks,0777,true);@chmod($Mks,0777);Wbg();return true;}
function Wab($Mmh=false){if($Mmh){ini_set("display_errors","Off");ini_set("log_errors","Off");}
global$Mbd;if($Mbd)return;$config=Wc_("config");if(!$config)return;$Mbd=array();$Mbd['Mmv']=true;foreach(array("config_error_display","config_error_log","error_display","error_log")as$Mgj){$Mbd[$Mgj]=$config->get($Mgj);$config->set($Mgj,0);}}
function Wbg(){global$Mbd;if(!$Mbd)return;$config=Wc_("config");if(!$config)return;foreach(array("config_error_display","config_error_log","error_display","error_log")as$Mgj)$config->set($Mgj,$Mbd[$Mgj]);$Mbd=false;}
function Wir($Mhj){if(stripos($Mhj,"ORDER BY p.date_added")){if(!stripos(str_replace('`','',$Mhj),DB_PREFIX."product p"))return false;$Mhj=Wau("ORDER BY p.date_added*DESC ","ORDER BY p.product_id DESC ",$Mhj." ");$Mhj=Wau("ORDER BY p.date_added*ASC ","ORDER BY p.product_id ASC ",$Mhj);return trim($Mhj);}
return trim($Mhj);}
function Wda($Mhj){if(stripos($Mhj,"ORDER BY p.date_added")){if(!stripos($Mhj,DB_PREFIX."product p"))return false;$Mhj=Wau("ORDER BY p.date_added*DESC ","ORDER BY p.product_id DESC ",$Mhj." ");$Mhj=Wau("ORDER BY p.date_added*ASC ","ORDER BY p.product_id ASC ",$Mhj);return trim($Mhj);}
if(!stripos($Mhj,"FROM ".DB_PREFIX."product_to_category p2c"))return false;$Mhj=Wau("ORDER BY p.sort_order*ASC ","ORDER BY p2c.product_id DESC ",$Mhj." ");return trim($Mhj);}
function Wdb($Mhj){return array(array("total"=>0));}
function Wdc($Mhj){static$Mkv;if(isset($Mkv[$Mhj]))return$Mkv[$Mhj];$Mhp=Wdd($Mhj);$Mkv[$Mhj]=$Mhp;return$Mhp;}
function Wde($Mhj){global$Mkw;if($Mkw)return false;$Mga=Wcg("`query` = '","'",$Mhj);global$Mkx;if(!isset($Mkx[$Mga])){$Mhp=Wdd($Mhj);if($Mhp){$Mfj=reset($Mhp);if(count($Mhp)==1&&count($Mfj)<4)$Mkx[$Mga]=$Mfj["keyword"];else$Mkx[$Mga]=$Mhp;}else$Mkx[$Mga]=false;return$Mhp;}
$Mky=$Mkx[$Mga];if($Mky===false)return array();if(is_array($Mky))return$Mky;return array(array("query"=>$Mga,"keyword"=>$Mky));}
function Wdf($Mhj){static$Mkz,$Mij;if(!stripos($Mhj,"ELECT DISTINCT *, pd.name")){$Mhp=Wdd($Mhj);$Mkz=array();if(count($Mhp)<1024)foreach($Mhp as$Mik)if(!empty($Mik["product_id"]))$Mkz[]=$Mik["product_id"];return$Mhp;}
$Mfk=Wcg("p.product_id = '","'",$Mhj);if(!$Mfk)return false;if(!empty($Mij[$Mfk]))return array($Mij[$Mfk]);if(empty($Mkz)or!in_array($Mfk,$Mkz)){if($Mij and count($Mij)>1024)return false;$Mhp=Wdd($Mhj);if(count($Mhp)<1024)foreach($Mhp as$Mik){$Mij[$Mik["product_id"]]=$Mik;if(isset($Mik["xseo"]))$Mkx["product_id=".$Mik["product_id"]]=$Mik["xseo"];}
return$Mhp;};if($Mij and count($Mij)>1024)return false;$Mhj=str_ireplace("p.product_id = '$Mfk'","p.product_id IN (".implode(",",$Mkz).")",$Mhj);$Mfq=Wc_("config")->get("config_seo_url");if($Mfq){$Mk_=Wdg();if(LVERSION>="3")$Msp=DB_PREFIX."seo_url";else$Msp=DB_PREFIX."url_alias";$Mhj=str_ireplace("AS discount,","AS discount, "."(SELECT `keyword` FROM $Msp WHERE `query` = CONCAT('product_id=', p.product_id) $Mk_) as xseo,",$Mhj);}
$Mhp=Wdd($Mhj);$Mkz=false;global$Mkx;foreach($Mhp as$Mik){$Mij[$Mik["product_id"]]=$Mik;if($Mfq){if(empty($Mik["xseo"]))$Mik["xseo"]=false;$Mkx["product_id=".$Mik["product_id"]]=$Mik["xseo"];}}
if(empty($Mij[$Mfk]))return false;return array($Mij[$Mfk]);}
function Wdh($Mhj){$Mfs=Wc_("config")->get("config_store_id");if(!$Mfs)$Mfs="0";$Mhj=str_ireplace("AND p2s.store_id = '".$Mfs."'","",$Mhj);$Mhj=str_ireplace("AND p2s.store_id = ".$Mfs,"",$Mhj);if(stripos($Mhj,"store_id"))return false;$Mhj=Wau(" LEFT JOIN ".DB_PREFIX."product_to_store p2s ON (*)","",$Mhj);$Mhj=Wau("LEFT JOIN `".DB_PREFIX."product_to_store` p2s ON (*)","",$Mhj);return$Mhj;}
function Wdi($Mhj){$Mhj=str_ireplace("LCASE(name)","LCASE(pd.name)",$Mhj);if(!stripos($Mhj,"pd.name")or!stripos($Mhj,"product p "))return false;if(stripos($Mhj,"as innertable"))return false;$Mhj=str_ireplace("LCASE(pd.name) ASC, LCASE(pd.name)","LCASE(pd.name)",$Mhj);$Mhj=str_ireplace("LCASE(pd.name) DESC, LCASE(pd.name)","LCASE(pd.name)",$Mhj);$Mhj=str_ireplace("LCASE(p.model) ASC, LCASE(pd.name)","LCASE(pd.name)",$Mhj);$Mhj=str_ireplace("LCASE(p.model) DESC, LCASE(pd.name)","LCASE(pd.name)",$Mhj);$Mhj=str_ireplace("ORDER BY pd.name","ORDER BY p.model",$Mhj);$Mhj=str_ireplace("LCASE(pd.name) ASC","p.model ASC",$Mhj);$Mhj=str_ireplace("LCASE(pd.name) DESC","p.model DESC",$Mhj);if(!stripos($Mhj,"pd.")and!stripos($Mhj,"name")){$Mhj=Wau(" LEFT JOIN ".DB_PREFIX."product_description pd ON (*)","",$Mhj);}
return$Mhj;}
function Wis($Mhj){if(stripos($Mhj,"BY p.sort_order"))return false;$Mhj=str_ireplace(", LCASE(pd.name) ASC",'',$Mhj);$Mhj=str_ireplace(", LCASE(pd.name) DESC",'',$Mhj);return$Mhj;}
function Wdj($Mhj){if(stripos($Mhj,"*")or stripos($Mhj," name")or stripos($Mhj," tag")or stripos($Mhj," description"))return false;$Mhj=Wau(" pd.language_id = '*' AND","",$Mhj);$Mhj=Wau("AND pd.language_id = '*'","",$Mhj);$Mhj=Wau(" WHERE pd.language_id = '*'","",$Mhj);$Mhj=Wau(" LEFT JOIN ".DB_PREFIX."product_description pd ON (*)","",$Mhj);$Mhj=Wau("LEFT JOIN `".DB_PREFIX."product_description` pd ON (*)","",$Mhj);$Mhj=Wau("sales DESC, LCASE(pd.name) DESC","sales DESC",$Mhj);if(stripos(str_replace('`','',$Mhj),"pd."))return false;return$Mhj;}
function Wfz($Mhj){$Mhj=Wau(" AND p.date_available <= NOW()","",$Mhj);return$Mhj;}
function Wdk($Mhj){if(stripos($Mhj,"MIN(")or stripos($Mhj,"MAX(")or stripos($Mhj,"SUM("))return false;$Mhj=Wau(" GROUP BY p.product_id","",$Mhj);return$Mhj;}
function Wdl($Mhj){if(strpos($Mhj,"SELECT",10))return false;Wlg($Mhj);$Mis=Wcz("FROM "," ",$Mhj);if(!$Mis)return false;$Mla=Wak("FROM $Mis "," ",$Mhj);if(!$Mla||strlen($Mla>3)||$Mla=="WHERE"||strpos($Mla,','))return false;$Mcj=Wcz("","WHERE",$Mhj);if(!$Mcj)return false;$Mlb=(int)Wcy(",","",Wcz("LIMIT","",$Mhj));if(!$Mlb)return false;$Mlc=Wa2.'cx';if(Whg($Mlc)&&@filemtime($Mlc)>time()-60*60)$Miu=unserialize(file_get_contents($Mlc));else$Miu=array();if(empty($Miu[$Mis])){$Mfi=Wdd("SHOW KEYS FROM $Mis WHERE Key_name = 'PRIMARY'");if(!$Mfi){$Miu[$Mis]=-1;file_put_contents($Mlc,serialize($Miu),LOCK_EX);return false;}
$Mld=$Mfi[0]["Column_name"];$Mjf=Wdd("SELECT count(*) FROM $Mis");$Mjf=$Mjf[0];$Mjf=reset($Mjf);if(!$Mjf){$Miu[$Mis]=-1;file_put_contents($Mlc,serialize($Miu),LOCK_EX);return false;}
$Mle=Wdd("SELECT $Mld FROM $Mis ORDER BY $Mld LIMIT 1");$Mle=$Mle[0][$Mld];$Mlf=Wdd("SELECT $Mld FROM $Mis ORDER BY $Mld DESC LIMIT 1");$Mlf=$Mlf[0][$Mld];$Miu[$Mis]=array('id'=>$Mld,'Mjf'=>$Mjf,'Mle'=>$Mle,'Mlf'=>$Mlf);file_put_contents($Mlc,serialize($Miu),LOCK_EX);}else if($Miu[$Mis]==-1)return false;$Mlg=$Miu[$Mis];if($Mlg['Mjf']<$Mlb*5)return false;$Mlh=Wcz(""," ORDER ",$Mhj);$Mix=Wcy("","GROUP BY",Wcz("WHERE","",$Mlh));$Mhp=array();$Mli=array();$Mlj=0;while(count($Mhp)<$Mlb&&$Mlj++<5){$Mlk=array();for($Mcb=0;$Mcb<$Mlb;$Mcb++){$Mll=0;while(in_array($Mld=rand($Mlg['Mle'],$Mlg['Mlf']),$Mli)&&$Mll++<10);$Mlk[]=$Mld;$Mli[]=$Mld;}
$Mlm=Wdd("$Mcj WHERE $Mla.".$Mlg['id']." IN (".implode(',',$Mlk).") AND ($Mix)");$Mhp=array_merge($Mhp,$Mlm);}
$Mhp=array_slice($Mhp,0,$Mlb);if(count($Mhp)<$Mlb){$Miu[$Mis]=-1;file_put_contents($Mlc,serialize($Miu),LOCK_EX);return false;}
return$Mhp;}
function Wdm($Mln){static$Mcr;if(!$Mcr){$Mlo=Wdd("SELECT category_id, parent_id FROM ".DB_PREFIX."category");$Mlp=array();$Mcr=array();foreach($Mlo as$Mlq){$Mlp[$Mlq["category_id"]]=$Mlq["parent_id"];$Mcr[$Mlq["parent_id"]][]=$Mlq["category_id"];}
$Mlr=array();foreach($Mlp as$Mls=>$Mlt)if(empty($Mcr[$Mls]))$Mlr[$Mls]=true;$Mlu=true;while($Mlu){$Mlv=array();$Mlu=false;foreach($Mlp as$Mls=>$Mlt)if(!empty($Mlr[$Mls])and empty($Mlr[$Mlt])){if(!empty($Mcr[$Mls]))$Mcr[$Mlt]=array_unique(array_merge($Mcr[$Mlt],$Mcr[$Mls]));if(!in_array($Mlt,$Mlv))$Mlv[]=$Mlt;$Mlu=true;}
foreach($Mlv as$Mlq)$Mlr[$Mlq]=true;}}
if(empty($Mcr[$Mln]))return$Mln;return$Mln.','.implode(',',$Mcr[$Mln]);}
function Wdn($data){global$Ma;if(!empty($Ma['fr']))return-1;if(!empty($_REQUEST["ajaxfilter"]))return-1;static$Mlw;if(!$Mlw){global$Mjj;if($Mjj and empty($_GET["li_op"]))$Mlw=-1;else$Mlw=1;}
if($Mlw==-1)return-1;global$Mjc,$Mjq;if(!empty($_POST["mfp"]))$data["mfp"]=$_POST["mfp"];elseif(!empty($_GET["mfp"]))$data["mfp"]=$_GET["mfp"];if(!empty($_GET["ocf"]))$data["ocf"]=$_GET["ocf"];if(!empty($_GET["ocfilter_page_id"]))$data["ocfilter_page_id"]=$_GET["ocfilter_page_id"];$Mjc=serialize($data);if(($Mbm=Wci($Mjc))!==-1)return$Mbm;global$Mcq;if(!$Mcq){global$Mcq,$request;if(!empty($request->get["route"]))$Mcq=$request->get["route"];}
static$Mlx;if(!$Mlx)$Mlx=time()-60*60;static$Mer;if(isset($Mer[$Mjc]))return$Mer[$Mjc];$Mhp=Wbd("beta",$Mjc,true);if($Mjq<$Mlx+rand(0,10*60))return-1;if(!is_numeric($Mhp))return-1;$Mer[$Mjc]=$Mhp;Wci($Mjc,$Mhp);$Mjc=false;return$Mhp;}
function Wcc($Mhp){global$Mjc;if(!isset($Mhp->row["total"])||count($Mhp->rows)>1){$Mjc=false;return;}
Wbb("beta",$Mjc,$Mhp->row["total"]);Wci($Mjc,$Mhp->row["total"]);$Mjc=false;}
function Wdo($Mhj){$Mly=Wcg("AND cp.path_id = '","'",$Mhj);if(!$Mly)return false;$Mhj=str_ireplace(" FROM ".DB_PREFIX."category_path cp LEFT JOIN ".DB_PREFIX."product_to_category p2c ON (cp.category_id = p2c.category_id)"," FROM ".DB_PREFIX."product_to_category p2c",$Mhj);$Mlo=Wdm($Mly);if(strpos($Mlo,','))$Mlo="IN ($Mlo)";else$Mlo="= $Mlo";if(!stripos($Mhj,"p2c.category_id"))return false;$Mhj=str_ireplace(" AND cp.path_id = '".$Mly."'"," AND p2c.category_id ".$Mlo,$Mhj);$Mhj=str_ireplace(" AND `cp`.`path_id` = '".$Mly."'"," AND p2c.category_id ".$Mlo,$Mhj);if(stripos($Mhj,"path_id"))return false;return$Mhj;}
function Wdg(){static$Mhp;if($Mhp)return$Mhp;if(LVERSION>="3")$Mhp="AND language_id='".Wc_("config")->get("config_language_id")."' AND store_id='".Wc_("config")->get("config_store_id")."' LIMIT 1";elseif(Wdd("SHOW COLUMNS FROM ".DB_PREFIX."url_alias LIKE 'language_id'"))$Mhp="AND language_id='".Wc_("config")->get("config_language_id")."' LIMIT 1";elseif(Wdd("SHOW COLUMNS FROM ".DB_PREFIX."url_alias LIKE 'lang'"))$Mhp="AND lang='".Wc_("config")->get("config_language_id")."' LIMIT 1";else$Mhp="LIMIT 1";return$Mhp;}
function Wdp($Mhj){if(!defined("LIGHT_FRONTEND")or!stripos($Mhj,"FROM ".DB_PREFIX."category c LEFT JOIN")or(strpos($Mhj,"category_description_")))return false;static$Mlo;if(!$Mlo){$Mga="SELECT * FROM ".DB_PREFIX."category c LEFT JOIN ".DB_PREFIX."category_description cd ON (c.category_id=cd.category_id) LEFT JOIN ".DB_PREFIX."category_to_store c2s ON (c.category_id = c2s.category_id) WHERE cd.language_id = '".(int)Wc_("config")->get("config_language_id")."' AND c2s.store_id = '".(int)Wc_("config")->get("config_store_id")."' AND c.status = '1' ORDER BY c.sort_order, LCASE(cd.name)";$Mfq=Wc_("config")->get("config_seo_url");if($Mfq){$Mk_=Wdg();if(LVERSION>="3")$Msp=DB_PREFIX."seo_url";else$Msp=DB_PREFIX."url_alias";$Mga=str_ireplace("* FROM","*, (SELECT `keyword` FROM $Msp WHERE `query` = CONCAT('category_id=', c.category_id) $Mk_) as xseo FROM",$Mga);}
$Mlz=Wdd($Mga);$Mlo=array();foreach($Mlz as$Mik){$Mik["children"]=0;$Mlo[$Mik["category_id"]]=$Mik;}
$Mlo[0]["children"]=0;global$Mkx;foreach($Mlo as$Mld=>$Mik){if(empty($Mik["category_id"]))continue;if($Mfq){if(empty($Mik["xseo"]))$Mik["xseo"]=false;$Mkx["category_id=".$Mik["category_id"]]=$Mik["xseo"];}
if(!$Mik["parent_id"])$Mik["parent_id"]=0;if(!isset($Mlo[$Mik["parent_id"]]["children"]))$Mlo[$Mik["parent_id"]]["children"]=0;$Mlo[$Mik["parent_id"]]["children"]++;$Mlo[$Mik["parent_id"]]["childs_id"][]=$Mik["category_id"];}}
if(!$Mlo)return false;$Ml_=Wcg("c.parent_id = '","'",$Mhj);if($Ml_!==''){if(empty($Mlo[$Ml_]["childs_id"]))return array();$Mhp=array();$Mlb=Wak(" LIMIT ","",$Mhj);if(!$Mlb)$Mlb=10000;foreach($Mlo[$Ml_]["childs_id"]as$Mld){$Mhp[]=$Mlo[$Mld];if(count($Mhp)==$Mlb)break;}
return$Mhp;}
$Mln=Wcg("c.category_id = '","'",$Mhj);if($Mln==="")return false;if(!$Mln or empty($Mlo[$Mln]["category_id"]))return array();return array($Mlo[$Mln]);}
function Wdq($Mkq=false){$Mjh=debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);$Mbp="";foreach($Mjh as$Mcb=>$Mhs){if($Mcb<3)continue;$Mji=$Mhs["function"];if($Mji=="call_user_func_array")break;if(!empty($Mhs["class"]))$Mji=$Mhs["class"].":".$Mji;if($Mbp)$Mbp=$Mji." -> ".$Mbp;else$Mbp=$Mji;}
if(!$Mkq)return$Mbp;$Mkq=explode(',',$Mkq);foreach($Mkq as$Mma)if(strpos($Mbp,$Mma)!==false)return true;return false;}
function Wdr($Mmb){$Mmb=explode(", ",$Mmb);$Mjh=debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);foreach($Mjh as$Mcb=>$Mhs){if(empty($Mhs["class"]))continue;if(in_array($Mhs["class"],$Mmb))return true;}
return false;}
function Wdd($Mhj){global$db,$Ma;$Mer=$Ma['cm'];$Ma['cm']=false;$Mhp=$db->query($Mhj);if(isset($Mhp->rows))$Mhp=$Mhp->rows;$Ma['cm']=$Mer;return$Mhp;}
function Wcf($Mhj){return preg_replace("/[\d\s,]|'[^']*'/",'',str_replace('\'."'","",$Mhj));}
function Wds($Mgj,$Mad){if($Mgj!="config_language_id")return;Wfc(1);global$Mkw,$Mxo;if(!$Mxo)$Mxo=$Mad;if($Mad!=$Mxo)$Mkw=2;if($Mad==$Mxo&&$Mkw==2)$Mkw=false;}
function Wci($Mgj,$Mad='x'){if(empty($GLOBALS['Ma']['cz']))return-1;if(file_exists(DIR_APPLICATION."controller/record/langmark.php"))return-1;if(is_string($Mad)&&substr($Mad,-27)=="index.php?route=common/home")$Mad=substr($Mad,0,-27);global$Mkw,$Mxo;static$Mfu;if($Mkw){if($Mkw==1&&$Mfu==$_SESSION["language"])$Mkw=false;else return-1;}
if(!empty($Mq["language"])){if(!$Mfu)$Mfu=$Mq["language"];else if($Mfu!=$Mq["language"]){$Mkw=1;return-1;}}
static$storage,$Mmm,$Map,$Mvf;global$Mmn,$Mml;if(!$Mvf){if($Mgj=='Mer')return-1;if(!defined("LIGHT_FRONTEND")or!empty($GLOBALS['Mab']))return-1;global$Mcq;if(!$Mcq){$Mcq='';if(!empty(Wc_("request")->get["route"]))$Mcq=Wc_("request")->get["route"];}
if(strpos($Mcq,"language"))return-1;$Mce=str_replace('/','',$Mcq);if($Maf=strpos($Mce,' ')||$Maf=strpos($Mce,"'")||$Maf=strpos($Mce,"&"))$Mce=substr($Mce,0,$Maf);if($Mce=="commonhome")$Mce="";$config=Wc_("config");if(!$config)return-1;$Map=DIR_CACHE."lightning/epsilon/".$config->get("config_store_id").$config->get("config_language_id").$Mce.".inc";Wcv($Map);if(!$Mce and!empty($GLOBALS['Ma']['Mnt'])and!empty($GLOBALS['Ma']['n'])and empty($GLOBALS['Wjk']))$Mmn=!file_exists($Map);else$Mmn=!(file_exists($Map)&&@filemtime($Map)>time()-3600);$Mvf=true;$Mxo=$config->get("config_language_id");if(!$Mmn){require_once$Map;$Mml=true;}else if($Mce){$Mcc=DIR_CACHE."lightning/epsilon/".$config->get("config_store_id").$config->get("config_language_id").".inc";if(file_exists($Mcc)){require_once$Mcc;$Mmm=$storage;$storage=array();}}}
if(!is_string($Mgj))$Mgj=(string)$Mgj;if($Mad!=='x'){if($Mmn){if(stripos($Mgj,"ELECT COUNT"))return 0;if(stripos($Mgj,"/not_found"))return 0;if(strlen(serialize($Mad))>20000)return 0;$storage[$Mgj]=$Mad;if($Mgj=='Mer'&&count($storage)>5){Waw(DIR_CACHE."lightning/epsilon/");file_put_contents($Map,"<?php
$"."storage = ".var_export($storage,true).";",LOCK_EX);}}
return 0;}
if(!empty($Mmm)and isset($Mmm[$Mgj]))$storage[$Mgj]=$Mmm[$Mgj];if(isset($storage[$Mgj]))if(is_object($storage[$Mgj]))return clone$storage[$Mgj];else return$storage[$Mgj];return-1;}
function Wdu($Mgj){if($Mgj!=="product")return;foreach(glob(DIR_CACHE."journal3.products.*")as$Map)@unlink($Map);foreach(glob(DIR_CACHE."journal3.product.*")as$Map)@unlink($Map);}
function Wfm($data){if(!$data)return"";if(!is_array($data))return$data;$Mbm='';foreach($data as$Mai){if($Mbm)$Mbm.=" ";if(!is_array($Mai))$Mbm.=$Mai;else$Mbm.=Wfm($Mai);}
return$Mbm;}
function Wfn($Mce,&$Mmo,&$output="xx"){if(defined("HTTP_CATALOG"))return-1;global$Mso;if(!isset($Mso[$Mce]))return-1;if($Mce=="design/translation/getTranslations"&&!strpos($Mmo[0],"/"))return-1;$Mgj=$Mce."(".Wfm($Mmo).")";if($output==="xx")return Wci($Mgj);Wci($Mgj,$output);}
function Wfv(){global$Mtj;return$Mtj;}
function light_measure($action="Custom Measure"){global$Mw_,$Mxa;if($Mxa){Wfw($Mxa,$Mw_,$Mw_);$Mxa=false;return;}
if(function_exists('Wfu')){$Mw_=Wfu($action);$Mxa=$action;}}
function Wnk($Mce){if(empty($GLOBALS['Ma']['ie']))return;$Mce=(string)$Mce;if(substr($Mce,-11)!=="common/cart"&&substr($Mce,-16)!=="common/cart/info")return;$Maet=Wc_("journal3");if($Maet->get("cartStyleCartCustomText"))return;$Maeu=$Maet->is_phone||($Maet->is_tablet&&$Maet->get('mobileHeaderTablet'));$Maev=null;$Maew=null;$Maex=null;if($Maey=$Maet->get('headerDesktop')){list($Maev,$Maew)=explode('/',$Maey);}
if($Maev&&$Maew){$Maet->set('header_desktop_type',$Maew);$Maet->set('header_desktop_id',$Maev);$Maex=Wc_('load')->controller('journal3/header_desktop',array('module_type'=>$Maew,'module_id'=>$Maev,));}
$Maez=null;$Mae_=null;$Mafa=null;if($Mafb=$Maet->get('headerMobile')){list($Maez,$Mae_)=explode('/',$Mafb);}
if($Maez&&$Mae_){$Maet->set('header_mobile_type',$Mae_);$Maet->set('header_mobile_id',$Maez);$Mafa=Wc_('load')->controller('journal3/header_mobile',array('module_type'=>$Mae_,'module_id'=>$Maez,));}
if($Maeu){if(!empty($Maex['settings']))$Maet->load($Maex['settings']);if(!empty($Mafa['settings']))$Maet->load($Mafa['settings']);}else{if(!empty($Mafa['settings']))$Maet->load($Mafa['settings']);if(!empty($Maex['settings']))$Maet->load($Maex['settings']);}}
function Wfa($Mce,&$data){global$registry;if($registry)Wc_("config")->set("developer_sass",1);if(!$Mce)return 0;Wnk($Mce);global$Mti,$Mtj;$Mtj=false;if(isset($Mti[$Mce])){global$Mtk;$Mtk=$Mce."(".Wfm($data).")";$Mtj=Wci($Mtk);if($Mtj==-1)$Mtj=false;else return 0;}
$Maf=0;if(function_exists('Wfu'))$Maf=Wfu($Mce);if(substr($Mce,0,6)=="event/")return$Maf;return$Maf;}
function Wfw($Mce,$Maf,&$Mbm){if(!$Mce)return;global$Mti;if(isset($Mti[$Mce])){global$Mtk;Wci($Mtk,$Mbm);}
global$Mam;if(!$Mam)return;$Mbt=microtime(true);global$Mjd;$Mbt-=$Mjd[$Maf]['Mdl'];if($Mbt<0.01){unset($Mjd[$Maf]);return;}
$Mjd[$Maf]['Mbt']=$Mbt;$Mjd[]=array('ed'=>'Mbn');}
function Wc_($Mbi){global$registry;if(!$registry)return false;return$registry->get($Mbi);}
function Wf_(&$Mce,&$Mmo){global$Ma;if(empty($Ma['en'])||$Mce!=="product/product")return;if(is_array($Mmo))$Mmo=http_build_query($Mmo);if(LVERSION>="4"){$Mmo=explode('&',$Mmo);foreach($Mmo as$Mcb=>$Mafl)if(!strpos($Mafl,"roduct_id")&&!strpos($Mafl,"anguage"))unset($Mmo[$Mcb]);$Mmo=implode('&',$Mmo);return;}
$Maf=strpos($Mmo,"product_id=");if(!$Maf)return;$Mey=strpos($Mmo,"&",$Maf);if(!$Mey)$Mey=strlen($Mmo);$Mmo=substr($Mmo,$Maf,$Mey-$Maf);}
function Wga(){global$Ma;if(empty($Ma['en']))return;global$Mk;if(strpos($Mk,"ajaxcart="))return;if(strpos($Mk,"popup="))return;if(empty(Wc_("request")->get["product_id"]))return;$Mfk=(int)Wc_("request")->get["product_id"];if(!$Mfk)return;global$light_bot;if($light_bot){$Mby=Wc_("request")->get;unset($Mby["route"]);unset($Mby["_route_"]);global$Mk;if(count($Mby)>1&&(strpos($Mk,'&')||strpos($Mk,'?'))){$Muj=Wc_("url")->link("product/product","product_id=$Mfk");if(!strpos(str_replace("&","&",$Muj),str_replace("&","&",$_SERVER["REQUEST_URI"])))Wc_("response")->redirect(Wc_("url")->link("product/product","product_id=$Mfk"),301);}}
$Mpi=array("_route_","route","product_id","path","li_module");foreach(Wc_("request")->get as$Mac=>$Muu)if(!in_array($Mac,$Mpi))unset(Wc_("request")->get[$Mac]);global$Mk;$Mk=Wc_("url")->link("product/product","product_id=$Mfk");foreach($_GET as$Mac=>$Muu)if(!in_array($Mac,$Mpi))unset($_GET[$Mac]);foreach($_REQUEST as$Mac=>$Muu)if(!in_array($Mac,$Mpi))unset($_REQUEST[$Mac]);if(!empty(Wc_("request")->get["path"]))return;global$Mir;$Mlo=$Mir->query("SELECT category_id FROM ".DB_PREFIX."product_to_category WHERE product_id = $Mfk")->rows;foreach($Mlo as&$Mlq)$Mlq=array($Mlq["category_id"]);$Mlb=0;$Mtn=false;do{if($Mlb++>10)return;$Mlr=true;$Mfj=true;foreach($Mlo as$Mcb=>&$Mlq)if(end($Mlq)){$Mfi=$Mir->query("SELECT parent_id, `status` FROM ".DB_PREFIX."category WHERE category_id = ".end($Mlq))->row;if($Mfi&&!$Mfi["status"]){unset($Mlo[$Mcb]);continue;}
if($Mfi&&!in_array($Mfi["parent_id"],$Mlq))$Mlq[]=$Mfi["parent_id"];else$Mlq[]=0;$Mlr=false;if($Mfj){$Mtn=$Mlq;$Mfj=false;}}
}while(!$Mlr and$Mlo);if(!$Mtn)return;$Mtn=array_values(array_reverse($Mtn));unset($Mtn[0]);Wc_("request")->get["path"]=implode('_',$Mtn);}
function Wgh(&$Muf,$Mlb=false){if(file_exists(DIR_APPLICATION."model/tool/path_manager.php")||file_exists(DIR_SYSTEM."library/multilingual_seo_toolkit"))return;static$Mug;if($Mlb and$Mug){$Muf["category_id"]=$Mug;$Mug=false;return;}
$Mld=(int)$Muf["category_id"];if(!$Mld)return;if((string)$Muf["category_id"]!==(string)$Mld)return;global$Mir;$Mug=$Mld;while($Mld){$Mcl[]=$Mld;$Mfi=$Mir->query("SELECT parent_id FROM ".DB_PREFIX."category WHERE category_id = ".$Mld)->row;if(!$Mfi)break;$Mld=$Mfi["parent_id"];if(in_array($Mld,$Mcl))break;}
$Muf["category_id"]=implode('_',array_reverse($Mcl));}
function Wgk(){static$Mtt;if(!$Mtt){$Mtu=DIR_IMAGE."catalog/lightning_optimized_data";$Mtv=Wa2.'ez';if(file_exists($Mtu)&&@filemtime($Mtu)>time()-60*30){$Mtt='es';Waw(DIR_IMAGE."cache/lightning/");}else{if(file_exists($Mtv))$Mtt=file_get_contents($Mtv);else{require_once"optima.php";if(optimizers_ready())$Mtt='ew';else$Mtt='ex';file_put_contents($Mtv,$Mtt);}}}
return$Mtt;}
function Wgf($Mdg){static$Mdh,$Mdi,$Mbt;if(!$Mdh){require_once("optima.php");$Mdh=new OptimizerFactory();$Mdi=$Mdh->get();}
$cache=strpos($Mdg,"mage/cache/");$Mub=DIR_CACHE."lightning/".'ey';if(!$cache)copy($Mdg,$Mub);$Muc=filesize($Mdg);$Mdi->optimize($Mdg);clearstatcache(true,$Mdg);$Mud=filesize($Mdg);if($Mud<$Muc){if(!$cache)Wgg($Mub,DIR_IMAGE."catalog/lightning_optimized_originals/".substr($Mdg,strlen(DIR_SYSTEM)-7));$Mtx=DIR_IMAGE."catalog/lightning_optimized_data";if(!file_exists($Mtx))$Mty=array(0,0,0);else$Mty=explode(" ",file_get_contents($Mtx));if(empty($Mty[0])||empty($Mty[1])||empty($Mty[2]))$Mty=array(0,0,0);$Mty[0]++;$Mty[1]+=$Muc;$Mty[2]+=$Mud;file_put_contents($Mtx,implode(" ",$Mty),LOCK_EX);@touch($Mtx,time()-60*60*60);}
if(!$cache)@unlink($Mub);Wab();if(!Wih($Mdg,floor((filemtime($Mdg)+76542)/76543)*76543+1)){}
Wbg();clearstatcache(true,$Mdg);}
function Wih($Map,$Mbt){if(touch($Map,$Mbt))return true;$Mxn=@file_get_contents($Map);@unlink($Map);file_put_contents($Map,$Mxn);return touch($Map,$Mbt);}
function Wgg($Muh,$Mui){$Mcl=pathinfo($Mui);if(!file_exists($Mcl["dirname"])){mkdir($Mcl["dirname"],0777,true);}
return copy($Muh,$Mui);}
function Whv($Mww){if(strpos($Mww,"beta"))return;$log="lightning";if($Maf=strpos($Mww,":")){$log.='_'.strtolower(substr($Mww,0,$Maf));$Mww=substr($Mww,$Maf+2);}
file_put_contents(DIR_LOGS.$log.".log",date("m.d H:i:s").' '.$Mww."
",FILE_APPEND|LOCK_EX);}
function in_cache($Mgj=NULL,$Miu="product"){if(empty($GLOBALS['Ma']['cj']))return false;if($Mgj===0){$Miu=0;$Mgj=NULL;}
$Mjh=debug_backtrace(false,2);$Mjh=$Mjh[1];$Myj=$Mjh["function"];if(!empty($Mjh["class"]))$Myj=$Mjh["class"].$Mjh["type"].$Myj;if(is_null($Mgj))$Mgj=str_replace(array(",",":"),array(", ",": "),str_replace(str_split("[]{}\""), '', json_encode($Mjh["args"])));$Mgj="$Myj $Mgj";global$Myk,$Mjq;$Myk=Wbd("beta",$Mgj);if(is_numeric($Miu)){global$Mjq;if($Miu&&$Mjq<time()-$Miu)$Myk=false;$Miu=false;}
if($Myk!==false){global$db;if(!$Miu or$db->db->Wbx("FROM ".DB_PREFIX.implode(" FROM ".DB_PREFIX,explode(' ',trim($Miu))),$Mjq)){$Myk=unserialize($Myk);if($Myk=="li_false")$Myk=false;global$Mam,$Mjd,$Mg_;$Mg_++;if($Mam)$Mjd[]=array('Mhj'=>$Mgj,'cr'=>$Mjq,'Mbt'=>0,'Mjv'=>Wce());return true;}}
global$Myl,$Mym;$Myl[$Myj]=$Mgj;$Mym[$Myj]=microtime(1);return false;}
function cache($Mhp="li_false"){if(empty($GLOBALS['Ma']['cj']))return false;if($Mhp==="li_false"){global$Myk;return$Myk;}
$Mjh=debug_backtrace(false,2);$Mjh=$Mjh[1];$Myj=$Mjh["function"];if(!empty($Mjh["class"]))$Myj=$Mjh["class"].$Mjh["type"].$Myj;global$Myl,$Mym;if(empty($Mym[$Myj]))return;$Mgj=$Myl[$Myj];$Mbt=microtime(true)-$Mym[$Myj];unset($Mym[$Myj]);unset($Myl[$Myj]);if($Mbt<-0.05)return;if($Mhp===false)$Mhp="li_false";Wbb("beta",$Mgj,serialize($Mhp));}
function lightning_delete($Map){if(!is_file($Map))return;Wab();@unlink($Map);Wbg();}
function Wfc($Mgj){static$Msb;if($Msb)return;global$registry;if(empty($registry))return;$Msb=true;global$Mjj;if($Mjj)return;if(!empty($GLOBALS['Ma']['hl']))return;if(defined("DIR_CATALOG")&&empty($GLOBALS['Ma']['cn']))return;$Msc=new Light_Event($registry);$registry->set("event",$Msc);}
class Light_Event{protected$registry;protected$data=array();protected$direct=array();public function __construct($registry){if(LVERSION<4)$Mafg="Action";else$Mafg="\Opencart\System\Engine\Action";$this->registry=$registry;if(!defined("DIR_CATALOG")&&defined("DIR_MODIFICATION")){$Muc="";$Muc=DIR_MODIFICATION."system/engine/event.php";if(file_exists($Muc))$Muc=file_get_contents($Muc);if(strpos($Muc,"register('model/setting/event/getEvents/after', new Action('common/BurnEngine/onGetEventsAfter'))"))$this->register("model/setting/event/getEvents/after",new$Mafg("common/BurnEngine/onGetEventsAfter"));}
if(class_exists("KaGlobal")){KaGlobal::init($registry);}
$config=$registry->get("config");if($config->has("action_event")){foreach($config->get("action_event")as$Mgj=>$Mad){if(!is_array($Mad))$this->register($Mgj,new$Mafg($Mad),0);else foreach($Mad as$Msi=>$Mtc)$this->register($Mgj,new$Mafg($Mtc),$Msi);}}}
function&Wlh($Msj){$Msj=str_replace('?','*',$Msj);if(($Maf=strpos($Msj,'*'))!==false){$Msj=substr($Msj,0,$Maf);if(!isset($this->data[$Msj])){$this->data[$Msj]=array();}
return$this->data[$Msj];}
if(!isset($this->direct[$Msj])){$this->direct[$Msj]=array();}
return$this->direct[$Msj];}
public function register($Msj,$action,$Msi=0){if(LVERSION<4)$Mafg="Action";else$Mafg="\Opencart\System\Engine\Action";if(!defined("DIR_CATALOG")&&(LVERSION==="3.0.2.0"||LVERSION==="3.0.3.1")&&$Msj==="controller/*/after"&&!empty($GLOBALS['Ma']['gh'])){$action=new$Mafg("event/language/after");}
$data=&$this->Wlh($Msj);$data[]=array("trigger"=>$Msj,"action"=>$action,"priority"=>$Msi );}
public function trigger($Msc,$Mmo=array()){if(LVERSION<4)$Mafg="Action";else$Mafg="\Opencart\System\Engine\Action";if(!empty($this->direct[$Msc])){$Mabw=$this->direct[$Msc];}else{$Mabw=array();}
foreach($this->data as$Mgj=>$data){if(substr($Msc,0,strlen($Mgj))==$Mgj){foreach($data as$Mad){if(preg_match('/^'.str_replace(array('\*','\?'),array('.*','.'),preg_quote($Mad['trigger'],'/')).'/',$Msc)){$Mabw[]=$Mad;}}}}
if(count($Mabw)>1){foreach($Mabw as$Mgj=>$Mad){$Msk[$Mgj]=$Mad["priority"];}
array_multisort($Msk,SORT_ASC,$Mabw);}
foreach($Mabw as$Mad){$action=$Mad["action"];if(is_string($action))$action=new$Mafg($action,$Mmo);$Mhp=$action->execute($this->registry,$Mmo);if(!is_null($Mhp)&&!($Mhp instanceof Exception)){return$Mhp;}}}
public function unregister($Msj,$Mce){$data=&$this->Wlh($Msj);foreach($data as$Mgj=>$Mad){if($Msj==$Mad["trigger"]&&$Mad["action"]->getId()==$Mce){unset($data[$Mgj]);}}}
public function clear($Msj){$data=&$this->Wlh($Msj);foreach($data as$Mgj=>$Mad){if($Msj==$Mad["trigger"]){unset($data[$Mgj]);}}}}
function LA_ControllerEventLanguage_index($Mce,&$Mmo){if(!Wc_("language")->data)return;$Mmo=array_merge(Wc_("language")->data,$Mmo);}
function LA_ControllerEventLanguage_before(&$Mce,&$output){$Mfu=Wc_("language");$Mfu->data["backup"]=$Mfu->data;}
function LA_ControllerEventLanguage_after(&$Mce,&$output){$Mfu=Wc_("language");if(empty($Mfu->data["backup"]))return;$data=$Mfu->data["backup"];$Mfu->data=array_merge($Mfu->data,$data);}
function Wl_($Macz,$Mbi){$Mac_=new ReflectionObject($Macz);$Mada=$Mac_->getProperties(ReflectionProperty::IS_PUBLIC);if(is_array($Mada)&&count($Mada)>0){foreach($Mada as$Madb)if($Madb->name==$Mbi)return true;}
return false;}
function Wkm($Mht,&$data){static$Mpi;if(is_null($Mpi)){$Mpi=Wl_($Mht,"adaptor")&&Wl_($Mht->adaptor,"data");if(is_file(DIR_APPLICATION."model/extension/module/regional_store.php"))$Mpi=false;}
if(!$Mpi)return false;if(!$Mht->adaptor->data)$Mht->adaptor->data=&$data;else$Mht->adaptor->data=array_merge($Mht->adaptor->data,$data);return true;}
function Wkn(&$Mmo,$Mce,$Mtt){Wnk($Mce);if(!$Mce)$Mce='';$Mjy=$Mce;if(LVERSION>4&&$Maf=strpos($Mjy,'.'))$Mjy=substr($Mjy,0,$Maf);$Mjy='Controller'.preg_replace('/[^a-zA-Z0-9]/','',$Mjy);$Maai='LA_'.$Mjy.'_'.$Mtt;if(function_exists($Maai))return call_user_func_array($Maai,$Mmo);if(LVERSION>4){$Mrh=strrpos($Mce,'.');if(!$Mrh)$Mrh=strrpos($Mce,'|');if($Mrh===false){$Mjy='Controller\'.str_replace(array('_','/'),array('','\'),ucwords($Mce,'_/'));}else{$Mjy='Controller\'.str_replace(array('_','/'),array('','\'),ucwords(substr($Mce,0,$Mrh),'_/'));}
$Mjy='Opencart\'.Wc_('config')->get('application').'\'.$Mjy;}
if(LVERSION<4){$Map=DIR_APPLICATION."controller/".$Mce.".php";if(!is_file($Map))return new \Exception("Error: Could not call ".$Mce.'/'.$Mtt.'!');}
global$Mti;if(isset($Mti[$Mce])){global$Mtk;$Mtk=$Mce."(".Wfm($Mmo).")";$Mtj=Wci($Mtk);if($Mtj!=-1)return$Mtj;}
if(function_exists('Wfu'))$Maf=Wfu($Mce);global$registry;$registry->get("config")->set("developer_sass",1);if(LVERSION<4&&!class_exists($Mjy))if(class_exists("VQMod")){if(function_exists("modification"))include_once(\VQMod::modCheck(modification($Map),$Map));else include_once(\VQMod::modCheck($Map,$Map));}else{if(function_exists("modification"))include_once(modification($Map));else include_once($Map);}
if(class_exists($Mjy)){$controller=new$Mjy($registry);}else{return new \Exception("Error: Could not call route ".$Mce.'!');}
$Mabk=new ReflectionClass($Mjy);if($Mabk->hasMethod($Mtt)&&$Mabk->getMethod($Mtt)->getNumberOfRequiredParameters()<=count($Mmo)||$Mabk->hasMethod("__call")){$Mbm=call_user_func_array(array($controller,$Mtt),$Mmo);}else{return new \Exception("Error: Could not call ".$Mce.'/'.$Mtt.'!');}
if(isset($Mti[$Mce])){global$Mtk;Wci($Mtk,$Mbm);}
global$Mam;if(!$Mam)return$Mbm;$Mbt=microtime(true);global$Mjd;$Mbt-=$Mjd[$Maf]['Mdl'];if($Mbt<0.01){unset($Mjd[$Maf]);return$Mbm;}
$Mjd[$Maf]['Mbt']=$Mbt;$Mjd[]=array('ed'=>'Mbn');return$Mbm;}
function Wko($Mht,&$data,$Mdt=''){if(!empty($data["module_id"])){global$Mafj;$Mafj=$data["module_id"];}
if(defined("DIR_CATALOG")&&empty($GLOBALS['Ma']['cn']))return-1;if(empty($GLOBALS['Ma']['hp']))return-1;require_once"twix.php";if(substr($Mht,-5)!==".twig")$Mht.=".twig";return twix_render($Mht,$data,$Mdt);}
function Wkp(){if(defined("DIR_CATALOG")&&empty($GLOBALS['Ma']['cn']))return false;global$registry;if(!empty($registry->get("request")->get["route"])&&strpos(str_replace('|','.',$registry->get("request")->get["route"]),"order.call")!==false)return false;return!empty($GLOBALS['Ma']['hp'])&&!empty($registry);}
function Wne($Mdg){if(empty($GLOBALS['Ma']['jv']))return;static$Maec,$Maed;if(!$Maec){$Maec=array(array(-1,-1,-1),array(-1,16,-1),array(-1,-1,-1),);$Maed=array_sum(array_map("array_sum",$Maec));}
imageconvolution($Mdg,$Maec,$Maed,0);}
function Wmn(){global$Ma;return empty($Ma['ip']);}
function Wnh($Maeh,$Mga){global$Maei;$Mda=0;if(!empty($Mga->row["data"]))$Mda=crc32($Mga->row["data"]);$Maei[$Maeh]=$Mda;if(LVERSION<"3.0.3.7"){$Mji=DIR_CACHE."lightning/".'jy';if(file_exists($Mji)&&@filemtime($Mji)>time()-5*60)return;Waw(DIR_CACHE."lightning/");file_put_contents($Mji,'');global$db;$db->query("DELETE FROM `".DB_PREFIX."session` WHERE `expire` < '".date("Y-m-d H:i:s",time())."'");}}
function Wni($Maeh,&$data,&$Maej){if(!$Maeh)return true;global$Maei;if(empty($Maei[$Maeh])&&empty($data["user_id"]))$Maej=10*60;$Mda=0;if(!empty($data))$Mda=crc32(json_encode($data));if($Mda===$Maei[$Maeh])return true;return false;} ?>
Did this file decode correctly?
Original Code
<?php global$Ma,$Mfv,$Mso,$Mti,$Mio,$Mip;if(!empty($_COOKIE["lie"])){unset($_COOKIE["lie"]);register_shutdown_function('Woq');}
function Woq(){$Mil="none";if($Mo_=error_get_last()){$Mil=$Mo_["message"];if(strpos($Mil,DB_PASSWORD))return;if($Mo_["line"])$Mil.=":".$Mo_["line"];}
if(!headers_sent())header("X-Lie: ".$Mil);echo"<br><br>\n\nX-Lie: ".$Mil;}
if(($Mbm=Wc_("response"))&&(empty($_GET["route"])||!(stripos($_GET["route"],"pdf")||stripos($_GET["route"],"doLabel"))))$Mbm->setCompression(2);define('Wa2',DIR_CACHE."lightning/".'b');$Mso=array("design/translation/getTranslations"=>1,"catalog/category/getCategory"=>1,"catalog/category/getCategories"=>1,"design/theme/getTheme"=>1,"catalog/information/getInformations"=>1);$Mti=array("common/footer"=>1,"common/menu"=>1,"extension/module/yumenu"=>1);if(defined("VERSION")&&VERSION<5)define("LVERSION",VERSION);else{$Maj=Wak("define('VERSION', '","'",file_get_contents(substr(DIR_SYSTEM,0,-7)."index.php"));if(!$Maj)$Maj="3";define("LVERSION",$Maj);}
$Mti=array();if(empty($Ma))if(file_exists(Wa2))$Ma=unserialize(file_get_contents(Wa2));if(empty($Ma))$Ma=array('ci'=>1440,'cj'=>true,'ck'=>true,'cl'=>0,'cm'=>true,'cn'=>false);$GLOBALS['Ma']['hm']=1;if(!empty($Ma['bz']))$Mti=array();$Mfv=@disk_free_space(DIR_CACHE);if($Mfv<10)$Mfv=2*500*1024*1024;$Mip=-1;$Mage=substr(DIR_SYSTEM,0,-7)."vqmod/checked.cache";if(file_exists($Mage)&&@filesize($Mage)>500000)@unlink($Mage);function Wbu(){if(!empty($_GET["j_edit"])){Wc_("response")->remove_headers("no-cache");header("Cache-Control: max-age=86400");}
return new light_db(Ws());}
function Wnf($Maef){global$Mqj;if(substr($Mqj,0,1)==$Maef[0]&&substr($Mqj,-1)==$Maef[1])$Mqj=substr($Mqj,1,-1);}
class light_db{public$driver;public$connection;public function __construct($driver){global$Mwx;if(!empty($GLOBALS['Ma']['ci']))$Mwx["beta"]=$GLOBALS['Ma']['ci']*60;else$Mwx["beta"]=24*60*60;$this->driver=$driver;$this->connection=new \stdClass();$this->connection->server_info='';global$Mjj;if(!$Mjj and!defined('Lightning'))define('Lightning',1);}
private function Wbw($Mis,$Mit=false){$Mis=str_replace(array('`',')'),'',$Mis);if(!$Mis)return 0;if($Mis!=strtolower($Mis))return 0;if(strpos($Mis,"_temp")!==false)return time()+100;static$Miu;if(!$Mit and!empty($Miu[$Mis]))return$Miu[$Mis];$Miv=DIR_CACHE."lightning/beta/qwert";$Map=$Miv."/$Mis";if($Mit){Waw($Miv);if(!file_exists($Map))file_put_contents($Map,'',LOCK_EX);touch($Map);$Miu[$Mis]=time();return$Miu[$Mis];}
if(!file_exists($Map))$Miu[$Mis]=0;else$Miu[$Mis]=filemtime($Map);return$Miu[$Mis];}
public function Wbx($Mhj,$Mbt){if(!$Mbt)return false;if(strpos($Mhj,"ORDER BY sales")&&defined("LIGHT_FRONTEND"))return true;$Miu=array_merge(Wby("FROM "," ",$Mhj),Wby("JOIN "," ",$Mhj));foreach($Miu as$Mis){if($this->Wbw(trim($Mis))>=$Mbt)return false;}
return true;}
private function Wbz($Mhj,$Miw=false){if(stripos($Mhj,"SET viewed")&&substr_count($Mhj,"=")<3)return;$Miu=array_merge(Wby("DELETE FROM "," ",$Mhj),Wby("INTO "," ",$Mhj),Wby("UPDATE "," ",$Mhj));if(!$Miw){foreach($Miu as$Mis){$Mis=trim($Mis);if(!preg_match("/^[`a-z0-9_-]+$/",$Mis))continue;$this->Wbw($Mis,true);}}
if(!$Miu)return;$Miu[0]=str_replace('`','',$Miu[0]);if(defined("HTTP_CATALOG")&&$Miu[0]==DB_PREFIX."setting"&&strpos($Mhj,"maintenance")&&@!strpos($_SERVER["REQUEST_URI"],"/refresh&")){$Mfw=DIR_CACHE."lightning/".'br';while(file_exists($Mfw)&&filemtime($Mfw)>time()-10)sleep(0.1);if(is_file(Wa2))@unlink(Wa2);}
if(!empty($GLOBALS['Ma']['hk']))return;if($Miu[0]!=DB_PREFIX."product")return;$Mjn=strtoupper(substr(trim($Mhj),0,6));if($Mjn=="INSERT")return;$Mqt=empty($GLOBALS['Ma']['gc']);$Maf=strripos($Mhj,"WHERE ");if(!$Maf)return;$Mix=substr($Mhj,$Maf+6);if(strpos(str_replace("p.",'',$Mix),'.'))return;if(substr($Mix,-1)==")"&&!strpos($Mix,"("))$Mix=substr($Mix,0,-1);$Mqg=false;$Mqh=strtoupper(substr($Mhj,0,$Maf-1));$Maf=strripos($Mqh,"SET ");if($Maf){$Mqi=trim(substr($Mqh,$Maf+4));if(substr($Mqi,0,1)=="`")$Mqi=substr($Mqi,0,1);if(substr($Mqi,0,8)=="QUANTITY"&&substr_count($Mqi,"=")==1){$Mqg=true;global$Mqj;$Mqj=trim(substr($Mqi,strpos($Mqi,"=")+1));Wnf("()");$Mqj=trim(str_replace("QUANTITY","",$Mqj));$Mqk=substr($Mqj,0,1);if($Mqk=="+"||$Mqk=="-")$Mqj=trim(substr($Mqj,1));else$Mqk=false;Wnf("''");if(!is_numeric($Mqj))$Mqg=false;}}
$Miy=array();if($Mqg){if(!$Mqt)$Mix=str_replace(" AND subtract = '1'",'',$Mix);$Mql=$this->driver->query("SELECT product_id, quantity FROM ".DB_PREFIX."product p WHERE ".$Mix)->rows;foreach($Mql as$Mqm){$Mfi=$Mqm["quantity"];if($Mqt){if($Mqk=="+")$Mne=$Mfi+$Mqj;elseif($Mqk=="-")$Mne=$Mfi-$Mqj;else$Mne=$Mqj;if($Mfi>0&&$Mne>0)continue;if($Mfi<=0&&$Mne<=0)continue;}
$Miy[]=$Mqm["product_id"];}
}else{$Miz=Wak("product_id",'',$Mix);if($Miz){$Miz=Wak('=','',str_replace("'","",$Miz));if(is_numeric($Miz))$Miy=array($Miz);}
if(!$Miy&&!stripos($Mix,"ORDER BY"))$Miy=$this->driver->query("SELECT product_id FROM ".DB_PREFIX."product p WHERE ".$Mix)->rows;}
if(!$Miy)return;touch(Wa2.'ee',time()-10*60);Wep($Miy,"Modify query");}
public function Whs($Mhj){$Mbt=microtime(true);$Mhp=$this->driver->query($Mhj);global$Mhe,$Mjo;$Mhe+=($Mjo=microtime(true)-$Mbt);return$Mhp;}
public function query($Mhj){$Mhj=(string)$Mhj;global$Macl;if(isset($Macl[$Mhj])){global$Mack;$Mack++;return Wcb($Macl[$Mhj]);}
if(strpos($Mhj,"ET time_zone")){static$Mwv;if($Mwv++>5)return;}
if(stripos($Mhj,"product SET viewed")&&substr_count($Mhj,"=")<3){global$Macy,$light_bot;if($Macy||$light_bot)return false;if(empty($GLOBALS['Ma']['iw']))return false;}
$Mhj=str_replace("TIMESTAMPADD(DAY, 1, expire) < NOW()","expire < DATE_SUB(NOW(), INTERVAL 1 DAY)",$Mhj);if(strpos($Mhj,"customer_id = '0') AND date_added < DATE_SUB(NOW(),")){$Mji=DIR_CACHE."lightning/".'gd';if(file_exists($Mji)&&@filemtime($Mji)>time()-24*60*60)return true;Waw(DIR_CACHE."lightning/");file_put_contents($Mji,'');$Mhj=str_replace("INTERVAL 1 HOUR","INTERVAL 30 DAY",$Mhj);}
static$Mjb;global$Mjo,$Mhd,$Mjc,$Mam,$Mjd;if(!$Mjb){$Mjb=microtime(true);$Mje=true;}else$Mje=false;static$Mjf;if($Mjf++>10000){$Mjf=0;global$Mgy;if($Mgy){$Mjg=microtime(true)-$Mgy;$Mjg/=60;if($Mjg>60*10){$Mjh=debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);$Mbp="";foreach($Mjh as$Mcb=>$Mhs){$Mji=$Mhs["function"];if($Mji=="call_user_func_array")break;if(!empty($Mhs["class"]))$Mji=$Mhs["class"].":".$Mji;if(!empty($Mhs["line"]))$Mji.=" [".$Mhs["line"]."]";if($Mbp)$Mbp=$Mji." -> ".$Mbp;else$Mbp=$Mji;}
global$Mk;file_put_contents(DIR_CACHE."lightning/bad","\n\n\nPID: ".getmypid()." URI:".$_SERVER["REQUEST_URI"]." $Mk \n\n SQL: $Mhj \n\n Trace: $Mbp",FILE_APPEND);}
if($Mjg>60*11)die("Hanged, killed by Lightning");}}
global$Mal,$Mz,$Mgz,$Mg_,$Mjj;if($Mal&&time()-$Mal>30){global$log,$Mk;if($log)$log->write("Page generation was killed (took more then 30 sec) - ".$Mk);exit;}
$Mjl=0.05;$Mjm=false;$Mjn=strtoupper(substr(trim($Mhj),0,6));if(empty($GLOBALS['Ma']['cj'])or$Mjj){$Mgz++;if(!$Mjj)if($Mjn=="DELETE"||$Mjn=="INSERT"||$Mjn=="UPDATE")$this->Wbz($Mhj,true);$Mhp=$this->Whs($Mhj);if($Mjn=="INSERT"&&strpos($Mhj,DB_PREFIX."product ")){global$Madu;$Miz=$this->getLastId();if($Miz)$Madu[]=$Miz;}
if($Mam)$Mjd[]=array('Mhj'=>$Mhj,'cr'=>false,'Mbt'=>$Mjo,'Mjv'=>Wce());else if(!$Mjj and($Mjo>2)and!defined("HTTP_CATALOG")and!strpos($Mhj,DB_PREFIX."light_")and(!empty($_SERVER["REQUEST_URI"])and!strpos($_SERVER["REQUEST_URI"],"feed"))){require_once"special.php";$Mwp="slow_query";if($Mjn=="DELETE"||$Mjn=="INSERT"||$Mjn=="UPDATE"||$Mjn=="REPLAC")$Mwp="slow_update_query";if(!strpos($Mhj,"santa_product")||$Mwp!="slow_update_query")Wb($Mwp,true,array("key"=>Wcf($Mhj),"sql"=>$Mhj,"score"=>$Mjo,"url"=>true,"origin"=>Wce()));}
if($Mjc&&stripos($Mhj,") AS total"))Wcc($Mhp);if(!$Mjj)Wcd($Mhp,$Mhj);if($Mje){$Mhd+=microtime(true)-$Mjb;$Mjb=false;}
return$Mhp;}
$Mg_++;$Macp=true;if($Mjn=="SELECT"){if(!$Mjm&&strlen($Mhj)<3*1024){Wca($Mhj);}
global$Mip;if(stripos($Mhj,"FOUND_ROWS()")){if($Mip<0){if($Mje){$Mhd+=microtime(true)-$Mjb;$Mjb=false;}
return$this->Whs($Mhj);}
$Mjp=Wak("as ","",$Mhj);$Mjp=str_replace("`","",$Mjp);$Mjp=str_replace("'","",$Mjp);if(!$Mjp)$Mjp="FOUND_ROWS()";$Mhp=Wcb(array(array($Mjp=>$Mip)));if($Mjc&&stripos($Mhj,") AS total"))Wcc($Mhp);if($Mje){$Mhd+=microtime(true)-$Mjb;$Mjb=false;}
return$Mhp;}
$Mpo=false;if(strpos($Mhj,DB_PREFIX."light_")||strpos($Mhj,"bf_tmp_"))$Mpo=true;else if(substr($Mhj,0,21)!="SELECT p.product_id F"&&substr($Mhj,0,12)!="SELECT COUNT"&&!stripos($Mhj,"distinct ")){$Mix=Wcz("WHERE ",'',$Mhj);if($Mix){if(!stripos($Mix,"NOW()")and!stripos($Mix,"limit ")and!stripos($Mix,"order ")and!stripos($Mix,"group ")){$Mee=str_replace(array("`",".","_"),'',Wak('','=',$Mix));if(ctype_alnum($Mee))$Mpo=true;}}}
global$Mjq;if(!$Mpo)$Mhp=Wbd("beta",$Mhj);else$Mjq=false;if($Mjq and ((defined("LIGHT_FRONTEND")and($Mjq>time()-$GLOBALS['Ma']['cl']))or$this->Wbx($Mhj,$Mjq))){if($Mhp!==false&&($Mhp=@unserialize($Mhp))!==false){$Mip=-1;$Mhp=Wcb($Mhp);if($Mam)$Mjd[]=array('Mhj'=>$Mhj,'cr'=>$Mjq,'Mbt'=>0,'Mjv'=>Wce());if($Mjc&&stripos($Mhj,") AS total"))Wcc($Mhp);Wcd($Mhp,$Mhj);if($Mje){$Mhd+=microtime(true)-$Mjb;$Mjb=false;}
return$Mhp;}}
}elseif($Mjn=="DELETE"||$Mjn=="INSERT"||$Mjn=="UPDATE"||$Mjn=="REPLAC"){$this->Wbz($Mhj);$Macl=array();$Macp=false;}elseif($Mjn=="CREATE"){$this->Wbw(Wak("CREATE TEMPORARY TABLE "," ",Wau("IF NOT EXISTS ","",$Mhj)),true);$Macl=array();$Macp=false;Wcd($Macp,$Mhj);}
$Mhp=$this->Whs($Mhj);$Mgz++;$Mg_--;if($Mjn=="INSERT"&&strpos($Mhj,DB_PREFIX."product ")){global$Madu;$Miz=$this->getLastId();if($Miz)$Madu[]=$Miz;}
if($Macp&&isset($Mhp->num_rows)&&$Mhp->num_rows<10)$Macl[$Mhj]=$Mhp->rows;if($Mam){$Mpp=false;if(!empty($Mpo))$Mpp=-1;$Mjd[]=array('Mhj'=>$Mhj,'cr'=>$Mpp,'Mbt'=>$Mjo,'Mjv'=>Wce());}
elseif(($Mjo>2)and!defined("HTTP_CATALOG")and!strpos($Mhj,DB_PREFIX."light_")and(!empty($_SERVER["REQUEST_URI"])and!strpos($_SERVER["REQUEST_URI"],"feed"))){require_once"special.php";$Mwp="slow_query";if($Mjn=="DELETE"||$Mjn=="INSERT"||$Mjn=="UPDATE"||$Mjn=="REPLAC")$Mwp="slow_update_query";if(!strpos($Mhj,"santa_product")||$Mwp!="slow_update_query")Wb($Mwp,true,array("key"=>Wcf($Mhj),"sql"=>$Mhj,"score"=>$Mjo,"url"=>true,"origin"=>Wce()));}
if($Mjn=="SELECT"){if(!$GLOBALS['Ma']['ck']||$Mjo>$Mjl){if(stripos($Mhj,"SQL_CALC_FOUND_ROWS")){$Mjr=$this->driver->query("SELECT FOUND_ROWS()")->row;$Mjr=reset($Mjr);$Mhp->rows['Mjr']=$Mjr;global$Mip;$Mip=$Mjr;}
$Mjs=false;if($Mhp->num_rows>50000)$Mjs=true;else if($Mhp->num_rows>500){if(strlen(serialize($Mhp->row))*$Mhp->num_rows>10000000)$Mjs=true;}
if($Mjs and!defined("HTTP_CATALOG")and!strpos($Mhj,DB_PREFIX."light_")and(!empty($_SERVER["REQUEST_URI"])and!strpos($_SERVER["REQUEST_URI"],"feed"))){require_once"special.php";Wb("big_query",true,array("key"=>Wcf($Mhj),"sql"=>$Mhj,"score"=>strlen(serialize($Mhp->row))*$Mhp->num_rows,"url"=>true,"origin"=>Wce()));}
if(!$Mjs){Wbb("beta",$Mhj,serialize($Mhp->rows));if(stripos($Mhj," RAND()")){global$Mwx;Wbe("beta",$Mhj,time()-$Mwx["beta"]+60);}}}}
if($Mjc&&stripos($Mhj,") AS total"))Wcc($Mhp);if(isset($Mhp->rows['Mjr']))unset($Mhp->rows['Mjr']);Wcd($Mhp,$Mhj);if($Mje){$Mhd+=microtime(true)-$Mjb;$Mjb=false;}
return$Mhp;}
public function Wch($Mjt){if(is_array($Mjt))return array_map(__METHOD__,$Mjt);if(!empty($Mjt)&&is_string($Mjt)){return str_replace(array('\\',"\0","\n","\r","'",'"',"\x1a"),array('\\\\','\\0','\\n','\\r',"\\'",'\\"','\\Z'),$Mjt);}
return$Mjt;}
public function escape($Mad){if(!$this->driver)return$this->Wch($Mad);return$this->driver->escape($Mad);}
public function countAffected(){return$this->driver->countAffected();}
public function getLastId(){return$this->driver->getLastId();}
public function __destruct(){Wci('Mer','Wc_');global$Madu;if($Madu){global$Mir;$Mir=null;Wlw($Madu);}
global$registry,$Ma;if(defined("DIR_CATALOG")&&!empty($Ma['bo'])){$Madd=DIR_CACHE."lightning/".'in';if($registry&&!empty($registry->get("session")->data["user_id"])){$Mbg=$_SERVER["REMOTE_ADDR"];if(!empty($_SERVER["HTTP_CF_CONNECTING_IP"]))$Mbg=$_SERVER["HTTP_CF_CONNECTING_IP"];elseif(!empty($_SERVER["HTTP_X_REAL_IP"]))$Mbg=$_SERVER["HTTP_X_REAL_IP"];if($Mbg=="::1")$Mbg="127.0.0.1";file_put_contents($Madd,$Mbg."=".$registry->get("session")->data["user_id"]);}}}}
function Wlw($Miy){if(!$Miy)return;Ws();global$Mir;$Mli=array(300000000);$Mlo=$Mir->query("SELECT DISTINCT category_id FROM ".DB_PREFIX."product_to_category WHERE product_id IN(".implode(",",$Miy).")")->rows;foreach($Mlo as$Mlq)if(!empty($Mlq["category_id"]))$Mli[]=$Mlq["category_id"]+100000000;$Mact=$Mir->query("SELECT DISTINCT manufacturer_id FROM ".DB_PREFIX."product WHERE product_id IN(".implode(",",$Miy).")")->rows;foreach($Mact as$Macu)if(!empty($Macu["manufacturer_id"]))$Mli[]=$Macu["manufacturer_id"]+200000000;foreach(glob(DIR_CACHE."journal3.product_extra_button.*")as$Map)@unlink($Map);foreach(glob(DIR_CACHE."journal3.product_label.*")as$Map)@unlink($Map);Wep($Mli,"New products added");}
function Wep($Miy,$Mqn=''){if(!$Miy)return false;if(is_array(reset($Miy))){$Msv=array();foreach($Miy as$Miz)$Msv[]=$Miz["product_id"];$Miy=$Msv;}
$Miy=array_unique($Miy);while(count($Miy)>100){Wep(array_slice($Miy,0,100),$Mqn);$Miy=array_slice($Miy,100);}
global$Mir;$Mi_=$Mir->query("SELECT page FROM ".DB_PREFIX."lightning_product_to_page WHERE product_id IN(".implode(",",$Miy).")")->rows;if(!$Mi_)return false;file_put_contents(DIR_LOGS."lightning_deleted.log","[".date("H:i:s")."] Deleted ".count($Mi_)." cache pages. Reason: ".$Mqn."\n\n",FILE_APPEND);global$Man;$Mja=$Man;foreach($Mi_ as$Mfd){$Mfd=$Mfd["page"];Wb_("alpha",$Mfd);Wb_("tetha",$Mfd);Wb_("gamma",$Mfd);}
$Mir->query("DELETE FROM ".DB_PREFIX."lightning_product_to_page WHERE product_id IN(".implode(",",$Miy).")");$Man=$Mja;return true;}
function Wcd(&$Mhp,&$Mhj){global$light_ob;if($light_ob<2)return;if(!empty($GLOBALS['Ma']['hk']))return;if($Mhp!==false){if(empty($Mhp->row["product_id"]))return;if($Mhp->num_rows>100)return;}
global$Mfh;if(!stripos($Mhj,"p.product_id = '")){if($Mly=Wak("category_id = '","'",$Mhj))$Mfh[100000000+$Mly]=1;if($Macv=Wak("manufacturer_id = '","'",$Mhj))$Mfh[200000000+$Macv]=1;if(!$Mly&&!$Macv&&strpos($Mhj,"ORDER BY p.date_added"))$Mfh[300000000]=1;}
if(!$Mhp)return;foreach($Mhp->rows as$Mik){$Mfh[$Mik["product_id"]]=1;}}
function Ws(){global$Mir;if($Mir)return$Mir;if(LVERSION<"2.0"&&defined("DIR_DATABASE")){$Map=DIR_DATABASE.DB_DRIVER.".php";$Mqr=substr(DIR_SYSTEM,0,-7)."vqmod/vqcache/vq2-system_".str_replace('/','_',str_replace(DIR_SYSTEM,'',$Map));if(file_exists($Mqr))$Map=$Mqr;if(file_exists($Map)){require_once($Map);$Mjy="DB".DB_DRIVER;if(!class_exists($Mjy))$Mjy=DB_DRIVER;$Mir=new$Mjy(DB_HOSTNAME,DB_USERNAME,DB_PASSWORD,DB_DATABASE);}else{exit("Lightning: Could not load database driver type ".DB_DRIVER.'!');}
}else{$Map=DIR_SYSTEM."library/db/".DB_DRIVER.".php";if(!file_exists($Map))$Map=DIR_SYSTEM."library/db/".strtolower(DB_DRIVER).".php";if(function_exists("modification"))require_once(modification($Map));else require_once($Map);$Mjy="DB\\".DB_DRIVER;if(LVERSION>=4)$Mjy="Opencart\System\Library\DB\\".DB_DRIVER;if(class_exists($Mjy)){$Mir=new$Mjy(DB_HOSTNAME,DB_USERNAME,DB_PASSWORD,DB_DATABASE);}else{exit("Lightning: Could not load database driver ".DB_DRIVER.'!');}}
return$Mir;}
function Wcm(&$Mhj){global$Mio;if(stripos($Mhj,"ELECT COUNT")and stripos($Mhj,"product_id) AS total"))return true;if(stripos($Mhj,"'information_id="))return true;$Mis=Wcg("(\*|xseo) FROM "," ",$Mhj);if(!$Mis)return false;if(substr($Mis,0,1)=="`")$Mis=substr($Mis,1,-1);$Mis=substr($Mis,strlen(DB_PREFIX));if(!in_array($Mis,$Mio))return false;return true;}
global$Mjj;$Mjj=file_exists(DIR_LOGS.'cv');function Wcb($Mjz){$Mga=new stdClass();if(!$Mjz){$Mga->num_rows=0;$Mga->row=array();$Mga->rows=array();return$Mga;}
if(isset($Mjz['Mjr'])){global$Mip;$Mip=$Mjz['Mjr'];unset($Mjz['Mjr']);}
$Mga->num_rows=count($Mjz);if($Mga->num_rows)$Mga->row=reset($Mjz);else$Mga->row=array();$Mga->rows=$Mjz;return$Mga;}
function Wcn(){foreach(glob(DIR_CACHE."lightning/".'b'."*")as$Mj_)if(is_file($Mj_))@unlink($Mj_);foreach(glob(DIR_CACHE."lightning/epsilon/*")as$Mj_)if(!is_dir($Mj_))@unlink($Mj_);}
function Wco($Mce){if(substr_count($Mce,'/')==2)$Mce=substr($Mce,0,strrpos($Mce,'/'));if(!in_array($Mce,array("setting/setting","localisation/language","localisation/currency","catalog/category","catalog/information")))return;Wcn();}
function Wcp(){global$Mir;if(!$Mir->query("SHOW tables like '".DB_PREFIX."lightning_mail'")->row)$Mir->query("CREATE TABLE ".DB_PREFIX."lightning_mail(mail_id int(11) AUTO_INCREMENT, mail MEDIUMTEXT CHARACTER SET utf8, KEY (mail_id))");else$Mir->query("ALTER TABLE ".DB_PREFIX."lightning_mail CONVERT TO CHARACTER SET utf8");if(!$Mir->query("SHOW tables like '".DB_PREFIX."lightning_product_to_page'")->row){$Mir->query("CREATE TABLE ".DB_PREFIX."lightning_product_to_page(product_id int(11), page varchar(36), KEY (product_id), KEY(page))");$Mir->query("CREATE TABLE ".DB_PREFIX."lightning_modified (page varchar(36), cs bigint(13), md int(11), scs bigint(13), smd int(11), KEY (page), KEY(smd))");}
if(!$Mir->query("SHOW tables like '".DB_PREFIX."lightning_lcp'")->row){$Mir->query("CREATE TABLE ".DB_PREFIX."lightning_lcp (page varchar(36), image text, smd int(11), PRIMARY KEY (page), KEY(smd))");}
if(LVERSION>"3")$Mir->query("ALTER TABLE ".DB_PREFIX."session CHANGE data data LONGTEXT");}
function Wft($Mcl,$Msw=false){if(substr($Mcl,-1)!="/")$Mcl.="/";if(!file_exists($Mcl))return true;$Map=$Mcl.".htaccess";if(file_exists($Map)){$Mdd=file_get_contents($Map);return strpos($Mdd,"speed.devs.mx");}
$Msx="# REAL SITE SPEED .htaccess\n# Visit http://speed.devs.mx for more info\n# ----------------------------------------\n\nFileETag none\n\n\n<IfModule mod_expires.c>\n ExpiresActive On\n ExpiresDefault \"access plus 99 days\"\n</IfModule>\n\n<ifmodule mod_deflate.c>\n AddType application/x-font-woff .woff\n AddType image/svg+xml .svg\n AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript text/javascript image/svg+xml application/x-font-woff\n</ifmodule>";if($Msw)$Msx=str_replace("99 days","1 day",$Msx);@file_put_contents($Map,$Msx);return file_exists($Map);}
function Wbv(){global$Mzj;if($Mzj){$Maag=false;foreach($Mzj as$Mcb=>$Maj)if(!empty($Maj[3]))if(strpos($Maj[3],"IP pretends")||strpos($Maj[3],"IP ")){unset($Mzj[$Mcb]);$Maag=true;}
if($Maag)Wjq();}
global$Mir;if($Mir){Wcp();Wcq('product_to_category','category_id','product_id');if(LVERSION<"3"){Wcq('url_alias','query');Wcq('url_alias','keyword');}else Wcq('session','expire');Wcq('product_option_value','product_id');Wcq('product_special','product_id');Wcq('product','model');Wcq('product','date_modified');Wcq('product_image','product_id');Wcq('product_option','product_id');Wcq('order_product','order_id');Wcq('product_attribute','attribute_id','product_id');}
Wab();if(!Wft(DIR_APPLICATION."view")){Wft(DIR_APPLICATION."view/javascript");Wft(DIR_APPLICATION."view/theme");}
Wft(DIR_APPLICATION."language");if(!Wft(DIR_IMAGE)){Wft(DIR_IMAGE."catalog");Wft(DIR_IMAGE."cache");}
foreach(glob(substr(DIR_SYSTEM,0,-7)."*",GLOB_ONLYDIR)as$Mks)if(!Wft($Mks."/view",true)){Wft($Mks."/view/image",true);Wft($Mks."/view/javascript",true);Wft($Mks."/view/stylesheet",true);}
require_once"special.php";$Mbs=substr(DIR_SYSTEM,0,-7)."index.php";$Mkb="extension/lightning/gamma.php";$Mdt=file_get_contents($Mbs);if(!strpos($Mdt,$Mkb)){$Maf=strpos($Mdt,"index.php");$Maf=strpos($Mdt,"}",$Maf+1);if($Maf){$Maf++;$Mdt=substr($Mdt,0,$Maf)."\n\nif (file_exists(".'$'."li"." = DIR_APPLICATION.'controller/extension/lightning/gamma.php')) require_once(".'$'."li"."); //Lightning".substr($Mdt,$Maf);$Mdt=str_replace("\nif (file_exists(DIR_SYSTEM.'lightning/gamma.php')) require(DIR_SYSTEM.'lightning/gamma.php'); //Lightning",'',$Mdt);file_put_contents($Mbs,$Mdt);}
$Mdt=file_get_contents($Mbs);if(strpos($Mdt,$Mkb))Wb("index_php",false);}else Wb("index_php",false);Wbg();}
function Wca(&$Mhj){return;}
function Wlg(&$Mhj){if(strpos($Mhj,"#"))$Mhj=preg_replace('/#.*$/m',' ',$Mhj);$Mhj=preg_replace('/\s+/',' ',$Mhj);}
function Wcq($Mis,$Mkc,$Mkd=false){global$Mir;$Maz=$Mkc;if($Mkd)$Maz.="_".$Mkd;if($Mir->query("SHOW KEYS FROM `".DB_PREFIX."$Mis` WHERE Key_name='$Maz'")->row)return;try{if(!$Mkd)$Mir->query("ALTER TABLE `".DB_PREFIX."$Mis` ADD INDEX `$Mkc` (`$Mkc`)");else$Mir->query("ALTER TABLE `".DB_PREFIX."$Mis` ADD INDEX `$Maz` (`$Mkc`,`$Mkd`)");}catch(Exception$Mey){}}
define('Wcw',"/meters");function Wad($Man,$Mkg=false,$Mkh=false){if(substr($Man,-3,1)=='/')$Man=substr($Man,0,-3);$Map=$Man.Wcw;if(file_exists($Map)){$data=explode(',',Wct($Map));if(!$Mkg and!$Mkh)return$data;$Mki=$data[0];$Mbj=$data[1];}else{$Mki=0;$Mbj=0;}
$Mki+=$Mkg;if($Mki<0)$Mki=0;$Mbj+=$Mkh;if($Mbj<0)$Mbj=0;file_put_contents($Map,$Mki.','.$Mbj,LOCK_EX);}
function Wct($Map){$Mkj=fopen($Map,'rt');flock($Mkj,LOCK_SH);$Mhp=file_get_contents($Map);fclose($Mkj);return$Mhp;}
function Wbb($Mwy,$Mgj,$data,$Mkk=false){$Man=DIR_CACHE."lightning/$Mwy";if(Waw($Man))file_put_contents($Man.Wcw,"0,0",LOCK_EX);global$Mfv,$Mb;if($Mfv<$Mb)return;$Mao=md5($Mgj);$Miv=$Man."/".substr($Mao,0,2);if($Mkk){global$Mwx;Wcu($Miv,$Mwx[$Mwy]);}
$Map=$Miv."/c".substr($Mao,2);$Mki=0;if(file_exists($Map))$Mbj=strlen($data)-filesize($Map);else{$Mbj=strlen($data);$Mki=1;}
Wad($Man,$Mki,$Mbj);Waw($Miv);file_put_contents($Map,$data,LOCK_EX);return$Map;}
function Whg($Map){Wcv($Map);return file_exists($Map);}
function Wcv($Map){static$Mkl;if(!$Mkl){$Mkl=phpversion();usleep(rand(0,1000));}
if($Mkl<"5.3")clearstatcache();else clearstatcache(true,$Map);}
function Wae($Mwy,$Mgj){$Man=DIR_CACHE."lightning/$Mwy";$Mao=md5($Mgj);$Miv=$Man."/".substr($Mao,0,2);$Map=$Miv."/c".substr($Mao,2);if(!Whg($Map))return false;return @filemtime($Map);}
function Wbe($Mwy,$Mgj,$Mbt,$Mkm=false){$Man=DIR_CACHE."lightning/$Mwy";$Mao=md5($Mgj);$Miv=$Man."/".substr($Mao,0,2);Waw($Miv);$Map=$Miv."/c".substr($Mao,2);if(!Whg($Map)){if(!$Mkm)return;file_put_contents($Map,'');Wad($Man,1,0);}
@touch($Map,$Mbt);}
function Wbd($Mwy,$Mgj,$Mkn=false){global$Mjq,$Mwx;$Mfg=$Mwx[$Mwy];$Man=DIR_CACHE."lightning/$Mwy";$Mjq=false;$Mao=md5($Mgj);$Miv=$Man."/".substr($Mao,0,2);$Map=$Miv."/c".substr($Mao,2);if(!$Mkn)Wcu($Miv,$Mfg);if(!Whg($Map))return false;$Mjq=@filemtime($Map);static$Mmk;if(!$Mmk)$Mmk=time();$Mbt=$Mmk-$Mfg;if(!$Mkn and$Mjq<$Mbt){@unlink($Map);return false;}
$data=@file_get_contents($Map);return$data;}
function Wcu($Miv,$Mfg){if(!$Mfg)return;static$Mka;if(!empty($Mka[$Miv]))return;$Mka[$Miv]=true;if(!Whg($Miv))return;$Mbt=time();if(filemtime($Miv)<$Mbt-10*60){touch($Miv);$Mbt-=$Mfg;$Mki=0;$Mbj=0;if(substr($Miv,-1)=="/")$Miv=substr($Miv,0,-1);$Mko=glob($Miv."/c*");$Mfj=true;if($Mko)foreach($Mko as$Mj_)if(Whg($Mj_)&&@filemtime($Mj_)<$Mbt){$Mbj+=filesize($Mj_);@unlink($Mj_);$Mki++;}
Wad($Miv,-$Mki,-$Mbj);}}
function Wag($Mwy,$Mgj=false){$Man=DIR_CACHE."lightning/$Mwy";if($Mgj){$Mao=md5($Mgj);$Miv=$Man."/".substr($Mao,0,2);$Map=$Miv."/c".substr($Mao,2);if(Whg($Map)){Wad($Man,-1,filesize($Map));@unlink($Map);}
return;}
foreach(glob($Man."/*")as$Miv){if(is_dir($Miv)){foreach(glob($Miv."/*")as$Mj_)if(Whg($Mj_))@unlink($Mj_);rmdir($Miv);}else if(Whg($Miv))@unlink($Miv);}
if(Whg($Man.Wcw))@unlink($Man.Wcw);}
function Wb_($Mwy,$Mkp){$Man=DIR_CACHE."lightning/$Mwy";$Map=$Man."/".$Mkp;if(Whg($Map)){$Mbj=@filesize($Map);@unlink($Map);Wad($Man,-1,-$Mbj);}}
function Wby($Mdl,$Min,$Mdk){preg_match_all("/$Mdl([^$Min]*)/i",$Mdk,$Mcu);return($Mcu[1]);}
function Wcg($Mdl,$Min,&$Mdk){preg_match("/$Mdl([^$Min]*)/i",$Mdk,$Mcu);if(isset($Mcu[1]))return($Mcu[1]);else return"";}
function Wcw($Mdl,$Mbn,$Mdk){$Mbm=array();$Mei=0;while(($Mei=strpos($Mdk,$Mdl,$Mei))!==false){$Mei+=strlen($Mdl);$Mey=strpos($Mdk,$Mbn,$Mei);if($Mey!==false){$Mbm[]=trim(substr($Mdk,$Mei,$Mey-$Mei));$Mei=$Mey+strlen($Mbn);}}
return$Mbm;}
function Wat($Mdl,$Mbn,$Mdk){$Mbm=array();$Mei=0;while(($Mei=strpos($Mdk,$Mdl,$Mei))!==false){$Mei+=strlen($Mdl);$Mey=strpos($Mdk,$Mbn,$Mei);if($Mey!==false){$Mbm[]=substr($Mdk,$Mei-strlen($Mdl),$Mey-$Mei+strlen($Mdl)+strlen($Mbn));$Mei=$Mey+strlen($Mbn);}}
return$Mbm;}
function Wip($Mkq,$Meu,$Mdk){if(($Maf=strpos($Mkq,'*'))!==false){$Mkq=str_replace("/","\/",$Mkq);$Mev=substr($Mkq,0,$Maf);$Mex=substr($Mkq,$Maf+1);return preg_replace("/$Mev.*?$Mex/is",$Meu,$Mdk);}else return str_ireplace($Mkq,$Meu,$Mdk);}
function Wau($Mkq=false,$Meu='',$Mdk=false){if(($Maf=strpos($Mkq,'*'))!==false){$Mev=substr($Mkq,0,$Maf);$Mex=substr($Mkq,$Maf+1);$Mbm=Wcx("","",$Mev,$Mex,$Mdk);$Mbm=str_ireplace($Mev.$Mex,$Meu,$Mbm);}else $Mbm=str_ireplace($Mkq,$Meu,$Mdk);return$Mbm;}
function Wcx($Mez,$Meu,$Mdl,$Mbn,$Mdk){if(!is_string($Mdk))return$Mdk;$Mei=0;while(($Mei=stripos($Mdk,$Mdl,$Mei))!==false){$Mei+=strlen($Mdl);if($Mbn)$Mey=stripos($Mdk,$Mbn,$Mei);else$Mey=strlen($Mdk);if($Mey){$Me_=substr($Mdk,0,$Mei);$Mfa=substr($Mdk,$Mey);$Mfb=substr($Mdk,$Mei,$Mey-$Mei);$Mfc=strlen($Mfb);if($Mez!=='')$Mfb=str_ireplace($Mez,$Meu,$Mfb);else$Mfb=$Meu;$Mdk=$Me_.$Mfb.$Mfa;$Mey=$Mey+strlen($Mfb)-$Mfc;$Mei=$Mey+strlen($Mbn);if($Mei>strlen($Mdk))break;}}
return$Mdk;}
function Wcy($Mdl,$Mbn,$Mdk){$Mkr=Wak($Mdl,$Mbn,$Mdk);if($Mkr)return$Mkr;return$Mdk;}
function Wak($Mdl,$Mbn,$Mdk){$Mbm='';if($Mdl)$Mei=stripos($Mdk,$Mdl);else$Mei=0;if($Mei!==false){$Mei+=strlen($Mdl);if($Mbn)$Mey=stripos($Mdk,$Mbn,$Mei);else$Mey=strlen($Mdk);if($Mey!==false)$Mbm=trim(substr($Mdk,$Mei,$Mey-$Mei));}
return$Mbm;}
function Wcz($Mdl,$Mbn,$Mdk){$Mbm='';if($Mdl)$Mei=strripos($Mdk,$Mdl);else$Mei=0;if($Mei!==false){$Mei+=strlen($Mdl);if($Mbn){if($Mdl)$Mey=stripos($Mdk,$Mbn,$Mei);else$Mey=strripos($Mdk,$Mbn,$Mei);}
else$Mey=strlen($Mdk);if($Mey!==false)$Mbm=trim(substr($Mdk,$Mei,$Mey-$Mei));}
return$Mbm;}
function Waw($Mks){if(file_exists($Mks))return false;Wab();mkdir($Mks,0777,true);@chmod($Mks,0777);Wbg();return true;}
function Wab($Mmh=false){if($Mmh){ini_set("display_errors","Off");ini_set("log_errors","Off");}
global$Mbd;if($Mbd)return;$config=Wc_("config");if(!$config)return;$Mbd=array();$Mbd['Mmv']=true;foreach(array("config_error_display","config_error_log","error_display","error_log")as$Mgj){$Mbd[$Mgj]=$config->get($Mgj);$config->set($Mgj,0);}}
function Wbg(){global$Mbd;if(!$Mbd)return;$config=Wc_("config");if(!$config)return;foreach(array("config_error_display","config_error_log","error_display","error_log")as$Mgj)$config->set($Mgj,$Mbd[$Mgj]);$Mbd=false;}
function Wir($Mhj){if(stripos($Mhj,"ORDER BY p.date_added")){if(!stripos(str_replace('`','',$Mhj),DB_PREFIX."product p"))return false;$Mhj=Wau("ORDER BY p.date_added*DESC ","ORDER BY p.product_id DESC ",$Mhj." ");$Mhj=Wau("ORDER BY p.date_added*ASC ","ORDER BY p.product_id ASC ",$Mhj);return trim($Mhj);}
return trim($Mhj);}
function Wda($Mhj){if(stripos($Mhj,"ORDER BY p.date_added")){if(!stripos($Mhj,DB_PREFIX."product p"))return false;$Mhj=Wau("ORDER BY p.date_added*DESC ","ORDER BY p.product_id DESC ",$Mhj." ");$Mhj=Wau("ORDER BY p.date_added*ASC ","ORDER BY p.product_id ASC ",$Mhj);return trim($Mhj);}
if(!stripos($Mhj,"FROM ".DB_PREFIX."product_to_category p2c"))return false;$Mhj=Wau("ORDER BY p.sort_order*ASC ","ORDER BY p2c.product_id DESC ",$Mhj." ");return trim($Mhj);}
function Wdb($Mhj){return array(array("total"=>0));}
function Wdc($Mhj){static$Mkv;if(isset($Mkv[$Mhj]))return$Mkv[$Mhj];$Mhp=Wdd($Mhj);$Mkv[$Mhj]=$Mhp;return$Mhp;}
function Wde($Mhj){global$Mkw;if($Mkw)return false;$Mga=Wcg("`query` = '","'",$Mhj);global$Mkx;if(!isset($Mkx[$Mga])){$Mhp=Wdd($Mhj);if($Mhp){$Mfj=reset($Mhp);if(count($Mhp)==1&&count($Mfj)<4)$Mkx[$Mga]=$Mfj["keyword"];else$Mkx[$Mga]=$Mhp;}else$Mkx[$Mga]=false;return$Mhp;}
$Mky=$Mkx[$Mga];if($Mky===false)return array();if(is_array($Mky))return$Mky;return array(array("query"=>$Mga,"keyword"=>$Mky));}
function Wdf($Mhj){static$Mkz,$Mij;if(!stripos($Mhj,"ELECT DISTINCT *, pd.name")){$Mhp=Wdd($Mhj);$Mkz=array();if(count($Mhp)<1024)foreach($Mhp as$Mik)if(!empty($Mik["product_id"]))$Mkz[]=$Mik["product_id"];return$Mhp;}
$Mfk=Wcg("p.product_id = '","'",$Mhj);if(!$Mfk)return false;if(!empty($Mij[$Mfk]))return array($Mij[$Mfk]);if(empty($Mkz)or!in_array($Mfk,$Mkz)){if($Mij and count($Mij)>1024)return false;$Mhp=Wdd($Mhj);if(count($Mhp)<1024)foreach($Mhp as$Mik){$Mij[$Mik["product_id"]]=$Mik;if(isset($Mik["xseo"]))$Mkx["product_id=".$Mik["product_id"]]=$Mik["xseo"];}
return$Mhp;};if($Mij and count($Mij)>1024)return false;$Mhj=str_ireplace("p.product_id = '$Mfk'","p.product_id IN (".implode(",",$Mkz).")",$Mhj);$Mfq=Wc_("config")->get("config_seo_url");if($Mfq){$Mk_=Wdg();if(LVERSION>="3")$Msp=DB_PREFIX."seo_url";else$Msp=DB_PREFIX."url_alias";$Mhj=str_ireplace("AS discount,","AS discount, "."(SELECT `keyword` FROM $Msp WHERE `query` = CONCAT('product_id=', p.product_id) $Mk_) as xseo,",$Mhj);}
$Mhp=Wdd($Mhj);$Mkz=false;global$Mkx;foreach($Mhp as$Mik){$Mij[$Mik["product_id"]]=$Mik;if($Mfq){if(empty($Mik["xseo"]))$Mik["xseo"]=false;$Mkx["product_id=".$Mik["product_id"]]=$Mik["xseo"];}}
if(empty($Mij[$Mfk]))return false;return array($Mij[$Mfk]);}
function Wdh($Mhj){$Mfs=Wc_("config")->get("config_store_id");if(!$Mfs)$Mfs="0";$Mhj=str_ireplace("AND p2s.store_id = '".$Mfs."'","",$Mhj);$Mhj=str_ireplace("AND p2s.store_id = ".$Mfs,"",$Mhj);if(stripos($Mhj,"store_id"))return false;$Mhj=Wau(" LEFT JOIN ".DB_PREFIX."product_to_store p2s ON (*)","",$Mhj);$Mhj=Wau("LEFT JOIN `".DB_PREFIX."product_to_store` p2s ON (*)","",$Mhj);return$Mhj;}
function Wdi($Mhj){$Mhj=str_ireplace("LCASE(name)","LCASE(pd.name)",$Mhj);if(!stripos($Mhj,"pd.name")or!stripos($Mhj,"product p "))return false;if(stripos($Mhj,"as innertable"))return false;$Mhj=str_ireplace("LCASE(pd.name) ASC, LCASE(pd.name)","LCASE(pd.name)",$Mhj);$Mhj=str_ireplace("LCASE(pd.name) DESC, LCASE(pd.name)","LCASE(pd.name)",$Mhj);$Mhj=str_ireplace("LCASE(p.model) ASC, LCASE(pd.name)","LCASE(pd.name)",$Mhj);$Mhj=str_ireplace("LCASE(p.model) DESC, LCASE(pd.name)","LCASE(pd.name)",$Mhj);$Mhj=str_ireplace("ORDER BY pd.name","ORDER BY p.model",$Mhj);$Mhj=str_ireplace("LCASE(pd.name) ASC","p.model ASC",$Mhj);$Mhj=str_ireplace("LCASE(pd.name) DESC","p.model DESC",$Mhj);if(!stripos($Mhj,"pd.")and!stripos($Mhj,"name")){$Mhj=Wau(" LEFT JOIN ".DB_PREFIX."product_description pd ON (*)","",$Mhj);}
return$Mhj;}
function Wis($Mhj){if(stripos($Mhj,"BY p.sort_order"))return false;$Mhj=str_ireplace(", LCASE(pd.name) ASC",'',$Mhj);$Mhj=str_ireplace(", LCASE(pd.name) DESC",'',$Mhj);return$Mhj;}
function Wdj($Mhj){if(stripos($Mhj,"*")or stripos($Mhj," name")or stripos($Mhj," tag")or stripos($Mhj," description"))return false;$Mhj=Wau(" pd.language_id = '*' AND","",$Mhj);$Mhj=Wau("AND pd.language_id = '*'","",$Mhj);$Mhj=Wau(" WHERE pd.language_id = '*'","",$Mhj);$Mhj=Wau(" LEFT JOIN ".DB_PREFIX."product_description pd ON (*)","",$Mhj);$Mhj=Wau("LEFT JOIN `".DB_PREFIX."product_description` pd ON (*)","",$Mhj);$Mhj=Wau("sales DESC, LCASE(pd.name) DESC","sales DESC",$Mhj);if(stripos(str_replace('`','',$Mhj),"pd."))return false;return$Mhj;}
function Wfz($Mhj){$Mhj=Wau(" AND p.date_available <= NOW()","",$Mhj);return$Mhj;}
function Wdk($Mhj){if(stripos($Mhj,"MIN(")or stripos($Mhj,"MAX(")or stripos($Mhj,"SUM("))return false;$Mhj=Wau(" GROUP BY p.product_id","",$Mhj);return$Mhj;}
function Wdl($Mhj){if(strpos($Mhj,"SELECT",10))return false;Wlg($Mhj);$Mis=Wcz("FROM "," ",$Mhj);if(!$Mis)return false;$Mla=Wak("FROM $Mis "," ",$Mhj);if(!$Mla||strlen($Mla>3)||$Mla=="WHERE"||strpos($Mla,','))return false;$Mcj=Wcz("","WHERE",$Mhj);if(!$Mcj)return false;$Mlb=(int)Wcy(",","",Wcz("LIMIT","",$Mhj));if(!$Mlb)return false;$Mlc=Wa2.'cx';if(Whg($Mlc)&&@filemtime($Mlc)>time()-60*60)$Miu=unserialize(file_get_contents($Mlc));else$Miu=array();if(empty($Miu[$Mis])){$Mfi=Wdd("SHOW KEYS FROM $Mis WHERE Key_name = 'PRIMARY'");if(!$Mfi){$Miu[$Mis]=-1;file_put_contents($Mlc,serialize($Miu),LOCK_EX);return false;}
$Mld=$Mfi[0]["Column_name"];$Mjf=Wdd("SELECT count(*) FROM $Mis");$Mjf=$Mjf[0];$Mjf=reset($Mjf);if(!$Mjf){$Miu[$Mis]=-1;file_put_contents($Mlc,serialize($Miu),LOCK_EX);return false;}
$Mle=Wdd("SELECT $Mld FROM $Mis ORDER BY $Mld LIMIT 1");$Mle=$Mle[0][$Mld];$Mlf=Wdd("SELECT $Mld FROM $Mis ORDER BY $Mld DESC LIMIT 1");$Mlf=$Mlf[0][$Mld];$Miu[$Mis]=array('id'=>$Mld,'Mjf'=>$Mjf,'Mle'=>$Mle,'Mlf'=>$Mlf);file_put_contents($Mlc,serialize($Miu),LOCK_EX);}else if($Miu[$Mis]==-1)return false;$Mlg=$Miu[$Mis];if($Mlg['Mjf']<$Mlb*5)return false;$Mlh=Wcz(""," ORDER ",$Mhj);$Mix=Wcy("","GROUP BY",Wcz("WHERE","",$Mlh));$Mhp=array();$Mli=array();$Mlj=0;while(count($Mhp)<$Mlb&&$Mlj++<5){$Mlk=array();for($Mcb=0;$Mcb<$Mlb;$Mcb++){$Mll=0;while(in_array($Mld=rand($Mlg['Mle'],$Mlg['Mlf']),$Mli)&&$Mll++<10);$Mlk[]=$Mld;$Mli[]=$Mld;}
$Mlm=Wdd("$Mcj WHERE $Mla.".$Mlg['id']." IN (".implode(',',$Mlk).") AND ($Mix)");$Mhp=array_merge($Mhp,$Mlm);}
$Mhp=array_slice($Mhp,0,$Mlb);if(count($Mhp)<$Mlb){$Miu[$Mis]=-1;file_put_contents($Mlc,serialize($Miu),LOCK_EX);return false;}
return$Mhp;}
function Wdm($Mln){static$Mcr;if(!$Mcr){$Mlo=Wdd("SELECT category_id, parent_id FROM ".DB_PREFIX."category");$Mlp=array();$Mcr=array();foreach($Mlo as$Mlq){$Mlp[$Mlq["category_id"]]=$Mlq["parent_id"];$Mcr[$Mlq["parent_id"]][]=$Mlq["category_id"];}
$Mlr=array();foreach($Mlp as$Mls=>$Mlt)if(empty($Mcr[$Mls]))$Mlr[$Mls]=true;$Mlu=true;while($Mlu){$Mlv=array();$Mlu=false;foreach($Mlp as$Mls=>$Mlt)if(!empty($Mlr[$Mls])and empty($Mlr[$Mlt])){if(!empty($Mcr[$Mls]))$Mcr[$Mlt]=array_unique(array_merge($Mcr[$Mlt],$Mcr[$Mls]));if(!in_array($Mlt,$Mlv))$Mlv[]=$Mlt;$Mlu=true;}
foreach($Mlv as$Mlq)$Mlr[$Mlq]=true;}}
if(empty($Mcr[$Mln]))return$Mln;return$Mln.','.implode(',',$Mcr[$Mln]);}
function Wdn($data){global$Ma;if(!empty($Ma['fr']))return-1;if(!empty($_REQUEST["ajaxfilter"]))return-1;static$Mlw;if(!$Mlw){global$Mjj;if($Mjj and empty($_GET["li_op"]))$Mlw=-1;else$Mlw=1;}
if($Mlw==-1)return-1;global$Mjc,$Mjq;if(!empty($_POST["mfp"]))$data["mfp"]=$_POST["mfp"];elseif(!empty($_GET["mfp"]))$data["mfp"]=$_GET["mfp"];if(!empty($_GET["ocf"]))$data["ocf"]=$_GET["ocf"];if(!empty($_GET["ocfilter_page_id"]))$data["ocfilter_page_id"]=$_GET["ocfilter_page_id"];$Mjc=serialize($data);if(($Mbm=Wci($Mjc))!==-1)return$Mbm;global$Mcq;if(!$Mcq){global$Mcq,$request;if(!empty($request->get["route"]))$Mcq=$request->get["route"];}
static$Mlx;if(!$Mlx)$Mlx=time()-60*60;static$Mer;if(isset($Mer[$Mjc]))return$Mer[$Mjc];$Mhp=Wbd("beta",$Mjc,true);if($Mjq<$Mlx+rand(0,10*60))return-1;if(!is_numeric($Mhp))return-1;$Mer[$Mjc]=$Mhp;Wci($Mjc,$Mhp);$Mjc=false;return$Mhp;}
function Wcc($Mhp){global$Mjc;if(!isset($Mhp->row["total"])||count($Mhp->rows)>1){$Mjc=false;return;}
Wbb("beta",$Mjc,$Mhp->row["total"]);Wci($Mjc,$Mhp->row["total"]);$Mjc=false;}
function Wdo($Mhj){$Mly=Wcg("AND cp.path_id = '","'",$Mhj);if(!$Mly)return false;$Mhj=str_ireplace(" FROM ".DB_PREFIX."category_path cp LEFT JOIN ".DB_PREFIX."product_to_category p2c ON (cp.category_id = p2c.category_id)"," FROM ".DB_PREFIX."product_to_category p2c",$Mhj);$Mlo=Wdm($Mly);if(strpos($Mlo,','))$Mlo="IN ($Mlo)";else$Mlo="= $Mlo";if(!stripos($Mhj,"p2c.category_id"))return false;$Mhj=str_ireplace(" AND cp.path_id = '".$Mly."'"," AND p2c.category_id ".$Mlo,$Mhj);$Mhj=str_ireplace(" AND `cp`.`path_id` = '".$Mly."'"," AND p2c.category_id ".$Mlo,$Mhj);if(stripos($Mhj,"path_id"))return false;return$Mhj;}
function Wdg(){static$Mhp;if($Mhp)return$Mhp;if(LVERSION>="3")$Mhp="AND language_id='".Wc_("config")->get("config_language_id")."' AND store_id='".Wc_("config")->get("config_store_id")."' LIMIT 1";elseif(Wdd("SHOW COLUMNS FROM ".DB_PREFIX."url_alias LIKE 'language_id'"))$Mhp="AND language_id='".Wc_("config")->get("config_language_id")."' LIMIT 1";elseif(Wdd("SHOW COLUMNS FROM ".DB_PREFIX."url_alias LIKE 'lang'"))$Mhp="AND lang='".Wc_("config")->get("config_language_id")."' LIMIT 1";else$Mhp="LIMIT 1";return$Mhp;}
function Wdp($Mhj){if(!defined("LIGHT_FRONTEND")or!stripos($Mhj,"FROM ".DB_PREFIX."category c LEFT JOIN")or(strpos($Mhj,"category_description_")))return false;static$Mlo;if(!$Mlo){$Mga="SELECT * FROM ".DB_PREFIX."category c LEFT JOIN ".DB_PREFIX."category_description cd ON (c.category_id=cd.category_id) LEFT JOIN ".DB_PREFIX."category_to_store c2s ON (c.category_id = c2s.category_id) WHERE cd.language_id = '".(int)Wc_("config")->get("config_language_id")."' AND c2s.store_id = '".(int)Wc_("config")->get("config_store_id")."' AND c.status = '1' ORDER BY c.sort_order, LCASE(cd.name)";$Mfq=Wc_("config")->get("config_seo_url");if($Mfq){$Mk_=Wdg();if(LVERSION>="3")$Msp=DB_PREFIX."seo_url";else$Msp=DB_PREFIX."url_alias";$Mga=str_ireplace("* FROM","*, (SELECT `keyword` FROM $Msp WHERE `query` = CONCAT('category_id=', c.category_id) $Mk_) as xseo FROM",$Mga);}
$Mlz=Wdd($Mga);$Mlo=array();foreach($Mlz as$Mik){$Mik["children"]=0;$Mlo[$Mik["category_id"]]=$Mik;}
$Mlo[0]["children"]=0;global$Mkx;foreach($Mlo as$Mld=>$Mik){if(empty($Mik["category_id"]))continue;if($Mfq){if(empty($Mik["xseo"]))$Mik["xseo"]=false;$Mkx["category_id=".$Mik["category_id"]]=$Mik["xseo"];}
if(!$Mik["parent_id"])$Mik["parent_id"]=0;if(!isset($Mlo[$Mik["parent_id"]]["children"]))$Mlo[$Mik["parent_id"]]["children"]=0;$Mlo[$Mik["parent_id"]]["children"]++;$Mlo[$Mik["parent_id"]]["childs_id"][]=$Mik["category_id"];}}
if(!$Mlo)return false;$Ml_=Wcg("c.parent_id = '","'",$Mhj);if($Ml_!==''){if(empty($Mlo[$Ml_]["childs_id"]))return array();$Mhp=array();$Mlb=Wak(" LIMIT ","",$Mhj);if(!$Mlb)$Mlb=10000;foreach($Mlo[$Ml_]["childs_id"]as$Mld){$Mhp[]=$Mlo[$Mld];if(count($Mhp)==$Mlb)break;}
return$Mhp;}
$Mln=Wcg("c.category_id = '","'",$Mhj);if($Mln==="")return false;if(!$Mln or empty($Mlo[$Mln]["category_id"]))return array();return array($Mlo[$Mln]);}
function Wdq($Mkq=false){$Mjh=debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);$Mbp="";foreach($Mjh as$Mcb=>$Mhs){if($Mcb<3)continue;$Mji=$Mhs["function"];if($Mji=="call_user_func_array")break;if(!empty($Mhs["class"]))$Mji=$Mhs["class"].":".$Mji;if($Mbp)$Mbp=$Mji." -> ".$Mbp;else$Mbp=$Mji;}
if(!$Mkq)return$Mbp;$Mkq=explode(',',$Mkq);foreach($Mkq as$Mma)if(strpos($Mbp,$Mma)!==false)return true;return false;}
function Wdr($Mmb){$Mmb=explode(", ",$Mmb);$Mjh=debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);foreach($Mjh as$Mcb=>$Mhs){if(empty($Mhs["class"]))continue;if(in_array($Mhs["class"],$Mmb))return true;}
return false;}
function Wdd($Mhj){global$db,$Ma;$Mer=$Ma['cm'];$Ma['cm']=false;$Mhp=$db->query($Mhj);if(isset($Mhp->rows))$Mhp=$Mhp->rows;$Ma['cm']=$Mer;return$Mhp;}
function Wcf($Mhj){return preg_replace("/[\d\s,]|'[^']*'/",'',str_replace('\\'."'","",$Mhj));}
function Wds($Mgj,$Mad){if($Mgj!="config_language_id")return;Wfc(1);global$Mkw,$Mxo;if(!$Mxo)$Mxo=$Mad;if($Mad!=$Mxo)$Mkw=2;if($Mad==$Mxo&&$Mkw==2)$Mkw=false;}
function Wci($Mgj,$Mad='x'){if(empty($GLOBALS['Ma']['cz']))return-1;if(file_exists(DIR_APPLICATION."controller/record/langmark.php"))return-1;if(is_string($Mad)&&substr($Mad,-27)=="index.php?route=common/home")$Mad=substr($Mad,0,-27);global$Mkw,$Mxo;static$Mfu;if($Mkw){if($Mkw==1&&$Mfu==$_SESSION["language"])$Mkw=false;else return-1;}
if(!empty($Mq["language"])){if(!$Mfu)$Mfu=$Mq["language"];else if($Mfu!=$Mq["language"]){$Mkw=1;return-1;}}
static$storage,$Mmm,$Map,$Mvf;global$Mmn,$Mml;if(!$Mvf){if($Mgj=='Mer')return-1;if(!defined("LIGHT_FRONTEND")or!empty($GLOBALS['Mab']))return-1;global$Mcq;if(!$Mcq){$Mcq='';if(!empty(Wc_("request")->get["route"]))$Mcq=Wc_("request")->get["route"];}
if(strpos($Mcq,"language"))return-1;$Mce=str_replace('/','',$Mcq);if($Maf=strpos($Mce,' ')||$Maf=strpos($Mce,"'")||$Maf=strpos($Mce,"&"))$Mce=substr($Mce,0,$Maf);if($Mce=="commonhome")$Mce="";$config=Wc_("config");if(!$config)return-1;$Map=DIR_CACHE."lightning/epsilon/".$config->get("config_store_id").$config->get("config_language_id").$Mce.".inc";Wcv($Map);if(!$Mce and!empty($GLOBALS['Ma']['Mnt'])and!empty($GLOBALS['Ma']['n'])and empty($GLOBALS['Wjk']))$Mmn=!file_exists($Map);else$Mmn=!(file_exists($Map)&&@filemtime($Map)>time()-3600);$Mvf=true;$Mxo=$config->get("config_language_id");if(!$Mmn){require_once$Map;$Mml=true;}else if($Mce){$Mcc=DIR_CACHE."lightning/epsilon/".$config->get("config_store_id").$config->get("config_language_id").".inc";if(file_exists($Mcc)){require_once$Mcc;$Mmm=$storage;$storage=array();}}}
if(!is_string($Mgj))$Mgj=(string)$Mgj;if($Mad!=='x'){if($Mmn){if(stripos($Mgj,"ELECT COUNT"))return 0;if(stripos($Mgj,"/not_found"))return 0;if(strlen(serialize($Mad))>20000)return 0;$storage[$Mgj]=$Mad;if($Mgj=='Mer'&&count($storage)>5){Waw(DIR_CACHE."lightning/epsilon/");file_put_contents($Map,"<?php\n $"."storage = ".var_export($storage,true).";",LOCK_EX);}}
return 0;}
if(!empty($Mmm)and isset($Mmm[$Mgj]))$storage[$Mgj]=$Mmm[$Mgj];if(isset($storage[$Mgj]))if(is_object($storage[$Mgj]))return clone$storage[$Mgj];else return$storage[$Mgj];return-1;}
function Wdu($Mgj){if($Mgj!=="product")return;foreach(glob(DIR_CACHE."journal3.products.*")as$Map)@unlink($Map);foreach(glob(DIR_CACHE."journal3.product.*")as$Map)@unlink($Map);}
function Wfm($data){if(!$data)return"";if(!is_array($data))return$data;$Mbm='';foreach($data as$Mai){if($Mbm)$Mbm.=" ";if(!is_array($Mai))$Mbm.=$Mai;else$Mbm.=Wfm($Mai);}
return$Mbm;}
function Wfn($Mce,&$Mmo,&$output="xx"){if(defined("HTTP_CATALOG"))return-1;global$Mso;if(!isset($Mso[$Mce]))return-1;if($Mce=="design/translation/getTranslations"&&!strpos($Mmo[0],"/"))return-1;$Mgj=$Mce."(".Wfm($Mmo).")";if($output==="xx")return Wci($Mgj);Wci($Mgj,$output);}
function Wfv(){global$Mtj;return$Mtj;}
function light_measure($action="Custom Measure"){global$Mw_,$Mxa;if($Mxa){Wfw($Mxa,$Mw_,$Mw_);$Mxa=false;return;}
if(function_exists('Wfu')){$Mw_=Wfu($action);$Mxa=$action;}}
function Wnk($Mce){if(empty($GLOBALS['Ma']['ie']))return;$Mce=(string)$Mce;if(substr($Mce,-11)!=="common/cart"&&substr($Mce,-16)!=="common/cart/info")return;$Maet=Wc_("journal3");if($Maet->get("cartStyleCartCustomText"))return;$Maeu=$Maet->is_phone||($Maet->is_tablet&&$Maet->get('mobileHeaderTablet'));$Maev=null;$Maew=null;$Maex=null;if($Maey=$Maet->get('headerDesktop')){list($Maev,$Maew)=explode('/',$Maey);}
if($Maev&&$Maew){$Maet->set('header_desktop_type',$Maew);$Maet->set('header_desktop_id',$Maev);$Maex=Wc_('load')->controller('journal3/header_desktop',array('module_type'=>$Maew,'module_id'=>$Maev,));}
$Maez=null;$Mae_=null;$Mafa=null;if($Mafb=$Maet->get('headerMobile')){list($Maez,$Mae_)=explode('/',$Mafb);}
if($Maez&&$Mae_){$Maet->set('header_mobile_type',$Mae_);$Maet->set('header_mobile_id',$Maez);$Mafa=Wc_('load')->controller('journal3/header_mobile',array('module_type'=>$Mae_,'module_id'=>$Maez,));}
if($Maeu){if(!empty($Maex['settings']))$Maet->load($Maex['settings']);if(!empty($Mafa['settings']))$Maet->load($Mafa['settings']);}else{if(!empty($Mafa['settings']))$Maet->load($Mafa['settings']);if(!empty($Maex['settings']))$Maet->load($Maex['settings']);}}
function Wfa($Mce,&$data){global$registry;if($registry)Wc_("config")->set("developer_sass",1);if(!$Mce)return 0;Wnk($Mce);global$Mti,$Mtj;$Mtj=false;if(isset($Mti[$Mce])){global$Mtk;$Mtk=$Mce."(".Wfm($data).")";$Mtj=Wci($Mtk);if($Mtj==-1)$Mtj=false;else return 0;}
$Maf=0;if(function_exists('Wfu'))$Maf=Wfu($Mce);if(substr($Mce,0,6)=="event/")return$Maf;return$Maf;}
function Wfw($Mce,$Maf,&$Mbm){if(!$Mce)return;global$Mti;if(isset($Mti[$Mce])){global$Mtk;Wci($Mtk,$Mbm);}
global$Mam;if(!$Mam)return;$Mbt=microtime(true);global$Mjd;$Mbt-=$Mjd[$Maf]['Mdl'];if($Mbt<0.01){unset($Mjd[$Maf]);return;}
$Mjd[$Maf]['Mbt']=$Mbt;$Mjd[]=array('ed'=>'Mbn');}
function Wc_($Mbi){global$registry;if(!$registry)return false;return$registry->get($Mbi);}
function Wf_(&$Mce,&$Mmo){global$Ma;if(empty($Ma['en'])||$Mce!=="product/product")return;if(is_array($Mmo))$Mmo=http_build_query($Mmo);if(LVERSION>="4"){$Mmo=explode('&',$Mmo);foreach($Mmo as$Mcb=>$Mafl)if(!strpos($Mafl,"roduct_id")&&!strpos($Mafl,"anguage"))unset($Mmo[$Mcb]);$Mmo=implode('&',$Mmo);return;}
$Maf=strpos($Mmo,"product_id=");if(!$Maf)return;$Mey=strpos($Mmo,"&",$Maf);if(!$Mey)$Mey=strlen($Mmo);$Mmo=substr($Mmo,$Maf,$Mey-$Maf);}
function Wga(){global$Ma;if(empty($Ma['en']))return;global$Mk;if(strpos($Mk,"ajaxcart="))return;if(strpos($Mk,"popup="))return;if(empty(Wc_("request")->get["product_id"]))return;$Mfk=(int)Wc_("request")->get["product_id"];if(!$Mfk)return;global$light_bot;if($light_bot){$Mby=Wc_("request")->get;unset($Mby["route"]);unset($Mby["_route_"]);global$Mk;if(count($Mby)>1&&(strpos($Mk,'&')||strpos($Mk,'?'))){$Muj=Wc_("url")->link("product/product","product_id=$Mfk");if(!strpos(str_replace("&","&",$Muj),str_replace("&","&",$_SERVER["REQUEST_URI"])))Wc_("response")->redirect(Wc_("url")->link("product/product","product_id=$Mfk"),301);}}
$Mpi=array("_route_","route","product_id","path","li_module");foreach(Wc_("request")->get as$Mac=>$Muu)if(!in_array($Mac,$Mpi))unset(Wc_("request")->get[$Mac]);global$Mk;$Mk=Wc_("url")->link("product/product","product_id=$Mfk");foreach($_GET as$Mac=>$Muu)if(!in_array($Mac,$Mpi))unset($_GET[$Mac]);foreach($_REQUEST as$Mac=>$Muu)if(!in_array($Mac,$Mpi))unset($_REQUEST[$Mac]);if(!empty(Wc_("request")->get["path"]))return;global$Mir;$Mlo=$Mir->query("SELECT category_id FROM ".DB_PREFIX."product_to_category WHERE product_id = $Mfk")->rows;foreach($Mlo as&$Mlq)$Mlq=array($Mlq["category_id"]);$Mlb=0;$Mtn=false;do{if($Mlb++>10)return;$Mlr=true;$Mfj=true;foreach($Mlo as$Mcb=>&$Mlq)if(end($Mlq)){$Mfi=$Mir->query("SELECT parent_id, `status` FROM ".DB_PREFIX."category WHERE category_id = ".end($Mlq))->row;if($Mfi&&!$Mfi["status"]){unset($Mlo[$Mcb]);continue;}
if($Mfi&&!in_array($Mfi["parent_id"],$Mlq))$Mlq[]=$Mfi["parent_id"];else$Mlq[]=0;$Mlr=false;if($Mfj){$Mtn=$Mlq;$Mfj=false;}}
}while(!$Mlr and$Mlo);if(!$Mtn)return;$Mtn=array_values(array_reverse($Mtn));unset($Mtn[0]);Wc_("request")->get["path"]=implode('_',$Mtn);}
function Wgh(&$Muf,$Mlb=false){if(file_exists(DIR_APPLICATION."model/tool/path_manager.php")||file_exists(DIR_SYSTEM."library/multilingual_seo_toolkit"))return;static$Mug;if($Mlb and$Mug){$Muf["category_id"]=$Mug;$Mug=false;return;}
$Mld=(int)$Muf["category_id"];if(!$Mld)return;if((string)$Muf["category_id"]!==(string)$Mld)return;global$Mir;$Mug=$Mld;while($Mld){$Mcl[]=$Mld;$Mfi=$Mir->query("SELECT parent_id FROM ".DB_PREFIX."category WHERE category_id = ".$Mld)->row;if(!$Mfi)break;$Mld=$Mfi["parent_id"];if(in_array($Mld,$Mcl))break;}
$Muf["category_id"]=implode('_',array_reverse($Mcl));}
function Wgk(){static$Mtt;if(!$Mtt){$Mtu=DIR_IMAGE."catalog/lightning_optimized_data";$Mtv=Wa2.'ez';if(file_exists($Mtu)&&@filemtime($Mtu)>time()-60*30){$Mtt='es';Waw(DIR_IMAGE."cache/lightning/");}else{if(file_exists($Mtv))$Mtt=file_get_contents($Mtv);else{require_once"optima.php";if(optimizers_ready())$Mtt='ew';else$Mtt='ex';file_put_contents($Mtv,$Mtt);}}}
return$Mtt;}
function Wgf($Mdg){static$Mdh,$Mdi,$Mbt;if(!$Mdh){require_once("optima.php");$Mdh=new OptimizerFactory();$Mdi=$Mdh->get();}
$cache=strpos($Mdg,"mage/cache/");$Mub=DIR_CACHE."lightning/".'ey';if(!$cache)copy($Mdg,$Mub);$Muc=filesize($Mdg);$Mdi->optimize($Mdg);clearstatcache(true,$Mdg);$Mud=filesize($Mdg);if($Mud<$Muc){if(!$cache)Wgg($Mub,DIR_IMAGE."catalog/lightning_optimized_originals/".substr($Mdg,strlen(DIR_SYSTEM)-7));$Mtx=DIR_IMAGE."catalog/lightning_optimized_data";if(!file_exists($Mtx))$Mty=array(0,0,0);else$Mty=explode(" ",file_get_contents($Mtx));if(empty($Mty[0])||empty($Mty[1])||empty($Mty[2]))$Mty=array(0,0,0);$Mty[0]++;$Mty[1]+=$Muc;$Mty[2]+=$Mud;file_put_contents($Mtx,implode(" ",$Mty),LOCK_EX);@touch($Mtx,time()-60*60*60);}
if(!$cache)@unlink($Mub);Wab();if(!Wih($Mdg,floor((filemtime($Mdg)+76542)/76543)*76543+1)){}
Wbg();clearstatcache(true,$Mdg);}
function Wih($Map,$Mbt){if(touch($Map,$Mbt))return true;$Mxn=@file_get_contents($Map);@unlink($Map);file_put_contents($Map,$Mxn);return touch($Map,$Mbt);}
function Wgg($Muh,$Mui){$Mcl=pathinfo($Mui);if(!file_exists($Mcl["dirname"])){mkdir($Mcl["dirname"],0777,true);}
return copy($Muh,$Mui);}
function Whv($Mww){if(strpos($Mww,"beta"))return;$log="lightning";if($Maf=strpos($Mww,":")){$log.='_'.strtolower(substr($Mww,0,$Maf));$Mww=substr($Mww,$Maf+2);}
file_put_contents(DIR_LOGS.$log.".log",date("m.d H:i:s").' '.$Mww."\n",FILE_APPEND|LOCK_EX);}
function in_cache($Mgj=NULL,$Miu="product"){if(empty($GLOBALS['Ma']['cj']))return false;if($Mgj===0){$Miu=0;$Mgj=NULL;}
$Mjh=debug_backtrace(false,2);$Mjh=$Mjh[1];$Myj=$Mjh["function"];if(!empty($Mjh["class"]))$Myj=$Mjh["class"].$Mjh["type"].$Myj;if(is_null($Mgj))$Mgj=str_replace(array(",",":"),array(", ",": "),str_replace(str_split("[]{}\""), '', json_encode($Mjh["args"])));$Mgj="$Myj $Mgj";global$Myk,$Mjq;$Myk=Wbd("beta",$Mgj);if(is_numeric($Miu)){global$Mjq;if($Miu&&$Mjq<time()-$Miu)$Myk=false;$Miu=false;}
if($Myk!==false){global$db;if(!$Miu or$db->db->Wbx("FROM ".DB_PREFIX.implode(" FROM ".DB_PREFIX,explode(' ',trim($Miu))),$Mjq)){$Myk=unserialize($Myk);if($Myk=="li_false")$Myk=false;global$Mam,$Mjd,$Mg_;$Mg_++;if($Mam)$Mjd[]=array('Mhj'=>$Mgj,'cr'=>$Mjq,'Mbt'=>0,'Mjv'=>Wce());return true;}}
global$Myl,$Mym;$Myl[$Myj]=$Mgj;$Mym[$Myj]=microtime(1);return false;}
function cache($Mhp="li_false"){if(empty($GLOBALS['Ma']['cj']))return false;if($Mhp==="li_false"){global$Myk;return$Myk;}
$Mjh=debug_backtrace(false,2);$Mjh=$Mjh[1];$Myj=$Mjh["function"];if(!empty($Mjh["class"]))$Myj=$Mjh["class"].$Mjh["type"].$Myj;global$Myl,$Mym;if(empty($Mym[$Myj]))return;$Mgj=$Myl[$Myj];$Mbt=microtime(true)-$Mym[$Myj];unset($Mym[$Myj]);unset($Myl[$Myj]);if($Mbt<-0.05)return;if($Mhp===false)$Mhp="li_false";Wbb("beta",$Mgj,serialize($Mhp));}
function lightning_delete($Map){if(!is_file($Map))return;Wab();@unlink($Map);Wbg();}
function Wfc($Mgj){static$Msb;if($Msb)return;global$registry;if(empty($registry))return;$Msb=true;global$Mjj;if($Mjj)return;if(!empty($GLOBALS['Ma']['hl']))return;if(defined("DIR_CATALOG")&&empty($GLOBALS['Ma']['cn']))return;$Msc=new Light_Event($registry);$registry->set("event",$Msc);}
class Light_Event{protected$registry;protected$data=array();protected$direct=array();public function __construct($registry){if(LVERSION<4)$Mafg="Action";else$Mafg="\Opencart\System\Engine\Action";$this->registry=$registry;if(!defined("DIR_CATALOG")&&defined("DIR_MODIFICATION")){$Muc="";$Muc=DIR_MODIFICATION."system/engine/event.php";if(file_exists($Muc))$Muc=file_get_contents($Muc);if(strpos($Muc,"register('model/setting/event/getEvents/after', new Action('common/BurnEngine/onGetEventsAfter'))"))$this->register("model/setting/event/getEvents/after",new$Mafg("common/BurnEngine/onGetEventsAfter"));}
if(class_exists("KaGlobal")){KaGlobal::init($registry);}
$config=$registry->get("config");if($config->has("action_event")){foreach($config->get("action_event")as$Mgj=>$Mad){if(!is_array($Mad))$this->register($Mgj,new$Mafg($Mad),0);else foreach($Mad as$Msi=>$Mtc)$this->register($Mgj,new$Mafg($Mtc),$Msi);}}}
function&Wlh($Msj){$Msj=str_replace('?','*',$Msj);if(($Maf=strpos($Msj,'*'))!==false){$Msj=substr($Msj,0,$Maf);if(!isset($this->data[$Msj])){$this->data[$Msj]=array();}
return$this->data[$Msj];}
if(!isset($this->direct[$Msj])){$this->direct[$Msj]=array();}
return$this->direct[$Msj];}
public function register($Msj,$action,$Msi=0){if(LVERSION<4)$Mafg="Action";else$Mafg="\Opencart\System\Engine\Action";if(!defined("DIR_CATALOG")&&(LVERSION==="3.0.2.0"||LVERSION==="3.0.3.1")&&$Msj==="controller/*/after"&&!empty($GLOBALS['Ma']['gh'])){$action=new$Mafg("event/language/after");}
$data=&$this->Wlh($Msj);$data[]=array("trigger"=>$Msj,"action"=>$action,"priority"=>$Msi );}
public function trigger($Msc,$Mmo=array()){if(LVERSION<4)$Mafg="Action";else$Mafg="\Opencart\System\Engine\Action";if(!empty($this->direct[$Msc])){$Mabw=$this->direct[$Msc];}else{$Mabw=array();}
foreach($this->data as$Mgj=>$data){if(substr($Msc,0,strlen($Mgj))==$Mgj){foreach($data as$Mad){if(preg_match('/^'.str_replace(array('\*','\?'),array('.*','.'),preg_quote($Mad['trigger'],'/')).'/',$Msc)){$Mabw[]=$Mad;}}}}
if(count($Mabw)>1){foreach($Mabw as$Mgj=>$Mad){$Msk[$Mgj]=$Mad["priority"];}
array_multisort($Msk,SORT_ASC,$Mabw);}
foreach($Mabw as$Mad){$action=$Mad["action"];if(is_string($action))$action=new$Mafg($action,$Mmo);$Mhp=$action->execute($this->registry,$Mmo);if(!is_null($Mhp)&&!($Mhp instanceof Exception)){return$Mhp;}}}
public function unregister($Msj,$Mce){$data=&$this->Wlh($Msj);foreach($data as$Mgj=>$Mad){if($Msj==$Mad["trigger"]&&$Mad["action"]->getId()==$Mce){unset($data[$Mgj]);}}}
public function clear($Msj){$data=&$this->Wlh($Msj);foreach($data as$Mgj=>$Mad){if($Msj==$Mad["trigger"]){unset($data[$Mgj]);}}}}
function LA_ControllerEventLanguage_index($Mce,&$Mmo){if(!Wc_("language")->data)return;$Mmo=array_merge(Wc_("language")->data,$Mmo);}
function LA_ControllerEventLanguage_before(&$Mce,&$output){$Mfu=Wc_("language");$Mfu->data["backup"]=$Mfu->data;}
function LA_ControllerEventLanguage_after(&$Mce,&$output){$Mfu=Wc_("language");if(empty($Mfu->data["backup"]))return;$data=$Mfu->data["backup"];$Mfu->data=array_merge($Mfu->data,$data);}
function Wl_($Macz,$Mbi){$Mac_=new ReflectionObject($Macz);$Mada=$Mac_->getProperties(ReflectionProperty::IS_PUBLIC);if(is_array($Mada)&&count($Mada)>0){foreach($Mada as$Madb)if($Madb->name==$Mbi)return true;}
return false;}
function Wkm($Mht,&$data){static$Mpi;if(is_null($Mpi)){$Mpi=Wl_($Mht,"adaptor")&&Wl_($Mht->adaptor,"data");if(is_file(DIR_APPLICATION."model/extension/module/regional_store.php"))$Mpi=false;}
if(!$Mpi)return false;if(!$Mht->adaptor->data)$Mht->adaptor->data=&$data;else$Mht->adaptor->data=array_merge($Mht->adaptor->data,$data);return true;}
function Wkn(&$Mmo,$Mce,$Mtt){Wnk($Mce);if(!$Mce)$Mce='';$Mjy=$Mce;if(LVERSION>4&&$Maf=strpos($Mjy,'.'))$Mjy=substr($Mjy,0,$Maf);$Mjy='Controller'.preg_replace('/[^a-zA-Z0-9]/','',$Mjy);$Maai='LA_'.$Mjy.'_'.$Mtt;if(function_exists($Maai))return call_user_func_array($Maai,$Mmo);if(LVERSION>4){$Mrh=strrpos($Mce,'.');if(!$Mrh)$Mrh=strrpos($Mce,'|');if($Mrh===false){$Mjy='Controller\\'.str_replace(array('_','/'),array('','\\'),ucwords($Mce,'_/'));}else{$Mjy='Controller\\'.str_replace(array('_','/'),array('','\\'),ucwords(substr($Mce,0,$Mrh),'_/'));}
$Mjy='Opencart\\'.Wc_('config')->get('application').'\\'.$Mjy;}
if(LVERSION<4){$Map=DIR_APPLICATION."controller/".$Mce.".php";if(!is_file($Map))return new \Exception("Error: Could not call ".$Mce.'/'.$Mtt.'!');}
global$Mti;if(isset($Mti[$Mce])){global$Mtk;$Mtk=$Mce."(".Wfm($Mmo).")";$Mtj=Wci($Mtk);if($Mtj!=-1)return$Mtj;}
if(function_exists('Wfu'))$Maf=Wfu($Mce);global$registry;$registry->get("config")->set("developer_sass",1);if(LVERSION<4&&!class_exists($Mjy))if(class_exists("VQMod")){if(function_exists("modification"))include_once(\VQMod::modCheck(modification($Map),$Map));else include_once(\VQMod::modCheck($Map,$Map));}else{if(function_exists("modification"))include_once(modification($Map));else include_once($Map);}
if(class_exists($Mjy)){$controller=new$Mjy($registry);}else{return new \Exception("Error: Could not call route ".$Mce.'!');}
$Mabk=new ReflectionClass($Mjy);if($Mabk->hasMethod($Mtt)&&$Mabk->getMethod($Mtt)->getNumberOfRequiredParameters()<=count($Mmo)||$Mabk->hasMethod("__call")){$Mbm=call_user_func_array(array($controller,$Mtt),$Mmo);}else{return new \Exception("Error: Could not call ".$Mce.'/'.$Mtt.'!');}
if(isset($Mti[$Mce])){global$Mtk;Wci($Mtk,$Mbm);}
global$Mam;if(!$Mam)return$Mbm;$Mbt=microtime(true);global$Mjd;$Mbt-=$Mjd[$Maf]['Mdl'];if($Mbt<0.01){unset($Mjd[$Maf]);return$Mbm;}
$Mjd[$Maf]['Mbt']=$Mbt;$Mjd[]=array('ed'=>'Mbn');return$Mbm;}
function Wko($Mht,&$data,$Mdt=''){if(!empty($data["module_id"])){global$Mafj;$Mafj=$data["module_id"];}
if(defined("DIR_CATALOG")&&empty($GLOBALS['Ma']['cn']))return-1;if(empty($GLOBALS['Ma']['hp']))return-1;require_once"twix.php";if(substr($Mht,-5)!==".twig")$Mht.=".twig";return twix_render($Mht,$data,$Mdt);}
function Wkp(){if(defined("DIR_CATALOG")&&empty($GLOBALS['Ma']['cn']))return false;global$registry;if(!empty($registry->get("request")->get["route"])&&strpos(str_replace('|','.',$registry->get("request")->get["route"]),"order.call")!==false)return false;return!empty($GLOBALS['Ma']['hp'])&&!empty($registry);}
function Wne($Mdg){if(empty($GLOBALS['Ma']['jv']))return;static$Maec,$Maed;if(!$Maec){$Maec=array(array(-1,-1,-1),array(-1,16,-1),array(-1,-1,-1),);$Maed=array_sum(array_map("array_sum",$Maec));}
imageconvolution($Mdg,$Maec,$Maed,0);}
function Wmn(){global$Ma;return empty($Ma['ip']);}
function Wnh($Maeh,$Mga){global$Maei;$Mda=0;if(!empty($Mga->row["data"]))$Mda=crc32($Mga->row["data"]);$Maei[$Maeh]=$Mda;if(LVERSION<"3.0.3.7"){$Mji=DIR_CACHE."lightning/".'jy';if(file_exists($Mji)&&@filemtime($Mji)>time()-5*60)return;Waw(DIR_CACHE."lightning/");file_put_contents($Mji,'');global$db;$db->query("DELETE FROM `".DB_PREFIX."session` WHERE `expire` < '".date("Y-m-d H:i:s",time())."'");}}
function Wni($Maeh,&$data,&$Maej){if(!$Maeh)return true;global$Maei;if(empty($Maei[$Maeh])&&empty($data["user_id"]))$Maej=10*60;$Mda=0;if(!empty($data))$Mda=crc32(json_encode($data));if($Mda===$Maei[$Maeh])return true;return false;}
Function Calls
None |
Stats
MD5 | e36d7db79cbc6a94ef93efd236b95897 |
Eval Count | 0 |
Decode Time | 975 ms |