A-L-E-X
öfter hier

Offline
Beiträge: 56
|
« am: 22 März 2004, 18:52:38 » |
|
hallo ich wollte mal das Menü auf eine Kathegorie weiter erweitern...
hier ist der code... wo ist denn da ein fehler???
<?php // $Id: block-Menu_editable.php,v 20.3 2003/10/01 12:00:51 EllselAn Exp $ /************************************************************************/ /* vkpMx 2.0 Content Management System */ /* ==================================================================== */ /* Copyright (C) 2003 by the vkpMx & pragmaMx Developer Team */ /* email: team@pragmamx.org */ /* homepage: http://www.maax-design.de */ /* further sites: http://www.pragmaMx.org, http;//guggemahier.de, */ /* http://www.marx-city.de, http://www.genutec-studios.de, */ /* http://www.shiba-design.de, http://www.power-maax.de */ /* ==================================================================== */ /* Based on: */ /* PHP-NUKE Web Portal System - http://phpnuke.org/ */ /* Thatware - http://thatware.org/ */ /* This program is free software. You can redistribute it and/or modify */ /* it under the terms of the GNU General Public License as published by */ /* the Free Software Foundation; either version 2 of the License. */ /************************************************************************/ $thisfile=basename(__file__); if (!defined("mxMainFileLoaded")) die ("You can't access this file directly...");
$mxblockcache = FALSE;
global $prefix, $name, $home, $bgcolor1, $bgcolor2, $bgcolor3;
//-------------MODIFY HERE TO CUSTOMIZE THE MENU------> $mouseOver = $bgcolor1; /* Sets mouseover color */ $mouseOver = "#e8e8e8"; /* Sets mouseover color */ $image1 = "images/menu/rarrow.gif"; /* image path relative to public root*/ $image2 = "images/menu/barrow.gif"; /* image path relative to public root*/ $image3 = "images/menu/oarrow.gif"; /* image path relative to public root*/ $image4 = "images/menu/oarrow.gif"; /* image path relative to public root*/
$viewSearch = 1; /* 0 = no search -- 1 = yes search */
$viewmoduleslist = 1; /* 0 = no List/dropdown -- 1 = yes List/dropdown */ $dropDown = 1; /* 0 = dropdown style -- 1 = scrolling Layer style */ $row2show = 1; /* "NUMBER YOU SELECT (default is 1)" = numbers of rows visible when block style */ $maxwordlen = 30; /* max. Number of charakters in Moduleslist */ $listheigth = 80; /* Heigth of the scrolling Layer for Moduleslist */
if(!defined("_MEN_SECTION1")) define ("_MEN_SECTION1","Home"); /* title Menu Section 1 */ if(!defined("_MEN_SECTION2")) define ("_MEN_SECTION2","Community"); /* title Menu Section 2 */ if(!defined("_MEN_SECTION3")) define ("_MEN_SECTION3","Neues Menü"); /* title Menu Section 3 */ if(!defined("_MEN_SECTION4")) define ("_MEN_SECTION4","Sonstiges"); /* title Menu Section 4 */ if(!defined("_MEN_SECTIONx")) define ("_MEN_SECTIONx","Gesamtauswahl"); /* title Dropdown */ //--------END-----------END----------END------------>
$mouseOut = "transparent"; /* Sets mouseout color - leave blank for background*/ $actionMenu = "style=\"background: transparent;\" onMouseOver=\"this.style.background='$mouseOver'\" onMouseOut=\"this.style.background='$mouseOut'\""; $main_module = mxGetMainModuleName(); $isseradmin = mxIsAdmin();
/* Now we make the Modules block with the correspondent links */ /* Menu Section 1 */ $content = "<div class=\"boxcontent\">";
/* Menu Section 1 */ $sec1["Home"] = "<a href=\"./\">"._HOME.""; if (mxModuleAllowed("Topics")) $sec1["Topics"] = "<a href=\"modules.php?name=Topics\">Themen"; if (mxModuleAllowed("Stories_Archive")) $sec1["Stories_Archive"] = "<a href=\"modules.php?name=Stories_Archive&sa=show_all\">Artikel"; if (mxModuleAllowed("Downloads")) $sec1["Downloads"] = "<a href=\"modules.php?name=Downloads\">Downloads"; if (mxModuleAllowed("Web_Links")) $sec1["Web_Links"] = "<a href=\"modules.php?name=Web_Links\">Links"; if (mxModuleAllowed("My_eGallery")) $sec1["My_eGallery"] = "<a href=\"modules.php?name=My_eGallery\">Bildergallerie"; if (mxModuleAllowed("Siteupdate")) $sec1["Siteupdate"] = "<a href=\"modules.php?name=Siteupdate\">Siteupdates"; if (mxModuleAllowed("Impressum")) $sec1["Impressum"] = "<a href=\"modules.php?name=Impressum\">Impressum";
/* Menu Section 2 */ if (mxModuleAllowed("Your_Account")) $sec2["Your_Account"] = "<a href=\"modules.php?name=Your_Account\">"._YACCOUNT.""; if (mxModuleAllowed("Members_List")) $sec2["Members_List"] = "<a href=\"modules.php?name=Members_List\">Memberliste"; if (mxModuleAllowed("eBoard")) $sec2["eBoard"] = "<a href=\"modules.php?name=eBoard\">Forum"; if (mxModuleAllowed("Submit_News")) $sec2["Submit_News"] = "<a href=\"modules.php?name=Submit_News\">Artikel schreiben"; if (mxModuleAllowed("maaXStat2")) $sec2["maaXStat2"] = "<a href=\"modules.php?name=maaXStat2\">Statistiken"; if (mxModuleAllowed("Kalender")) $sec2["Kalender"] = "<a href=\"modules.php?name=Kalender\">Kalender";
/* Menu Section 3 */ if (mxModuleAllowed("Bla")) $sec3["Bla"] = "<a href=\"bla.php\">Bla";
/* Menu Section 4 */ if (mxModuleAllowed("LinkMe")) $sec4["LinkMe"] = "<a href=\"modules.php?name=LinkMe\">Link Me"; #if (mxModuleAllowed("LogoEditor")) $sec4["LogoEditor"] = "<a href=\"modules.php?name=LogoEditor\">Logo-Editor"; if (mxModuleAllowed("FAQ")) $sec4["LogoEditor"] = "<a href=\"modules.php?name=FAQ\">FAQ"; #if (mxModuleAllowed("Dict")) $sec4["Dict"] = "<a href=\"modules.php?name=Dict\">Wörterbuch"; if ($isseradmin) $sec4["Administration"] = "<a href=\"admin.php\">"._ADMINMENUEBL."";
if (isset($sec1)) { $size1 = @getimagesize($image1); $size1 = (empty($size1[3])) ? "" : $size1[3]; $img1 = "<img src=\"".$image1."\" BORDER=\"0\" ".$size1.">"; $content .= "<b>"._MEN_SECTION1."</b><BR>\n"; $content .= "<TABLE BORDER=\"0\" CELLPADDING=\"1\" CELLSPACING=\"0\" WIDTH=\"100%\">\n"; foreach($sec1 as $valname => $value) { $m_title2 = strip_tags($value); $content .= "<TR $actionMenu\"><TD title=\"".$m_title2."\"><span class=\"boxcontent\">".$img1."Â ".$value."</a></span></TD></TR>\n"; $manvalues[$valname] = 1; } $content .= "</TABLE><br>\n"; }
if (isset($sec2)) { $size2 = @getimagesize($image2); $size2 = (empty($size2[3])) ? "" : $size2[3]; $img2 = "<img src=\"".$image2."\" BORDER=\"0\" ".$size2.">"; $content .= "<b>"._MEN_SECTION2."</b><BR>\n"; $content .= "<TABLE BORDER=\"0\" CELLPADDING=\"1\" CELLSPACING=\"0\" WIDTH=\"100%\">\n"; foreach($sec2 as $valname => $value) { $m_title2 = strip_tags($value); $content .= "<TR $actionMenu\"><TD title=\"".$m_title2."\"><span class=\"boxcontent\">".$img2."Â ".$value."</a></span></TD></TR>\n"; $manvalues[$valname] = 1; } $content .= "</TABLE><br>\n"; }
if (isset($sec3)) { $size3 = @getimagesize($image3); $size3 = (empty($size3[3])) ? "" : $size3[3]; $img3 = "<img src=\"".$image3."\" BORDER=\"0\" ".$size3.">"; $content .= "<b>"._MEN_SECTION3."</b><BR>\n"; $content .= "<TABLE BORDER=\"0\" CELLPADDING=\"1\" CELLSPACING=\"0\" WIDTH=\"100%\">\n"; foreach($sec3 as $valname => $value) { $m_title2 = strip_tags($value); $content .= "<TR $actionMenu\"><TD title=\"".$m_title2."\"><span class=\"boxcontent\">".$img3." ".$value."</a></span></TD></TR>\n"; $manvalues[$valname] = 1; } $content .= "</TABLE><br>\n"; }
if (isset($sec4)) { $size4 = @getimagesize($image4); $size4 = (empty($size4[3])) ? "" : $size4[3]; $img4 = "<img src=\"".$image4."\" BORDER=\"0\" ".$size4.">"; $content .= "<b>"._MEN_SECTION4."</b><BR>\n"; $content .= "<TABLE BORDER=\"0\" CELLPADDING=\"1\" CELLSPACING=\"0\" WIDTH=\"100%\">\n"; foreach($sec4 as $valname => $value) { $m_title2 = strip_tags($value); $content .= "<TR $actionMenu\"><TD title=\"".$m_title2."\"><span class=\"boxcontent\">".$img4." ".$value."</a></span></TD></TR>\n"; $manvalues[$valname] = 1; } $content .= "</TABLE><br>\n"; }
$checkmodule = (mxSessionGetVar("checkmodule") <= time() - 600) ? 1 : 0; // Module nur alle 10 Minuten checken /* Make dropdown or block style full selection menu - NOTE: inactive modules only viewable by Admin */ if ($viewmoduleslist == 1) { if (!isset($img1) && !$dropDown) { $size1 = @getimagesize($image1); $size1 = (empty($size1[3])) ? "" : $size1[3]; $img1 = "<img src=\"".$image1."\" BORDER=\"0\" ".$size1.">"; } if (!isset($img2) && !$dropDown) { $size2 = @getimagesize($image2); $size2 = (empty($size2[3])) ? "" : $size2[3]; $img2 = "<img src=\"".$image2."\" BORDER=\"0\" ".$size2.">"; } if (!isset($img3) && $isseradmin && !$dropDown) { $size3 = @getimagesize($image3); $size3 = (empty($size3[3])) ? "" : $size3[3]; $img3 = "<img src=\"".$image3."\" BORDER=\"0\" ".$size3.">"; }
$name = (empty($name)) ? $main_module : $name; $where = ($isseradmin) ? "" : "WHERE active='1'"; $result = sql_query("select mid, title, custom_title, active from ${prefix}_modules $where"); while(list($mid, $m_title, $custom_title, $active) = sql_fetch_row($result)) { if ($isseradmin && $checkmodule) { $dbmodlist[strtolower($m_title)] = 1; /* If the module doesn't exist, it will be removed from the database automaticaly */ if (!@file_exists("modules/$m_title/")) { sql_query("delete from ${prefix}_groups_modules where module_id=$mid"); sql_query("UPDATE ${prefix}_modules SET active=0 where mid=$mid"); continue; } } $m_title2 = (empty($custom_title)) ? str_replace("_", " ", $m_title) : str_replace("_", " ", $custom_title); $m_title3 = mxCutString($m_title2, $maxwordlen, "..", ""); $sel = ($m_title == $name) ? " SELECTED" : ""; if ($active) { if ((mxModuleAllowed($m_title)) && !isset($manvalues[$m_title])) { if ($dropDown) $opt_u[strtolower($m_title2)] = "<OPTION VALUE='$m_title' $sel title='$m_title2'>$m_title3</option>"; else $opt_u[strtolower($m_title2)] = "<TR $actionMenu\"><TD title=\"".$m_title2."\"><span class=\"boxcontent\">".$img1."Â <a href=\"modules.php?name=".$m_title."\">".$m_title3."</a></span></TD></TR>\n"; } } else { /* If you're Admin you and only you can see Inactive modules and test it */ if ($isseradmin && !isset($manvalues[$m_title])) { if ($dropDown) $opt_a[strtolower($m_title2)] = "<OPTION VALUE='$m_title' $sel title='$m_title2'>$m_title3</option>"; else $opt_a[strtolower($m_title2)] = "<TR $actionMenu\"><TD title=\"".$m_title2."\"><span class=\"boxcontent\">".$img2."Â <a href=\"modules.php?name=".$m_title."\">".$m_title3."</a></span></TD></TR>\n"; } } } $options = ""; if ($dropDown) { if (isset($opt_u)) { ksort($opt_u, SORT_STRING); #$options .= "<OPTION VALUE='$main_module' disabled>"._MEN_SECTIONx."</option>"; #$options .= "<OPTION VALUE='$main_module' disabled>".str_repeat("Å»",$maxwordlen)."</option>"; $options .= implode("",$opt_u); } if (isset($opt_a)) { ksort($opt_a, SORT_STRING); $options .= "<OPTION VALUE='$main_module' disabled>".str_repeat("_",$maxwordlen)."</option>"; $options .= "<OPTION VALUE='$main_module' disabled>"._NOACTIVEMODULES."</option>"; $options .= "<OPTION VALUE='$main_module' disabled>".str_repeat("Å»",$maxwordlen)."</option>"; $options .= implode("",$opt_a); } if ($options) { $size = ($row2show > 1) ? "SIZE=\\\"$row2show\\\"" : ""; $content .= "\n<!--\ndocument.write(\""; $content .= "<FORM METHOD=\\\"POST\\\" ACTION=\\\"modules.php\\\">"; $content .= "<b>"._MEN_SECTIONx."</b><br>"; $content .= "<SELECT NAME=\\\"name\\\" onChange=\\\"top.location.href='modules.php?name='+this.options[this.selectedIndex].value\\\" ".$size." style=\\\"width: 100%;\\\">".$options."</SELECT>"; $content .= "</FORM>"; $content .= "\")\n//-->\n\n"; } } else { if (isset($opt_u)) { ksort($opt_u, SORT_STRING); $options .= implode("",$opt_u); } if (isset($opt_a)) { ksort($opt_a, SORT_STRING); $options .= "<tr><td><b>"._NOACTIVEMODULES."</b></td></tr>"; $options .= implode("",$opt_a); } if ($options) { $content .= "<b>"._MEN_SECTIONx."</b><br>"; $content .= "<div style=\"width: 100%; height: ".$listheigth."px; overflow : auto;\">"; $content .= "<TABLE BORDER=\"0\" CELLPADDING=\"1\" CELLSPACING=\"0\" WIDTH=\"100%\">"; $content .= $options; $content .= "</table></div><br>\n"; } } }
/* Search feature */ if ($viewSearch == 1){ $content .= "<form action=\"modules.php?name=Search\" method=\"post\">"; $content .= "<b>"._SEARCH."</b><br>"; $content .= "<input type=\"text\" onfocus=\"value=''\" value=\""._SEARCH."\" name=\"query\" size=\"10\" style=\"width: 100%;\">"; $content .= "</form>"; } $content .= "</div>";
/* If you copied a new module is the /modules/ directory, it will be added to the database */ if ($isseradmin && isset($dbmodlist) && $checkmodule) { #print "<h1>checkmodule</h1>"; mxSessionSetVar("checkmodule", time()); $handle=opendir('modules'); while ($file = readdir($handle)) { if (!ereg("[.]",$file) && empty($dbmodlist[strtolower($file)])) { $ctitle = str_replace("_", " ", $file); $qry = "insert into ${prefix}_modules (title,custom_title,active,view) values ('".$file."', '".$ctitle."', 0, 0)"; sql_query($qry); } } closedir($handle); }
/* CVS-Log: $Log: block-Menu_editable.php,v $ Revision 20.3 2003/10/01 12:00:51 EllselAn problem mit file_exists bei safe_mode=on
Revision 20.2 2003/09/01 14:49:24 EllselAn function join() / implode() falsch verwendet
*/
?>
|