21
solo71
Re: [MULTIMENU] Test the multiMenu 1.6
  • 2005/2/16 8:01

  • solo71

  • Module Developer

  • Posts: 941

  • Since: 2003/1/29


Yepeyo. Agreed.

*Add to possible To Be Done list*


22
karedokx
Re: [MULTIMENU] Test the multiMenu 1.6
  • 2005/2/16 14:12

  • karedokx

  • Quite a regular

  • Posts: 319

  • Since: 2004/7/1 6


thanks a lot solo71! would really great if we can have the (main menu) copy feature. will be really usable for lost of people i think.

just if it's doable.

23
Gizmhail
Re: [MULTIMENU] Test the multiMenu 1.6
  • 2005/2/18 16:27

  • Gizmhail

  • Just popping in

  • Posts: 15

  • Since: 2005/2/15


I'm quite a lazy guy, so I'll not sum up evrything me told in this topic about version 1.5 ;) : I've got a problem to make some sublink appear.

I go on with the discussion here, since my problems remains in version 1.6.

So, concerning your last porposition Solo (ie, moving my "customcontent" directory content in the multiMenu dir, to have a TRUE module in my path), it didn't worked.

I think that the problems resides in my target page content :

<?php
include '../../../mainfile.php';
include(
XOOPS_ROOT_PATH."/header.php");


echo 
"test";

include(
XOOPS_ROOT_PATH."/footer.php");
?>


I guess that nothing here tells Xoops(and so multiMenu) in which module I am...

Do you know how I should edit my page to make XOOPS believe it's a module part? Or any other ideas ?

PS : For my lazy fellows who do not want to read through our previous discussion , I've currently avoid this problem by adding this:
$temppatharray=explode("/",$myrow['link']);
array_pop($temppatharray);
$baselink=implode("/",$temppatharray);
if (
eregi($baselink ,$_SERVER['REQUEST_URI']))
{
  
$imenu['showsub'] = 1;
}

just after that :
//-------------Added for showing submenu when actived-------
$imenu['showsub'] = 0;
//if ( (!empty($xoopsModule)) && (eregi("/".$xoopsModule->getVar('dirname')."/", $link)) ) {
if ( (!empty($xoopsModule)) && (eregi("/".$xoopsModule->getVar('dirname')."/"$link)) || $myrow['submenu'] == 1) {
  
$imenu['showsub'] = 1;
  }


in modules/multiMenu/blocks/block.php.
But I stilll wonder if it's ok; hence my question.

24
Gizmhail
Re: [MULTIMENU] Test the multiMenu 1.6
  • 2005/3/1 13:32

  • Gizmhail

  • Just popping in

  • Posts: 15

  • Since: 2005/2/15


I've made a patch that suits my need better, and I would like to have your opinion on the interest/validity of it.
It activates dynamic sub-menu without checking directories inclusion.

Nothing is changed, there's only 2 additions in the blocks/block.php file. I'll quote the normal code between my é addition to allow you to locate them.

My code - part 1(this code determines which main main is active):

$currentmainmenu = -1;
$opengroupheadermenu = -1;
$sql =                  "SELECT groups, link, submenu, title, target, imageurl, weight
                FROM "
.$xoopsDB->prefix('multimenu').$options[11]."
                WHERE hide = 1
                ORDER BY "
.$options[3];
$result $xoopsDB->queryF($sql ,$randlimit ,$rand);
while ( 
$myrow $xoopsDB->fetchArray($result) ) {
    
// On teste si on est dans un menu principal
    
if($myrow['submenu'] == 0)
    {
        
$currentmainmenu $myrow['link'];
    }
    
$isSub substr_count($_SERVER['REQUEST_URI'], $myrow['link']);
    if (
$isSub>0)
    {
        
$opengroupheadermenu $currentmainmenu;
    }
}
$currentmainmenu = -1;


Standard code just following:

$sql =                  "SELECT groups, link, submenu, title, target, imageurl, weight
                        FROM "
.$xoopsDB->prefix('multimenu').$options[11]."
                        WHERE hide = 1
                        ORDER BY "
.$options[3];

    
$result $xoopsDB->queryF($sql ,$randlimit ,$rand);

    while ( 
$myrow $xoopsDB->fetchArray($result) ) {

    
$imenu['submenu'] = $myrow['submenu'];  // fetch the value from database, is it a submenu?
    
$title $myts->makeTboxData4Show($myrow["title"]);
        if ( !
XOOPS_USE_MULTIBYTES ) {
            if (
strlen($myrow['title']) >= $options[5]) {
                
$title $myts->makeTboxData4Show(substr($myrow['title'],0,($options[5]-1)))."...";
            } else {
                
$title $myts->makeTareaData4Show($myrow['title']);
            }
        }
        
$groups explode(" ",$myrow['groups']);
        if (
count(array_intersect($group,$groups)) > 0) {
if ( 
$options[4] == ) {$imenu['title'] = $title;} else {$imenu['title'] = "";}
$alt_title strip_tags($myrow['title']);

if (
$myrow['link']) {
        if (    (
eregi("mailto:"$myrow['link'])) ||
            (
eregi("http://"$myrow['link'])) ||
            (
eregi("https://"$myrow['link'])) ||
            (
eregi("ftp://"$myrow['link'])))
             {
            
$link $myrow['link'];
            } else {
            
$link XOOPS_URL."/".$myrow['link'];
            }

//-------------Added for showing submenu when actived-------
$imenu['showsub'] = 0;
//if ( (!empty($xoopsModule)) && (eregi("/".$xoopsModule->getVar('dirname')."/", $link)) ) {
if ( (!empty($xoopsModule)) && (eregi("/".$xoopsModule->getVar('dirname')."/"$link)) || $myrow['submenu'] == 1) {
  
$imenu['showsub'] = 1;
  }


My code - Part 2, just following yours(this part activate sub menus according to the active main menu):
// On teste si on est dans un sous-menu dynamique
if($imenu['submenu'] == 2)
{
    
//On vérifie si le dernier menu principal est l'entête du groupe actif
    
if($currentmainmenu==$opengroupheadermenu)
    {
        
$imenu['showsub'] = 1;
    }
    else
    {
        
$imenu['showsub'] = 0;
    }
}
// On teste si on est dans un menu principal
if($imenu['submenu'] == 0)
{
    
//On stocke les information relative à ce
    
$currentmainmenu $myrow['link'];
}


Sorry for the french comments ;)

In advance, thanks for any advice or tips :)

Login

Who's Online

138 user(s) are online (92 user(s) are browsing Support Forums)


Members: 0


Guests: 138


more...

Donat-O-Meter

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

Latest GitHub Commits