954,123 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

PHP-Nuke Tutorial #1: Altering the Header Tags

Intro

PHP-Nuke comes preloaded with a lot of metatag information, however the keywords pre-installed are not likely to be very useful for your site. The keywords are keywords that are for a PHP-Nuke information site so unless that is what you are creating you will want to change the metatag information. You may also wish to alter the header information codes, i.e. anything that comes between the and tags. PHP-Nuke v7 does not have an administrator module to alter these settings on the fly, however changing them is not all that difficult.

Metatags

The metatag information is stored in the meta.php file that resides in the yourphpnukedir/includes/ folder. Here is what the meta.php looks like on install:

[php]
<?php
/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2002 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 (eregi("meta.php",$_SERVER['PHP_SELF'])) {
Header("Location: ../index.php");
die();
}

##################################################
# Include for Meta Tags generation #
##################################################
echo "\n";
echo "\n";
echo "\n";
echo "\n";
echo "\n";
echo "\n";
echo "\n";
echo "\n";
echo "\n";
echo "\n";
echo "\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!
echo "\n";
?>
[/php]

In order to customise your keywords you merely have to alter the echo "Other header tags

All other header tags belong in the my_header.php file, which is also in yourphpnukedir/includes/ folder. Here is what that file looks like upon install:

[php]
<?php
/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2002 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. */
/************************************************************************/
/*
[/php]

This file is to customize whatever stuff you need to include in your site when the header loads. This can be used for third party banners, custom javascript, popup windows, etc. With this file you don't need to edit system code each time you upgrade to a new version. Just remember, in case
you add code here to not overwrite this file when updating!

Whatever you put here will be between and tags.
*/
?>
This file is blank to begin with, however if you want to add anything too your page that should be written between the header tags this is where it would be placed. For example if you wanted to include a favicon line it would look like this:

echo '';

Notice the single quotes around the echo statement so that you can use double quotes within the LINK REL tag. It is crucial that you do not use the same quote styles for both the tag and the echo.

TheComputerGeek
Junior Poster in Training
54 posts since Mar 2004
Reputation Points: 89
Solved Threads: 5
 

ComputerGeek,

do you have any experience in making the meta-tags dynamic in php-nuke? From a search engine standpoint, it's bad form to have the keywords static on every page - they should be unique and reflect the content that is actually on the page instead of site wide.

Sideshow Bob
Newbie Poster
18 posts since Jun 2004
Reputation Points: 10
Solved Threads: 0
 

when I was first Nuke'ing I had this problem :

search engines want unique pages , they want unique meta tags for keywords and description.

hacking the meta.php in Nuke is fine if you want a set of keywords and description to run through every page on your new site i.e. mysite,its, great
and "my site is great and you should go and see it now "

but search engines want variety and for this reason I was stumped ! So I found a module that sort of did the job and I hacked it so it would incorporate both Nuke news stories and the content pages

it's been implemented on a number of my sites and works well , it's very easy to add and edit keywords from the admin panel.

The forum on this addon
http://www.voice-changer.net/seo/forum6.html
The Download
http://www.voice-changer.net/seo/downloads-file-3.html
The main site http://www.voice-changer.net/seo/index.html

nickhg
Newbie Poster
1 post since Sep 2004
Reputation Points: 10
Solved Threads: 0
 

ComputerGeek,

do you have any experience in making the meta-tags dynamic in php-nuke? From a search engine standpoint, it's bad form to have the keywords static on every page - they should be unique and reflect the content that is actually on the page instead of site wide.


I am and I can say that Jeff is correct on this too. I also can say that I know for a fact that it works great as well. You shuold try it!

Also would like Jeff to post this tutorial on my site if he is up to it. :cheesy:

mikeSQL
Junior Poster
196 posts since Dec 2004
Reputation Points: 16
Solved Threads: 3
 

Oh and btw, just upgrade and that will be taken care of. You can also see that in other versions such as yours, compare it to the new veersion like 7.5, it has no diffrences. So meaning theyve fixed that problem in 7.6x. HOwever, this wasent done in YOURTHEME/header.html or header.php, it wa altered somewhere else. :D I ust thought about that th e other day and had to come back and post. Cant tell me anything new about PHPNuke. Infact, many people are loosing intrest in it as we speak like myself. SMILE!

mikeSQL
Junior Poster
196 posts since Dec 2004
Reputation Points: 16
Solved Threads: 3
 

great tut thanks alot ill try and use it on my site

Ignite
Newbie Poster
12 posts since Feb 2005
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You