1
saintolaf2
Re: multimenu sublink problem
  • 2007/2/13 9:23

  • saintolaf2

  • Just popping in

  • Posts: 3

  • Since: 2004/12/15


Hi

I have the same problem when using multimenu in combination with wiwimod. As I think it is a good idea to handle all "static" information pages with wiwimod, and using multimenu to make menu links as I see fit. As there are no structure in the wiwi pages urls (in the general case), the pattern matching principles of multimenu won't work.

As an intermediate solution to the problem I have hacked wiwimod to use some extra GET variables to "rembember" which menu item was selected, and use that to show submenus.

I edited the file modules/multimenu/blocks/block.php as follows:

Quote:

// Insert these lines
$mm_submen = isset($_GET['mm_submen']) ? intval($_GET['mm_submen']) : 0;
$mm_menu = isset($_GET['mm_menu']) ? intval($_GET['mm_menu']) : 0;
//end insertion

///////////////////////// Create Links /////////////////////////
// SQL query
$sql = "SELECT id, pid, groups, link, submenu, title, target, imageurl, weight
FROM ".$xoopsDB->prefix('multimenu').$options[15]."
WHERE $where
ORDER BY ".$options[3];


Quote:

// Sub link Display
if ( $myrow['link'] ) { $link = $myrow['link']; } else { $link = ''; }
//start insert
if ( $mm_submen && $options[15]==$mm_menu) { $mainid = $mm_submen; }
else {
//end insert

if ( !empty($xoopsModule) &&
eregi( "/".$xoopsModule->getVar('dirname')."/", $myrow['link'] )
&& ( $myrow['submenu'] < 1 || $myrow['submenu'] > 2 )
) { $mainid = $myrow['id']; }

} //also inserted



insert these lines
Quote:

// Insert start: transfer of selected link to next issue.
if ( (eregi('\?', $link)) )
$link = $link."&";
else
$link = $link."?";
$link = $link."mm_submen=".$myrow['pid']."&mm_menu=".$options[15];
//end insert
// Create link
$imenu['link'] = '<a href="'.$link.'" '.$target.'title="'.$alt_title.'">';
$imenu['linkurl'] = $link;
$imenu['a'] = '</a>';
} else {
$imenu['link'] = '';
$imenu['linkurl'] = '';
$imenu['a'] = '';
}




TopTop



Login

Who's Online

158 user(s) are online (84 user(s) are browsing Support Forums)


Members: 0


Guests: 158


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