Forum Features Hack
---- About
This adds several new options and features to individual forums that can be useful.
New Features
1. Meta Tag Keywords set by forum.
2. Meta Tag Description set by forum.
3. Robot Meta Tag set by forum.
New Options
1. Censor words by Forum.
2. Minimum Posts required for New Thread.
3. Minimum Posts to view Forum.
---- Credits
This hack is distributed under the GPL as an add-on to vBulletin. vBulletin is a commercial product and not subject to this license agreement.
Written by: Wayne Luke
Portions of the Install script written by: Kier Darby
vBulletin is created by Jelsoft Ltd. http://www.jelsoft.com
---- Installation.
Run ff_install.php. This will make the modifications to the database and create the new templates.
Open admin/forum.php and look for:
PHP Code:
makeyesnocode("Count posts made in this forum towards user post counts?","countposts",1);
After that add:
PHP Code:
//WL 04-JUNE-2001 New Forum Features Hack
maketableheader("Search Engine Options (v1.2 by Wayne Luke)");
maketextareacode("Meta Tag Keywords: ","metakey");
maketextareacode("Meta Tag Description","metadesc");
makeinputcode("Meta Robot Tag","robotext");
maketableheader("Forum Control Options (v1.0 by Wayne Luke)");
makeyesnocode("Show in Active Topics?","showactive",1);
makeyesnocode("Censor Words in this Forum","censor",1);
makeinputcode("Minimum Posts to View","minviewposts");
makeinputcode("Minimum Posts to Start New Thread","minposts");
//WL End Modification
Also in admin/forum.php Look for:
PHP Code:
$DB_site->query("INSERT INTO forum
(forumid,styleid,title,description,active,displayorder,parentid,
parentlist,allowposting,cancontainthreads,daysprune,newpostemail,newthreademail,
moderatenew,allowhtml,allowbbcode,allowimages,allowsmilies,allowicons,
styleoverride,allowratings,countposts,moderateattach)
VALUES
(NULL,'$styleset','".addslashes($title)."','".addslashes($description)."','$isactive','$displayorder','$parentid',
'','$allowposting','$cancontainthreads','$daysprune','".addslashes($newpostemail)."','".addslashes($newthreademail)."',
'$moderatenew','$aallowhtmlcode','$aallowbbcode','$aallowimgcode','$aallowsmilies','$aallowicons',
'$styleoverride','$allowratings','$countposts','$moderateattach')");
Replace with:
PHP Code:
$DB_site->query("INSERT INTO forum
(forumid,styleid,title,description,active,displayorder,parentid,
parentlist,allowposting,cancontainthreads,daysprune,newpostemail,newthreademail,
moderatenew,allowhtml,allowbbcode,allowimages,allowsmilies,allowicons,
styleoverride,allowratings,countposts,moderateattach,metakey,metadesc,robotext,
showactive,censor,minviewposts,minposts)
values (NULL,'$styleset','".addslashes($title)."','".addslashes($description)."',
'$isactive','$displayorder','$parentid','','$allowposting','$cancontainthreads',
'$daysprune','".addslashes($newpostemail)."','".addslashes($newthreademail)."',
'$moderatenew','$aallowhtmlcode','$aallowbbcode','$aallowimgcode','$aallowsmilies',
'$aallowicons','$styleoverride','$allowratings','$countposts','$moderateattach',
'".addslashes($metakey)."','".addslashes($metadesc)."','".addslashes($robotext)."',
'$showactive','$censor','$minviewposts','$minposts')");
After that add:
PHP Code:
//WL 04-JUNE-2001 New Forum Features Hack
maketableheader("Search Engine Options (v1.2 by Wayne Luke)");
maketextareacode("Meta Tag Keywords: ","metakey",$forum[metakey]);
maketextareacode("Meta Tag Description","metadesc",$forum[metadesc]);
makeinputcode("Meta Robot Tag","robotext",$forum[robotext]);
maketableheader("Forum Control Options (v1.0 by Wayne Luke)");
makeyesnocode("Show in Active Topics?","showactive",1,$forum[showactive]);
makeyesnocode("Censor Words in this Forum","censor",1,$forum[censor]);
makeinputcode("Minimum Posts to View","minviewposts",$forum[minviewposts]);
makeinputcode("Minimum Posts to Start New Thread","minposts",$forum[minposts]);
//WL End Modification
Last edit in admin/forum.php. Find:
PHP Code:
$DB_site->query("UPDATE forum
SET
styleid='$styleset', title='".addslashes($title)."', description='".addslashes($description)."',
active='$isactive', displayorder='$displayorder', parentid='$parentid', parentlist=$parentlist,
allowposting='$allowposting', cancontainthreads='$cancontainthreads', daysprune='$daysprune',
newpostemail='".addslashes($newpostemail)."', newthreademail='".addslashes($newthreademail)."',
moderatenew='$moderatenew', allowhtml='$aallowhtmlcode', allowbbcode='$aallowbbcode',
allowimages='$aallowimgcode', allowsmilies='$aallowsmilies', allowicons='$aallowicons',
styleoverride='$styleoverride', allowratings='$allowratings', countposts='$countposts',
moderateattach='$moderateattach'
WHERE forumid='$forumid'");
Replace with:
PHP Code:
$DB_site->query("UPDATE forum
SET
styleid='$styleset', title='".addslashes($title)."', description='".addslashes($description)."',
active='$isactive', displayorder='$displayorder', parentid='$parentid', parentlist=$parentlist,
allowposting='$allowposting', cancontainthreads='$cancontainthreads', daysprune='$daysprune',
newpostemail='".addslashes($newpostemail)."', newthreademail='".addslashes($newthreademail)."',
moderatenew='$moderatenew', allowhtml='$aallowhtmlcode', allowbbcode='$aallowbbcode',
allowimages='$aallowimgcode', allowsmilies='$aallowsmilies', allowicons='$aallowicons',
styleoverride='$styleoverride', allowratings='$allowratings', countposts='$countposts',
moderateattach='$moderateattach', metakey='".addslashes($metakey)."',metadesc='".addslashes($metadesc)."',robotext='".addslashes($robotext)."',
showactive='$showactive',censor='$censor',minviewposts='$minviewposts',minposts='$minposts'
WHERE forumid='$forumid'");
//WL 04-June-2001 Forum Features Hack (v1.0 Wayne Luke)
if (($foruminfo[minposts]>$bbuserinfo[posts]) and !(ismoderator($foruminfo[forumid],"",$bbuserinfo[userid])) {
eval("standarderror(\"".gettemplate("error_forumnopost")."\");");
exit;
}
//WL End Modifications
//WL 04-June-2001 Forum Features Hack (v1.0 Wayne Luke)
$keyword=$foruminfo[metakey];
$description=$foruminfo[metadesc];
$robotext=$foruminfo[robotext];
if (($foruminfo[minviewposts]>$bbuserinfo[posts]) and !(ismoderator($foruminfo[forumid],"",$bbuserinfo[userid]))) {
eval("standarderror(\"".gettemplate("error_forumnoview")."\");");
exit;
}
//WL End Modifications
Finally add the following to your forumdisplay template:
<META NAME="keyword" content="$keyword">
<META NAME="description" content="$description">
<META name="robots" content="$robotext">
These same instructions are included in the readme.txt located in the zip file.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
i know it's not perfect, but it's pretty damn close to all the information you want, and you could always add an override facility. generally though, we found at BT that meta tags are never maintained properly, but dynamically generating them takes into account when the forum is moved in the hierarchy, etc. or if you re-purpose a board, it just works out the new variables.
again, just a suggestion that doesn't need to be listened to, but thought you'd like to know how other people do this stuff.
Installed it and it works perfect, But how can they make their first post if they cant get in to the forum, they can only view the board, Have i done something wrong or am I just stupid.
Originally posted by Jpp Installed it and it works perfect, But how can they make their first post if they cant get in to the forum, they can only view the board, Have i done something wrong or am I just stupid.
They can post in other forums. That is handled on a forum by forum basis and the post counts are compared against the user's total.
The reason we do it is because we have an advertising forum where each member can post one ad a month. We made a requirement that they have to have 20 posts minimum so that they contribute to the community in a meaningful way (since posts in the general chat forum don't count) before they post their advertisement.