11
chefry
Re: NEW!!!
  • 2013/3/24 15:32

  • chefry

  • Home away from home

  • Posts: 1005

  • Since: 2006/10/14


Doesn't really make it a feature of xoops does it?

12
irmtfan
Re: NEW!!!
  • 2013/3/25 1:14

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


As flipse said i cannot see any mean for have a new modules in main menu.
we dont install a new module everyday. (I didnt install a module for more than 2 years!!!)

so have new links are important. you can use whats new module for this purpose.

Also you can use My menus module and create your custome main menu with desire style and new image for any link/module you like.
The main menu in xoops is very old and will be dropped and replace by menu creator in 2.6 as far as i know.

13
xoobaru
Re: NEW!!!
  • 2013/3/26 0:05

  • xoobaru

  • Just can't stay away

  • Posts: 494

  • Since: 2010/12/2


Quote:

chefry wrote:
Doesn't really make it a feature of xoops does it?


Do you limit your recipes to a single ingredient supplier also? As irmtfan mentioned, there is a custom option although I tried the suggested module early on and it had issues at that time.

xoob

14
chefry
Re: NEW!!!
  • 2013/3/26 14:55

  • chefry

  • Home away from home

  • Posts: 1005

  • Since: 2006/10/14


flipse, try to be a little more constructive and a little less critical.

irmtfan, I hear what you're saying, but using a module to do it was not what I had in mind, and I'm not sure you can put graphics in mymenu. I have used it, but never tried graphics.

I'm like you. I don't change modules all the time, but there are a couple of new modules I'm waiting to get out of Beta test so I can install them on two of my websites. So it would be nice to be able to highlight something new in the main menu for users. New content is important, but so are new up-to-date features. My android apps are a good example. I have them on 2 websites now.

I don't know anything about new menus in 2.6 but i thought it would be a nice added feature for any website and would probably be easy to do. Make New yes/no, days to show graphic XX.

15
irmtfan
Re: NEW!!!
  • 2013/3/30 3:16

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


Quote:

I'm like you. I don't change modules all the time, but there are a couple of new modules I'm waiting to get out of Beta test so I can install them on two of my websites. So it would be nice to be able to highlight something new in the main menu for users. New content is important, but so are new up-to-date features. My android apps are a good example. I have them on 2 websites now.


mymenus is the best solution for you. I used it for this purpose (add new in the start part of links) in my website.
https://xoops.org/modules/newbb/viewtopic.php?topic_id=75935


16
luciorota
Re: NEW!!!
  • 2013/3/30 9:09

  • luciorota

  • Module Developer

  • Posts: 216

  • Since: 2007/4/20


Hi chefry
I tested this solution on Xoops 2.5.5

Try this:

modify template file: modules/system/templates/blocks/system_block_mainmenu.html
or your custom template file system_block_mainmenu.html this way:

<div id="mainmenu">
    <
class="menuTop <{if !$block.nothome}>maincurrent<{/if}>" href="<{xoAppUrl }>" title="<{$block.lang_home}>"><{$block.lang_home}></a>
    <!-- 
start module menu loop -->
<{
php}>
    global 
$xoopsUser,$xoopsModule;

    
$days_for_new 10// a module is NEW! if "younger" then $days_for_new days

    
$block = array();
    
$block['lang_home'] = _MB_SYSTEM_HOME;
    
$block['lang_close'] = _CLOSE;
    
$module_handler =& xoops_gethandler('module');
    
$criteria = new CriteriaCompo(new Criteria('hasmain'1));
    
$criteria->add(new Criteria('isactive'1));
    
$criteria->add(new Criteria('weight'0'>'));
    
$modules $module_handler->getObjects($criteriatrue);
    
$moduleperm_handler =& xoops_gethandler('groupperm');
    
$groups is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;
    
$read_allowed $moduleperm_handler->getItemIds('module_read'$groups);
    foreach (
array_keys($modules) as $i) {
        if (
in_array($i$read_allowed)) {
            
$block['modules'][$i]['name'] = $modules[$i]->getVar('name');
            
$block['modules'][$i]['directory'] = $modules[$i]->getVar('dirname');
            
$block['modules'][$i]['last_update'] = formatTimestamp$modules[$i]->getVar('last_update'), 'm' );
            
$block['modules'][$i]['updated_from_days'] = round((time() - $modules[$i]->getVar('last_update')) / (24 60 60));
            
$block['modules'][$i]['is_new'] = ($block['modules'][$i]['updated_from_days'] < $days_for_new) ? true false;
            
$sublinks $modules[$i]->subLink();
            if ((!empty(
$xoopsModule)) && ($i == $xoopsModule->getVar('mid'))) {
                
$block['modules'][$i]['highlight'] = true;
                
$block['nothome'] = true;
            }if ((!empty(
$xoopsModule)) && ($i == $xoopsModule->getVar('mid'))) {
                
$block['modules'][$i]['highlight'] = true;
                
$block['nothome'] = true;
            }
            if ((
count($sublinks) > 0) && (!empty($xoopsModule)) && ($i == $xoopsModule->getVar('mid'))) {
                foreach(
$sublinks as $sublink){
                    
$block['modules'][$i]['sublinks'][] = array('name' => $sublink['name'], 'url' => XOOPS_URL.'/modules/'.$modules[$i]->getVar('dirname').'/'.$sublink['url']);
                }
            } else {
                
$block['modules'][$i]['sublinks'] = array();
            }
        }
    }
    
// render output
    
foreach ($block['modules'] as $module) {
        echo 
"<a class='menuMain " . ($module['highlight'] ? "maincurrent" "") . "' href='" XOOPS_URL "/modules/" $module['directory'] . "/' title='" $module['name'] . "'>" . ($module['is_new'] ? "<span style='color :red;'>NEW!</span> " "") . $module['name'] . "</a>";
        foreach (
$module['sublinks'] as $sublink) {
            echo 
"<a class='menuSub' href='" $sublink['url'] . "' title='" $sublink['name'] . "'>" $sublink['name'] . "</a>";
        }
    }
<{/
php}>
    <!-- 
end module menu loop -->
</
div>


maybe not the best solution but...

Login

Who's Online

144 user(s) are online (104 user(s) are browsing Support Forums)


Members: 0


Guests: 144


more...

Donat-O-Meter

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

Latest GitHub Commits