How to create a top navigation bar as in NukeNews theme

14.3.1. How to create a top navigation bar as in NukeNews theme

Figure 14-3. Top navigation bar in the NukeNews theme.

Top navigation bar in the NukeNews theme.

Sometimes, like in the case of the NukeNews theme, the themeheader() function will include the contents of a separate file, written in pure HTML:

    $tmpl_file = "themes/NukeNews/header.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    print $r_file;

The header.html file, which is "evaluated" here, contains HTML code that creates the "top navigation bar", the one with the "Home", "Topics", "Downloads", "Your Account" etc. links (Figure 14-3):

<tr valign="middle" bgcolor="#dedebb"> 
<td width="15%" nowrap><font class="content" color="#363636"> 
<td align="center" height="20" width="70%"><font class="content"><B> 
<A href="index.php">Home</a> 
<A href="topics.html">Topics</a> 
<A href="downloads.html">Downloads</a> 
<A href="account.html">Your Account</a> 
<A href="submit.html">Submit News</a> 
<A href="top.html">Top 10</a> 
<td align="right" width="15%"><font class="content"><b> 
<script type="text/javascript"> 
<!--   // Array ofmonth Names 
var monthNames = new Array(
var now = new Date();
thisYear = now.getYear(); 
if(thisYear < 1900) {thisYear += 1900}; // corrections if Y2K display problem 
document.write(monthNames[now.getMonth()] + " " + now.getDate() + ", " + thisYear); 
// -->
<td> </td>

Thus, if you want to delete or change this top navigation bar, you will have to delete or change the above code to reflect your needs (see How to change the top menu (top navigation bar) of PHP-Nuke and how to remove the search box from the top menu of PHP-Nuke). A similar technique is used in the Odyssey theme, where one uses the contents of themes/Odyssey/left_center.html, additionally to themes/Odyssey/header.html.


Site Info v2.2.2

Last SeenLast Seen
Server TrafficServer Traffic
  • Total: 339,303,038
  • Today: 10,368
Server InfoServer Info
  • Oct 23, 2017
  • 02:35 am PDT

Daily Inspiration