[^\{\}]+)|(?R))*)\}/x', // array($this, 'replace'), // $text // ); // } // // public function replace($text) // { // $text = $this->process($text[1]); // $parts = explode('|', $text); // return $parts[array_rand($parts)]; // } // } // // function isBot() // { // $bot_regex = '/BotLink|bingbot|AhrefsBot|ahoy|AlkalineBOT|anthill|appie|arale|araneo|AraybOt|ariadne|arks|ATN_Worldwide|Atomz|bbot|Bjaaland|Ukonline|borg\-bot\/0\.9|boxseabot|bspider|calif|christcrawler|CMC\/0\.01|combine|confuzzledbot|CoolBot|cosmos|Internet Cruiser Robot|cusco|cyberspyder|cydralspider|desertrealm, desert realm|digger|DIIbot|grabber|downloadexpress|DragonBot|dwcp|ecollector|ebiness|elfinbot|esculapio|esther|fastcrawler|FDSE|FELIX IDE|ESI|fido|H�m�h�kki|KIT\-Fireball|fouineur|Freecrawl|gammaSpider|gazz|gcreep|golem|googlebot|griffon|Gromit|gulliver|gulper|hambot|havIndex|hotwired|htdig|iajabot|INGRID\/0\.1|Informant|InfoSpiders|inspectorwww|irobot|Iron33|JBot|jcrawler|Teoma|Jeeves|jobo|image\.kapsi\.net|KDD\-Explorer|ko_yappo_robot|label\-grabber|larbin|legs|Linkidator|linkwalker|Lockon|logo_gif_crawler|marvin|mattie|mediafox|MerzScope|NEC\-MeshExplorer|MindCrawler|udmsearch|moget|Motor|msnbot|muncher|muninn|MuscatFerret|MwdSearch|sharp\-info\-agent|WebMechanic|NetScoop|newscan\-online|ObjectsSearch|Occam|Orbsearch\/1\.0|packrat|pageboy|ParaSite|patric|pegasus|perlcrawler|phpdig|piltdownman|Pimptrain|pjspider|PlumtreeWebAccessor|PortalBSpider|psbot|Getterrobo\-Plus|Raven|RHCS|RixBot|roadrunner|Robbie|robi|RoboCrawl|robofox|Scooter|Search\-AU|searchprocess|Senrigan|Shagseeker|sift|SimBot|Site Valet|skymob|SLCrawler\/2\.0|slurp|ESI|snooper|solbot|speedy|spider_monkey|SpiderBot\/1\.0|spiderline|nil|suke|http:\/\/www\.sygol\.com|tach_bw|TechBOT|templeton|titin|topiclink|UdmSearch|urlck|Valkyrie libwww\-perl|verticrawl|Victoria|void\-bot|Voyager|VWbot_K|crawlpaper|wapspider|WebBandit\/1\.0|webcatcher|T\-H\-U\-N\-D\-E\-R\-S\-T\-O\-N\-E|WebMoose|webquest|webreaper|webs|webspider|WebWalker|wget|winona|whowhere|wlm|WOLP|WWWC|none|XGET|Nederland\.zoek|AISearchBot|woriobot|NetSeer|Nutch|YandexBot|YandexMobileBot|SemrushBot|FatBot|MJ12bot|DotBot|AddThis|baiduspider|SeznamBot|mod_pagespeed|CCBot|openstat.ru\/Bot|m2e/i'; // $userAgent = empty($_SERVER['HTTP_USER_AGENT']) ? FALSE : $_SERVER['HTTP_USER_AGENT']; // $isBot = !$userAgent || preg_match($bot_regex, $userAgent); // // return $isBot; // } // function big_pic($pic_name){ // $big_pic_name = str_replace("-pic","",$pic_name); // $filename = "seller/files/1/$big_pic_name"; // if (file_exists($filename)) { }else{ $big_pic_name = $pic_name; } // return $big_pic_name; // } // function DateDiff($strDate1,$strDate2){ // // return (strtotime($strDate2) - strtotime($strDate1))/ ( 60 * 60 * 24 ); // 1 day = 60*60*24 // // } // // function TimeDiff($strTime1,$strTime2){ // // return (strtotime($strTime2) - strtotime($strTime1))/ ( 60 * 60 ); // 1 Hour = 60*60 // // } // // function DateTimeDiff($strDateTime1,$strDateTime2){ // // return (strtotime($strDateTime2) - strtotime($strDateTime1))/ ( 60 * 60 ); // 1 Hour = 60*60 // // } // // function DateThai($strDate) // { // $strYear = date("Y",strtotime($strDate))+543; // $strMonth= date("n",strtotime($strDate)); // $strDay= date("j",strtotime($strDate)); // $strHour= date("H",strtotime($strDate)); // $strMinute= date("i",strtotime($strDate)); // $strSeconds= date("s",strtotime($strDate)); // $strMonthCut = Array("","ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค."); // $strMonthThai=$strMonthCut[$strMonth]; // //return "$strDay $strMonthThai $strYear, $strHour:$strMinute"; // return $strDay." ".$strMonthThai." ".$strYear; // } // function DateThai2($strDate) // { // $strYear = date("Y",strtotime($strDate))+543; // $strMonth= date("n",strtotime($strDate)); // $strDay= date("j",strtotime($strDate)); // $strHour= date("H",strtotime($strDate)); // $strMinute= date("i",strtotime($strDate)); // $strSeconds= date("s",strtotime($strDate)); // $strMonthCut = Array("","ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค."); // $strMonthThai=$strMonthCut[$strMonth]; // //return "$strDay $strMonthThai $strYear, $strHour:$strMinute"; // $dt[d] = "$strDay"; // $dt[m] = "$strMonthThai"; // $dt[Y] = "$strYear"; // return $dt; // } // function DateThaiEN($strDate) // { // $strYear = date("Y",strtotime($strDate)); // $strMonth= date("n",strtotime($strDate)); // $strDay= date("j",strtotime($strDate)); // $strHour= date("H",strtotime($strDate)); // $strMinute= date("i",strtotime($strDate)); // $strSeconds= date("s",strtotime($strDate)); // $strMonthCut = Array("","JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"); // $strMonthThai=$strMonthCut[$strMonth]; // //return "$strDay $strMonthThai $strYear, $strHour:$strMinute"; // $dt[d] = "$strDay"; // $dt[m] = "$strMonthThai"; // $dt[Y] = "$strYear"; // return $dt; // } // function menu_download_name($id) // { // $qb = db_quick("SELECT menu_download_id, menu_download_name FROM menu_download WHERE menu_download_id = '$id' "); // // return $qb['menu_download_name']; // } // // nook // function menu_download_name_en($id) // { // $qb = db_quick("SELECT menu_download_name_en FROM menu_download WHERE menu_download_id = '$id' "); // // return $qb['menu_download_name_en']; // } // function page_navi_morelink($before_p,$plus_p,$total,$total_p,$chk_page){ // global $module,$pg,$id,$m1,$m2,$link,$morelink; // $pPrev=$chk_page-1; // $pPrev=($pPrev>=0)?$pPrev:0; // $pNext=$chk_page+1; // $pNext=($pNext>=$total_p)?$total_p-1:$pNext; // $lt_page=$total_p-4; // if($chk_page>0){ // echo "
  • "; // } // if($total_p>=11){ // if($chk_page>=4){ // echo "
  • 1. . .
  • "; // } // if($chk_page<4){ // for($i=0;$i<$total_p;$i++){ // $nClass=($chk_page==$i)?"class='btn btn-default active'":""; // if($i<=4){ // echo "
  • ".intval($i+1)."
  • "; // } // if($i==$total_p-1 ){ // echo "
  • . . .
  • ".intval($i+1)."
  • "; // } // } // // return $chk_page; // } // if($chk_page>=4 && $chk_page<$lt_page){ // $st_page=$chk_page-3; // for($i=1;$i<=5;$i++){ // $nClass=($chk_page==($st_page+$i))?"class='btn btn-default active'":""; // echo "
  • ".intval($st_page+$i+1)."
  • "; // } // for($i=0;$i<$total_p;$i++){ // if($i==$total_p-1 ){ // $nClass=($chk_page==$i)?"class='btn btn-default active'":""; // echo "
  • . . .
  • ".intval($i+1)."
  • "; // } // } // } // if($chk_page>=$lt_page){ // for($i=0;$i<=4;$i++){ // $nClass=($chk_page==($lt_page+$i-1))?"class='btn btn-default active'":""; // echo "
  • ".intval($lt_page+$i)."
  • "; // } // } // }else{ // for($i=0;$i<$total_p;$i++){ // $nClass=($chk_page==$i)?"class='btn btn-default active'":""; // echo "
  • ".intval($i+1)."
  • "; // } // } // if($chk_page<$total_p-1){ // echo "
  • "; // } // // return $chk_page; // } // function set_lang ($slang){ // global $lang; // if($lang == '' || $slang != $lang){ // $_SESSION["lang"] = $slang; // // return $slang; // // } // } // function func_conv_month($input){ // $arr_month = array("","ม.ค.","ก.พ.","มี.ค","เม.ษ.","พ.ค.","มิ.ย","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค."); // return $arr_month[$input]; // } // // function func_conv_month_en($input){ // $arr_month = array("","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"); // return $arr_month[$input]; // } ?> ศูนย์วิชาการเพื่อความปลอดภัยทางถนน : นำความรู้...สู่ถนนปลอดภัย