Announcement

Collapse
No announcement yet.

Profile Field as link?

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

  • plutonash
    replied
    Moved to new post
    Last edited by plutonash; Fri 18 Feb '11, 5:03am.

    Leave a comment:


  • zeroality
    replied
    If I remember correctly, you'll have to manually edit the postbit templates to add in the custom profile fields.

    It's nasty, complicated business. I tried adding one to my forums as a badge system and got it working, mostly. But one thing I couldn't resolve led me to scrap the whole thing. Can't remember what it was though, been a while.

    Leave a comment:


  • plutonash
    replied
    I don't get this - I have added a new User Profile Field (field8) but can't find it in the postbit template. I need to make it a hyperlink (as discussed at the start of this thread).

    Would appreciate any help, please.

    Many thanks
    Last edited by plutonash; Thu 17 Feb '11, 10:15am.

    Leave a comment:


  • TheLastSuperman
    replied
    Originally posted by hellekim View Post
    Thank you! Got it working now!
    Old expression:

    "Good, good, good"

    Leave a comment:


  • hellekim
    replied
    Thank you! Got it working now!

    Leave a comment:


  • TheLastSuperman
    replied
    Originally posted by hellekim View Post
    I hope I don't kidnapp this thread, but I feel this would fit to this topic.

    I'm trying to get a user profile field5 to show on my site. After the upgrade from 3.8.2 to 4.0.6 it didn't work anymore.

    My code:
    Code:
        <vb:if condition="$post['field5'] != ''"><br /><div>Minä kannatan: <img src="http://forum.domain.com/images/MyTeam/$post[field5].png" title="$post['field5']"></div></vb:if>
    At least the "<vb:if condition="$post['field5'] != ''">" works as the "Minä kannatan:" parts comes out, but the rest doesn't and the output is:

    <div>Minä kannatan: <img src="http://foorumi.domain.com/images/MyTeam/$post[field5].png" title="$post['field5']"></div>Can someone help me out?
    See if this helps: http://www.vbulletin.com/forum/showt...74#post2036374

    Use {vb:raw post.fieldx} instead of the userinfo we discussed there as your still using this to show in posts, if not and you want to show on their profile then follow the userinfo references in that thread.

    Post back here if it does, that way this thread has a link to what solved your question and no need to bump the other thread as we know here that it was useful info .

    Leave a comment:


  • hellekim
    replied
    I hope I don't kidnapp this thread, but I feel this would fit to this topic.

    I'm trying to get a user profile field5 to show on my site. After the upgrade from 3.8.2 to 4.0.6 it didn't work anymore.

    My code:
    Code:
        <vb:if condition="$post['field5'] != ''"><br /><div>Minä kannatan: <img src="http://forum.domain.com/images/MyTeam/$post[field5].png" title="$post['field5']"></div></vb:if>
    At least the "<vb:if condition="$post['field5'] != ''">" works as the "Minä kannatan:" parts comes out, but the rest doesn't and the output is:

    <div>Minä kannatan: <img src="http://foorumi.domain.com/images/MyTeam/$post[field5].png" title="$post['field5']"></div>Can someone help me out?

    Leave a comment:


  • giovanni40223
    replied
    Just tested it and it was close. If you did not have a signature at all it would not display the original code. Tricky one. I am in process of cleaning up with what i came up with. This has been a challenge. As soon as i took something out of the signature in the profile settings the code vanish and did not show the machine. Okay mate . Yes I appreciate everything. I am going to clean it up and try to see if i can shorten it down some.

    Not sitting right with you . I can understand. Trust me I am sure there is a shorter way and now I am going to try to find it. I learn by mistakes so here i go ...

    Thanks again mate.

    Leave a comment:


  • TheLastSuperman
    replied
    Your code is well... not sitting right with me and lets leave it at that, basically start fresh with a default postbit template and locate the beginning and ending IF for the signature then tinker within that to add these links, use my code if you wish and modify to suite. It's late Matt and I need to get back on it for someone else bud so I'll check on this tomorrow and see how you've come along and also too many comments i.e. <!-- all over the place make it clean code and I know you space it out to know what's yours but templates merging in new code during upgrades do not like all the extra spacing imo so keep it together and label it only at beginning and end of your code. If you label things right you can come in and do str_replacements on <!-- tags quite handy down the road, I use labels/hidden comments to keep up with changes and the dates implemented.

    Leave a comment:


  • TheLastSuperman
    replied
    Originally posted by giovanni40223 View Post
    Here for everyone else if they wonder about how to do this. Please superman if i am wrong correct me but this makes it either way if you have signature or not . You get a nice pretty one below with correct formatting. If you pick you have product 1 in your profile settings it gives you one link and if you go back and pick product 2 you get another link in your signature .

    Code:
       {vb:raw template_hook.postbit_signature_start}
                                   {vb:raw ad_location.ad_showthread_firstpost_sig}
                    <vb:if condition="$post['signature']">
                            <blockquote class="signature restore"><div class="signaturecontainer">{vb:raw post.signature}</div>
    
    
    <!-- matt mod -->
    
    <div class="signaturecontainer">
    
    <vb:if condition="$post['field7'] == 'machine 1' "> Machine: <a href="http://www.google.com"  {vb:raw post.field7} </a>
    
    <vb:else />
    
     Machine: <a href="http://www.amazon.com">{vb:raw post.field7} </a>
    <br /><br /></vb:if>
    
    </div>
    
    </div></blockquote>
    
    
    <!-- matt mod -->
    
                     </vb:if>
    <!-- matt mod extended -->
    
    <vb:else />
    
    <div class="after_content">      
                                           
      <blockquote class="signature restore"><div class="signaturecontainer">
    
    <!-- matt modd -->
    <vb:if condition="$post['field7'] == 'machine 1' "> Machine: <a href="http://www.google.com">{vb:raw post.field7} </a>
    
    <vb:else />
    
     Machine:<a href="http://www.amazon.com">{vb:raw post.field7} </a>
    <br /><br /></vb:if>
    
    <!-- matt modd --></div></blockquote>
                
            </div>
    <div>
    
                                            {vb:raw template_hook.postbit_signature_end}
                </div>
    I mean this in one of those *sigh I'm tired but time to go back at it moods... the red killed my eyes

    Lemme check it real quick...

    Originally posted by giovanni40223 View Post
    Also to clarify ...sometimes client requests get me thinking real hard and i kept going at it til i get it right. But yes i do not care how many times i stare at the code i end up getting it right for clients sake. I just wanted to clarify that. Even it takes me a long time. This one actually took me awhile and challenged me. But i do go crazy cause sometimes i have a hard time figuring it out.

    I will test your code out as it might be better superman.
    Try it and see if it works...

    Leave a comment:


  • giovanni40223
    replied
    Also to clarify ...sometimes client requests get me thinking real hard and i kept going at it til i get it right. But yes i do not care how many times i stare at the code i end up getting it right for clients sake. I just wanted to clarify that. Even it takes me a long time. This one actually took me awhile and challenged me. But i do go crazy cause sometimes i have a hard time figuring it out.

    I will test your code out as it might be better superman. Also i will take your tip. I understand what you mean . Hopefully i did not offend you on offering to pay for your knowledge/time.

    Leave a comment:


  • giovanni40223
    replied
    Here for everyone else if they wonder about how to do this. Please superman if i am wrong correct me but this makes it either way if you have signature or not . You get a nice pretty one below with correct formatting. If you pick you have product 1 in your profile settings it gives you one link and if you go back and pick product 2 you get another link in your signature .

    Code:
       {vb:raw template_hook.postbit_signature_start}
                                   {vb:raw ad_location.ad_showthread_firstpost_sig}
                    <vb:if condition="$post['signature']">
                            <blockquote class="signature restore"><div class="signaturecontainer">{vb:raw post.signature}</div>
    
    
    <!-- matt mod -->
    
    <div class="signaturecontainer">
    
    <vb:if condition="$post['field7'] == 'machine 1' "> Machine: <a href="http://www.google.com"  {vb:raw post.field7} </a>
    
    <vb:else />
    
     Machine: <a href="http://www.amazon.com">{vb:raw post.field7} </a>
    <br /><br /></vb:if>
    
    </div>
    
    </div></blockquote>
    
    
    <!-- matt mod -->
    
                     </vb:if>
    <!-- matt mod extended -->
    
    <vb:else />
    
    <div class="after_content">      
                                           
      <blockquote class="signature restore"><div class="signaturecontainer">
    
    <!-- matt modd -->
    <vb:if condition="$post['field7'] == 'machine 1' "> Machine: <a href="http://www.google.com">{vb:raw post.field7} </a>
    
    <vb:else />
    
     Machine:<a href="http://www.amazon.com">{vb:raw post.field7} </a>
    <br /><br /></vb:if>
    
    <!-- matt modd --></div></blockquote>
                
            </div>
    <div>
    
                                            {vb:raw template_hook.postbit_signature_end}
                </div>

    Leave a comment:


  • TheLastSuperman
    replied
    Originally posted by giovanni40223 View Post
    You will not believe this at all ..But you just posted that up and i solved it finally on my test board. My code looks nothing like that. If you have msn PM me your id . I will paypal you twenty dollars just to look at code. I do not know why yours would not work I had to change it. I know if i did yours that it would not appear unless i put a signature in the settings. I followed my code and understand the logic but i am shocked cause your logic looks the same but only thing i think i did was wrap it so it made it down in signature spot. With yours i think it was butting it right against the content. I truly thank you for showing me this and the break down of code. I am sure it will help people. I am just baffled and muffed.

    If you want to shoot me PM you can.

    I would post code here but might want to clean it up or show you on test board. Sometimes clients get me all crazy with there requests. <- not an expert like superman

    still want to shoot you some money ... I am just like that ...someone helps me out in a jam ...I pay for there valuable time.
    Again no PayPal, besides I'm about to be back on another project in the next few so I might not be back for until tomorrow sometime.

    I did not test the previous code but try this version to see if my adjustments helped:
    Code:
    			<vb:if condition="$post['signature']">
    			<blockquote class="signature restore">
    		<div class="signaturecontainer">
    <vb:if condition="$post['field5']"><div align="center">Web: <a href="http://$post[field5]">$post[field5]</a></div></vb:if>
                    {vb:raw post.signature}
                    </div>
    			</blockquote>
    			<vb:else />
    			<vb:if condition="$post['field5']"><div align="center">Web: <a href="http://$post[field5]">$post[field5]</a></div></vb:if>
    			</vb:if>
    I removed the postdata class as that might have been causing the issue and also moved it down into the css for the sig just above the sig. The bottom code might still need css to tell it font size etc otherwise should be same as body/post.

    Edit: And as a favor just make sure you do people right if they are your clients and we will always be friends. Some might take that statement the wrong way and label you so be careful how you thank one as well, just a tip imo.

    Leave a comment:


  • giovanni40223
    replied
    You will not believe this at all ..But you just posted that up and i solved it finally on my test board. My code looks nothing like that. If you have msn PM me your id . I will paypal you twenty dollars just to look at code. I do not know why yours would not work I had to change it. I know if i did yours that it would not appear unless i put a signature in the settings. I followed my code and understand the logic but i am shocked cause your logic looks the same but only thing i think i did was wrap it so it made it down in signature spot. With yours i think it was butting it right against the content. I truly thank you for showing me this and the break down of code. I am sure it will help people. I am just baffled and muffed.

    If you want to shoot me PM you can.

    I would post code here but might want to clean it up or show you on test board. Sometimes cilents get me all crazy with there requests. <- not an expert like superman <posted anyways>

    still want to shoot you some money ... I am just like that ...someone helps me out in a jam ...I pay for there valuable time.
    Last edited by giovanni40223; Thu 19 Aug '10, 8:11pm.

    Leave a comment:


  • TheLastSuperman
    replied
    Originally posted by giovanni40223 View Post
    well dang i feel like a freeloader. ...

    Thank you for the explanation and the links. I have not seen those before and helps big time. I will check out the mods also ..maybe they will help me a little more.

    <hitting the virtual thank you button >

    but thinking about this for a minute if i did any of the code above it must have a signature for it to work.

    I am missing how to just add it and have it in signature and if someone makes a signature then it also adds that to it also below the specifications ? Maybe i explained wrong. Just trying to have it added there if you do not have a signature. Then if you have signature that new data is appended to the default that is there already. I have it all working except that part. I must of explained it wrong.

    Where is the redbull ..going to be a long night. Unless i missed something.

    I still have paypal. LOL
    You do know what they say about assuming right? Basically the new code I provided does just that.

    Follow along with me here:
    Code:
    			<vb:if condition="$post['signature']">
    			<blockquote class="signature restore">
    <vb:if condition="$post['field5']"><div class="postdata">Web: <a href="http://$post[field5]">$post[field5]</a></div></vb:if>
    		<div class="signaturecontainer">{vb:raw post.signature}</div>
    			</blockquote>
    			<vb:else />
    			<vb:if condition="$post['field5']"><div class="postdata">Web: <a href="http://$post[field5]">$post[field5]</a></div></vb:if>
    			</vb:if>
    <vb:if condition="$post['signature']">
    = If the user DOES have a signature do this:

    <blockquote class="signature restore">
    = The div code, the class = css code that helps style it!

    <vb:if condition="$post['field5']"><div class="postdata">Web: <a href="http://$post[field5]">$post[field5]</a></div></vb:if>
    = Ok this is a slight doozy if your thinking about it for the the first time but it basically says:
    If user has something entered in field 5 then div style this word Web and the a href link.

    <div class="signaturecontainer">{vb:raw post.signature}</div>
    </blockquote>
    = the Actual signature code in a css div wrapper and the end of the blockquote which helps it look separated best way to explain it.

    <vb:else />
    = Otherwise do this...

    <vb:if condition="$post['field5']"><div class="postdata">Web: <a href="http://$post[field5]">$post[field5]</a></div></vb:if>
    = If the user has something entered into field 5 show this! *Now after the else notice there is no code regarding a signature.

    </vb:if>
    = Well this ends the question the code asked your forum, the asnwer is either in the top code or the bottom code based on what the user entered in IF anything in his/her signature and/or field 5.

    So to sum it all up,

    If the user has a signature -
    Show the web link and signature
    OTHERWISE
    Show just the web link
    Ending the question to the forum

    Got it?

    Leave a comment:

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