How can I edit postbit_legacy to include additional profile field where it is a link

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Rupe42
    Member
    • Jan 2010
    • 68
    • 3.8.x

    [Forum] How can I edit postbit_legacy to include additional profile field where it is a link

    I've done a search, and gone a little cross-eyed trying to figure this out, coming close, but not close enough

    A friend suggested this code -
    Code:
    <if condition="$post['field5']">Twitter: <a  href="http://twitter.com/$post[field5]" target='_blank'  style="text-decoration: none;">
    @$post[field5]
    </a>
    <br />
    </if>
    Though as it was from an older version of vb didn;t work on mine :s

    So I had a play and came up with this, thinking it might work as it was purely extending the logic of the other bits of my postbit legacy and applying them as above
    Code:
    <vb:if condition="$post['field5']"><dt>{vb:rawphrase  twitter}</dt> <dd><a href="http://twitter.com/{vb:twitter  post.field5}" target='_blank' style="text-decoration: none;">
    {vb:twitter post.field5}</a></dd></vb:if>
    Well, trying to save that throws a fatal error in my face -

    Code:
    Fatal error: Uncaught exception 'Exception' with message 'Unable to find  a class to validate: vB_TemplateParser_Curlytwitter' in  /....../forum/includes/class_template_parser.php:1028  Stack trace: #0  /....../forum/includes/adminfunctions_template.php(2750):  vB_TemplateParser->validate(Array) #1  /....../forum/admincp/template.php(2108):  compile_template('{vb:raw templat...') #2 {main} thrown in  /....../forum/includes/class_template_parser.php  on line 1028
    where /....../ is the begiing of the url

    So..... What, where & how? I gotta be close, but have I got to define something else somewhere or somehow, if so, would really appreciate a pointer or two on this!

    Also, as I wanna do the same for 2 other clickable links, but with images, how much different would that be from the code my buddy provided here -
    Code:
    <if condition="$post['field6']"><a href="http://www.facebook.com/$post[field6]" target='_blank' ">
    <img alt="My Facebook" border="0" src="..../images/misc/facebook.png" border="0"/>
    </a>
    </if>
  • Rupe42
    Member
    • Jan 2010
    • 68
    • 3.8.x

    #2
    Also, would kinda like the ability to make the inputted fields appear as links on the users profile page too....

    Comment

    • Andy
      Senior Member
      • Jan 2002
      • 5886
      • 4.1.x

      #3
      Here you go.

      PHP Code:

      <vb:if condition="$post['field5']">Twitter

      <
      a href="http://twitter.com/{vb:raw post.field5}">{vb:raw post.field5}</a>

      </
      vb:if> 

      Comment

      • Rupe42
        Member
        • Jan 2010
        • 68
        • 3.8.x

        #4
        Andy! I could give ya a big sloppy kiss!

        You know what it's like when you have been staring at the screen for so long that the code goes all blurry and no matter how many times you headbutt the screen you just can't see the obvious?

        I did have to add the dd and dt tags in to space it properly, then I decided to **** it and went and used images instead!
        Though now am using images on top of each other, (am adding facebook, etc) the space inbetween them is a little cramped, any suggestions on increasing it? have tried a BR but nothing happening there, or am I sticking it in the wrong place?

        Ok, am off to hunt for which template I need to edit so these changes are replicated on the profile page and hoping it's not more complicated for me than this! Especially as I have now opened a bottle of celebratory cider!

        (seems I Can't give you rep as you must have assisted in the past and I've not given rep to others since!!!)
        Last edited by Rupe42; Wed 13 Apr '11, 8:28pm. Reason: rep limits! Grrrr

        Comment

        • Andy
          Senior Member
          • Jan 2002
          • 5886
          • 4.1.x

          #5
          Glad to help.

          Regarding spacing, I use <br /><br /> but I'm not sure if that will work for you.

          Comment

          Related Topics

          Collapse

          Working...