PDA

View Full Version : Installing Top Navigational Bar (aka Smart menu) into php?



MetalPrincess
09-30-2006, 02:12 PM
1) Script Title: Top Navigational Bar (aka Smart menu)

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/sm/index.htm

My problem is I'm new to php things. I can install a java menu in html and do a bit of html coding along with css, but I canot for the life of me get this to work on my page and its in php. The page is MKPortal and its a portal page with a VBulletin forum installed within it. the codes I need to install into the php code for the java to work are these codes here:


1) Add the following code inside the <HEAD> section of your page:

<style>
all.clsMenuItemNS, .clsMenuItemIE{text-decoration: none; font: bold 12px Arial; color: white; cursor: hand; z-index:100}
#MainTable A:hover {color: yellow;}
</style>

<script language="JavaScript">

//Top Nav Bar I v2.1- By Constantin Kuznetsov Jr.
//Modified by Dynamic Drive for various improvements
//Visit http://www.dynamicdrive.com for this script

var keepstatic=1 //specify whether menu should stay static (works only in IE4+)
var menucolor="#000000" //specify menu color
var submenuwidth=150 //specify sub menus' width

</script>


2) Copy and paste the below code into your webpage, RIGHT AFTER the <body> tag (proceeding any other tags):

<script language="JavaScript" src="menu.js"></script>
<script language="JavaScript" src="menucontext.js"></script>
<script language="JavaScript">
showToolbar();
</script>
<script language="JavaScript">
function UpdateIt(){
if (ie&&keepstatic&&!opr6)
document.all["MainTable"].style.top = document.body.scrollTop;
setTimeout("UpdateIt()", 200);
}
UpdateIt();
</script>

Next...

MetalPrincess
09-30-2006, 02:13 PM
The page I need to install them into is coded like this:


class tpl_main {

function view_header($title, $css, $js, $pmk_js, $board_header) {
global $mklib, $mklib_board;
$css = $mklib_board->import_css();
return <<<EOF

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<!-- begin document head -->

<head>
<meta http-equiv="content-type" content="text/html; charset={$mklib->charset}" />
<meta name="generator" content="MKPortal" />
<meta http-equiv="Pragma" content="no-cache" />
<meta content="no-cache" http-equiv="no-cache" />
<meta http-equiv="Cache-Control" content="no-cache" />
{$title}
{$css}
{$board_header}
<script type="text/javascript" src="{$js}"></script>
{$pmk_js}

</head>

<body onload="javascript:GetPos()">

<!-- end document head -->

EOF;
}

function open_main($mainwidth) {
global $mklib;
return <<<EOF

<!-- begin open main table -->

<div id="mkwrapper" style="width: {$mainwidth};">
<table class="tabmain" width="100%" align="center" border="0" cellspacing="0" cellpadding="0">

<tr>
<td width="100%" align="center">

<table border="0" width="100%" cellpadding="0" cellspacing="0">

<!-- end open main table -->

EOF;
}

function view_logo() {
global $mklib;
return <<<EOF

<!-- begin logostrip -->


<tr>

<a href="$mklib->siteurl/index.php"><img src="$mklib->images/logo.gif" border="0" alt="" /></a>

</td>

</tr>



<!-- end logostrip -->

EOF;
}

function view_linkbar($row_link) {
global $mklib, $mkportals;
return <<<EOF

<!-- begin linkbar -->

<tr>
<td>
<table width="100%" align="center" cellspacing="0" cellpadding="2" border="0">
<tr>
<td class="navigatore" style="padding: 4px;">
$row_link&nbsp;
</td>
</tr>
</table>
</td>
</tr>

<!-- end linkbar -->

EOF;
}

function view_urlo($urlo1, $urlo2) {
global $mklib;
return <<<EOF

<!-- begin shoutbox -->

<tr align="left">
<td>
<table cellpadding="0" cellspacing="0" border="0" width="100%" align="center">
<tr>
<td class="urlo" width="100%" valign="bottom" nowrap="nowrap">
{$mklib->lang['urlolast']} - $urlo1
</td>
</tr>
<tr>
<td class="urlo2" colspan="2">$urlo2
</td>
</tr>
</table>
</td>
</tr>

<!-- end shoutbox -->

EOF;
}

function view_separator_h() {
global $mklib;
return <<<EOF

<!-- begin horizontal spacer -->

<!-- separatore orizzontale
<tr align="center">
<td class="trattini"><img src="$mklib->images/punto_or.gif" width="1" height="1" alt="" />
</td>
</tr> -->

<!-- end horizontal spacer -->

EOF;
}

function open_body() {
global $mklib;
return <<<EOF

<!-- begin open portal body -->

<tr align="center">
<td width="100%">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>

<!-- end open portal body -->

EOF;
}

function view_column_left($blocks) {
global $mklib;

return <<<EOF

<!-- begin left column -->

<td id="menusx" valign="top" align="left">
<div id="menucontents" style="$mklib->menucontents">
<table cellpadding="0" cellspacing="2" border="0" style="width: {$mklib->columnwidth}px;">
{$blocks}
</table>
</div>
</td>

<!-- end left column -->

EOF;
}


function view_separator_v() {
global $mklib;
return <<<EOF

<!-- begin column spacer -->

<td class="vspacer" width="0%" align="left">&nbsp;</td>

<!-- end column spacer -->

EOF;
}

function view_column_center($blocks) {
global $mklib;
return <<<EOF

<!-- begin center column -->

<td valign="top" align="left" width="100%">
<table cellpadding="0" cellspacing="3" border="0" width="100%">
{$blocks}
</table>
</td>

<!-- end center column -->

EOF;
}

function view_column_right($blocks) {
global $mklib;
return <<<EOF

<!-- begin right column -->

<td id="menudx" valign="top" align="left">
<div id="menucontentr" style="$mklib->menucontentr">
<table cellpadding="0" cellspacing="2" border="0" style="width: {$mklib->columnwidth}px;">
{$blocks}
</table>
</div>
</td>

<!-- end right column -->

EOF;
}

function close_body() {
global $mklib;
return <<<EOF

<!-- begin close portal body -->

</tr>
</table>
</td>
</tr>

<!-- end close portal body -->

EOF;
}

function close_main() {
global $mklib;
return <<<EOF

<!-- begin close main table -->

</table>

</td>
</tr>
</table>
</div>

<!-- end close main table -->

EOF;
}


function view_footer($block) {
global $mklib;
return <<<EOF

<!-- begin footer -->
Copyright Demented Thinking Productions 2006-2007
<!-- end footer -->
<p align="center">{$block}</p>

</body>
</html>

<!-- end footer -->

EOF;
}

function view_block($title, $content) {
global $mklib;
return <<<EOF

<!-- begin block template -->

<tr>
<td class="tablemenu" valign="top">
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td>
<table border="0" cellpadding="4" cellspacing="0" width="100%">
<tr>
<td width="100%" class="sottotitolo" valign="middle" nowrap="nowrap">{$title}</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="100%">
<table border="0" width="100%" cellpadding="0" cellspacing="1">
{$content}
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="tdspacer">&nbsp;</td>
</tr>

<!-- end block template -->

EOF;
}

function row_link( $icon, $url, $text) {
global $mklib;
return <<<EOF

<!-- begin link template -->

&nbsp;<img src="$icon" border="0" style="vertical-align: middle;" alt="" />&nbsp;<a class="uno" $url>$text</a>

<!-- end link template -->

EOF;
}

function view_quote($content, $author) {
global $mklib;
return <<<EOF
<!-- begin mkportal quote -->
<table class="mkquotetable" style="margin-top: 5px; margin-bottom: 5px; width: auto;" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td valign="bottom">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" width="26"><img src="$mklib->images/quote/mkquote_balloon_l.gif" height="23" width="26" alt="" /></td>
<td style="background-image: url($mklib->images/quote/mkquote_balloon_bg.gif); background-position: center; padding-bottom: 3px;" valign="middle" nowrap="nowrap">
<span class="mkquoteball"><b>{$mklib->lang['editor_quote']}</b> $author</span>
</td>
<td valign="top"><img src="$mklib->images/quote/mkquote_balloon_r.gif" height="23" width="26" alt="" /></td>
</tr>
</table>
</td>

<td align="right" valign="bottom" width="100%">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="100%">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td style="background-image: url($mklib->images/quote/mkquote_top_bg.gif);" valign="middle" width="100%"></td>
<td align="left" valign="top"><img src="$mklib->images/quote/mkquote_top_r.gif" height="23" width="13" alt="" /></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td style="background-image: url($mklib->images/quote/mkquote_left_bg.gif);" width="13"></td>
<td class="mkquotetext" bgcolor="#ffffff" valign="top" width="100%">
<i>$content</i>
</td>
<td style="background-image: url($mklib->images/quote/mkquote_right_bg.gif);" width="13"></td>
</tr>
<tr>
<td valign="bottom" height="9" width="13"><img src="$mklib->images/quote/mkquote_bot_l.gif" alt="" /></td>
<td style="background-image: url($mklib->images/quote/mkquote_bot_bg.gif);" width="100%"></td>
<td valign="bottom" height="9" width="13"><img src="$mklib->images/quote/mkquote_bot_r.gif" alt="" /></td>
</tr>
</table>
</td>
</tr>
</table>
<!-- end mkportal quote -->
EOF;
}

}

$Skin = new tpl_main;

?>


My question is how do I install this and were do I put the code? I want the menu to show up in the Navigational menu. you can see it on my page at http://www.metalbootlegdatabase.com the menu I have now is under the header banner.

TIA!
MP

MetalPrincess
10-03-2006, 01:02 AM
Anyone? Please I need to get this to work on my page.


MP

MetalPrincess
10-06-2006, 07:19 PM
Still need help with this.


MP