8
hi,
block system theme or duplicate block
exemple :
<?php
function mes_themes_show($options)
{
global $xoopsConfig;
$theme_options = '';
$mes_themes = file(XOOPS_ROOT_PATH . '/themes/kris_theme.txt');
$allowed_themes = $xoopsConfig['theme_set_allowed'];
foreach ($mes_themes as $theme) {
$theme = trim($theme);
$key = array_search($theme, $allowed_themes);
if ($key) {
$theme_options .= '<option value="'.$theme.'"';
if ($theme == $xoopsConfig['theme_set']) {
$theme_options .= ' selected="selected"';
}
$theme_options .= '>'.$theme.'</option>';
}
}
$block = array();
if ($options[0] == 1) {
$block['theme_select'] = "<img vspace="2" id="xoops_theme_img" src="".XOOPS_THEME_URL."/".$xoopsConfig['theme_set']."/shot.gif" alt="screenshot" width="".intval($options[1])."" /><br /><select id="xoops_theme_select" name="xoops_theme_select" onchange="showImgSelected('xoops_theme_img', 'xoops_theme_select', 'themes', '/shot.gif', '".XOOPS_URL."');">".$theme_options."</select><input type="submit" value=""._GO."" />";
} else {
$block['theme_select'] = '<select name="xoops_theme_select" onchange="submit();" size="3">'.$theme_options.'</select>';
}
$block['theme_select'] .= '<br />('.sprintf(_MB_SYSTEM_NUMTHEME, '<b>'.count($xoopsConfig['theme_set_allowed']).'</b>').')<br />';
return $block;
}
function mes_themes_edit($options)
{
$chk = "";
$form = _MB_SYSTEM_THSHOW." ";
if ( $options[0] == 1 ) {
$chk = " checked='checked'";
}
$form .= "<input type='radio' name='options[0]' value='1'".$chk." /> "._YES;
$chk = "";
if ( $options[0] == 0 ) {
$chk = ' checked="checked"';
}
$form .= ' <input type="radio" name="options[0]" value="0"'.$chk.' />'._NO;
$form .= '<br />'._MB_SYSTEM_THWIDTH.' ';
$form .= "<input type='text' name='options[1]' value='".$options[1]."' />";
return $form;
}
?>
and the file .txt with the themes list
@++