if ( !$vbulletin->db->query_first ( "SELECT postid FROM " . TABLE_PREFIX . "post WHERE userid='".$vbulletin->userinfo[userid]."' AND threadid=$threadinfo[threadid]" ) ) :
Replace With
PHP Code:
if ( !$vbulletin->db->query_first ( "SELECT postid FROM " . TABLE_PREFIX . "post WHERE userid='6".$vbulletin->userinfo[userid]."' AND threadid=$threadinfo[threadid]" ) ) :
if ( !$vbulletin->db->query_first ( "SELECT postid FROM " . TABLE_PREFIX . "post WHERE userid='".$vbulletin->userinfo[userid]."' AND threadid=$threadinfo[threadid]" ) ) :
Replace With
PHP Code:
if ( !$vbulletin->db->query_first ( "SELECT postid FROM " . TABLE_PREFIX . "post WHERE userid='6".$vbulletin->userinfo[userid]."' AND threadid=$threadinfo[threadid]" ) ) :
Ok i tried that, i didnt receive an error but it still didnt work.
Thanks for helping but if i cant get this sorted im gonna have to uninstall.
[edit] Infact it didnt work for anybody wanting to download after that code edit. They could reply to the thread 10 times and they still couldnt have downloaded the attachment.
Hi. Great plugin you have here. Is there a plugin or can you mod it so that it says they are require to have a certain number of posts before they are allowed to download?
This doesn't work in any way shape of form for me.
I've done the edit to the attachment.php.
Is there supposed to be an option in VB Options or anywhere else in Admin CP?
I think you need to elaborate on this a little more, maybe a better read me file.
Also worth mentioning when I reply to the post I still get the
Quote:
.You can't Download The Attachments Before Reply To The Thread.
Best Wishes
message.
This includes all usergroups including Admin even with this line in the attachments.php
Code:
if ( !$vbulletin->db->query_first ( "SELECT postid FROM " . TABLE_PREFIX . "post WHERE userid='6".$vbulletin->userinfo[userid]."' AND threadid=$threadinfo[threadid]" ) ) :
You need to remove the 6 from that line cos it doesnt work, infact it stops it from working altogether. As yet we havnt another solution to the Admin problem which is a shame cos this could be a really good mod for my forum.
If you want to prevent a usergroup or groups from having to reply to a thread before downloading attachment you need to do this..
Replace this code ...
PHP Code:
if ( !$vbulletin->db->query_first ( "SELECT postid FROM " . TABLE_PREFIX . "post WHERE userid='".$vbulletin->userinfo[userid]."' AND threadid=$threadinfo[threadid]" ) ) :
with this this..
PHP Code:
if (!is_member_of($vbulletin->userinfo, x, y, z))
{
if ( !$vbulletin->db->query_first ( "SELECT postid FROM " . TABLE_PREFIX . "post WHERE userid='".$vbulletin->userinfo[userid]."' AND threadid=$threadinfo[threadid]" ) ) :
}
Changing x, y, z for your groups that dont need to reply.
If you want to prevent a usergroup or groups from having to reply to a thread before downloading attachment you need to do this..
Replace this code ...
PHP Code:
if ( !$vbulletin->db->query_first ( "SELECT postid FROM " . TABLE_PREFIX . "post WHERE userid='".$vbulletin->userinfo[userid]."' AND threadid=$threadinfo[threadid]" ) ) :
with this this..
PHP Code:
if (!is_member_of($vbulletin->userinfo, x, y, z)) { if ( !$vbulletin->db->query_first ( "SELECT postid FROM " . TABLE_PREFIX . "post WHERE userid='".$vbulletin->userinfo[userid]."' AND threadid=$threadinfo[threadid]" ) ) : }
Changing x, y, z for your groups that dont need to reply.
Hope that helps.
Thanks to Lynne for her help.
Thanks for the advise but now I get this error when the attachment is clicked.
Code:
Parse error: syntax error, unexpected '}' in /home/test/domains/test-forum.com/public_html/forum/attachment.php on line 193
Quote:
Install :
Import The Product From Your Admincp
Open Read Me file In attachments For File Changes