function _initialize()
 {
     parent::_initialize();
     //每次显示的时候清除缓存
     if (is_dir("./admin/Runtime")) {
         deleteCacheData("./admin/Runtime");
     }
     $this->cate_list = get_items_cate_list('0', '0', '1', 'collect_miao');
 }
예제 #2
0
 function clearCache()
 {
     set_time_limit(0);
     $i = intval($_REQUEST['id']);
     if (!$i) {
         $this->error('操作失败');
     } else {
         import("ORG.Io.Dir");
         $dir = new Dir();
         switch ($i) {
             case 1:
                 //更新全站缓存
                 is_dir(CACHE_PATH) && $dir->del(CACHE_PATH);
                 is_dir(DATA_PATH . '_fields/') && $dir->del(DATA_PATH . '_fields/');
                 is_dir(TEMP_PATH) && $dir->del(TEMP_PATH);
                 if (is_dir("./index/Runtime")) {
                     deleteCacheData("./index/Runtime");
                 }
                 if (is_dir("./admin/Runtime")) {
                     deleteCacheData("./admin/Runtime");
                 }
                 //Api缓存
                 is_dir('./Apicache/') && delCache('./Apicache/');
                 break;
             case 2:
                 //后台模版缓存
                 is_dir(CACHE_PATH) && $dir->del(CACHE_PATH);
                 break;
             case 3:
                 //前台模版缓存
                 is_dir("./index/Runtime/Cache/") && $dir->del("./index/Runtime/Cache/");
                 is_dir("./index/Html/") && $dir->del("./index/Html/");
                 break;
             case 4:
                 //数据库缓存
                 is_dir(DATA_PATH . '_fields/') && $dir->del(DATA_PATH . '_fields/');
                 is_dir("./index/Runtime/Data/_fields/") && $dir->del("./index/Runtime/Data/_fields/");
                 break;
             case 5:
                 //Api缓存
                 is_dir('./Apicache/') && delCache('./Apicache/');
                 break;
             default:
                 break;
         }
         $runtime = defined('MODE_NAME') ? '~' . strtolower(MODE_NAME) . '_runtime.php' : '~runtime.php';
         $runtime_file_admin = RUNTIME_PATH . $runtime;
         $runtime_file_front = ROOT_PATH . '/index/Runtime/' . $runtime;
         is_file($runtime_file_admin) && @unlink($runtime_file_admin);
         is_file($runtime_file_front) && @unlink($runtime_file_front);
         $this->success('更新完成', U('Cache/index'));
     }
 }
예제 #3
0
     //Inserting to greeting card subscription table. Free geeting card subscription for 30 days
     $query = "REPLACE INTO photo_search (number,circle,channel,expiry,medium,status,pricepoint,subscribed,pre_sent) VALUES ('{$msisdn}','{$circle}',9,DATE_ADD(NOW(),INTERVAL 30 DAY),'5','1','0','2',0)";
     mysql_query($query) or trigger_error(mysql_error(), E_USER_ERROR);
     if ($operator == "airtel") {
         $total_return = "Congrats. You won a free 30day subscription to Mobile Greeting Cards. Dial *321*552# (tollfree) to send customized Greeting Card to your loved ones. Happy Gaming :)";
     } else {
         $total_return = "Congratulations.!! You Won. Happy Gaming :)";
     }
     //if it is dictionary game then giving the dictionary meaning of that word
     if ($category == 'dic') {
         $total_return .= "\nThe meaning is : " . ucfirst($gdict);
     }
     if (!empty($arCacheData["ga"])) {
         unset($arCacheData["ga"]);
     } else {
         if (deleteCacheData("ga" . $msisdn)) {
             echo "<br>Record Deleted";
         }
     }
 } else {
     //calculating how much point yet to score
     $remPoint = 100 - $point;
     if ($operator == "airtel") {
         $total_return = "The level {$level} is successfully completed\nYour point is : {$point} \nYou need " . $remPoint . " more points to win the prize.";
     } else {
         $total_return = "The level {$level} is successfully completed\nYour point is : {$point} \nYou need " . $remPoint . " more points to win.";
     }
     //Updatin status,time,level and point in temp table
     $query = "update game_data set level={$level},Points={$point},status=2,hit_time='" . date('Y-m-d H:i:s') . "' where id={$gameid}";
     if (mysql_query($query)) {
         echo 'Record updated in game_data';