Dynamic Meta keywords and description,PhpNuke
Hi all,
Even that PhpNuke is a popular CMS, still it has not implemented in a way that it can generate dynamic Meta keywords purchase levitra or descriptions for its pages. Fortunately, there are many modules to deal with this problem. They are easy to install, but really I can not make them run properly on my site. … No prob. I got angry and found a solution for my problem in my way.
download:
dynamic_meta_keywords_and_description_for_phpnuke
In the beginning we should understand the structure of the PhpNuke Meta generation. Just by looking on the folder (includes) you will find a file called (meta.php). That file is the one responsible for adding Meta for your site pages. blah blah blah …… jump!
Open (meta.php) find those lines:
$metastring .= “<META NAME=\”KEYWORDS\” CONTENT=\”……. “>\n”;
$metastring .= “<META NAME=\”DESCRIPTION\” CONTENT=\”…….”\”>\n”;
What we need is to replace the CONTENT value by our dynamic values.
* Dynamic KEYWORDS:
westernunion kentucky left; direction: ltr; unicode-bidi: embed;”>
First we need to download this module.
price cialis style=”font-size: medium;”>
After that you will need to upload (dynamic_titles.php) to (includes). Then open (header.php), find:
levitra buy medium;”>echo “<title>$sitename $pagetitle</title>\n”;
Change it to:
include(“includes/dynamic_titles.php”);
//echo “<title>$sitename $pagetitle</title>\n”;
Now open (meta.php) find this line:
$metastring .= “<META NAME=\”KEYWORDS\” CONTENT=\”……. “>\n”;
Change it to:
$metastring .= “<META NAME=\”KEYWORDS\” CONTENT=\”$newpagetitle, …any constant text….\”>\n”;
This will add the page title to the keywords of the page.
* Dynamic DESCRIPTION:
Now open (meta.php) find this line:
$metastring .= “<META NAME=\”DESCRIPTION\” CONTENT=\”…….”\”>\n”;
Change it to:
//dynamic DESCRIPTION
if ($_GET["sid"]!=”){
$dynamic_DESCRIPTION = $db->sql_fetchrow($db->sql_query(“SELECT hometext FROM “.$prefix.”_stories WHERE sid=’”.$_GET["sid"].”‘”));
$dynamic_DESCRIPTION = filter($dynamic_DESCRIPTION['hometext'], “nohtml”);
$metastring .= “<META NAME=\”DESCRIPTION\” CONTENT=\”".$dynamic_DESCRIPTION.”\”>\n”;}
else{
//it is not an article, generate the normal description.
$metastring .= “<META NAME=\”DESCRIPTION\” CONTENT=\”$newpagetitle, …any constant text….\”>\n”;
}
You may notice the word (“hometext”) in the select query. It is because PhpNuke use it to store the introduction part of the article, where the remaining text should be stored in the bodytext.
At this level, both of your site KEYWORDS and DESCRIPTION meta are dynamics.
All the best.
Related posts:
This entry was posted by AL YAMANI on February 9, 2009 at 8:22 pm, and is filed under Web. Follow any responses to this post through RSS 2.0.You can leave a response or trackback from your own site.
- Read feedburner awareness api using php simplexml_load_file()
- pligg, stories with no comments
- pligg avatar based on user id
- write text on image using php
- setting up a proxy server for small building lan
- easy way to pass odesk reading test
- Own a website in no time and with no fees
- installing mysql, php , apache on ubuntu
- easy java image Box, my way
- Easy Energy have charging their way
very nice explaination
hopefully it will be very usefull for all php nuke users