Changeset 96 for trunk/include/xpress_block_render.php
- Timestamp:
- Mar 6, 2009, 5:16:22 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/xpress_block_render.php
r95 r96 99 99 } 100 100 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 101 121 function xpress_block_render($mydirname,$block_function_name,$options) 102 122 { … … 108 128 $blockID =get_block_id($mydirname,$func_file,$options); 109 129 110 if (!is_null($wpdb)){ 130 $this_url = '/modules/'. $mydirname; 131 $call_url = $_SERVER['REQUEST_URI']; 132 if (strstr($call_url,$this_url)){ 111 133 xpress_block_css_set($mydirname); 112 134 … … 114 136 require_once $block_theme_file; 115 137 $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 Event118 // xpress_block_cache_write($mydirname,$cache_title. $blockID, $block);119 138 } 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 } 122 145 } 123 146
Note: See TracChangeset
for help on using the changeset viewer.