prefix($wp_prefix).'_options'; $theme_name = ''; $sql = "SELECT option_value FROM $module_tbl WHERE option_name LIKE 'template'"; $result = $xoopsDB->query($sql, 0, 0); if ($xoopsDB->getRowsNum($result) > 0){ $row = $xoopsDB->fetchArray($result); $theme_name = $row['option_value']; } return $theme_name; } function get_block_stylesheet_url($mydirname) { $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname; $select_theme = get_xpress_theme_name($mydirname); $style_file = $mydirpath . '/wp-content/themes/' . $select_theme . '/blocks/style.css'; if (file_exists($style_file)) return XOOPS_URL . '/modules/' .$mydirname . '/wp-content/themes/' . $select_theme . '/blocks/style.css'; else return XOOPS_URL . '/modules/' .$mydirname . '/wp-content/themes/xpress_default/blocks/style.css'; } function xpress_block_css_set($mydirname = '') { if (empty($mydirname)) $mydirname = $mydirname = basename( dirname( dirname( __FILE__ ) ) ) ; $style_url = get_block_stylesheet_url($mydirname); $tplVars =& $GLOBALS['xoopsTpl']->get_template_vars(); $csslink = "\n".''; if(array_key_exists('xoops_block_header', $tplVars)) { if (!strstr($tplVars['xoops_block_header'],$csslink)) { $GLOBALS['xoopsTpl']->assign('xoops_block_header',$tplVars['xoops_block_header'].$csslink); } } else { $GLOBALS['xoopsTpl']->assign('xoops_block_header',$csslink); } } function get_block_file_path($mydirname,$block_name) { $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname; $select_theme = get_xpress_theme_name($mydirname); $block_file = $mydirpath . '/wp-content/themes/' . $select_theme . '/blocks/' . $block_name.'.php'; if (!file_exists($block_file)) $block_file = XOOPS_ROOT_PATH . '/modules/' .$mydirname . '/wp-content/themes/xpress_default/blocks/' . $block_name .'.php'; return $block_file; } ?>