Adding a custom button in postbit template

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tomydamic68
    Member
    • Jan 2009
    • 75
    • 3.8.x

    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
  • Mark.B
    vBulletin Support
    • Feb 2004
    • 24288
    • 6.0.X

    #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
    ------------
    My Unofficial vBulletin 6.0.0 Demo: https://www.talknewsuk.com
    My Unofficial vBulletin Cloud Demo: https://www.adminammo.com

    Comment

    • AliMadkour
      Senior Member
      • Dec 2004
      • 1588
      • 6.X

      #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

      • Mark.B
        vBulletin Support
        • Feb 2004
        • 24288
        • 6.0.X

        #4
        Originally posted by AliMadkour
        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
        ------------
        My Unofficial vBulletin 6.0.0 Demo: https://www.talknewsuk.com
        My Unofficial vBulletin Cloud Demo: https://www.adminammo.com

        Comment

        • tomydamic68
          Member
          • Jan 2009
          • 75
          • 3.8.x

          #5
          Worked beautifully! Thank you!

          Comment

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