Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 10-02-2002, 04:15 PM
groovesalad groovesalad is offline
 
Join Date: Aug 2002
Posts: 210
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Question For all!

Anyone know of a hack that limits people to download attachments if they don't have enough posts?

I see a lot of miminum posts in order to post a thread, etc, but not to download attachments. Thanks.
Reply With Quote
  #2  
Old 10-02-2002, 04:59 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

edit attachment.php, find:

PHP Code:
if (!$permissions[canview] or !$permissions[cangetattachment]) {
  
show_nopermission();

After that add:

PHP Code:
if ($bbuserinfo['posts']<X)
{
show_nopermission(); exit;} 
Replace X with the post number you want..

Not tested but should work..

Enjoy..
Reply With Quote
  #3  
Old 10-02-2002, 05:29 PM
groovesalad groovesalad is offline
 
Join Date: Aug 2002
Posts: 210
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

works great. Thank you
Reply With Quote
  #4  
Old 10-24-2002, 12:47 AM
groovesalad groovesalad is offline
 
Join Date: Aug 2002
Posts: 210
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Under what error template would I put down that you need a certain amount of posts in order to download?
Reply With Quote
  #5  
Old 10-24-2002, 10:08 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Replace the line :

PHP Code:
{show_nopermission(); exit;} 
as

PHP Code:
 {eval("standarderror(\"".gettemplate("error_cantdlattachments")."\");");exit} 
then create a new template named "error_cantdlattachments" and you can customize it according to your wish..
Reply With Quote
  #6  
Old 10-27-2002, 04:28 PM
groovesalad groovesalad is offline
 
Join Date: Aug 2002
Posts: 210
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Logician - What if I wanted to make it 10 threads, instead of posts? Where would I go to edit that?
Reply With Quote
  #7  
Old 10-27-2002, 10:09 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by groovesalad
Logician - What if I wanted to make it 10 threads, instead of posts? Where would I go to edit that?
Unlike post number, user's thread number is not kept in a seperate variable, so to achieve your goal you first have to query db to learn this count (that means it will add 1 query to your page load)..

Replace:

PHP Code:
if ($bbuserinfo['posts']<X)
{
show_nopermission(); exit;} 
AS:

PHP Code:
$user_thread_count=$DB_site->query_first("SELECT count(*) as tc FROM thread WHERE postuserid=$bbuserinfo[userid]");
if (
$user_thread_count['tc']<X)
{
show_nopermission(); exit;} 
Reply With Quote
  #8  
Old 10-27-2002, 10:16 PM
groovesalad groovesalad is offline
 
Join Date: Aug 2002
Posts: 210
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Logician

Unlike post number, user's thread number is not kept in a seperate variable, so to achieve your goal you first have to query db to learn this count (that means it will add 1 query to your page load)..

Is that bad? 1 query?
Reply With Quote
  #9  
Old 10-27-2002, 10:23 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

IMO no.. check the bottom of this page and you'll see it has 27 queries. What if would it be 28? 1 query does not harm much unless your server load is already too high..
Reply With Quote
  #10  
Old 10-27-2002, 10:25 PM
groovesalad groovesalad is offline
 
Join Date: Aug 2002
Posts: 210
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh, cool. I have music to download off my site, but I get a lot of leechers that don't contribute, so I originally put it that you had to get 10 posts to download. So, several people just would put garbage in the threads. So, I figured if I made it a minimum of 5 threads to download music, it might deter people that just leech.
Reply With Quote
Reply

Thread Tools
Display Modes

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 01:31 AM.


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.04160 seconds
  • Memory Usage 2,259KB
  • 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
  • (6)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)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_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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete