Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases

Reply
 
Thread Tools
Minimum posts to download attachments.. Details »»
Minimum posts to download attachments..
Version: 1.00, by EvilLS1 EvilLS1 is offline
Developer Last Online: May 2021 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 05-06-2003 Last Update: Never Installs: 9
 
No support by the author.

This little hack will make it possible for you to require your users to have a minimum number of posts (which you define in the admin control panel) before they can download attachments.

Requested by TranceMaster and a couple of others in this thread:
https://vborg.vbsupport.ru/showthrea...threadid=48636

Updated: No more red Xs if the "view images" option is set to "yes". Now if "view images" is set to yes, everyone will be able to see the images in the threads, but not download other file types unless they have enough posts.. But if "view images" is set to no, users who do not have the minimum # of posts will still get the "not enough post" error message (even with images)...

Credits: Thanks to Sophocle for his help with this update.

If you downloaded the first version clear your browser cache and download the zip file again.

Screenshots included in the zip.

If you find this hack useful please click install.

Show Your Support

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

Comments
  #2  
Old 05-07-2003, 06:48 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks! I'll give this a go.
Reply With Quote
  #3  
Old 05-07-2003, 09:47 AM
squawell's Avatar
squawell squawell is offline
 
Join Date: Oct 2001
Posts: 681
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

one question can make this when u post a attach file set user

how many posts can download???can do that?thankz...
Reply With Quote
  #4  
Old 05-07-2003, 10:00 AM
Koutaru's Avatar
Koutaru Koutaru is offline
 
Join Date: Feb 2003
Location: IL
Posts: 589
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice I'm still considering whether to use it or not but I just think I might
Reply With Quote
  #5  
Old 05-07-2003, 10:59 AM
TranceMaster TranceMaster is offline
 
Join Date: Mar 2002
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

excellent man, thank you very much
ill go test it out just now


edit: i was just thinking, would it be possible to only have this hack affect a certain forum.

i run a music production site, with various sub forums.
but the one forum that contains the most attachments is the samples forum.

right now people need 50 posts before they can even view it, would be good to let them view it but not download until they have enough posts.

and having it not effect any other forum would be great.
dunno if thats possible though
let me know
thanks again

TM
Reply With Quote
  #6  
Old 05-07-2003, 12:36 PM
shungo shungo is offline
 
Join Date: Nov 2002
Location: France
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thx alot !!!

I've searched it ... but without no results... thx again for your job

I'm going to translate it for my forum... in franch now.. would you like i post it here ?
Reply With Quote
  #7  
Old 05-07-2003, 03:25 PM
Shimmy Shimmy is offline
 
Join Date: Sep 2002
Location: Ohio
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks alot for responding to us...i'll give a try

Edit: it works perfectly on my site...and with vb 2.3.0

Thanks
Reply With Quote
  #8  
Old 05-08-2003, 03:20 AM
EvilLS1's Avatar
EvilLS1 EvilLS1 is offline
 
Join Date: Apr 2002
Location: Georgia, USA
Posts: 987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

squawell,
I don't understand what you're asking.


TranceMaster,
Sure, if you only want this to effect a single forum just remove the code that you added earlier to attachment.php..

Then find (in attachment.php):

Code:
$getforuminfo=$DB_site->query_first("SELECT forumid".
                                     iif($postid,',attachmentid ','')."
                                     FROM thread,post
                                     WHERE post.threadid=thread.threadid ".
                                      iif($postid,"AND post.postid='$postid'","AND post.attachmentid='$attachmentid'")."
                                      ");
Below it add:
Code:
// minimum post to view attachments
if ($bbuserinfo[posts] < $minpostattach and $getforuminfo['forumid']==X) {
        eval("standarderror(\"".gettemplate("error_attachmoreposts")."\");");
exit;
}
Now in the code above, replace the red X with the forum ID of the one that you want this to effect.
I haven't tested this but it should work.

When I get some free time I might re-do this so that the minimum # of posts can be set on a forum by forum basis in the CP. So if ya want to be notified about updates just click install.


shungo,
Sure, go ahead and post the French version if you want.
Reply With Quote
  #9  
Old 05-08-2003, 09:02 AM
squawell's Avatar
squawell squawell is offline
 
Join Date: Oct 2001
Posts: 681
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i mean when u start a new topic u can set the post number if

member over that number than he can download if not he cant..

can do this??
Reply With Quote
  #10  
Old 05-09-2003, 12:01 PM
Sophocle Sophocle is offline
 
Join Date: Feb 2002
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

To avoid the problem of the View Images option, I would suggest those modifications in the hack :

In spite of doing :
Code:
##### In attachment.php find:
require("./global.php");

##### Below add:
// minimum posts to download attachments hack
if ($minpostattach > $bbuserinfo[posts]) {
        eval("standarderror(\"".gettemplate("error_attachmoreposts")."\");");
exit;
}
// end minimum posts to download attachments hack
Just do :
Code:
##### In attachment.php find:
updateuserforum($getforuminfo['forumid']);

##### Just before, add:

// minimum posts to download attachments hack
$extension=strtolower(substr(strrchr($attachmentinfo[filename],"."),1));
if (($minpostattach > $bbuserinfo[posts]) && $minpostattach!=0 && $extension!='gif' && $extension!='jpeg' && $extension!='png') {
        eval("standarderror(\"".gettemplate("error_attachmoreposts")."\");");
exit;
}
// end minimum posts to download attachments hack
And if you are perfectionist, you can also suppress the line :
$extension=strtolower(substr(strrchr($attachmentin fo
which appears just after the headers of the attachment.
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 01:07 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.12274 seconds
  • Memory Usage 2,296KB
  • 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
  • (4)bbcode_code
  • (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
  • (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