View Full Version : CSS category menu needed asap (Will pay)
WESHUK
10-15-2006, 08:03 PM
Hi All
I am in need of a 100% CSS category menu that looks exactly the same as the category menu in the "dedicated" skin but without all that bloated javascript and having it 100% SEO friendly.
It needs to be very lightweight and also needs to be used for my forum skin too.
subcategories should NOT show on this menu.....
This job shouldnt take long for the right person so please do let me know if you can do this, and how quickly....
Initial colourscheme of the menu should match the green used @ http://forums.digitalpoint.com
72dpi
10-16-2006, 01:22 AM
meh,
Why pay?
Play with this, it is close to what u want, just doesn't have the white inset border for the active state:
CSS is:
/* top navigation style */
.navcontainer
{
margin: 0;
padding: 0;
border: 1px solid #aeaeae;
}
#navcontainer ul
{
list-style: none;
margin: 0;
padding: 0;
}
#navcontainer li
{
display: block;
margin: 0;
padding: 0;
float: left;
width: auto;
}
#navcontainer a
{
color: #757575;
display: block;
width: auto;
text-decoration: none;
background: #E4E4E4;
margin: 0;
padding: 2px 10px;
border-left: 1px solid #fff;
border-top: 1px solid #ababab;
border-right: 1px solid #ababab;
font-family:"Trebuchet MS",Verdana, Arial, Helvetica, sans-serif;
font-size:75%;
}
#navcontainer a:hover, #navcontainer a:active { background: #BBBBBB; }
#navcontainer li#active a,#navcontainer ul li .active a, #navcontainer #navlist a:hover,#navcontainer #navlist #current
{
background-color: #A0A0A0;
color: #ffffff;
}
/* end topnav*/Your categories.php in your skin file needs to be similar to:
<?php
// +---------------------------------------------+
// | Copyright © 2003 – 2005 Subdreamer |
// | http://www.subdreamer.com |
// | This file may not be redistributed. |
// +---------------------------------------------+
if(!defined('IN_SUBDREAMER'))
{
die("Hacking attempt!");
}
// define the category
$thecategory = $DB->query_first("SELECT name FROM " . TABLE_PREFIX . "categories WHERE categoryid = '$categoryid'");
echo '<div id="navcontainer">';
echo '<ul id="navlist">';
for($i = 0; $i < $categoryrows; $i++)
{
if ($categoryname[$i] == $thecategory['name']){
echo '<li id="active"><a href="'.$categorylink[$i].'" id="current">'.$categoryname[$i].'</a></li>'; }
else {
echo '<li><a href="'.$categorylink[$i].'">'.$categoryname[$i].'</a></li>'; }
}
echo '</ul></div>';
?> Notice how I have created an Active menu state, by calling the category.... (u need to test this in your version of SD)
Then, wherever u have you menu, it wil appear.
hope this helps, anyone want to better it, or anyone have some thing to add, please do..
abcohen
10-16-2006, 02:36 PM
but if you'd still like to pay we're going to pass around a plate and collect money for some really cool plugins :)
WESHUK
10-16-2006, 11:36 PM
meh,
Why pay?
Play with this, it is close to what u want, just doesn't have the white inset border for the active state:
Hi 72dpi....
Firstly let me say a huge thank you for providing this... I cannot honestly beleive people still do things for each other just to be nice!!!
Definately not something that happens here in London...
How exactly do I implement this... heres what I just tried...
Rename the current categories.php / menu.css files to x.php / x.css and create 2 new blank files with the same names as before then copied your code into each one then uploaded them..
This went a little mental and left me with an error message on the homepage:
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE or '$' in /home/username/public_html/skins/dedicated/categories.php on line 3
I tried hitting the "switch skins" to re-apply the skin too but got the same error message...
the forumskin.php looks a little mental and I havent "reskinned the forum" as I figured it would just go nuts the same as the website homepage...
I figure I am missing something here ?
again a huge thanks, once this is working, I owe somebody something for sure...
Regards
Rich
WESHUK
10-17-2006, 12:32 AM
Here the current categories.php file I have.....
<?php
// +---------------------------------------------+
// | Copyright © 2003 – 2005 Subdreamer |
// | http://www.subdreamer.com |
// | This file may not be redistributed. |
// +---------------------------------------------+
if(!defined('IN_SUBDREAMER'))
{
die("Hacking attempt!");
}
if($usehovermenu = $DB->query_first("SELECT categoryid FROM " . TABLE_PREFIX . "categories WHERE parentid != 0 LIMIT 1"))
{
echo "<script language=\"JavaScript\">
<!--
function wrap_root (text)
{
/*normal, hover, click*/
return ['<table cellpadding=0 cellspacing=0 border=0 class=width_100><tr><td class=bullet_1><table cellpadding=0 cellspacing=0 border=0 class=bullet_2><tr><td class=categorydefault> ' + text + ' </td></tr></table></td></tr></table>',
'<table cellpadding=0 cellspacing=0 border=0 class=width_100><tr><td class=bullet_1_hover><table cellpadding=0 cellspacing=0 border=0 class=bullet_2_hover><tr><td class=categoryhover> ' + text + ' </td></tr></table></td></tr></table>',
'<table cellpadding=0 cellspacing=0 border=0 class=width_100><tr><td class=bullet_1><table cellpadding=0 cellspacing=0 border=0 class=bullet_2><tr><td class=categorydefault> ' + text + ' </td></tr></table></td></tr></table>'
];
}
function wrap_parent (text, icon, hovericon)
{
/*normal, hover, click*/
return [['<table cellpadding=0 cellspacing=0 border=0 class=width_100><tr><td class=a0> ' + text + ' </td></tr></table>'].join(''),
['<table cellpadding=0 cellspacing=0 border=0 class=width_100><tr><td class=a1> ' + text + ' </td></tr></table>'].join(''),
['<table cellpadding=0 cellspacing=0 border=0 class=width_100><tr><td class=a0> ' + text + ' </td></tr></table>'].join('')
];
}
function wrap_child (text, icon, hovericon)
{
/*normal, hover, click*/
return [['<table cellpadding=0 cellspacing=0 border=0 class=width_100><tr><td class=a0> ' + text + ' </td></tr></table>'].join(''),
['<table cellpadding=0 cellspacing=0 border=0 class=width_100><tr><td class=a1> ' + text + ' </td></tr></table>'].join(''),
['<table cellpadding=0 cellspacing=0 border=0 class=width_100><tr><td class=a0> ' + text + ' </td></tr></table>'].join('')
];
}
var MENU_POS =[
// Level 0 block configuration
{
// Item's height in pixels
'height' : 24,
// Item's width in pixels
'width' : 100,
// if Block Orientation is vertical
'vertical' : false,
// Time Delay in milliseconds before subling block expands
// after mouse pointer overs an item
'expd_delay' : 0,
// Style class names for the level
'css':
{
// Block outing table class
'table' : '',
// Item outer tag style class for all item states or
// classes for [<default state>, <hovered state>, <clicked state>]
'outer' : '',
// Item inner tag style class for all item states or
// classes for [<default state>, <hovered state>, <clicked state>]
'inner' : ''
}
},
// Level 1 block configuration
{
'width' : 75,
'height' : 20,
// Vertical Offset between adjacent levels in pixels
'block_top' : 26,
// Horizontal Offset between adjacent levels in pixels
'block_left' : 0,
// block behaviour if single frame:
// 1 - shift to the edge, 2 - flip relatively to left upper corner
'wise_pos' : 1,
'vertical' : false,
// transition effects for the block
// [index on expand, duration on expand, index on collapse, duration on collapse]
'transition' : [0, 0.3, 0, 0.3],
// Time Delay in milliseconds before menu collapses after mouse
// pointer lefts all items
'hide_delay' : 300,
'css' :
{
'table' : '',
'outer' : '',
'inner' : ''
}
},
// Level 2 block configuration
{
'block_top' : 20,
'block_left' : 0
}
//Subling level configurations are inherited from level 2
]
var MENU_ITEMS = [";
CreateHoverMenu();
echo "];
new menu (MENU_ITEMS, MENU_POS);
//-->
</script>";
}
else
{
echo '<table border="0" cellpadding="0" cellspacing="0"><tr>';
// use normal category menu
for($i = 0; $i < $categoryrows; $i++)
{
echo '<td class="bullet_1_normal"><table border="0" cellpadding="0" cellspacing="0" class="width_100"><tr><td class="bullet_2_normal"><div class="bullet_3"><a href="'.$categorylink[$i].'" class="sdcategory">'.$categoryname[$i].'</a></div></td></tr></table></td>';
}
echo '</tr></table>';
}
?>
Thanks
richie
72dpi
10-17-2006, 05:18 AM
=)
being nice is all part of my plan, first I sucker you in, then WHAM! I sign you up for lifetime membership with the "Church of Scientology". heh heh. Just kidding.
First up, don't delete the old file, in case this doesn't achieve what you want.
just rename it, like: categories_orig.php
Save the next as "categories.php"
<?php
// +---------------------------------------------+
// | Copyright © 2003 – 2005 Subdreamer |
// | http://www.subdreamer.com |
// | This file may not be redistributed. |
// +---------------------------------------------+
if(!defined('IN_SUBDREAMER'))
{
die("Hacking attempt!");
}
// define the category
$thecategory = $DB->query_first("SELECT name FROM " . TABLE_PREFIX . "categories WHERE categoryid = '$categoryid'");
echo '<div id="navcontainer">';
echo '<ul id="navlist">';
for($i = 0; $i < $categoryrows; $i++)
{
if ($categoryname[$i] == $thecategory['name']){
echo '<li id="active"><a href="'.$categorylink[$i].'" id="current">'.$categoryname[$i].'</a></li>'; }
else {
echo '<li><a href="'.$categorylink[$i].'">'.$categoryname[$i].'</a></li>'; }
}
echo '</ul></div>';
?>Then, grab the CSS code, and add it to your existing stylesheet that is called from the skin.
I haven't looked at forum skin, but it will basically be the same principal, I will try and download it later and have a look. Shouldn't be hard at all, cos we are not using the drop down.
Just for your info, I am trying to get the submenus written as <ul> <li> etc, for SEO. I believe that it will happen soon, so stay tuned. I am also working on a flash varient for menus. I am close, just have a few issues.
That's it!
Hope this helps matey..
PS, I can't remember London being too bad, but maybe cos I lived in Wimbleton with the Wombles =)
Cya!
WESHUK
10-17-2006, 03:56 PM
Hiya 72dpi
I just tried the new one and I now get this error:
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE or '$' in /home/username/public_html/skins/dedicated/categories.php on line 13
I added the CSS to my main "styles.css" file too...
Thx, rich
72dpi
10-17-2006, 04:14 PM
I think it changed " to %quote;
See how the ammended content in my last post goes.
Sorry for the stuff around, Cut/paste in the editor mucked it..
WESHUK
10-17-2006, 06:19 PM
Totally cool... it works a treat...
Made a quick mod on the font and font size to get it to fit perfectly and its excellent!!!
Now I need figure to to port this into the forumskin because I want to rid the forum of all the bloated code and get this menu to work on that too...
Thanks a lot for your help 72dpi...
Would you like me to PM you website link?
WESHUK
10-17-2006, 07:20 PM
Hi 72dpi....
Is there any chance you might be able to make any sense of this forumskin to use this new menu as I have no idea what I am looking at here... its all foreign..
<?php
if(!defined('IN_SUBDREAMER'))
{
die("Hacking attempt!");
}
// ################################ CATEGORIES ################################
$categories .= '
<link rel="stylesheet" href="'.$sdpath.'skins/dedicated/menu.css" />
<link rel="stylesheet" href="'.$sdpath.'skins/dedicated/forumskin.css" />
<script type="text/javascript" src="'.$sdpath.'skins/dedicated/forummenu.php"></script>
';
// ################################ SDHEADER ###################################
$sdheader = '
<body style="margin-bottom: 10px; margin-top: 0px; margin-left: 0px; margin-right: 0px; padding: 0;
text-align:center; font-family: Verdana, Arial, Helvetica, sans-serif; background-position: top;">
<table border="0" cellpadding="0" cellspacing="0" class="width_1">
<tr>
<td class="logo"><div class="padding">' . $logo . '</div></td>
</tr>
<tr>
<td align="left" class="navigation">' . $categories . '</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td class="main_1">
';
// ################################ SDFOOTER ###################################
$sdfooter = ' </td></tr><tr>
<br />
<td class="sdfooter"><div class="sdcopyright">' . $copyright . iif(!$mainsettings['bfo'], '') . '</div></td></tr></table>
<br /></body>';
?>
I think if you can nail the forumskin.php then we will be all set to go...
Thanks again
Richie
abcohen
10-17-2006, 09:24 PM
Richie - I think if he nails the forum skin you need to ship him a bottle of vodka or something ;)
WESHUK
10-17-2006, 09:36 PM
Richie - I think if he nails the forum skin you need to ship him a bottle of vodka or something ;)
Excatly what I wanted to do.....
I dont want to put anybody out and if he is good enough to offer then I would love to return the favour...
I'm not keen on people who ask for a little then take a lot if you know what I mean..
What ever is a suitable reward then that works for me...
72dpi
10-18-2006, 02:01 AM
okkies. Please BACKUP forumskin.php
We are not going to be calling forumenu.php, as my code doesn't require drop downs.
I am giving you 2 choices, the first, has the css embedded, the second, links to your css. See what works for you, and choose either method.
Embedded CSS:
Backup existing, and save this as "forumskin.php" in the dedicated folder:
<?php
// +---------------------------------------------+
// | Copyright © 2005 indiqo.media |
// | http://www.indiqo.de |
// | This file may not be redistributed. |
// +---------------------------------------------+
if(!defined('IN_SUBDREAMER'))
{
die("Hacking attempt!");
}
// ################################ CATEGORIES ################################
// define the category
$thecategory = $DB->query_first("SELECT name FROM " . TABLE_PREFIX . "categories WHERE categoryid = '$categoryid'");
$categories = '<div id="navcontainer">';
$categories .= '<ul id="navlist">';
// loop through
for($i = 0; $i < $categoryrows; $i++)
{
if ($categoryname[$i] == $thecategory['name']){
$categories .= '<li id="active"><a href="'.$categorylink[$i].'" id="current">'.$categoryname[$i].'</a></li>'; }
else {
$categories .= '<li><a href="'.$categorylink[$i].'">'.$categoryname[$i].'</a></li>'; }
}
$categories .= '</ul></div>';
// ################################ SDHEADER ###################################
$sdheader = '
<style type="text/css">
a.sdcopyright:link { font-family: "Verdana", Arial, Helvetica, sans-serif; font-size: 9px; color: #727272; font-stretch:expanded; text-decoration: none; }
a.sdcopyright:active { font-family: "Verdana", Arial, Helvetica, sans-serif; font-size: 9px; color: #727272; font-stretch:expanded; text-decoration: none; }
a.sdcopyright:visited { font-family: "Verdana", Arial, Helvetica, sans-serif; font-size: 9px; color: #727272; font-stretch:expanded; text-decoration: none; }
a.sdcopyright:hover { font-family: "Verdana", Arial, Helvetica, sans-serif; font-size: 9px; color: #505050; font-stretch:expanded; text-decoration: none; }
img { border: 0; }
.width_1
{ width: 700px; margin-left:auto; margin-right:auto; }
.width_100
{ width: 100%; vertical-align:top; text-align:left; }
body {
margin-bottom: 10px;
margin-top: 0px;
margin-left: 0px;
margin-right: 0px;
padding: 0;
text-align:center;
font-family: Verdana, Arial, Helvetica, sans-serif;
background-color: #FFFFFF;
background-image:url(' . $sdpath . 'skins/dedicated/images/dd_background.jpg);
background-repeat:repeat-x;
background-position: top;
}
.sdcopyright
{ color:#727272; font-size: 9px; font-stretch:expanded; }
.logo
{ width: 100%; height: 46px; vertical-align:bottom; text-align:right; }
.padding
{ padding: 5px 0px 5px 0px; }
.navigation
{ width: 100%; height: 25px; border-bottom: 1px solid #ABABAB; border-left: 1px solid #ABABAB; }
.banner
{ width: 100%; padding-top: 1px; }
.sdfooter
{ width: 100%; vertical-align:middle; text-align:center; }
.main_1
{ width: 100%; padding: 12px 10px 5px 10px; }
/* top navigation style */
.navcontainer
{
margin: 0;
padding: 0;
border: 1px solid #aeaeae;
}
#navcontainer ul
{
list-style: none;
margin: 0;
padding: 0;
}
#navcontainer li
{
display: block;
margin: 0;
padding: 0;
float: left;
width: auto;
}
#navcontainer a
{
color: #757575;
display: block;
width: auto;
text-decoration: none;
background: #E4E4E4;
margin: 0;
padding: 2px 10px;
border-left: 1px solid #fff;
border-top: 1px solid #ababab;
border-right: 1px solid #ababab;
font-family:"Trebuchet MS",Verdana, Arial, Helvetica, sans-serif;
font-size:75%;
}
#navcontainer a:hover, #navcontainer a:active { background: #BBBBBB; }
#navcontainer li#active a,#navcontainer ul li .active a, #navcontainer #navlist a:hover,#navcontainer #navlist #current
{
background-color: #A0A0A0;
color: #ffffff;
}
/* end topnav*/
</style>
<script type="text/javascript" src="'.$sdpath.'skins/dedicated/javascript/prototype.js"></script>
<script type="text/javascript" src="'.$sdpath.'skins/dedicated/javascript/reflection.js"></script>
<body style="margin-bottom: 10px;
margin-top: 0px;
margin-left: 0px;
margin-right: 0px;
padding: 0;
text-align:center;
font-family: Verdana, Arial, Helvetica, sans-serif;
background-color: #FFFFFF;
background-image:url(' . $sdpath . 'skins/dedicated/images/dd_background.jpg);
background-repeat:repeat-x;
background-position: top;">
<table border="0" cellpadding="0" cellspacing="0" class="width_1">
<tr>
<td class="logo"><div class="padding">' . $logo . '</div></td>
</tr>
<tr>
<td class="navigation">' . $categories . '</td>
</tr>
<tr>
<td class="banner"><img src="' . $sdpath . 'skins/dedicated/images/dd_banner.jpg" alt="Banner" class="reflect" /></td>
</tr>
<tr>
<td class="main_1">
';
// ################################ SDFOOTER ###################################
$sdfooter = ' </td>
</tr>
<tr>
<td class="sdfooter"><div class="sdcopyright">' . $copyright . iif(!$mainsettings['bfo'], '<br /><a href="http://www.indiqo.de" title="indiqo.media" target="_blank" class="sdcopyright">design by indiqo.media</a>') . '</div></td>
</tr>
</table></body>';
?>
Or Try:
External CSS
<?php
// +---------------------------------------------+
// | Copyright © 2005 indiqo.media |
// | http://www.indiqo.de |
// | This file may not be redistributed. |
// +---------------------------------------------+
if(!defined('IN_SUBDREAMER'))
{
die("Hacking attempt!");
}
// ################################ CATEGORIES ################################
// define the category
$thecategory = $DB->query_first("SELECT name FROM " . TABLE_PREFIX . "categories WHERE categoryid = '$categoryid'");
$categories = '<div id="navcontainer">';
$categories .= '<ul id="navlist">';
// loop through
for($i = 0; $i < $categoryrows; $i++)
{
if ($categoryname[$i] == $thecategory['name']){
$categories .= '<li id="active"><a href="'.$categorylink[$i].'" id="current">'.$categoryname[$i].'</a></li>'; }
else {
$categories .= '<li><a href="'.$categorylink[$i].'">'.$categoryname[$i].'</a></li>'; }
}
$categories .= '</ul></div>';
// ################################ SDHEADER ###################################
$sdheader = '
<link rel="stylesheet" type="text/css" href="'.$sdpath.'skins/dedicated/styles.css" />
<link rel="stylesheet" type="text/css" href="'.$sdpath.'skins/dedicated/menu.css" />
<script type="text/javascript" src="'.$sdpath.'skins/dedicated/javascript/prototype.js"></script>
<script type="text/javascript" src="'.$sdpath.'skins/dedicated/javascript/reflection.js"></script>
<body style="margin-bottom: 10px;
margin-top: 0px;
margin-left: 0px;
margin-right: 0px;
padding: 0;
text-align:center;
font-family: Verdana, Arial, Helvetica, sans-serif;
background-color: #FFFFFF;
background-image:url(' . $sdpath . 'skins/dedicated/images/dd_background.jpg);
background-repeat:repeat-x;
background-position: top;">
<table border="0" cellpadding="0" cellspacing="0" class="width_1">
<tr>
<td class="logo"><div class="padding">' . $logo . '</div></td>
</tr>
<tr>
<td class="navigation">' . $categories . '</td>
</tr>
<tr>
<td class="banner"><img src="' . $sdpath . 'skins/dedicated/images/dd_banner.jpg" alt="Banner" class="reflect" /></td>
</tr>
<tr>
<td class="main_1">
';
// ################################ SDFOOTER ###################################
$sdfooter = ' </td>
</tr>
<tr>
<td class="sdfooter"><div class="sdcopyright">' . $copyright . iif(!$mainsettings['bfo'], '<br /><a href="http://www.indiqo.de" title="indiqo.media" target="_blank" class="sdcopyright">design by indiqo.media</a>') . '</div></td>
</tr>
</table></body>';
?>
I can't guarantee either will work, but hopefully they will.
Good luck!
WESHUK
10-18-2006, 02:13 AM
Hey 72dpi......
Crikey blimey it works i tells ya'...........................
good work old chap, tally ho......
All i did was remove the .js calls and the CSS for the banner and i got it spot on.
It does look somewhat different to the main website CSS menu though, dispite both CSS menu sections being the same...
I used the second example to keep the CSS out of the skin file and let it be cached on users PC's instead of loading it with every page view.
Name a good cause... what can I do for you in return?
Thanks
Richie
72dpi
10-18-2006, 02:18 AM
=)
Glad it works matey.
All I ask is just spread the Subdreamer love.
abcohen
10-18-2006, 03:27 AM
haha - thats fine too - please purchase an itunes gift card or something :P its always nice to give back it encourges people to help more :)
Usurper
10-18-2006, 08:44 PM
Nice work, 72dpi. That's a lot cleaner than what I hacked together, the active state thing is awesome, and did I read this right--there's no more block level width vars, just pure css?
72dpi
10-18-2006, 11:58 PM
hey Usurper,
yeah, pure css. the trick is to ensure you reference the id. The little hack to show current state was quite funny. it was something I was trying to do for ages. i can't rmember correctly, but there was another guy on here who came up with the similar method, but slightly different code.
One thing with this method, is you should be able to write child categories underneath. This is omething that i want to work towrds, giving pure CSS & using unordered lists for output, but right now I am trying to nail my Flash menu for Subdreamer integration.
Any thoughts on expanding this for subcategories are welcome & definately needed =)
WESHUK
10-19-2006, 01:16 AM
Hiya 72dpi....
I just wanted to ask 1 last question about this CSS hack...
Can I use it like a normal CSS include on pages that were not done by subdreamer?
So for example, if I had a gallery section or some kind of link directory that was not part of SD and I wanted the menu's to be pulled from SD, is this possible?
Thanks again...
Richie
72dpi
10-19-2006, 03:11 AM
heya,
I haven't tried, but U should have no worries.
The css is not a problem, the problem is connecting to the database.
if your external content does not reside in your links database, then it obviously won't recognise the "current" state, so we can cut this out of the code & make it even smaller.
This works the same way that "forummenu.php" works, in that it inlcudes subdreamer core data.
In theory, U could use the following menu system on other page:
Save as:
externalmenu.php
<?php
// +---------------------------------------------+
// | Copyright © 2003 – 2005 Subdreamer, LLC |
// | http://www.subdreamer.com |
// | This file may not be redistributed. |
// +---------------------------------------------+
define('IN_SUBDREAMER', true);
// If the $sdpath doesn't work, set the path as relative
// $rootpath = "../../";
// or as absolute (with trailing slash):
// $rootpath = "http://www.yoursite.com/";
$rootpath = $sdpath;
// INCLUDE CORE
include($rootpath . 'includes/core.php');
// define the category
$thecategory = $DB->query_first("SELECT name FROM " . TABLE_PREFIX . "categories WHERE categoryid = '$categoryid'");
echo '<div id="navcontainer">';
echo '<ul id="navlist">';
for($i = 0; $i < $categoryrows; $i++)
{
if ($categoryname[$i] == $thecategory['name']){
echo '<li id="active"><a href="'.$categorylink[$i].'" id="current">'.$categoryname[$i].'</a></li>'; }
else {
echo '<li><a href="'.$categorylink[$i].'">'.$categoryname[$i].'</a></li>'; }
}
echo '</ul></div>';
// close our call to the database
$DB->Close();
?>I don't know if this will work, as I need to play with the database call a bit better, but gives you the general gist of what you need to do.
Then just inlcude, or echo in your php file, like so:
<?php
echo'<link rel="stylesheet" href="'.$sdpath.'skins/blah/menu.css" />
<script type="text/javascript" src="'.$sdpath.'/skins/blah/externalmenu.php"></script>';
?>or if you can't use php, say in a html tenplate file, yuou can always include as html like:
<link rel="stylesheet" href="http://www.yourwebsite.com/skins/blah/menu.css" />
<script type="text/javascript" src="http://www.yourwebsite.com/skins/blah/externalmenu.php"></script>hope this helps..
Robert_J_Ellis
10-19-2006, 02:09 PM
=)
being nice is all part of my plan, first I sucker you in, then WHAM! I sign you up for lifetime membership with the "Church of Scientology". heh heh. Just kidding.
lol.
I liked the picture on the poster for scary movie 4 poster.
minis007
12-26-2006, 07:10 PM
I use the code below for my menu. The question is, how to add dropdown menu for this style?
meh,
Why pay?
Play with this, it is close to what u want, just doesn't have the white inset border for the active state:
CSS is:
/* top navigation style */
.navcontainer
{
margin: 0;
padding: 0;
border: 1px solid #aeaeae;
}
#navcontainer ul
{
list-style: none;
margin: 0;
padding: 0;
}
#navcontainer li
{
display: block;
margin: 0;
padding: 0;
float: left;
width: auto;
}
#navcontainer a
{
color: #757575;
display: block;
width: auto;
text-decoration: none;
background: #E4E4E4;
margin: 0;
padding: 2px 10px;
border-left: 1px solid #fff;
border-top: 1px solid #ababab;
border-right: 1px solid #ababab;
font-family:"Trebuchet MS",Verdana, Arial, Helvetica, sans-serif;
font-size:75%;
}
#navcontainer a:hover, #navcontainer a:active { background: #BBBBBB; }
#navcontainer li#active a,#navcontainer ul li .active a, #navcontainer #navlist a:hover,#navcontainer #navlist #current
{
background-color: #A0A0A0;
color: #ffffff;
}
/* end topnav*/Your categories.php in your skin file needs to be similar to:
<?php
// +---------------------------------------------+
// | Copyright © 2003 – 2005 Subdreamer |
// | http://www.subdreamer.com |
// | This file may not be redistributed. |
// +---------------------------------------------+
if(!defined('IN_SUBDREAMER'))
{
die("Hacking attempt!");
}
// define the category
$thecategory = $DB->query_first("SELECT name FROM " . TABLE_PREFIX . "categories WHERE categoryid = '$categoryid'");
echo '<div id="navcontainer">';
echo '<ul id="navlist">';
for($i = 0; $i < $categoryrows; $i++)
{
if ($categoryname[$i] == $thecategory['name']){
echo '<li id="active"><a href="'.$categorylink[$i].'" id="current">'.$categoryname[$i].'</a></li>'; }
else {
echo '<li><a href="'.$categorylink[$i].'">'.$categoryname[$i].'</a></li>'; }
}
echo '</ul></div>';
?> Notice how I have created an Active menu state, by calling the category.... (u need to test this in your version of SD)
Then, wherever u have you menu, it wil appear.
hope this helps, anyone want to better it, or anyone have some thing to add, please do..
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.