{if $xoops_isadmin}> <{/if}> <{$xoops_sitename}> <{if $auto_mainmenu}> <{php}> global $xoopsDB,$xoopsModule; echo "".THEME_MODULE1."\n"; $now_dir=isset($xoopsModule) && is_object($xoopsModule) ? $xoopsModule->getVar('dirname') : 'system'; $sql="select dirname,name from ".$xoopsDB->prefix("modules")." where isactive='1' and hasmain='1' and weight > 0 order by weight"; $result = $xoopsDB->query($sql) or redirect_header($_SERVER['PHP_SELF'],3, mysql_error()); while(list($dirname,$name)=$xoopsDB->fetchRow($result)){ $selected=($now_dir==$dirname)?"selected":""; echo "{$name}\n"; } <{/php}> <{/if}> <{if $xoops_isadmin}> <{if $xoops_dirname=="" || $xoops_dirname=="system"}> <{else}> <{/if}> <{/if}>