Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases

Reply
 
Thread Tools
Details »»

Version: , by Wayne Luke (Senior Member) Wayne Luke is offline
Developer Last Online: Oct 2023 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 06-04-2001 Last Update: Never Installs: 5
 
No support by the author.

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'"); 
In newthread.php find:
PHP Code:
  $smilieson=iif($foruminfo[allowsmilies],$ontext,$offtext); 
After it add:
PHP Code:
  //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 
In newthread.php find:
PHP Code:
    $subject=censortext($subject);
    
$message=censortext($message); 
Replace with:
PHP Code:
    if ($foruminfo[censor]) {
      
$subject=censortext($subject);
      
$message=censortext($message);
    } 
In Forumdisplay find:
PHP Code:
$smilieson=iif($foruminfo['allowsmilies'],$ontext,$offtext); 
After that add:
PHP Code:
//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.

Comments
  #12  
Old 06-06-2001, 03:15 PM
Jpp
Guest
 
Posts: n/a
Default

Ok that make sence, have to figure out how to use it on my board then. Btw very nice work. ;-)
Reply With Quote
  #13  
Old 06-06-2001, 07:29 PM
gmtalk gmtalk is offline
 
Join Date: Oct 2001
Location: Phillip Island
Posts: 47
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This looks to be a great hack. I just ran into a slight problem on the install

I have followed the instructions and when i run the ff_install.php

I get to the following
Forum Features (version 1.2)
from Wayne Luke
Altering forum table
Installing necessary templates...

it just hangs there.

Does not go any further.

I have seen that it created the following in the forum table:


metakey char(250) Yes None NULL
metadesc char(250) Yes None NULL
robotext char(50) Yes None NULL
showactive smallint(5) No None 1
censor smallint(5) No None 1
minviewposts smallint(5) No None 0
minposts smallint(5) No None 0

No other information was entered that I can see in any of the tables.

Any thoughts. I have removed the above fields.

TIA

john
Reply With Quote
  #14  
Old 06-06-2001, 09:42 PM
Wayne Luke's Avatar
Wayne Luke Wayne Luke is offline
Senior Member
 
Join Date: Jan 2002
Location: Southern California
Posts: 1,694
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It isn't hanging there.. It is done at that point.

To clarify, I add a phrase saying it was done at the end of the script.

The only table in the database that it touches is the forum table and those fields are the ones it adds. The install script also adds 2 new error templates to handle the minimum post requirements for new threads and viewing a forum.

You can change these options by modifying a particular forum.
Reply With Quote
  #15  
Old 06-07-2001, 02:34 AM
gmtalk gmtalk is offline
 
Join Date: Oct 2001
Location: Phillip Island
Posts: 47
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

WLuke,

I installed and now I get this when I try to add a subforum.


Database error in vBulletin Control Panel: Invalid SQL: INSERT INTO forum
(forumid,styleid,title,description,active,displayo rder,parentid,
parentlist,allowposting,cancontainthreads,daysprun e,newpostemail,newthreademail,
moderatenew,allowhtml,allowbbcode,allowimages,allo wsmilies,allowicons,
styleoverride,allowratings,countposts,moderateatta ch,metakey,metadesc,robotext,
showactive,censor,minviewposts,minposts)
values (NULL,'1','testtesttest','',
'1','1','1','','1','1',
'30','','',
'0','0','1','0','1',
'1','0','1','1','0',
'','','',
1,1,,)
mysql error: You have an error in your SQL syntax near ')' at line 13
mysql error number: 1064
Date: Wednesday 06th of June 2001 10:31:10 PM
Script: /forum2/admin/forum.php
Referer: http://www.s-seriesforum.com/forum2/...add&parentid=1
Reply With Quote
  #16  
Old 06-07-2001, 04:27 AM
fastforward fastforward is offline
 
Join Date: Oct 2001
Location: NC, USA
Posts: 399
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You need to put single quotes around the $minviewposts and $minposts in the INSERT statement you edited in admin/forum.php. For some reason MySQL requires quotes for all datatypes except INT. Those two fields are SMALLINT.
Reply With Quote
  #17  
Old 06-07-2001, 05:24 AM
Snoozy's Avatar
Snoozy Snoozy is offline
 
Join Date: Oct 2001
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If I do all of your code changes, and run upgrade10.php from the newest vbulletin2.zip file that I downloaded from the Member's Area, will I be fully compliant with 2.0.1, becuse I have alot of hacks, and don't want to have to go through them all again....Thanks.
Reply With Quote
  #18  
Old 06-07-2001, 11:23 AM
Wayne Luke's Avatar
Wayne Luke Wayne Luke is offline
Senior Member
 
Join Date: Jan 2002
Location: Southern California
Posts: 1,694
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Snoozy
If I do all of your code changes, and run upgrade10.php from the newest vbulletin2.zip file that I downloaded from the Member's Area, will I be fully compliant with 2.0.1, becuse I have alot of hacks, and don't want to have to go through them all again....Thanks.
You will have to apply all the hacks to the 2.0.1 code base to be compliant with it. This hack is not part of the official vBulletin distribution.
Reply With Quote
  #19  
Old 06-07-2001, 01:25 PM
Snoozy's Avatar
Snoozy Snoozy is offline
 
Join Date: Oct 2001
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there anywhere I can find a list of changes in 2.0.1? from 2.0.0
Reply With Quote
  #20  
Old 06-07-2001, 01:40 PM
kdog316
Guest
 
Posts: n/a
Default

when i try to run the ff_install.php i get this erorr

Quote:
Fatal error: Call to undefined function: cpheader() in /home/photo/public_html/tmbps/ff_install.php on line 7
Reply With Quote
  #21  
Old 06-07-2001, 05:02 PM
Wayne Luke's Avatar
Wayne Luke Wayne Luke is offline
Senior Member
 
Join Date: Jan 2002
Location: Southern California
Posts: 1,694
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Put it in your admin directory.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:06 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04535 seconds
  • Memory Usage 2,375KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (13)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (9)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete