![]() |
Limit Attachment Downloads based off Posts!!! Help Please
Does anyone know how to limit downloading of forum attachments based off post count?
|
You can modify the template attachmentbit.
Code:
<!-- code corrected, see post #5 below --> Change the 50 to whatever post count you want it to be. If you want to make it more advanced than that, you should post a mod request. |
Thank you sir!
--------------- Added [DATE]1237866241[/DATE] at [TIME]1237866241[/TIME] --------------- hey does this work with vb 3.8 because it does not seem to be working for me???? please help --------------- Added [DATE]1237866710[/DATE] at [TIME]1237866710[/TIME] --------------- It's still allowing downloads & i copied your code word for word! |
Templates should use $bbuserinfo instead of $vbulletin->userinfo. Also, postcount may be the post number at the location - maybe spit it out and see (like this is post #4)
|
Ah, I just kinda wrote it without thinking. Yeah, I agree $bbuserinfo is a much better way to go about it. I think it would then be...
Code:
<if condition="$bbuserinfo['posts'] >= 10"> |
Quote:
|
Keep in mind that there is such a thing as browser caching, and post caching. When testing this, make sure you're clearing your brower's cache.
How to clear the cache for the page you're viewing For Firefox: hold SHIFT and click the refresh button on the toolbar For Internet Explorer: hold CTRL and click the refresh button on the toolbar |
I am pretty sure ['posts] won't work if a user has more than 1,000 posts because of the comma. That variable $post['posts'] gets formatted prior to use in the postbit templates. I think you need to write a plugin to get the 'real' unformatted posts to use in a condition.
|
Ok. I've tried your updated code, Cleared my browsers chache & cookies and It's still not working on the forum. I think Lynne may be right that some of the variables are incorrect.
Thanks. |
It's not that the variable is wrong, it's just that you can't use it in a condition since it's formatted. You need to write a plugin, maybe using postbit_display_start?, to grab the posts number *before* it gets formatted.
|
Quote:
|
Is that so? I was under the impression that PHP operated like Perl in that it would convert the string to a number for comparison - but perhaps the number is converted to a string for comparison instead...
If that's the case... Then yes... We'd have to collect the post count before the template runs. I... Don't really know if I want to take this mod on. You should post a mod request. |
All times are GMT. The time now is 11:13 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|