How do I edit the header.php on phpnuke?

Status
Not open for further replies.

Ferinos

New Member
Messages
69
Reaction score
0
Points
0
Hi, I am a total newbie at web designing, and especially php nuke. I need to edit the header.php to insert the code for the text/banner link. If anyone could give me instructions on how to do this, I would be most grateful,
#Thanks in advance,
Ferinos

PS, could someone tell me if this is posted somewhere else? I checked this forum and couldn't find it, so sorry in avance if I missed it. Cheers peeps, PS2 urgent replies required Cheers!!
 

Fedlerner

Former Adm & Team Manager
Community Support
Messages
12,934
Reaction score
6
Points
38
You need to edit it with an FTP client, or with the File Manager of cPanel.
You'll need to edit the header.php, and insert the PHP code in the very top of the header. Do it and tell us if it worked for you ;)
 

Zenax

Active Member
Messages
1,377
Reaction score
4
Points
38
What you need to do is to login to cPanel. From their navigate to your File manager.

Once you have done that, open the WWW directory and then navigate to the main folder where you have PHP NUKE installed.

Once there, find a file callsed header.php

Click on the name of the file, and the box in the top right will change to a list of options that you can do to that file.

Click on "Edit this file".

A new window will open and a editor for that file will appear.

For corperate place this at the very top:
PHP:
<div align="center">
<? include("http://staff.x10hosting.com/adCode.php?ad=corporate"); ?>
</div>

For Advanced place this at the very top:
PHP:
<div align="center">
<? include("http://staff.x10hosting.com/adCode.php?ad=advanced"); ?>
</div>

I hope this helps you

Regards,
Zenax
 

Ferinos

New Member
Messages
69
Reaction score
0
Points
0
K, I did that, went to my site to check it and it's taking ages to oad. I'll try later, in the meantime, can someone tell me how long I have b4 my account gets terminated for no ad, and who I can talk to about my probs, so that I might not get banned, this site means a lot to both me and my clan, for over a year we've been trying to get a decent site, we cannot lose this, so please, post the admin/site owners username so I can contact him.
 

Ferinos

New Member
Messages
69
Reaction score
0
Points
0
Ok, thats slowed my site right down, I waited, and it said it took 2 mins to generate the home page, and that's only since I modified the footer.php, and it still doesn't show up. I get this standard footer message about licensed by php view the licence here, registere by blah blah, but no text link!

Is it me doing something wrong still, please help, before I tear my hair out completely!!!
 

Ferinos

New Member
Messages
69
Reaction score
0
Points
0
My site is at normal speed again now, after I removed the code from the footer, which still wouldn't display. Also, I uploaded the theme sub black how the instructions said to, and it isn't listed in my account themes, or my site themes.

I have downloaded the theme subblack from a php theme download site, if anyone could give me EXACT instructions on how to upload this for use on my site/member profiles, as I have never done anything like this before, I would be most grateful, cheers peeps.
 
Last edited:

Ferinos

New Member
Messages
69
Reaction score
0
Points
0
Ok, here's the footer code for my site without any editing. I cannot get it to display with the text link, so could someone please modify it with the advanced text code, place it where it needs to be, then paste the whole thing in a reply? Cheers peeps, my footer is;;
PHP:
<?php

/************************************************************************/
/* PHP-NUKE: Advanced Content Management System                         */
/* ============================================                         */
/*                                                                      */
/* Copyright (c) 2005 by Francisco Burzi                                */
/* [url]http://phpnuke.org[/url]                                                   */
/*                                                                      */
/* 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(htmlentities($_SERVER['PHP_SELF']), "footer.php")) 
    Header("Location: index.php");
    die();
}

define('NUKE_FOOTER', true);

function footmsg() {
    global $foot1, $foot2, $foot3, $copyright, $total_time, $start_time, $commercial_license, $footmsg;
    $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;
    $footmsg = "<span class=\"footmsg\">\n";
    if (!empty($foot1))     $footmsg .= $foot1."<br>\n";
    }
    if (!empty($foot2)) {
        $footmsg .= $foot2."<br>\n";
    }
    if (!empty($foot3)) {
        $footmsg .= $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: [url]http://phpnuke.org/modules.php?name=Commercial_License[/url]
    // PLAY FAIR AND SUPPORT THE DEVELOPMENT, PLEASE!
    if ($commercial_license == 1) {
        $footmsg .= $total_time."<br>\n</span>\n";
    } else {
        $footmsg .= $copyright."<br>$total_time<br>\n</span>\n";
    }
    echo $footmsg;
}

function foot() {
    global $prefix, $user_prefix, $db, $index, $user, $cookie, $storynum, $user, $cookie, $Default_Theme, $foot1, $foot2, $foot3, $foot4, $home, $name, $admin, $commercial_license;
    if(defined('HOME_FILE')) {
        blocks("Down");
    }
    if (basename($_SERVER['PHP_SELF']) != "index.php" AND defined('MODULE_FILE') AND file_exists("modules/$name/copyright.php") && $commercial_license != 1) {
        $cpname = str_replace("_", " ", $name);
        echo "<div align=\"right\"><a href=\"javascript:openwindow()\">$cpname &copy;</a></div>";
    }
    if (basename($_SERVER['PHP_SELF']) != "index.php" AND defined('MODULE_FILE') 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 "</body>\n</html>";
        ob_end_flush();
    die();


foot();


?>

Exactly like that. Thanks.

edit by Chris Z-i
PHP:
ed your code
 
Last edited by a moderator:

Zenax

Active Member
Messages
1,377
Reaction score
4
Points
38
I said that you should modify the header so that the ads will appear at the very top of the page.

PHP:
<?php 

/************************************************************************/ 
/* PHP-NUKE: Advanced Content Management System                         */ 
/* ============================================                         */ 
/*                                                                      */ 
/* Copyright (c) 2005 by Francisco Burzi                                */ 
/* [url]http://phpnuke.org[/url]                                                   */ 
/*                                                                      */ 
/* 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(htmlentities($_SERVER['PHP_SELF']), "footer.php"))  
    Header("Location: index.php"); 
    die(); 
} 

define('NUKE_FOOTER', true); 

function footmsg() { 
    global $foot1, $foot2, $foot3, $copyright, $total_time, $start_time, $commercial_license, $footmsg; 
    $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; 
    $footmsg = "<span class=\"footmsg\">\n"; 
    if (!empty($foot1))     $footmsg .= $foot1."<br>\n"; 
    } 
    if (!empty($foot2)) { 
        $footmsg .= $foot2."<br>\n"; 
    } 
    if (!empty($foot3)) { 
        $footmsg .= $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: [url]http://phpnuke.org/modules.php?name=Commercial_License[/url] 
    // PLAY FAIR AND SUPPORT THE DEVELOPMENT, PLEASE! 
    if ($commercial_license == 1) { 
        $footmsg .= $total_time."<br>\n</span>\n"; 
    } else { 
        $footmsg .= $copyright."<br>$total_time<br>\n</span>\n"; 
    } 
    echo $footmsg; 
} 

function foot() { 
    global $prefix, $user_prefix, $db, $index, $user, $cookie, $storynum, $user, $cookie, $Default_Theme, $foot1, $foot2, $foot3, $foot4, $home, $name, $admin, $commercial_license; 
    if(defined('HOME_FILE')) { 
        blocks("Down"); 
    } 
    if (basename($_SERVER['PHP_SELF']) != "index.php" AND defined('MODULE_FILE') AND file_exists("modules/$name/copyright.php") && $commercial_license != 1) { 
        $cpname = str_replace("_", " ", $name); 
        echo "<div align=\"right\"><a href=\"javascript:openwindow()\">$cpname &copy;</a></div>"; 
    } 
    if (basename($_SERVER['PHP_SELF']) != "index.php" AND defined('MODULE_FILE') 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 "</body>\n</html>"; 
        ob_end_flush(); 
    die(); 


foot(); 



?> 

<div align="center"> 
<? include("http://staff.x10hosting.com/adCode.php?ad=advanced"); ?> 
</div>

But if you really want the ads in the footer, replace the footer code with what is in the modified version above. However this will only work on the advanced plan, as you know corperate plan requires the ads to be at the top of the page. This code has been modified so that it displays the advanced ads.

If you are on the corperate plan, PM me and I shall guide you into placing the corperate plan ads in.

EDIT: Make sure you place the code after the code of PHP NUKE, which means placing outside the end PHP tag, like shown above.
 
Last edited:

Ferinos

New Member
Messages
69
Reaction score
0
Points
0
Ok, I tried both of those codes, both of them slowed my site down, but not as much as before, just a lil bit, and neither worked. Could someone else check my site @ www.hawksclan.exofire.net/home and tell me if its just me that cant see it, ps, I couldn't see ANY footer.
And who can I goto and ask not to terminate my site because I am trying to obey the rules, like I said we need this site badly.
cheers peeps, ps, im a firefox (;latest version user) could this be the prob, I don't recall seeing anything about ff/ie etc.
 

Zenax

Active Member
Messages
1,377
Reaction score
4
Points
38
Ferinos PM me with your account details, I shall gladly fix this for you, if you want me too!
 

Kansy

Community Advocate
Community Support
Prime Account
Messages
2,621
Reaction score
9
Points
38
just say an email and modify the files for him, or let him make a momentany FTP account for you.

Im not saying that he cant trust you but Its better keep yopur own accounts to you :p
 

Ferinos

New Member
Messages
69
Reaction score
0
Points
0
Thanks to everyone who posted here, I finally got my code to display, thanks again peeps!
Feri
 

Zenax

Active Member
Messages
1,377
Reaction score
4
Points
38
We discussed it over PM and we decided that I would make a tutorial for him with images explaining how to do it.

Regards,
Zenax

EDIT: If it is a success with Ferinos, I will change my current tutorial on this to the one I have created.
 
Status
Not open for further replies.
Top