<?php
/*-------------------------------------------------------+
| PHPFusion Content Management System
| Copyright © 2002 - 2012 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Name: menu.php
| Author : Smokeman
| Email: smokeman@esenet.dk
| Web: http://www.phpfusion-tips.dk/
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
include INFUSIONS."deluxe_dropdown_menu/infusion_db.php";
add_to_head("<script src='".INFUSIONS."deluxe_dropdown_menu/includes/js/stuHover.js' type='text/javascript'></script>");
echo "
<div class='preload1'></div>
<div class='preload2'></div>
<div class='preload3'></div>
<div class='preload4'></div>
";
// Read the menus
$m = array();
$msql = dbquery("SELECT * FROM ".DB_MENUS." ORDER BY menu_order");
while ($mdata = dbarray($msql))
{
$m[] = $mdata;
}
// Parse links and names
foreach ($m as &$mdata)
{
if (!preg_match("!^(ht|f)tp(s)?://!i", $mdata['menu_link']))
{
$mdata['menu_link'] = BASEDIR.$mdata['menu_link'];
}
$mdata['menu_name'] = parseubb($mdata['menu_name'], "b|i|u|img|color");
}
// Make the menu
menuitem($m);
// ============================== Get Data From Menu Settings ============================== //
$menusettings = dbarray(dbquery("SELECT * FROM ".DB_MENU_SETTINGS));
// ============================== Adjusting The Width ============================== //
$width1 = $menusettings['mset_width'] - 10;
$width2 = $menusettings['mset_width'] - 2;
if ($menusettings['mset_set_style'] == "0") {
// ============================== Load Pre-Installed Templates CSS ============================== //
add_to_head("<link rel='stylesheet' type='text/css' href='".INFUSIONS."deluxe_dropdown_menu/templates/".$menusettings['mset_templates']."/".$menusettings['mset_templates'].".css' />");
} else {
// ============================== Load User Defined Template CSS ============================== //
add_to_head("<style type='text/css'>
/* ================================================================
This copyright notice must be kept untouched in the stylesheet at
all times.
The original version of this stylesheet and the associated (x)html
is available at http://www.stunicholls.com/ (...)
Copyright (c) 2005-2007 Stu Nicholls. All rights reserved.
This stylesheet and the associated (x)html may be modified in any
way to fit your requirements.
Very highly modified by Smokeman
so it fits for the DeLuxe Dropdown Menu v1.1
=================================================================== */
/* ---------- Preload Hover Images ---------- */
.preload1 {background: url(".INFUSIONS."deluxe_dropdown_menu/images/".$menusettings['mset_main_img'].");}
.preload2 {background: url(".INFUSIONS."deluxe_dropdown_menu/images/".$menusettings['mset_main_arrow_himg'].");}
/* ---------- Hide The Next level ---------- */
#nav ul,
#nav li:hover ul ul,
#nav li:hover li:hover ul ul,
#nav li:hover li:hover li:hover ul ul,
#nav li:hover li:hover li:hover li:hover ul ul
{position:absolute; left:-9999px; top:-9999px; width:0; height:0; margin:0; padding:0; list-style:none;}
/* ---------- All Link Colors ---------- */
#nav li a
{color: black;}
/* ---------- Position Of The Dropdown's ---------- */
#nav li:hover {position:relative; z-index:200;}
/* ---------- Main Menu ---------- */
#nav {padding:0; margin:0; list-style:none; height:35px; background: url('".INFUSIONS."deluxe_dropdown_menu/images/".$menusettings['mset_main_img']."') repeat-x; background-color: #".$menusettings['mset_main_bgcolor']."; position:relative; z-index:500; font-family:".$menusettings['mset_textfont'].";}
#nav li.top {display:block; float:left; height:35px;}
#nav li a.top_link {float:left; display:block; height:35px; line-height:33px; color:#CCC; text-decoration: none; font-size:".$menusettings['mset_textsize']."px; font-weight:bold; padding:0 0 0 12px; cursor:pointer;}
#nav li div {float:left; display:block; margin-left:12px; padding-right:24px; height:35px; background: url('".INFUSIONS."deluxe_dropdown_menu/images/".$menusettings['mset_main_img']."') right top no-repeat;}
#nav li div.down {float:left; display:block; margin-left:12px; padding-right:24px; height:35px; background: url('".INFUSIONS."deluxe_dropdown_menu/images/".$menusettings['mset_main_arrow_img']."') right top no-repeat; background-color: #".$menusettings['mset_main_bgcolor_arrow'].";}
#nav li.top:hover{color:#".$menusettings['mset_htextcolor_main']."; background: url('".INFUSIONS."deluxe_dropdown_menu/images/".$menusettings['mset_main_himg']."') no-repeat;}
#nav li:hover a.top_link {color:#".$menusettings['mset_htextcolor_main'].";}
#nav li:hover div {background: url('".INFUSIONS."deluxe_dropdown_menu/images/".$menusettings['mset_main_himg']."') right top no-repeat; background-color: #".$menusettings['mset_main_hbgcolor'].";}
#nav li:hover div.down {background: url('".INFUSIONS."deluxe_dropdown_menu/images/".$menusettings['mset_main_arrow_himg']."') right top no-repeat; background-color: #".$menusettings['mset_main_hbgcolor_arrow'].";}
/* ---------- Sub Menu 1 ---------- */
#nav li ul li a:hover
{color: #".$menusettings['mset_htextcolor_sub1'].";}
#nav li:hover ul
{left:".$menusettings['mset_width']."px; top:-4px; background: #".$menusettings['mset_sub1_bgcolor']."; padding:3px; border:1px solid #".$menusettings['mset_bordercol_sub1']."; white-space:nowrap; width:".$menusettings['mset_width']."px; z-index:400; height:auto;}
#nav li:hover ul.sub
{left: 1px; top:35px; background: #".$menusettings['mset_sub1_bgcolor']."; padding:3px; border:1px solid #".$menusettings['mset_bordercol_sub1']."; white-space:nowrap; width:".$menusettings['mset_width']."px; height:auto; z-index:300;}
#nav li:hover ul.sub li
{display:block; height:20px; position:relative; float:left; width:".$menusettings['mset_width']."px; font-weight:normal;}
#nav li:hover ul.sub li a
{display:block; font-size:".$menusettings['mset_textsize']."px; height:18px; width:".$width2."px; line-height:18px; text-indent:5px; text-decoration:none;border:1px solid #".$menusettings['mset_sub1_bgcolor'].";}
#nav li:hover ul.sub li a:hover
{background:#".$menusettings['mset_sub1_hbgcolor']."; border-color:#".$menusettings['mset_hbordercol_sub1'].";}
#nav li:hover ul.sub li a.fly:hover
{background:#".$menusettings['mset_sub1_hbgcolor']." url(".INFUSIONS."deluxe_dropdown_menu/images/".$menusettings['mset_sub_arrow_himg'].") ".$width1."px 6px no-repeat;}
#nav li:hover a.fly
{background:#".$menusettings['mset_sub1_hbgcolor']." url(".INFUSIONS."deluxe_dropdown_menu/images/".$menusettings['mset_sub_arrow_himg'].") ".$width1."px 6px no-repeat; border-color:#".$menusettings['mset_hbordercol_sub1'].";}
#nav li:hover li a
{border-color:#".$menusettings['mset_sub1_bgcolor'].";}
#nav li:hover li a:hover
{border-color:#".$menusettings['mset_hbordercol_sub1']."; background:#".$menusettings['mset_sub1_hbgcolor'].";}
#nav li:hover li a.fly
{background:#".$menusettings['mset_sub1_bgcolor']." url(".INFUSIONS."deluxe_dropdown_menu/images/".$menusettings['mset_sub_arrow_img'].") ".$width1."px 6px no-repeat; border-color:#".$menusettings['mset_sub1_bgcolor'].";}
#nav li:hover li a.fly:hover
{background:#".$menusettings['mset_sub1_hbgcolor'].";}
/* ---------- Sub Menu 2 ---------- */
#nav li ul li ul li a:hover
{color: #".$menusettings['mset_htextcolor_sub2'].";}
#nav li:hover li:hover ul
{left:".$menusettings['mset_width']."px; top:-4px; background: #".$menusettings['mset_sub2_bgcolor']."; padding:3px; border:1px solid #".$menusettings['mset_bordercol_sub2']."; white-space:nowrap; width:".$menusettings['mset_width']."px; z-index:400; height:auto;}
#nav li:hover li:hover ul.sub
{left: 1px; top:35px; background: #".$menusettings['mset_sub2_bgcolor']."; padding:3px; border:1px solid #".$menusettings['mset_bordercol_sub2']."; white-space:nowrap; width:".$menusettings['mset_width']."px; height:auto; z-index:300;}
#nav li:hover li:hover ul.sub li
{display:block; height:20px; position:relative; float:left; width:".$menusettings['mset_width']."px; font-weight:normal;}
#nav li:hover li:hover ul.sub li a
{display:block; font-size:".$menusettings['mset_textsize']."px; height:18px; width:".$width2."px; line-height:18px; text-indent:5px; text-decoration:none;border:1px solid #".$menusettings['mset_sub2_bgcolor'].";}
#nav li:hover li:hover ul.sub li a:hover
{background:#".$menusettings['mset_sub2_hbgcolor']."; border-color:#".$menusettings['mset_hbordercol_sub2'].";}
#nav li:hover li:hover ul.sub li a.fly:hover
{background:#".$menusettings['mset_sub2_hbgcolor']." url(".INFUSIONS."deluxe_dropdown_menu/images/".$menusettings['mset_sub_arrow_himg'].") ".$width1."px 6px no-repeat;}
#nav li:hover li:hover a.fly
{background:#".$menusettings['mset_sub1_hbgcolor']." url(".INFUSIONS."deluxe_dropdown_menu/images/".$menusettings['mset_sub_arrow_himg'].") ".$width1."px 6px no-repeat; border-color:#".$menusettings['mset_hbordercol_sub1'].";}
#nav li:hover li:hover li a
{border-color:#".$menusettings['mset_sub2_bgcolor'].";}
#nav li:hover li:hover li a:hover
{border-color:#".$menusettings['mset_hbordercol_sub2']."; background:#".$menusettings['mset_sub2_hbgcolor'].";}
#nav li:hover li:hover li a.fly
{background:#".$menusettings['mset_sub2_bgcolor']." url(".INFUSIONS."deluxe_dropdown_menu/images/".$menusettings['mset_sub_arrow_img'].") ".$width1."px 6px no-repeat; border-color:#".$menusettings['mset_sub2_bgcolor'].";}
#nav li:hover li:hover li a.fly:hover
{background:#".$menusettings['mset_sub2_hbgcolor'].";}
/* ---------- Sub Menu 3 ---------- */
#nav li ul li ul li ul li a:hover
{color: #".$menusettings['mset_htextcolor_sub3'].";}
#nav li:hover li:hover li:hover ul
{left:".$menusettings['mset_width']."px; top:-4px; background: #".$menusettings['mset_sub3_bgcolor']."; padding:3px; border:1px solid #".$menusettings['mset_bordercol_sub3']."; white-space:nowrap; width:".$menusettings['mset_width']."px; z-index:400; height:auto;}
#nav li:hover li:hover li:hover ul.sub
{left: 1px; top:35px; background: #".$menusettings['mset_sub3_bgcolor']."; padding:3px; border:1px solid #".$menusettings['mset_bordercol_sub3']."; white-space:nowrap; width:".$menusettings['mset_width']."px; height:auto; z-index:300;}
#nav li:hover li:hover li:hover ul.sub li
{display:block; height:20px; position:relative; float:left; width:".$menusettings['mset_width']."px; font-weight:normal;}
#nav li:hover li:hover li:hover ul.sub li a
{display:block; font-size:".$menusettings['mset_textsize']."px; height:18px; width:".$width2."px; line-height:18px; text-indent:5px; text-decoration:none;border:1px solid #".$menusettings['mset_sub3_bgcolor'].";}
#nav li:hover li:hover li:hover ul.sub li a:hover
{background:#fff; border-color:#".$menusettings['mset_hbordercol_sub3'].";}
#nav li:hover li:hover li:hover ul.sub li a.fly:hover
{background:#fff url(".INFUSIONS."deluxe_dropdown_menu/images/".$menusettings['mset_sub_arrow_himg'].") ".$width1."px 6px no-repeat;}
#nav li:hover li:hover li:hover a.fly
{background:#".$menusettings['mset_sub2_hbgcolor']." url(".INFUSIONS."deluxe_dropdown_menu/images/".$menusettings['mset_sub_arrow_himg'].") ".$width1."px 6px no-repeat; border-color:#".$menusettings['mset_hbordercol_sub2'].";}
#nav li:hover li:hover li:hover li a
{border-color:#".$menusettings['mset_sub3_bgcolor'].";}
#nav li:hover li:hover li:hover li a:hover
{border-color:#".$menusettings['mset_hbordercol_sub3']."; background:#".$menusettings['mset_sub3_hbgcolor'].";}
#nav li:hover li:hover li:hover li a.fly
{background:#".$menusettings['mset_sub3_bgcolor']." url(".INFUSIONS."deluxe_dropdown_menu/images/".$menusettings['mset_sub_arrow_img'].") ".$width1."px 6px no-repeat; border-color:#".$menusettings['mset_sub3_bgcolor'].";}
#nav li:hover li:hover li:hover li a.fly:hover
{background:#".$menusettings['mset_sub3_hbgcolor'].";}
</style>");
}
function menucount(&$m, $id)
{
$n = 0;
foreach($m as $mdata)
if ($mdata['menu_cat'] == $id) $n++;
return $n;
}
function menuitem(&$m, $id = 0, $level = 0)
{
if (menucount($m, $id) > 0)
{
// Set ul class/id
$ul_class = '';
if ($level == 0) $ul_class = " id='nav'";
if ($level == 1) $ul_class = " class='sub'";
echo "<ul".$ul_class.">";
foreach($m as $mdata)
{
if ($mdata['menu_cat'] == $id && checkgroup($mdata['menu_access']))
{
$link_target = ($mdata['menu_window'] == "1" ? " target='_blank'" : "");
if ($level == 0 && menucount($m, $mdata['menu_id']) > 0)
{
$div_start = "<div class='down'>";
$div_end = "</div>";
}
else if ($level == 0)
{
$div_start = "<div>";
$div_end = "</div>";
}
else
{
$div_start = "";
$div_end = "";
}
if ($level == 0)
{
$link_class = " class='top_link'";
}
else if (menucount($m, $mdata['menu_id']) > 0)
{
$link_class = " class='fly'";
}
else
{
$link_class = "";
}
if ($level == 0)
{
$li_class = " class='top'";
}
else
{
$li_class = "";
}
if ($mdata['menu_name'] !== "---" && $mdata['menu_link'] == "---") {
echo "<li".$li_class.">".$div_start."<b>".$mdata['menu_name']."</b>".$div_end."\n";
} else if ($mdata['menu_name'] == "---" && $mdata['menu_link'] == "---") {
echo "<li".$li_class.">".$div_start."<hr />".$div_end."\n";
} else {
echo "<li".$li_class.">".$div_start."<a href='".$mdata['menu_link']."'".$link_target."".$link_class.">".$mdata['menu_name']."</a>".$div_end."\n";
}
menuitem($m, $mdata['menu_id'], $level + 1);
echo "</li>\n";
}
}
echo "</ul>\n";
}
}
?>
Quote
smokeman wrote:
1. You said earliere in this post you can't edit my description in the download - but now you say you can delete this line:- then you can actually edit it, right ?Quote
- V1.2 - SQL-Optimization by Flemming (flj) - the menu now use only one single SQL-Query
Quote
smokeman wrote:
2. Regarding:Quote
That is quite a serious allegation to make are you sure?
I do not see why assensvej would swap a file around?
Why would he?
- maybe because he had the earliere version on his site/server - and with a mistake when testing the new version the file menu.php was being swapped around ? I am not accusing anyone of anything. I have nothing agains Assensvej - it's just the only thing I can see that maybe causing this. I mean he's the person that Approved this. Like I write Im 112% sure that when I submitted v1.2 then all files was as they should be.
Quote
- V1.2 - SQL-Optimization by Flemming (flj) - the menu now use only one single SQL-Query
Quote
That is quite a serious allegation to make are you sure?
I do not see why assensvej would swap a file around?
Why would he?
Quote
smokeman wrote:
I think @Assensvej (which approved this Addon) must have swapped the file menu.php from v1.2 with menu.php from v1.1 when he tested & Approved the Addon..
I don't see why I shopuld "pay" for this..
Im 112% sure that I submitted the Addon - it was with the new file menu.php
Quote
- V1.2 - SQL-Optimization by Flemming (flj) - the menu now use only one single SQL-Query
Quote
smokeman wrote:
Latest: Ok I can't find that post.. - nevermind I'll just re-submit then. :G
One question: Can I get the text/description incl. text-format/bbcodes ? I mean so I don't have to format it all again in the description ? If you edit the Adddon I htink you can copt it for me ?
Category Forum
General DiscussionLabels
None yet
Statistics
2 participants
Notifications
You are not receiving notifications from this thread.
Related Questions