Announcement

Collapse
No announcement yet.

Adding a custom button in postbit template

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Adding a custom button in postbit template

    Hello,
    not even sure if it's the right template, I would like to add a "subscribe to thread" button next to the edit button - To the left side of it. Any help? Thanks in advance!

    -Tom
    Attached Files

  • #2
    You would need a button making obviously. Upload this to your style's /buttons directory. Call it something like subscribe_postbit.gif

    Then find this code in the template postbit_legacy:
    Code:
    <if condition="$post['editlink']">
    Add above:
    Code:
    <a href="subscription.php?$session[sessionurl]do=addsubscription&amp;t=$post[threadid]" rel="nofollow""><img src="$stylevar[imgdir_button]/subscribe_postbit.gif" alt="$vbphrase[subscribe_to_this_thread]" border="0" /></a>
    The problem you'll have here, is that the link won't be dynamic - it will show the subscribe link even if the user is already subscribed to the thread. There's no way round that without custom coding.
    MARK.B | vBULLETIN SUPPORT

    TalkNewsUK - My vBulletin 5.6.4 Demo
    AdminAmmo - My Cloud Demo

    Comment


    • #3
      Note you should use $post[threadid] not $threadid
      Code:
      <a href="subscription.php?$session[sessionurl]do=addsubscription&amp;t=[B]$post[threadid][/B]"><img src="$stylevar[imgdir_button]/subscribe_postbit.gif" border="0" /></a>

      Former vBulletin Support Staff
      Need Help?, Or P.M. Me

      Comment


      • #4
        Originally posted by AliMadkour View Post
        Note you should use $post[threadid] not $threadid
        Yes, I just changed that actually, forgot to edit the code despite having gone to the trouble of actually testing the variable worked.
        MARK.B | vBULLETIN SUPPORT

        TalkNewsUK - My vBulletin 5.6.4 Demo
        AdminAmmo - My Cloud Demo

        Comment


        • #5
          Worked beautifully! Thank you!

          Comment

          widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
          Working...
          X