vBulletin SQL Help

Fredward

Acquaintance
Joined
Sep 17, 2009
Messages
36
Reaction score
0
FP$
6
On my site, i have a specific thread i want to require people to reply to before they can download an attachment, i've found a mod which does this on a global scale across all forums, but i want to limit it to a single thread. This is the code which is added to attachment.php

Code:
  if ( !$vbulletin->db->query_first ( "SELECT postid FROM " . TABLE_PREFIX . "post WHERE userid='".$vbulletin->userinfo[userid]."'  AND threadid=$threadinfo[threadid]" ) ) :   
                        eval('print_output("' . fetch_template('MARCO1 Cant See Attach') . '");');   
                endif ;

Could anyone tell me how i can edit this so i can define the thread it apples to?

Thanks 🙂
 
Code:
 if ( !$vbulletin->db->query_first ( "SELECT postid FROM " . TABLE_PREFIX . "post WHERE userid='".$vbulletin->userinfo[userid]."'  AND threadid=$threadinfo[threadid]" ) ) :   
                        eval('print_output("' . fetch_template('MARCO1 Cant See Attach') . '");');   
                endif ;

BACKUP BEFORE TRYING THIS!

Change to:

Code:
 if ( !$vbulletin->db->query_first ( "SELECT postid FROM " . TABLE_PREFIX . "post WHERE userid='".$vbulletin->userinfo[userid]."'  AND threadid=1" ) ) :   
                        eval('print_output("' . fetch_template('MARCO1 Cant See Attach') . '");');   
                endif ;

Changing the threadid from 1 to whatever number the forum is. I haven't actually tried this myself, so I cannot guarantee it works.
 
Thanks, that was my initial thought too - tried setting the threadid before i posted this thread, but it doesn't seem to alter anything.

It doesn't seem to break the query, but it doesn't work as we hoped, if you visit thread 3, or 4 then you still get the same message when trying to view the attachment.
 
Can you link me to the MOD you are using, I run vBulletin too do I might be able to help if I see where you got the MOD from.
 
I replied to that MOD for you, hopefully a reply will be given soon.
 
Back
Top Bottom