Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-08-2005, 09:25 PM
nautiqeman nautiqeman is offline
 
Join Date: Jan 2003
Posts: 119
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Restrict a Thread depending on users' posts

I'd like to be able to restrict a Thread from being seen/posted in/etc based on how many posts I user has done. For example under my main forum thread I'll have a thread title '100K' -- I'd only like those users that have 100k posts or more to even see that. How can I do this? Thanks in advance.
Reply With Quote
  #2  
Old 01-09-2005, 10:01 AM
Tekton Tekton is offline
 
Join Date: Jun 2004
Location: Wisconsin
Posts: 362
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello. I was pretty bored tonight/this morning so I thought I'd play around with this idea. Here's what I did so far:

Step 1 - Made `req_posts` field (INT, default=0) in THREAD table. (database)

### FOLLOWING DONE IN FORUMDISPLAY.PHP ###

Step 2 - Added req_posts into the thread query
PHP Code:
$threads $DB_site->query("SELECT [...], req_posts, [...] 
------
Step 3 - Find:
PHP Code:
while ($thread $DB_site->fetch_array($threads))    
// AND $counter++<$perpage) 
Add AFTER
PHP Code:
$bbuserinfo['posts']+=1// min post count requirment minimum | line 1
if($bbuserinfo['posts']>=$thread['req_posts']){    // min post count requirment minimum | line 2 
-------
Step 4 - Find:
PHP Code:
eval('$threadbit .= "' fetch_template('threadbit') . '";');

Add AFTER
PHP Code:
// min post count requirment minimum | line 3 | last line 
------
------
That should prevent them from showing up in the forum display... which is a start, eh? If you're wondering about the +1 to the bbuserinfo[posts], it seems to error out my way for GUESTS and users not logged in, not that adding one to that is a HUGE deal; it's just one extra line of code and doesn't actually add to the post count. Maybe someone knows a better way?
Reply With Quote
  #3  
Old 01-09-2005, 01:34 PM
nautiqeman nautiqeman is offline
 
Join Date: Jan 2003
Posts: 119
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So I'm guessing that somewhere in the AdminCP you'll set up the req_posts?

Will this still display the thread in the list though??
Reply With Quote
  #4  
Old 01-09-2005, 01:49 PM
Tekton Tekton is offline
 
Join Date: Jun 2004
Location: Wisconsin
Posts: 362
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oooooh, you want users to SEE the thread but not be able to access it? Well, if that's the case, you can disregard anything after step 1. :P

It could be configurable in the admin panel if you added some code there to do it with.

More code is needed for when they actually visit the thread, I just didn't do that part. (yet?)
Reply With Quote
Reply


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 07:09 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.03369 seconds
  • Memory Usage 2,193KB
  • Queries Executed 13 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (5)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)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_postinfo_query
  • fetch_postinfo
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete