How to change placement of the banner in the PHP-Nuke header

14.3.6. How to change placement of the banner in the PHP-Nuke header

Sometimes the banner will appear at a position that you would feel is unfavourable for your theme and overall appearence of your site (of course, only if you enabled the banner functionality in the administration panel, see Section 7.1). The code that controls whether the banner will appear or not, is a few lines long:

if ($banners == 1) {

and is found in the themeheader() function of the theme.php file. You don't need to bother about the included file, banners.php, that actually does all the job of selecting and displaying the appropriate banner, keeping banner statistics up-to-date and all that stuff. All you need is find out where to place those 3 lines in order to achieve the desired banner placement. As this is a highly theme dependent topic, there are no general recipes. Just move the 3-liner around in themeheader() to get a feeling of the various elements and their positions, then experiment a little to find the right one for you. You might, for example, choose to include it in a table layout and echo it directly after the HTML <body> line:

echo "<body bgcolor=\"#ffffff\" topmargin=\"0\" 
leftmargin=\"0\" marginheight=\"0\" marginwidth=\"0\">\n\n"
."<table cellpadding=\"0\" cellspacing=\"0\" 
 width=\"100%\" border=\"0\" bgcolor=\"#6487dc\"><tr>\n"
."<td bgcolor=\"#6487dc\" align=\"left\" 
 valign=\"top\" width=\"20%\"><br>
<a href=\"index.php\"><img src=\"themes/subSilver/images/logo.gif\" 
 align=\"left\" alt=\""._WELCOMETO
." $sitename\" border=\"0\"></a><br></td>\n"
."</td><td bgcolor=\"#6487dc\" align=\"right\">";
if ($banners) {
  echo "<br>";
  echo "<br>";

See Banner placement and banner next to logo for a discussion of banner placement in PHP-Nuke.


Site Info v2.2.2

Last SeenLast Seen
Server TrafficServer Traffic
  • Total: 373,162,298
  • Today: 74,649
Server InfoServer Info
  • Dec 12, 2018
  • 04:04 pm CET