Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Beta Releases

Reply
 
Thread Tools
Forum Activity Check For Forum Access (Per Forum) Details »»
Forum Activity Check For Forum Access (Per Forum)
Version: 1.10, by sabret00the sabret00the is offline
Developer Last Online: Apr 2010 Show Printable Version Email this Page

Version: 3.0.7 Rating:
Released: 02-23-2005 Last Update: Never Installs: 5
Is in Beta Stage  
No support by the author.

FAQ
i wrote it but when i tried to bullet it, it went all pear shaped, in short, no more questions

thanks to Dean for the assistance


in "/forums/forumdisplay.php" find
PHP Code:
// check if there is a forum password and if so, ensure the user has it set
verify_forum_password($foruminfo['forumid'], $foruminfo['password']); 
and addove it add
PHP Code:
    $facffa_checkforums explode(","$vboptions['facffa_checkforums']);
    
$facffa_excludeusergroups explode(","$vboptions['facffa_excludeusergroups']);
    if ((
$vboptions['facffa_checkforumactivity'] AND in_array($foruminfo['forumid'], $facffa_checkforums) AND !in_array($bbuserinfo['usergroupid'], $faffa_excludeusergroups)))
    {
        
// forum activity check
        
$definedtime = ($vboptions['facffa_checkforumactivitytime'] * 86400);
        
$limit TIMENOW $definedtime;
        
$recentpostcount $DB_site->query_first("
            SELECT COUNT(*) AS total
            FROM " 
TABLE_PREFIX "post 
            WHERE userid = 
$bbuserinfo[userid] 
            AND dateline >= 
$limit
        "
);

        if (
$recentpostcount['total'] < $vboptions['facffa_checkforumactivityposts'])
        {
            eval(
print_standard_error('facffa_checknotenoughposts'));
        }
    } 
now shoot over to the "/forums/showthread.php" and find
PHP Code:
// *********************************************************************************
// get thread info
$thread verify_id('thread'$threadid11);
$threadinfo = &$thread
and below that add
PHP Code:
    $facffa_checkforums explode(","$vboptions['facffa_checkforums']);
    
$facffa_excludeusergroups explode(","$vboptions['facffa_excludeusergroups']);
    if ((
$vboptions['facffa_checkforumactivity'] AND in_array($threadinfo['forumid'], $facffa_checkforums) AND !in_array($bbuserinfo['usergroupid'], $faffa_excludeusergroups)))
    {
        
// forum activity check
        
$definedtime = ($vboptions['facffa_checkforumactivitytime'] * 86400);
        
$limit TIMENOW $definedtime;
        
$recentpostcount $DB_site->query_first("
            SELECT COUNT(*) AS total
            FROM " 
TABLE_PREFIX "post 
            WHERE userid = 
$bbuserinfo[userid] 
            AND dateline >= 
$limit
        "
);

        if (
$recentpostcount['total'] < $vboptions['facffa_checkforumactivityposts'])
        {
            eval(
print_standard_error('facffa_checknotenoughposts'));
        }
    } 
now you need to add the phrase
Code:
You have not had enough forum activity in order to access this forum, please become more active then check back there-after.
this slots in front end-error messages

now what else was there, oh yeah the options
direct your browser to http://www.mydomain.com/forums/admin...hp?do=addgroup
(please don't take that literally)

and then put this in the boxes
Code:
Varname: facffa
Title: Forum Activity Check For Forum Access (Per Forum)
vB Default: No
once you done that you should be in there? i hoe so cos you need to populate that group with, oh yeah you do that by clicking this http://www.mydomain.com/forums/admin...uptitle=facffa
Code:
Varname: facffa_checkforumactivity
Title: Turn This Option On?
Description: Turning this on will mean that this hack will start working and checking if users have enough posts in order to access specified forums and their threads
Option Code: yesno
Default: no
vBulletin Default: no

Varname: facffa_checkforumactivitytime
Title: Required Time For Forum Activity
Description: This is the option for how many posts in XX days they need to access the forum.
Option Code:
Default: 1
vBulletin Default: no

Varname: facffa_checkforumactivityposts
Title: Required Posts For Forum Activity
Description: This is the setting for how many posts they need in the above time in order to access that forum.
Option Code:
Default: 1
vBulletin Default: no

Varname: facffa_checkforums
Title: Protected Forums
Description: These are the forums id's you want to protect with this hack, please seperate them with a comma.
Option Code:
Default: 
vBulletin Default: no

Varname: facffa_excludeusergroups
Title: Excluded Usergroups
Description: These are the usergroup id's you want to exclude from having to actually post, please seperate them with a comma.
Option Code:
Default: 
vBulletin Default: no
now i aint had time to test this so test it on your test board and let me know if you get a chance to test it before me, heh the nature of beta huh

even if this hack don't work, feed it to your search engine, by that i mean www.ebslive.com and stop stealing my smilies :lol:

and i'm spent.

UPDATED: 24/04/05 19:28

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 04-24-2005, 06:45 PM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

what's line 223?
Reply With Quote
  #23  
Old 04-24-2005, 06:51 PM
esfron esfron is offline
 
Join Date: Nov 2002
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

223:

PHP Code:
    if (($vboptions['facffa_checkforumactivity'] AND in_array($foruminfo['forumid'], $facffa_checkforums) AND !in_array($bbuserinfo['usergroupid'], $faffa_excludeusergroups))) 
Reply With Quote
  #24  
Old 04-24-2005, 07:41 PM
esfron esfron is offline
 
Join Date: Nov 2002
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Right now as user, I made 1 posts in 1 day. I tryed to access to protected forum but I get:

Unable to add cookies, header already sent.
File: /home.../includes/init.php
Line: 27

Init.php is fine because the hack is working without the usergroups update. I replaced the last forumdisplay&showthread by the old ones.
Reply With Quote
  #25  
Old 04-25-2005, 01:44 PM
esfron esfron is offline
 
Join Date: Nov 2002
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK. I fixed the last one.

Right now, I get "Warning: in_array(): Wrong datatype for second argument in /showthread.php on line 319". Usergroups are not going to be excluded.

319 ->
PHP Code:
 if (($vboptions['facffa_checkforumactivity'] AND in_array($threadinfo['forumid'], $facffa_checkforums) AND !in_array($bbuserinfo['usergroupid'], $faffa_excludeusergroups))) 
Any idea ?
.
Reply With Quote
  #26  
Old 04-25-2005, 01:50 PM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

can you put 27 in the excuded usergroups in the vboptions and tell me if you still get the error please.
Reply With Quote
  #27  
Old 04-25-2005, 02:17 PM
esfron esfron is offline
 
Join Date: Nov 2002
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Usergroups:

- not connected (ID=1): error is:
Warning: in_array(): Wrong datatype for second argument in /showthread.php on line 319
AND
You have not had enough forum activity in order to access this forum, please become more active then check back there-after.


- connected member4 (ID=27), error is:
Warning: in_array(): Wrong datatype for second argument in /showthread.php on line 319
AND
Unable to add cookies, header already sent.
File: /home.../includes/init.php
Line: 27


Fix for forumdisplay:

PHP Code:
if (($vboptions['facffa_checkforumactivity'] AND in_array($threadinfo['forumid'], $facffa_checkforums) AND !in_array($bbuserinfo['usergroupid'], $faffa_excludeusergroups))) 
    { 
Reply With Quote
  #28  
Old 04-25-2005, 08:20 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What php version are you running?
Reply With Quote
  #29  
Old 04-25-2005, 08:54 PM
esfron esfron is offline
 
Join Date: Nov 2002
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Php 4.3.11
Reply With Quote
  #30  
Old 05-14-2005, 02:12 AM
Darmak Darmak is offline
 
Join Date: Jun 2004
Location: M?xico
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by esfron
Usergroups:

- not connected (ID=1): error is:
Warning: in_array(): Wrong datatype for second argument in /showthread.php on line 319
AND
You have not had enough forum activity in order to access this forum, please become more active then check back there-after.


- connected member4 (ID=27), error is:
Warning: in_array(): Wrong datatype for second argument in /showthread.php on line 319
AND
Unable to add cookies, header already sent.
File: /home.../includes/init.php
Line: 27


Fix for forumdisplay:

PHP Code:
if (($vboptions['facffa_checkforumactivity'] AND in_array($threadinfo['forumid'], $facffa_checkforums) AND !in_array($bbuserinfo['usergroupid'], $faffa_excludeusergroups))) 
    { 
To solve your problem replace in your forumdisplay.php & showthread.php this line

PHP Code:
if (($vboptions['facffa_checkforumactivity'] AND in_array($threadinfo['forumid'], $facffa_checkforums) AND !in_array($bbuserinfo['usergroupid'], $faffa_excludeusergroups))) 
    { 
Whit

PHP Code:
if (($vboptions['facffa_checkforumactivity'] AND in_array($threadinfo['forumid'], $facffa_checkforums) AND !in_array($bbuserinfo['usergroupid'], $facffa_excludeusergroups))) 
    { 
TYPO error...
Reply With Quote
  #31  
Old 05-14-2005, 09:23 AM
esfron esfron is offline
 
Join Date: Nov 2002
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Es bueno. Muchas gracias amigo Darmark de M?xico.
Thank you very much, Sabret00the. :up:
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:44 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.04728 seconds
  • Memory Usage 2,348KB
  • 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
  • (3)bbcode_code
  • (10)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
  • (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
  • (11)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