XPressME Integration Kit

Trac


Ignore:
Timestamp:
Mar 6, 2009, 5:16:22 PM (15 years ago)
Author:
toemon
Message:

途中経過でインストール、アップデートできなくなってしまっていたバグ修正
イベント通知の部分をFix、(ゲストのモジュールアクセス権限がないと通知できないのは直らない)
ブロックのキャッシュを見直し、キャッシュがない場合と、ブロックオプションが変更された場合にリフレッシュする機能を追加
ブロックキャッシュの更新にてポスト削除時のイベントをDB削除前にとっていたバグを修正。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/xpress_block_render.php

    r95 r96  
    9999        } 
    100100         
     101    function xpress_block_cache_found($mydirname,$block_name) 
     102    { 
     103        global $xoops_config; 
     104        if(defined('XOOPS_ROOT_PATH')){ 
     105                $cache_dir = XOOPS_ROOT_PATH . '/cache/'; 
     106        } else { 
     107                $cache_dir = $xoops_config->xoops_root_path . '/cache/'; 
     108        } 
     109        $xml_name = $block_name . '.xml'; 
     110 
     111        $filename = $cache_dir .$mydirname . '_' . $xml_name; 
     112                $cache_time = 0; 
     113//        if (file_exists($filename) && ((time() - filemtime($filename)) < $cache_time)) { 
     114        if (file_exists($filename)) { 
     115            return true; 
     116       } else { 
     117                        return false; 
     118                } 
     119    }  
     120         
    101121        function xpress_block_render($mydirname,$block_function_name,$options) 
    102122        { 
     
    108128                $blockID =get_block_id($mydirname,$func_file,$options);          
    109129 
    110                 if (!is_null($wpdb)){ 
     130                $this_url = '/modules/'. $mydirname; 
     131                $call_url = $_SERVER['REQUEST_URI']; 
     132                if (strstr($call_url,$this_url)){ 
    111133                        xpress_block_css_set($mydirname); 
    112134                         
     
    114136                        require_once $block_theme_file; 
    115137                        $block = $call_theme_function_name($options);           //The block name and the called function name should be assumed to be the same name.  
    116  
    117 // Not Cache Write Now.  Becose Cache Write On WordPress Event                   
    118 //                      xpress_block_cache_write($mydirname,$cache_title. $blockID, $block);   
    119138                } else { 
    120                         $xml = xpress_block_cache_read($mydirname,$cache_title. $blockID); 
    121                         $block = $xml['block']; 
     139                        if (xpress_block_cache_found($mydirname,$cache_title. $blockID)){ 
     140                                $xml = xpress_block_cache_read($mydirname,$cache_title. $blockID); 
     141                                $block = $xml['block']; 
     142                        } else { 
     143                                $block['err_message'] = sprintf(_MB_XPRESS_BLOCK_CACHE_ERR, '<a href="' . XOOPS_URL . '/modules/' . $mydirname . '">' . $mydirname .'</a>'); 
     144                        } 
    122145                } 
    123146 
Note: See TracChangeset for help on using the changeset viewer.