Changeset 46 for trunk/include
- Timestamp:
- Dec 26, 2008, 12:15:54 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/xpress_block_render.php
r44 r46 38 38 function get_xpress_theme_name($mydirname) 39 39 { 40 $xoopsDB =& Database::getInstance(); 41 $wp_prefix = $mydirname; 42 if ($wp_prefix == 'wordpress') $wp_prefix = 'wp'; 40 global $wpdb; 41 42 if (is_null($wpdb)){ 43 $xoopsDB =& Database::getInstance(); 44 $wp_prefix = $mydirname; 45 if ($wp_prefix == 'wordpress') $wp_prefix = 'wp'; 43 46 44 $module_tbl = $xoopsDB->prefix($wp_prefix).'_options';45 $theme_name = '';47 $module_tbl = $xoopsDB->prefix($wp_prefix).'_options'; 48 $theme_name = ''; 46 49 47 $sql = "SELECT option_value FROM $module_tbl WHERE option_name LIKE 'template'"; 48 $result = $xoopsDB->query($sql, 0, 0); 49 if ($xoopsDB->getRowsNum($result) > 0){ 50 $row = $xoopsDB->fetchArray($result); 51 $theme_name = $row['option_value']; 50 $sql = "SELECT option_value FROM $module_tbl WHERE option_name LIKE 'template'"; 51 $result = $xoopsDB->query($sql, 0, 0); 52 if ($xoopsDB->getRowsNum($result) > 0){ 53 $row = $xoopsDB->fetchArray($result); 54 $theme_name = $row['option_value']; 55 } 56 } else { 57 $theme_name = get_option('template'); 52 58 } 53 59 return $theme_name; … … 106 112 require_once $block_theme_file; 107 113 $block = $call_theme_function_name($options); //The block name and the called function name should be assumed to be the same name. 108 109 xpress_block_cache_write($mydirname,$cache_title. $blockID, $block); 114 115 // Not Cache Write Now. Becose Cache Write On WordPress Event 116 // xpress_block_cache_write($mydirname,$cache_title. $blockID, $block); 110 117 } else { 111 118 $block = xpress_block_cache_read($mydirname,$cache_title. $blockID);
Note: See TracChangeset
for help on using the changeset viewer.