View Full Version : PHPNuke, Text links above header?
fultz
07-04-2006, 09:35 AM
Okay, I'm back with another question already. This one should be much easier though.
I know how to create links and stuff, but im a bit stumped. By default, the theme I am editing to create my theme has a header at the top (it's actually two sliced images) What I want to do is move the entire site down a few lines and make the background above the header the same peach color as the rest of the sites background so that I can add a few simple text links above my header.
I could just as easily do what needs to be done up there in the footer, but I believe by adding the links up top it will add balance to the design I am making since right now it looks like my page is glued to the top of my browser and there's nothing to balance out the top part of the site where the header is.
Also, if you take a look at the footer, for some reason the background color I have defined for the outside of php-nuke is showing through on the footer. I want the footer to display the same color background as the body of the site, there is a file called footer.php and theme.php but I don't see that color on either of them, except as defined for the outside of the page. Is there any way I can change it to match the rest of the site?
You can view my site here: http://www.gn.aerohostale.com/nuke/index.php
erisco
07-04-2006, 10:52 AM
Here we go again! Is this going to exceed our last post count? :P
For the footer.php actually doesn't have any background at all. However we can give it one.
<?php
/************************************************************************/
/* PHP-NUKE: Advanced Content Management System */
/* ============================================ */
/* */
/* Copyright (c) 2005 by Francisco Burzi */
/* http://phpnuke.org */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/
if (stristr($_SERVER['SCRIPT_NAME'], "footer.php")) {
Header("Location: index.php");
die();
}
$footer = 1;
function footmsg() {
global $foot1, $foot2, $foot3, $copyright, $total_time, $start_time, $commercial_license;
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$end_time = $mtime;
$total_time = ($end_time - $start_time);
$total_time = ""._PAGEGENERATION." ".substr($total_time,0,4)." "._SECONDS."";
echo "<div style=\"width:100%;height:100%;background-color:#ffc790;\"> "; // Begin footer background
echo "<font class=\"footmsg\">\n";
if ($foot1 != "") {
echo "$foot1<br>\n";
}
if ($foot2 != "") {
echo "$foot2<br>\n";
}
if ($foot3 != "") {
echo "$foot3<br>\n";
}
// DO NOT REMOVE THE FOLLOWING COPYRIGHT LINE. YOU'RE NOT ALLOWED TO REMOVE NOR EDIT THIS.
// IF YOU REALLY NEED TO REMOVE IT AND HAVE MY WRITTEN AUTHORIZATION CHECK: http://phpnuke.org/modules.php?name=Commercial_License
// PLAY FAIR AND SUPPORT THE DEVELOPMENT, PLEASE!
if ($commercial_license == 1) {
echo "$total_time<br>\n</font>\n";
} else {
echo "$copyright<br>$total_time<br>\n</font>\n";
}
}
function foot() {
global $prefix, $user_prefix, $db, $index, $user, $cookie, $storynum, $user, $cookie, $Default_Theme, $foot1, $foot2, $foot3, $foot4, $home, $module, $name, $admin, $commercial_license;
if ($home == 1) {
blocks(Down);
}
if ($module == 1 AND file_exists("modules/$name/copyright.php") && $commercial_license != 1) {
$cpname = ereg_replace("_", " ", $name);
echo "<div align=\"right\"><a href=\"javascript:openwindow()\">$cpname ©</a></div>";
}
if ($module == 1 AND (file_exists("modules/$name/admin/panel.php") && is_admin($admin))) {
echo "<br>";
OpenTable();
include("modules/$name/admin/panel.php");
CloseTable();
}
themefooter();
if (file_exists("includes/custom_files/custom_footer.php")) {
include_once("includes/custom_files/custom_footer.php");
}
echo "</div>"; // End footer backgrounds
echo "</body>\n"
."</html>";
die();
}
foot();
?>
Try that footer.php instead and lets see where it gets you.
fultz
07-04-2006, 01:27 PM
lol, it just may, but as always, im happy to have help from someone that knows their stuff.
Using that footer.php does indeed give it a peach background, but for some reason some of the gray background is showing through in a little 10 pixel or so line.
http://www.gn.aerohostale.com/nuke/
I do want to ask something more specific, though. I *may* be making more than one theme, so if the global footer.php file needs to be edited I suppose my question is, What if I want two themes with two different background colors and I want the footer to look correctly in both themes?
erisco
07-04-2006, 03:00 PM
Well if it is not automated, then you will have to edit it manually.
There is going to be a table cell or something that is making that 'line' in either the footer.php or the theme.php, it's YOUR turn to take a look now :)
fultz
07-04-2006, 03:20 PM
What do you mean by "If it is not automated, you will have to edit it manually"?
I'll look for the table cell, I really need to start doing some of the coding myself anyway, I do want to learn.
Can you tell me what a table cell looks like so I know what im looking for?
EDIT: I think I may have found it, but before I muck it up I'd like your confirmation.
function themefooter() {
global $index;
echo "<br>";
if ($index == 1) {
echo "</td><td><img src=\"themes/DeepBlue/images/pixel.gif\" width=\"10\" height=\"1\" border=\"0\" alt=\"\"></td><td valign=\"top\" width=\"138\" bgcolor=\"ffc790\">\n";
blocks(right);
echo "<td><img src=\"themes/DeepBlue/images/pixel.gif\" width=\"6\" height=\"1\" border=\"0\" alt=\"\">";
}
else {
echo "</td><td colspan=\"2\"><img src=\"themes/DeepBlue/images/pixel.gif\" width=\"10\" height=\"1\" border=\"0\" alt=\"\">";
}
echo "<br><br></td></tr></table>\n"
."<br><center>";
footmsg();
echo "</center>";
}
I found that in the themefooter section of my theme.php file, 10 pixels sounds about right, could that be the problem?
BTW, how can I have more than one background if theres only one footer.php file but I want multiple themes?
erisco
07-04-2006, 03:32 PM
Table cell is a <td> tag, also I don't think that is the section you are looking for.
Take a look at the source of the page, and look at the html. You will be able to spot the problem in there, then go back to the PHP scripts and see where that code is put into the page.
BTW, how can I have more than one background if theres only one footer.php file but I want multiple themes?
What do you mean by "If it is not automated, you will have to edit it manually"?
You answered yourself.
fultz
07-04-2006, 03:39 PM
Table cell is a <td> tag, also I don't think that is the section you are looking for.
Take a look at the source of the page, and look at the html. You will be able to spot the problem in there, then go back to the PHP scripts and see where that code is put into the page.
You answered yourself.
I don't see how I answered myself... I want two themes seperate themes for the same installation of php-nuke to work in contrast with each other, and both themes will have different background colors. If there is only one footer.php, even if I did edit it manually, it would override the color for the first theme. There would always be one theme with the wrong background color.
Unless there is some way to make the footer a different background color using just the theme.php file or the style sheet, I don't see how it would be possible and it must be possible because i've seen it done before.
I'll take your advice on the table tag and have a look at the source. Thanks :)
erisco
07-04-2006, 03:44 PM
If you want both templates to work simultaneously, then you will have to setup an if statement. The trick is identifying which is being used... how are you switching between the templates?
fultz
07-04-2006, 03:45 PM
In the user control panel, users can choose which template they want to use to view the site, in the admin panel, you can control a global default template for the users to view the site.
I have looked at the HTML page source, the closest table cell tag I see to the footer is
<tr><td width="138" bgcolor="#ffffff">
<br><center><font class="content">
<a href="http://phpnuke.org"><img src="images/powered/powered5.jpg" border="0" alt="Powered by PHP-Nuke" title="Powered by PHP-Nuke" width="88" height="31"></a>
<br><br>
<a href="http://validator.w3.org/check/referer"><img src="images/html401.gif" width="88" height="31" alt="Valid HTML 4.01!" title="Valid HTML 4.01!" border="0"></a>
<br><br>
<a href="http://jigsaw.w3.org/css-validator"><img src="images/css.gif" width="88" height="31" alt="Valid CSS!" title="Valid CSS!" border="0"></a></font></center><br></td></tr></table></td></tr></table><br><td><img src="themes/DeepBlue/images/pixel.gif" width="6" height="1" border="0" alt=""><br><br></td></tr></table>
<br><center><div style="width:100%;height:100%;background-color:#ffc790;"> <font class="footmsg">
<a href="http://gn.aerohostale.com/nuke/admin.php">Admin Panel</a> | <a href="">Privacy Policy</a> | <a href="">Terms of Use</a> | <a href="mailto:armedgamer@gmail.com">Contact Us</a><br>
<br><a href="http://phpnuke.org"><font class="footmsg_l">PHP-Nuke</font></a> Copyright © 2005 by Francisco Burzi.</font></a> Armed Gamer, it's themes and logos are Copyright © 2006 Armed Gamer Inc.<br>Page Generation: 0.25 Seconds<br>
</font>
</center></div></body>
</html>
At the very top of the code. Could that be the problem?
erisco
07-04-2006, 03:48 PM
Something changed from last night... you are getting an old error.
Second last line needs to have </tr></td></table> before the </div>
fultz
07-04-2006, 03:49 PM
Where would I find that code? It's not in the footer.php...
erisco
07-04-2006, 04:33 PM
if it is not in the footer, check the theme.
fultz
07-04-2006, 04:50 PM
I loaded the theme.php into notepad and searched with the search command for </center></div></body> and nothing came up. I've also check the header.php and a couple of the blocks and none of them have that code. :(
vBulletin® v3.6.7, Copyright ©2000-2010, Jelsoft Enterprises Ltd.