Changeset 43 for trunk/include
- Timestamp:
- Dec 23, 2008, 9:51:44 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/xoops_block_cache.php
r42 r43 15 15 return @xpress_XML_unserialize($xml_data); 16 16 } 17 18 function get_block_id($mydirname,$func_file,$options) 19 { 20 $options_string = ''; 21 foreach ($options as $val){ 22 if (!empty($options_string)) $options_string .='|'; 23 $options_string .= $val; 24 } 25 $xoopsDB =& Database::getInstance(); 26 $block_tbl = $xoopsDB->prefix('newblocks'); 27 $module_dir = XOOPS_ROOT_PATH . '/modules/' . $mydirname; 28 29 $sql = "SELECT bid FROM $block_tbl WHERE (func_file LIKE '$func_file') AND (options LIKE '$options_string')"; 30 $result = $xoopsDB->query($sql, 0, 0); 31 if ($xoopsDB->getRowsNum($result) > 0){ 32 $row = $xoopsDB->fetchArray($result); 33 $block_id = $row['bid']; 34 } 35 return $block_id; 36 } 37 38 function block_render($mydirname) 39 { $block_theme_file = get_block_file_path($mydirname,$block_render_file_name); 40 require_once $block_theme_file; 41 $block = recent_comments_block($options); 42 43 require_once $mydirpath.'/include/xoops_block_cache.php'; 44 $my_name = basename( __FILE__ ); 45 $blockID =get_block_id($mydirname,$my_name,$options); 46 xpress_block_cache_write($mydirname,$block_render_file_name. $blockID, $block); 47 } 17 48 ?>
Note: See TracChangeset
for help on using the changeset viewer.