6
I would paste this line in top of the theme:
<{include_php file="file:$xoops_rootpath/themes/mytheme/extension.php"}>
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Then create the extension.php file inside the mytheme folder with the content:
if (isset($GLOBALS['xoopsUser']) && is_object($GLOBALS['xoopsUser'])) {
$this->assign('xoops_avatar' => $GLOBALS['xoopsUser']->getVar('user_avatar'));
}
?>
Here is one example of an extension.php file for creating mainmenu and submenus (Credits to Ryuji AMANO): Quote:
add(new Criteria('to_userid', $xoopsUser->getVar('uid'))); $message = $pm_handler->getCount($criteria); $message =1; if ($message > 0) $message = "".$message.""; $this->assign("ex_new_messages", $message)); } if ( is_object($xoopsModule) ) { $this->assign('ex_moduledir', $xoopsModule->getVar('dirname')); } require_once XOOPS_ROOT_PATH."/modules/system/blocks/system_blocks.php"; $mainmenu = b_system_main_show(); foreach($mainmenu["modules"] as $module){ if (count($module["sublinks"]) > 0 ){ $mainmenu["sublinks"] = $module["sublinks"]; } } $this->assign("ex_mainmenu", $mainmenu); $this->assign("mymodules", $mainmenu["modules"]); global $xoopsRequestUri; if ( is_object($xoopsModule) ) { $this->assign('ex_moduledir', $xoopsModule->getVar('dirname')); $this->assign('ex_modulename', $xoopsModule->getVar('name')); if( count($xoopsModule->subLink()) > 0 ) { $replacedUri = preg_replace("/\/modules\/".$xoopsModule->getVar('dirname')."\/(.*)$/i", "$1", $xoopsRequestUri); foreach( $xoopsModule->subLink() as $sublink ) { if( $sublink['url'] == $replacedUri ) { $this->assign('ex_sublinkname', $sublink['name']); } } } } ?>
(I'm using quote because 'code' breaks the reg expression) And html code for it:
<div id="row1">
<div id="siteName">
<h1><{$xoops_sitename}>h1>
div>
<div id="utility">
<{if $xoops_isadmin}>
<a href="<{$xoops_url}>/user.php">User Panela> | <a href="<{$xoops_url}>/admin.php">Admin Panela> | <a href="<{$xoops_url}>/user.php?op=logout">Log Outa>
<{elseif $xoops_isuser}>
<a href="<{$xoops_url}>/user.php">User Panela> | <a href="<{$xoops_url}>/user.php?op=logout">Log Outa>
<{else}>
<a href="<{$xoops_url}>/register.php">Register Nowa> | <a href="<{$xoops_url}>/user.php">Log ina> | <a href="<{$xoops_url}>/user.php#lost">Lost Passworda>
<{/if}>
div>
div>
<div id="row2">
<img alt="" src="<{$xoops_imageurl}>images/gblnav_left.gif" height="32" width="4" id="gnl" /> <img alt="" src="<{$xoops_imageurl}>images/glbnav_right.gif" height="32" width="4" id="gnr" />
<div id="globalLink">
<a href="<{$xoops_url}>/" id="gl1" class="glink">
Home
a>
<{foreach item=module from=$mymodules}>
<a href="<{$xoops_url}>/modules/<{$module.directory}>/" class="glink"><{$module.name}>a>
<{/foreach}>
div>
<form id="search_nav" action="<{$xoops_url}>/search.php" method="get">
<input type="text" name="query" size="16" onfocus="this.value=''" value="Enter keywords" /><input type="hidden" name="action" value="results" /><input type="submit" value="Go" />
form>
div>
<div id="row3">
<img alt="" src="<{$xoops_imageurl}>images/tl_curve_white.gif" height="6" width="6" id="tl" /> <img alt="" src="<{$xoops_imageurl}>images/tr_curve_white.gif" height="6" width="6" id="tr" />
<div id="breadCrumb">
<{foreach item=sublink from=$ex_mainmenu.sublinks}>
<a href="<{$sublink.url}>"><{$sublink.name}>a> |
<{/foreach}>
div>
<div id="pageName">
<h2><{$xoops_pagetitle}>h2>
div>
div>