1
mrphilong
What's this menu?

Anyone know what menu system is on http://xoops.peak.ne.jp/
www.UcChau.Net
www.XoopsViet.Org

2
pod
Re: What's this menu?
  • 2007/9/5 0:10

  • pod

  • Quite a regular

  • Posts: 301

  • Since: 2003/4/19


Menu with dynamic sublinks as found at peak.ne.jp:

<{php}> 
global 
$xoopsModule $xoopsUser ;
$xoops_url XOOPS_URL ;
$submenu_str "" ;
$mainmenu_str "
  <tr> 
    <td class='head_menu_left' width='15'>&nbsp;</td>
    <td class='head_menu'>
      <a href='
$xoops_url/'>HOME</a> |
      <a href='
$xoops_url/modules/news/'>NEWS</a> |
      <a href='
$xoops_url/modules/mydownloads/'>DOWNLOADS</a> |
      <a href='
$xoops_url/modules/xhnewbb/'>FORUMS</a> |
      <a href='
$xoops_url/modules/piCal/'>piCal</a> |
      <a href='
$xoops_url/modules/myalbum/'>myAlbum-P</a> |
    </td>
    <td class='head_menu_right'></td>
  </tr>
;
if( isset( 
$xoopsModule ) && is_object$xoopsModule ) ) {
    
$dirname $xoopsModule->getVar'dirname' ) ;
    
$mainmenu_str str_replace"/modules/$dirname/'" "/modules/$dirname/' style='background: #C0CCD9;'" $mainmenu_str ) ;
    
$sublinks =& $xoopsModule->subLink();
    if( 
count$sublinks ) > ) {
        
$submenu_str .= "  <tr>
    <td class='sub_menu_left' width='15'>&nbsp;</td>
    <td class='sub_menu'>
 &nbsp; &nbsp; " 
;
        foreach( 
$sublinks as $sublink ) {
            
$submenu_str .= "<a href='$xoops_url/modules/$dirname/{$sublink['url']}'>{$sublink['name']}</a> |
"
;
        }
        
$submenu_str .= "    </td>
    <td class='sub_menu_right'></td>
  </tr>
;
    }
} else {
    
$mainmenu_str str_replace"'>HOME</a>" "' style='background: #C0CCD9;'>HOME</a>" $mainmenu_str ) ;
    if( 
$xoopsUser ) {
        
$pm_handler =& xoops_gethandler('privmessage');
        
$criteria = new CriteriaCompo(new Criteria('read_msg'0));
        
$criteria->add(new Criteria('to_userid'$xoopsUser->getVar('uid')));
        
$new_messages $pm_handler->getCount($criteria);
        if( 
$xoopsUser->isadmin() ) $admin_link "<a href='$xoops_url/admin.php' target='_blank'>Admin</a>" ;
        if( 
$new_messages ) {
            
$pm_str "<span style='color:#ff0000; font-weight: bold;'> ($new_messages)</span>" ;
            
$pm_class "class='highlight'" ;
        } else {
            
$pm_str '' ;
            
$pm_class '' ;
        }
        
$submenu_str .= "
        <tr>
          <td class='sub_menu_left' width='15'>&nbsp;</td>
          <td class='sub_menu'> &nbsp; &nbsp; 
            <a href='
$xoops_url/user.php'>View Account</a> |
            <a href='
$xoops_url/edituser.php'>Edit Account</a> |
            <a href='
$xoops_url/notifications.php'>Notifications</a> |
            <a href='
$xoops_url/viewpmsg.php' $pm_class>Inbox$pm_str</a> |
            
$admin_link
          </td>
          <td class='sub_menu_right'></td>
        </tr>
;
    }
}
echo 
$mainmenu_str ;
echo 
$submenu_str ;
<{/
php}>


This code is also included in MyXoopsExtensions 1.0.4 and better.

Hope this helps!
www.myxoops.com - MyXoops Is Your XOOPS!

Login

Who's Online

243 user(s) are online (162 user(s) are browsing Support Forums)


Members: 0


Guests: 243


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits