Re: Probléme avec les MP | Titre du sujet : Re: Probléme avec les MP par tatane sur 28/01/2007 18:50:39
voici mon fichier modules/multiMenu/blocks/block.php
Je n'ai pas ce que tu cite à la ligne 116 et je n'ai même pas la ligne 142!!
<?php
/**
* XOOPS - PHP Content Management System
* Copyright (c) 2001 - 2006 <http://www.xoops.org/>
*
* Module: multiMenu 1.90
* Licence : GPL
* Authors :
* - solo (http://www.wolfpackclan.com/wolfactory)
* - herve (http://www.herve-thouzard.com)
* - blueteen (http://myxoops.romanais.info)
* - DuGris (http://www.dugris.info)
*/
global $xoopsDB, $xoopsUser, $xoopsConfig, $xoopsModule;
$myts =& MyTextSanitizer::getInstance();
$group = is_object($xoopsUser) ? $xoopsUser->getGroups() : array(XOOPS_GROUP_ANONYMOUS);
$current_page = $_SERVER['SCRIPT_NAME'];
$mainid = '';
$rand = '';
$randlimit = '';
$columns_limit = 0;
$columns_limit_drop = 0;
$block = array();
$block['css_file'] = $xoopsConfig['theme_set'];
// Check user agent (SEO). If Spider, display list style
if ( eregi( "bot", getenv("HTTP_USER_AGENT") ) || eregi( "spider", getenv("HTTP_USER_AGENT") ) || eregi( "robot", getenv("HTTP_USER_AGENT") ) || eregi( "crawler", getenv("HTTP_USER_AGENT") ) ) {
$block['format'] = "ul";
} else {
$block['format'] = $options[0];
}
// General options regarding block type
$width = '';
$block['marquee'] = '';
$block['columns'] = $options[2];
$block['block_size'] = $options[8];
$block['marquee_height'] = $options[9];
$block['submenu_color'] = $options[10];
$block['latency'] = $options[11];
$block['marquee_delay'] = $options[12];
$block['mm'] = $options[15];
if ($options[1] != "all" ) {$where = "hide = 1 AND submenu = ".$options[1]."";} else {$where = "hide = 1";}
if ($options[0] == "scrollist") {$block['marquee'] = 'behavior="scroll" direction="up"'; $block['format'] = "ul";}
if ($options[0] == "slidelist") {$block['marquee'] = 'behavior="slide" direction="up"'; $block['format'] = "ul";}
if ($options[0] == "picscroll" ) {$block['marquee'] = 'behavior="scroll" direction="up"';}
if ($options[0] == 'menu'
OR $options[0] == 'ul'
OR $options[0] == 'ol'
OR $options[0] == 'scrollist'
OR $options[0] == 'slidelist' )
{$align = 'align="absmiddle" ';} else { $align= ''; }
// Random function
if ($options[0] != "droplist" or $options[0] != "selectlist") {
$randresult = $xoopsDB -> queryF( " SELECT COUNT(*) FROM " .$xoopsDB->prefix("multimenu") . $options[15] . " WHERE $where");
list( $total )=$xoopsDB->fetchRow($randresult);
}
if ($options[13]) {
$randlimit = $options[14];
$total = $total-1-$randlimit;
$rand = rand(0,$total);
}
///////////////////////// 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];
$result = $xoopsDB->queryF($sql ,$randlimit ,$rand);
while ( $myrow = $xoopsDB->fetchArray($result) ) {
// Group access
$groups = explode(" ",$myrow['groups']);
if (count(array_intersect($group,$groups)) > 0) {
// Sub link Display
if ( $myrow['link'] ) { $link = $myrow['link']; } else { $link = ''; }
if ($options[16]) { // Contextual menu
if ( empty($xoopsModule) ) {
if ( $myrow['submenu'] == 4 ) {
$mainid = $myrow['id'];
}
} else {
switch ($myrow['submenu']) {
case 0:
if ( eregi( "/".$xoopsModule->getVar('dirname')."/", $myrow['link'] )) {
$mainid = $myrow['id'];
}
break;
case 3:
if ( eregi( "/".$xoopsModule->getVar('dirname')."/", $myrow['link'] )) {
$mainid = $myrow['id'];
}
break;
case 4:
$mainid = $myrow['id'];
break;
}
}
// Test : link is sub of a main link and do we display it
if ( $myrow['pid'] == $mainid ) {
$block['contents'][] = multimenu_makelink($options, $myrow);
}
// Test : link is sub of a main link and do we display it
} else { // Not contextual menu
if ( !empty($xoopsModule) && eregi( "/".$xoopsModule->getVar('dirname')."/", $myrow['link'] ) && ( $myrow['submenu'] < 1 || $myrow['submenu'] > 2 ) ) {
$mainid = $myrow['id'];
}
// Test : link is sub of a main link and do we display it
if ( $myrow['pid'] == $mainid && ( $myrow['submenu'] == 2 ) || ( $myrow['submenu'] != 2 ) ) {
$block['contents'][] = multimenu_makelink($options, $myrow);
}
// Test : link is sub of a main link and do we display it
} // end Contextual menu or Not contextual menu
} // Groups
}
return $block;
?>
|
|