943,489 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 22969
  • PHP RSS
Mar 11th, 2004
0

PHP-Nuke Tutorial #1: Altering the Header Tags

Expand Post »
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 <head> and </head> 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 "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html;
charset="._CHARSET."\">\n";
echo "<META HTTP-EQUIV=\"EXPIRES\" CONTENT=\"0\">\n";
echo "<META NAME=\"RESOURCE-TYPE\" CONTENT=\"DOCUMENT\">\n";
echo "<META NAME=\"DISTRIBUTION\" CONTENT=\"GLOBAL\">\n";
echo "<META NAME=\"AUTHOR\" CONTENT=\"$sitename\">\n";
echo "<META NAME=\"COPYRIGHT\" CONTENT=\"Copyright (c) 2003 by $sitename\">\n";
echo "<META NAME=\"KEYWORDS\" CONTENT=\"News, news, New, new, Technology, technology, Headlines, headlines, Nuke, nuke, PHP-Nuke, phpnuke, php-nuke, Geek, geek, Geeks, geeks, Hacker, hacker, Hackers, hackers, Linux, linux, Windows, windows, Software, software, Download, download, Downloads, downloads, Free, FREE, free, Community, community, MP3, mp3, Forum, forum, Forums, forums, Bulletin, bulletin, Board, board, Boards, boards, PHP, php, Survey, survey, Kernel, kernel, Comment, comment, Comments, comments, Portal, portal, ODP, odp, Open, open, Open Source, OpenSource, Opensource, opensource, open source, Free Software, FreeSoftware, Freesoftware, free software, GNU, gnu, GPL, gpl, License, license, Unix, UNIX, *nix, unix, MySQL, mysql, SQL, sql, Database, DataBase, Blogs, blogs, Blog, blog, database, Mandrake, mandrake, Red Hat, RedHat, red hat, Slackware, slackware, SUSE, SuSE, suse, Debian, debian, Gnome, GNOME, gnome, Kde, KDE, kde, Enlightenment, enlightenment, Interactive, interactive, Programming, programming, Extreme, extreme, Game, game, Games, games, Web Site, web site, Weblog, WebLog, weblog, Guru, GURU, guru, Oracle, oracle, db2, DB2, odbc, ODBC, plugin, plugins, Plugin, Plugins\">\n";
echo "<META NAME=\"DESCRIPTION\" CONTENT=\"$slogan\">\n";
echo "<META NAME=\"ROBOTS\" CONTENT=\"INDEX, FOLLOW\">\n";
echo "<META NAME=\"REVISIT-AFTER\" CONTENT=\"1 DAYS\">\n";
echo "<META NAME=\"RATING\" CONTENT=\"GENERAL\">\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 "<META NAME=\"GENERATOR\" CONTENT=\"PHP-Nuke $Version_Num - Copyright 2003 by http://phpnuke.org\">\n";
?>
[/php]

In order to customise your keywords you merely have to alter the echo "<META NAME=\"KEYWORDS\" CONTENT=\" line. Put in the keywords that your site will be using. You can change any other metatag information on this screen as well, but strictly speaking it is not necessary the preloaded metatags are probably ok for your site.

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 <head> and </head> 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 '<LINK REL="SHORTCUT ICON" HREF="http://www.yoursite.com/favicon.ico">';

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.
Last edited by happygeek; Oct 28th, 2006 at 11:30 am. Reason: Formatting
Similar Threads
Reputation Points: 89
Solved Threads: 5
Junior Poster in Training
TheComputerGeek is offline Offline
53 posts
since Mar 2004
Jun 8th, 2004
0

Re: PHP-Nuke Tutorial #1: Altering the Header Tags

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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Sideshow Bob is offline Offline
18 posts
since Jun 2004
Sep 8th, 2004
0

Re: PHP-Nuke Tutorial #1: Altering the Header Tags

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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
nickhg is offline Offline
1 posts
since Sep 2004
Dec 18th, 2004
0

Re: PHP-Nuke Tutorial #1: Altering the Header Tags

Quote originally posted by SEO Bob ...
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:
Reputation Points: 16
Solved Threads: 3
Junior Poster
mikeSQL is offline Offline
196 posts
since Dec 2004
Dec 24th, 2004
0

Re: PHP-Nuke Tutorial #1: Altering the Header Tags

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. 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!
Reputation Points: 16
Solved Threads: 3
Junior Poster
mikeSQL is offline Offline
196 posts
since Dec 2004
Feb 19th, 2005
0

Re: PHP-Nuke Tutorial #1: Altering the Header Tags

great tut thanks alot ill try and use it on my site
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Ignite is offline Offline
12 posts
since Feb 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Newbie Question - Hiding php extension
Next Thread in PHP Forum Timeline: mysql_connect





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC