User's Link in Postbit

Discussion in 'vBulletin Discussions' started by Tex, Nov 15, 2009.

  1. Tex

    Tex Adept

    Hi all!

    I am looking for a way users can add a link to their postbit. I know this is done by creating a profile field and using a conditional in the postbit template, but how would I make that link click-able like AA does it here?

    Cheers,
    Tex
     
  2. Tex

    Tex Adept

    Well I ended up answering my own question. Sometimes it helps to just get up and walk away from it for a while. :P

    For anyone who finds this thread looking for the answer you can use the following conditional in your postbit template:

    HTML:
    <if condition="$post['field8']"><div><a href="http://$post[field8]"><b>$post[field9]</b></a></div></if>
    

    *Note: you need to create 2 single line profile fields. One they should enter the URL without http:// and the second field they should enter the site name. Make sure you change the field numbers in the conditional above to your profile field numbers.
     
    3 people like this.
  3. Nick

    Nick Regular Member

    Glad you figured it out, Tex. That's exactly how we've got it set up. :)
     
  4. Tex

    Tex Adept

    Thanks Nick!

    Actually for my site I ultimately wanted my users to be able to post a link to their addon page from a specific addon site. I just changed the conditional a bit and used only one profile field for them to enter their username from the addon site.

    HTML:
    <if condition="$post['field8']"><div><a href="http://orbithangar.com/searchauth.php?search=$post[field8]"><b>$post[field8]'s Addons</b></a></div></if>
     
  5. Ryan Ashbrook

    Ryan Ashbrook Regular Member

    Here, use this one. It has better checking to see if they've actually filled out both fields.


    HTML:
    <if condition="$post['field8']">
    <div>
    <a href="http://$post[field8]"><b><if condition="$post['field9']">$post[field9]<else />$post[field8]</if></b></a>
    </div>
    </if>
    
    If the user hasn't filled out the Website Name field, but has filled out the URL field, then it will simply display the URL. Else it'll display the name.
     
    5 people like this.
  6. MjrNuT

    MjrNuT Grand Master

    so any location in the postbit template or somewhere particular?



    Thanks for the tip and info!!
     
  7. Ryan Ashbrook

    Ryan Ashbrook Regular Member

    Search for something similar to:

    HTML:
    <div>$post[posts]</div>
    That general area is where you should add it.
     
    2 people like this.
  8. Tex

    Tex Adept

    Thanks Ryan, nice addition. :)
     

Share This Page