vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   [RELEASE V2.0.1] New Forum Features (https://vborg.vbsupport.ru/showthread.php?t=19390)

Wayne Luke 06-04-2001 10:00 PM

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.

fastforward 06-05-2001 04:28 PM

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 :D

RobAC 06-05-2001 04:36 PM

Whoa! Nice job Wayne!!! Thanks. :)

Wayne Luke 06-06-2001 12:23 AM

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.

Hooper 06-06-2001 12:33 AM

Thanks Wayne.

Wayne Luke 06-06-2001 06:08 AM

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.

kitchend 06-06-2001 08:15 AM

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

Jpp 06-06-2001 11:34 AM

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.

MrLister 06-06-2001 01:36 PM

Good Job! I love it!

Wayne Luke 06-06-2001 02:54 PM

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.

Jpp 06-06-2001 03:15 PM

Ok that make sence, have to figure out how to use it on my board then. Btw very nice work. ;-)

gmtalk 06-06-2001 07:29 PM

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

Wayne Luke 06-06-2001 09:42 PM

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.

gmtalk 06-07-2001 02:34 AM

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

fastforward 06-07-2001 04:27 AM

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.

Snoozy 06-07-2001 05:24 AM

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.

Wayne Luke 06-07-2001 11:23 AM

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.

Snoozy 06-07-2001 01:25 PM

Is there anywhere I can find a list of changes in 2.0.1? from 2.0.0

kdog316 06-07-2001 01:40 PM

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
:confused:

Wayne Luke 06-07-2001 05:02 PM

Put it in your admin directory.

kdog316 06-07-2001 06:06 PM

ok but now when i try to post a new thread i get this erorr
Quote:

Parse error: parse error in /home/photo/public_html/tmbps/newthread.php on line 306
:confused:

Wayne Luke 06-07-2001 09:08 PM

Double check and make sure your code changes match the ones listed in the first post of this thread.

kdog316 06-07-2001 09:09 PM

could it be because i have version 2.0 not 2.01 it wont work:confused:

Wayne Luke 06-07-2001 09:10 PM

It will work in both.... And most likely all the betas as well.

kdog316 06-07-2001 09:35 PM

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])) { 

oh and add reply works fine

Wayne Luke 06-07-2001 09:41 PM

You need to add another closing paranthesis ')' before the curly brace '{'.

kdog316 06-07-2001 09:48 PM

where

Mas*Mind 06-07-2001 10:06 PM

this is definitely wrong:

PHP Code:

}[userid])) { 


kdog316 06-07-2001 10:41 PM

so whwre do i add the (

Wayne Luke 06-08-2001 01:16 AM

Make it look like:
PHP Code:

if (($foruminfo[minposts]>=$bbuserinfo[posts]) and !(ismoderator($foruminfo[forumid],"",$bbuserinfo[userid]))) { 

and replace the line after "exit;" with }

ThomasP 06-16-2001 04:07 PM

Hi,
sounds to be a great hack,
does it work with php3-servers?
thx,
-Tom

Raptor 06-26-2001 01:13 AM

very strange

ive installed this to the letter

everything seems perfectly fine BUT

it denies access for new users to EVERY forum (says blah blah you need 0 posts to access)

i have set just one forum to 10 posts to view/new thread and when the newbie gets 10 posts he then has access to ALL the forums with no problems

it also does give the odd few members access to these locked forums when they have only 1 post even though its set to 10

what could possibly be wrong ?

Christian 06-26-2001 02:36 PM

One question:

In your zip file, which set of files is the right one?

ff_install.php and readme.txt are there each twice!

Once in the root and once in webwork\sitepointforums.com\hacks\forum_features!

AND: they have different file sizes!

Which package is the corect?

KeithMcL 06-26-2001 03:59 PM

Quote:

Originally posted by Christian
One question:

In your zip file, which set of files is the right one?

ff_install.php and readme.txt are there each twice!

Once in the root and once in webwork\sitepointforums.com\hacks\forum_features!

AND: they have different file sizes!

Which package is the corect?

I just finished installing great hack and everything went very smoothly. Thanks Wayne.

BTW, Christian the best files to use would be the ones with the latest modified date which is the 06/06/01.

Rgds,

Raptor 06-29-2001 02:04 PM

Quote:

Originally posted by Raptor
very strange

ive installed this to the letter

everything seems perfectly fine BUT

it denies access for new users to EVERY forum (says blah blah you need 0 posts to access)

i have set just one forum to 10 posts to view/new thread and when the newbie gets 10 posts he then has access to ALL the forums with no problems

it also does give the odd few members access to these locked forums when they have only 1 post even though its set to 10

what could possibly be wrong ?

*bump*

Morgo 07-01-2001 03:25 PM

Am I being totally blind, or is the zip file no longer on this thread? Has it been removed?

Christian 07-01-2001 08:49 PM

You are NOT blind!
It is away!

DeadlyMax 07-01-2001 08:54 PM

where did the zip file go?

Wayne Luke 07-01-2001 10:37 PM

Sorry.. The file must have gotten deleted the last time I tried to update it.

Here is the most up to date file.

Pingu 07-02-2001 03:53 PM

the install txt in the zip file contains errors.

I got a a parse error on /forumdisplay.php and /admin/forum.php
I replaced the code with the code published on the first post in this thread and things are ok now...


All times are GMT. The time now is 05:02 AM.

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.01438 seconds
  • Memory Usage 1,914KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (17)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete