Version: 1.00, by EvilLS1
Developer Last Online: May 2021
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.
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.
Important! If you use this hack the "View Images" option in the admin control panel should be set to "no" or else guests & people who don't have enough posts will only see a red X.
I thought it was a too big limitation, so my suggestion permit to show images attachments even if the user hasn't send the minimum number of messages.
Sophocle,
That is an excellent idea! The only problem that I saw with it is that perhaps some people prefer that users with less than the minimum # of posts not be able to download images.. And even with the "view images" option set to "no", they would still be able to download images that way.
But there's an easy solution..
Code:
if ($viewattachedimages==1) {
$extension=strtolower(substr(strrchr($attachmentinfo[filename],"."),1));
if (($minpostattach > $bbuserinfo[posts]) && $minpostattach!=0 && $extension!='gif' && $extension!='jpeg' && $extension!='jpg' && $extension!='png') {
eval("standarderror(\"".gettemplate("error_attachmoreposts")."\");");
exit;
}
} else if ($minpostattach > $bbuserinfo[posts] and $minpostattach!=0) {
eval("standarderror(\"".gettemplate("error_attachmoreposts")."\");");
exit;
}
With this code, 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 when attempting to download images.. But 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.
I've tested this and it works. I'll update the zip file in the first post.
{edit} I just noticed something.. As an added bonus, this hack will also stop people from hot linking images on other sites if you set view images to no and minimum posts > 0.