The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Minimum posts to download attachments.. Details »» | |||||||||||||||||||||||||
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
|
Comments |
#2
|
||||
|
||||
Thanks! I'll give this a go.
|
#3
|
||||
|
||||
one question can make this when u post a attach file set user
how many posts can download???can do that?thankz... |
#4
|
||||
|
||||
Nice I'm still considering whether to use it or not but I just think I might
|
#5
|
|||
|
|||
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 |
#6
|
|||
|
|||
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 ? |
#7
|
|||
|
|||
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 |
#8
|
||||
|
||||
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'")." "); Code:
// minimum post to view attachments if ($bbuserinfo[posts] < $minpostattach and $getforuminfo['forumid']==X) { eval("standarderror(\"".gettemplate("error_attachmoreposts")."\");"); exit; } 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. |
#9
|
||||
|
||||
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?? |
#10
|
|||
|
|||
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 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 $extension=strtolower(substr(strrchr($attachmentin fo which appears just after the headers of the attachment. |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|