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
  #2  
Old 06-05-2001, 04:28 PM
fastforward fastforward is offline
 
Join Date: Oct 2001
Location: NC, USA
Posts: 399
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How spooky is that!

I was sat at my PC last night wondering what the easiest way would be to:

a) Set meta tags per forum.
b) Restrict posting and reading individual forums based on posts

Perfect!
Thanks for this
Reply With Quote
  #3  
Old 06-05-2001, 04:36 PM
RobAC RobAC is offline
 
Join Date: Oct 2001
Posts: 314
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Whoa! Nice job Wayne!!! Thanks.
Reply With Quote
  #4  
Old 06-06-2001, 12: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

I am glad you like it. Several of the features we have been using at SitePoint so I thought others would like them as well.
Reply With Quote
  #5  
Old 06-06-2001, 12:33 AM
Hooper's Avatar
Hooper Hooper is offline
 
Join Date: Oct 2001
Location: St. Louis, Mo
Posts: 286
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Wayne.
Reply With Quote
  #6  
Old 06-06-2001, 06:08 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

The code above has been updated with to correct two bugs that I am surprised didn't cause errors in my testing. Sorry for any inconvenience.

Thanks to Fastforward for noticing this.
Reply With Quote
  #7  
Old 06-06-2001, 08:15 AM
kitchend
Guest
 
Posts: n/a
Default

just an idea, something we do at BT is to dynamically generate meta-tags and descriptions using information already available.

as i see it, the information for the meta tags already exists, you just need to use it better.

you already have the meta-description, by using that forum's description.

for example this forum would have the decription:

"Posts your code hack releases for version 2 in here. Please, no requests!"

you already have the meta-keywords, by using the 'breadcrumb' of that forum.

for example this forum would have the keywords:

"vBulletin, Community, Forum, Customising, vBulletin, vBulletin, Code, Hacks, Releases"

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.

cheers

david k
Reply With Quote
  #8  
Old 06-06-2001, 11:34 AM
Jpp
Guest
 
Posts: n/a
Default

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.
Reply With Quote
  #9  
Old 06-06-2001, 01:36 PM
MrLister's Avatar
MrLister MrLister is offline
 
Join Date: Oct 2001
Posts: 434
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Good Job! I love it!
Reply With Quote
  #10  
Old 06-06-2001, 02:54 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

Quote:
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.
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 06:33 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.15820 seconds
  • Memory Usage 2,358KB
  • Queries Executed 23 (?)
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
  • (1)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
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (8)postbit_onlinestatus
  • (10)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