The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
HOW-TO Check if user is subscribed to thread?
I'm looking for some kind of conditional in SHOWTHREAD to check if a user is subscribed to the thread.
Basically as of now I have a 'subscribe to thread' button that shows only to members. I was hoping there is a way to add one more conditional to check if the user already subscribed to the thread, in which case the button would disappear. |
#2
|
||||
|
||||
Try this: add new plugin showthread_query
PHP Code:
PHP Code:
|
#3
|
|||
|
|||
And how to make it work on vbulletin 3.8? Thanks
|
#4
|
||||
|
||||
Create the plugin as stated above, name it Subscribed.
Hook Location, select, showthread_query In the Plugin PHP Code message area, Add: Code:
$hook_query_fields .= " ,subscribethread.*"; $hook_query_joins .= " LEFT JOIN " . TABLE_PREFIX . "subscribethread AS subscribethread ON (subscribethread.threadid=post.threadid AND subscribethread.userid=post.userid)"; In your postbit or postbit_legacy template find: Code:
<if condition="$post['signature']"> <!-- sig --> <div> __________________<br /> $post[signature] </div> <!-- / sig --> </if> <br><br><br><br><br><br><br><br><br> Code:
<div align="left"> <if condition="$post['subscribethreadid']">Subscribed</if> </div> |
#5
|
|||
|
|||
Just install this mod...[OzzModz] Users Subscribed To Thread Block. I have this running and it's great.
https://vborg.vbsupport.ru/showthread.php?t=305173 |
Благодарность от: | ||
Max Taxable |
#6
|
||||
|
||||
Quote:
Quote:
|
Благодарность от: | ||
Max Taxable |
#7
|
|||
|
|||
Thanks blind.
To make it work under ForumDisplay also? Or make it work on all site? Should I change hook location to "global start"? Much thanks. |
#8
|
||||
|
||||
No plugin needed...
There is an image on the Forum Display page that shows if you are subscribed. Its a bit small, but does its job. You would just need to change the image to your liking on the Forum Display page |
#9
|
|||
|
|||
Agreed, I didn't realize the age of the thread and I was directing my reply to the person who started the thread, as this is the VB4 section after all.
|
#10
|
|||
|
|||
Do you mean this (?):
Code:
<if condition="$show['subscribed_to_forum']"> <a href="subscription.php?$session[sessionurl]do=removesubscription&f=$foruminfo[forumid]" rel="nofollow">$vbphrase[unsubscribe_from_this_forum]</a> <else /> <a href="subscription.php?$session[sessionurl]do=addsubscription&f=$foruminfo[forumid]" rel="nofollow">$vbphrase[subscribe_to_this_forum]</a> </if> Any suggestions? |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|