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.
red di ti and still get the erorr and here is what lines 307-310 look like
PHP Code:
if (($foruminfo[minposts]>=$bbuserinfo[posts]) and !(ismoderator($foruminfo[forumid],"",$bbuserinfo[userid])) {
eval("standarderror(\"".gettemplate("error_forumnopost")."\");");
exit;
}[userid])) {
here is line 307 the one it is saying is wrong
PHP Code:
if (($foruminfo[minposts]>=$bbuserinfo[posts]) and !(ismoderator($foruminfo[forumid],"",$bbuserinfo[userid])) {