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
  #22  
Old 05-10-2003, 10:00 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

EvilLS1, The red x is still showing for me on attachments that are set to view. I have Slynderdale's "Show Image attachments" hack installed and it doesn't show the image with that, just the red x. I have "View image attachments" turned of in the Admin CP but with Slynderdale's hack, you can set it to view an attachment or a link. How would I get this to work with that?
Reply With Quote
  #23  
Old 05-10-2003, 11:07 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, I figured out how to do it by putting it in the postbit_attachmentimage template (using Logician's Dynamic Templates hack). In place of the actual image showing, they will see the contents of the error_attachmoreposts template. How can I pull the $minpostattach amount form the postbit_attachmentimage template? Right now, unless I hard code it, it shows nothing for the number.
Reply With Quote
  #24  
Old 05-10-2003, 11:10 AM
EvilLS1's Avatar
EvilLS1 EvilLS1 is offline
 
Join Date: Apr 2002
Location: Georgia, USA
Posts: 987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Boofo,
Did you reinstall the updated version of the hack in the zip? I added Sophocle's fix aswell as another improvement which is described a couple of posts above this one. Try re-downloading the zip file in the first post & reinstalling the newer version. Let me know if that fixes it (it should).
Reply With Quote
  #25  
Old 05-10-2003, 11:21 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I already installed that before I wrote the last message. The hack for show image attachments is what is messing it up. I like it the way I have it now where is shows the message in place of the image in the post. I just want to be able to have it show the $minpostattach amount in the postbit_attachmentimage without having to hard code it in. If they're not allowed to download attachments, they shouldn't be able to view them either.
Reply With Quote
  #26  
Old 05-10-2003, 11:29 AM
EvilLS1's Avatar
EvilLS1 EvilLS1 is offline
 
Join Date: Apr 2002
Location: Georgia, USA
Posts: 987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you installed the code from Sophocle's post you will still get red Xs for images with the .jpg extension because he forgot to include $extension!='jpg' in his code. I added it in the zip though.

I'm not sure why the $minpostattach isn't working in that template for ya. I gotta hit the sack right now but I'll check it out when I get up.
Reply With Quote
  #27  
Old 05-10-2003, 11:35 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The code I installed is from your hack. I help off until you changed yours.

You might want to take a look at The Show images hack. It works with the viewimages set to off.

Somehow, I need to add something somewhere that will pull out that number, but I don't know where.
Reply With Quote
  #28  
Old 05-10-2003, 11:43 AM
EvilLS1's Avatar
EvilLS1 EvilLS1 is offline
 
Join Date: Apr 2002
Location: Georgia, USA
Posts: 987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Today at 01:35 PM Boofo said this in Post #26
The code I installed is from your hack. I help off until you changed yours.

You might want to take a look at The Show images hack. It works with the viewimages set to off.




{EDIT} OK, n/m. I know what your saying now.. I'll check out the show images hack.
Reply With Quote
  #29  
Old 05-10-2003, 11:52 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The "Show Images hack" allows you to show an image in the post when the viewimages is turned off in the Admin CP. That way, you can show an image instead of a link on a post by post basis.

Right now, I have it set up to show the error template in place of the image inside the post. I think if they are not allowed to download attachments, they shouldn't be able to view them either. I accomplished this by doing a conditional in the postbit_attachmentimage template itself. What I can't get to show in the template is the number that is set for the $minpostattach variable. I have to hard code whatever number that is inside the template. I think I need to define that variable inside the attachment.php.
Reply With Quote
  #30  
Old 05-10-2003, 11:58 AM
EvilLS1's Avatar
EvilLS1 EvilLS1 is offline
 
Join Date: Apr 2002
Location: Georgia, USA
Posts: 987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Boofo,
I just realized that you were talking about a completely different hack. At first when you said "show images hack" I thought you were referring to the post by Sophocle in the first page of this thread. I'm an idiot! lol
Reply With Quote
  #31  
Old 05-10-2003, 12:06 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, you're not an idiot. I was not explaining myself very well, I guess.

All I really need now is to get the $minpostattach variable ammount to show up in the postbit_attachmentimage template.
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:01 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.04532 seconds
  • Memory Usage 2,302KB
  • 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
  • (1)bbcode_quote
  • (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
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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_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