I searching and searching for a Dynamic Meta Tag Mod. I use the Dynamic Title Mod, it works great. But I wish to have unique discription tags also, not the run of site tags.
I found Dymetakeys here:
Only registered users can see links on this board! Get registered or login to the forums!
but that is very old and only does the news articles, I need the forums, FAQ's, reviews...
I also found related discussions about phpnukeseopack.zip here:
Only registered users can see links on this board! Get registered or login to the forums!
but all the links are useless.
Any ideas where I could find a Dynamic Meta Tag Mod?
Our approach for nukeSEO will be meta keywords by module, rather than fully dynamic meta keys. If you use dynamic meta keys for user-submitted content, you might use some inappropriate meta keywords... How should it decide which keywords to use dynamically?
Our approach for nukeSEO will be meta keywords by module, rather than fully dynamic meta keys. If you use dynamic meta keys for user-submitted content, you might use some inappropriate meta keywords... How should it decide which keywords to use dynamically?
I am not so much concerned about keyword meta, I am more concerned about discription.
For discription, i would love it to either pull the Title and the first 150 charactors of content in all forum posts/topics and for all other mods just the Title.
The actual description itself is not important to me, the uniqueness of the description vs a run of site one is.
I do it with a modified version of dynamic title.
I have a meta.php file for each module, that grab title and 150 characters from the content.
The only problem is with BBCODE in forums.
If you query from database you could get something like this
Code:
Why dry and store?
[size=24:2199834232] EAT!!!!!!!!![/size:2199834232] :D :D :D :wink:
That is really not a good description....
You can strip out HTML quite easy in PHP, but what about bbcodes?
Guido
I do it with a modified version of dynamic title.
I have a meta.php file for each module, that grab title and 150 characters from the content.
The only problem is with BBCODE in forums.
If you query from database you could get something like this
Code:
Why dry and store?
[size=24:2199834232] EAT!!!!!!!!![/size:2199834232] :D :D :D :wink:
That is really not a good description....
You can strip out HTML quite easy in PHP, but what about bbcodes?
Guido
This is the meta.php for encyclopedia, because I disabled it in forums for the bbcoode and News on my site are disabled.
It's a cooking site so on my home I have the recipes module so i have metadescription for Recipes, Ingredients, Encyclopedia, Docs.
Anyway it's not very hard to call database for the needed tables.
Please note: I'm almost a complete php dumbass, so i've probably made mistakes. It works on my site but no warranties!
Note2: This was made for phpnuke 6.9 patched 2.8
Code:
<?php
# $Author: chatserv $
# $Date: 2004/11/01 03:56:44 $
/************************************************************************/
/* 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 (stristr($_SERVER['SCRIPT_NAME'], "meta.php")) {
Header("Location: ../index.php");
die();
}
global $name;
include ("config.php");
include("db/db.php");
// encyclopedia
if($name=="Encyclopedia"){
global $op,$eid,$tid, $desc;
if($op=="list_content") {
$sql="SELECT eid, description FROM nuke_encyclopedia WHERE eid='$eid'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$desc = $row[description];
$MyNewDesc = "$desc";
}
if($op=="terms") {
$sql="SELECT eid, title FROM nuke_encyclopedia WHERE eid=$eid";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$texto = $row[title];
$MyNewDesc = "Alphabetical list of terms contained in $texto encyclopedia";
}
if($op=="content") {
$sql="SELECT tid, title text, eid FROM nuke_encyclopedia_text WHERE tid='$tid'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$term = $row[text];
$MyNewDesc = "$term";
}
}
###############################################
# DO NOT REMOVE THE FOLLOWING COPYRIGHT LINE! #
# YOU'RE NOT ALLOWED TO REMOVE NOR EDIT THIS. #
###############################################
I am sure, a php expert could do much better, without all those calls to the database, but for my limited skills, this was the easiest way.
Do not shoot on the pianist!
Guido
Correct.
You need to create a meta.php for each module.
The one i posted here is only for Encyclopedia, for the forums, you need to change the queries to the database and so for reviews, FAQ, and every other module you need.
Guido
Correct.
You need to create a meta.php for each module.
The one i posted here is only for Encyclopedia, for the forums, you need to change the queries to the database and so for reviews, FAQ, and every other module you need.
Guido
Ok here it is.
It doesnt work good.
I did not find a way to remove bbcodes, smilies , and other strange things (like ascii art) from the text of a post.
I think this is pretty much useless, but maybe you can find a way to adapt for your needs.
About reviews: I do not have it done.
Code:
<?php
# $Author: chatserv $
# $Date: 2004/11/01 03:56:44 $
/************************************************************************/
/* 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 ( !defined('MODULE_FILE') )
{
die("You can't access this file directly...");
}
define('INDEX_FILE', true);
global $name;
include ("config.php");
include("db/db.php");
// ---> This generates the desc for module----> Forums
if($name=="Forums"){
global $p,$t,$forum,$f, $first_post;
$MyNewdesc = "Our forum section ";
if($p) {
$sql = "SELECT post_subject, post_id, post_text FROM ".$prefix."_bbposts_text WHERE post_id='$p'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$title = $row[post_subject]; //post subject
$post = $row[post_id]; //post id
$text = $row[post_text]; //post text
$MyNewdesc = "$title: $text";
}
if($t) {
$sql = "SELECT topic_title, topic_first_post_id, forum_id FROM ".$prefix."_bbtopics WHERE topic_id='$t'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$title = $row[topic_title]; //topic title
$forum = $row[forum_id]; //id of the forum the topic belongs to
$first_post = $row[topic_first_post_id]; // id of first post in the topic
$sql = "SELECT forum_name FROM ".$prefix."_bbforums WHERE forum_id='$forum'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$forum = $row[forum_name]; //forum name
$sql = "SELECT post_subject, post_id, post_text FROM ".$prefix."_bbposts_text WHERE post_id='$first_post'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$post = $row[post_id]; // id of first post in topic
$text = $row[post_text]; //text of the first post in topic
$MyNewdesc= "$title: $text";
}
elseif($f) {
$sql = "SELECT forum_name, forum_desc FROM ".$prefix."_bbforums WHERE forum_id='$f'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$forum = $row[forum_name]; // forum name
$desc= $row[forum_desc]; // forum description
$MyNewdesc = "$forum: $desc";
}
$db->sql_freeresult($result);}
###############################################
# DO NOT REMOVE THE FOLLOWING COPYRIGHT LINE! #
# YOU'RE NOT ALLOWED TO REMOVE NOR EDIT THIS. #
###############################################
I just wanted to report back on how this is working.
It is great, I have seen a 40% increase in traffic in a very short amount of time. Google is now seeing each forum post, not just each topic, as a page and is listing it in the directory. The bb code being included in some (not many) descriptions is really not an issue for me and far out weighs the benefits of having unique descriptions for each post/topic.
I was wondering if anyone had the code that would do the news (article.php) description meta in a similar fashion (the title and the first 150 characters of text)?
This idea of having a dynamic description for every page is a good one. The code listed above is for an older version of phpnuke though; I am using version 7.8, does anyone know how to configure this code for this version?
This idea of having a dynamic description for every page is a good one. The code listed above is for an older version of phpnuke though; I am using version 7.8, does anyone know how to configure this code for this version?
Nice idea! I think we could use the same functions in the nukeSEO sitemap to do dynamic descriptions. The question is: would you want to be able to disable that for modules (i.e. don't include this content in the sitemap - regardless of whether or not the module is active and don't include the title in the description).
Also, you might want to check the module description to make sure something is there, and if not, use the standard description.
Finally, you should probably use include_once instead of include.
Nice idea! I think we could use the same functions in the nukeSEO sitemap to do dynamic descriptions. The question is: would you want to be able to disable that for modules (i.e. don't include this content in the sitemap - regardless of whether or not the module is active and don't include the title in the description).
Also, you might want to check the module description to make sure something is there, and if not, use the standard description.
Finally, you should probably use include_once instead of include.
The bottom line is: Use as much as you can for descriptions. Grab the title first and 200 charactors of text.
I am not sure what you mean about the sitemaps, as I do not include any meta other than Follow, NoIndex in those files.
Sorry, that was really more of a note to myself. The nukeSEO sitemap has the ability to use a title for each page of content, so we could use the same functions to get the description.
Joined: Aug 29, 2004 Posts: 9136 Location: Arizona
Posted:
Fri Apr 28, 2006 5:37 am
Any chance the META information for each module can be "managed" in a table as apposed to having potentially many, many module meta.php files in the includes folder?
Joined: Aug 28, 2003 Posts: 6373 Location: Vsetin, Czech Republic
Posted:
Fri Apr 28, 2006 5:42 am
Interesting thread.
dconnor - I would be interested to learn what happens over the long term, say a month or two. The increase in traffic you are currently seeing may just be down to the fact that your content has changed (at least from the perspective of the search engine) as they re-crawl and index the changes due to the modifications made.
If you start seeing more visitors from anything other than bots/crawlers/spiders then I would certainly appreciate you confirming that at some point as that would be a good indicator of whether or not the search engines are feeding search results more appropriately.
Any chance the META information for each module can be "managed" in a table as apposed to having potentially many, many module meta.php files in the includes folder?
View next topic View previous topic
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum