Announcement

Collapse
No announcement yet.

Profile Field as link?

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

  • [Forum] Profile Field as link?

    I was wondering if there was a way/option/mod that can set profile fields as a link.
    Either instantly creating a hyperlink out of the inputted text or into a 'Click Here' or even better users can enter the name of the link themselves?

    All help appreciated.

  • #2
    I have the same quetion. I been working on getting it like that for awhile. But with a list.

    Comment


    • #3
      you have to edit the postbit manually atm

      something like this:
      Code:
      <vb:if condition="$post['field5']"><div class="postdata">Web: <a href="http://$post[field5]">$post[field5]</a></div></vb:if>

      Comment


      • #4
        yeah i finally got it right after i posted. I just wondering how i can add it to signature in the actual post bit legacy. So even if they do not have a signature it shows up. I been trying for hours.

        Comment


        • #5
          Originally posted by punchbowl View Post
          you have to edit the postbit manually atm

          something like this:
          Code:
          <vb:if condition="$post['field5']"><div class="postdata">Web: <a href="http://$post[field5]">$post[field5]</a></div></vb:if>
          Originally posted by giovanni40223 View Post
          yeah i finally got it right after i posted. I just wondering how i can add it to signature in the actual post bit legacy. So even if they do not have a signature it shows up. I been trying for hours.
          Hours? Ohh man let's save you some frustration!

          So then search postbit template and find:

          Code:
          			<vb:if condition="$post['signature']">
          			<blockquote class="signature restore"><div class="signaturecontainer">{vb:raw post.signature}</div></blockquote>
          			</vb:if>
          Replace with:
          Code:
          			<vb:if condition="$post['signature']">
          			<blockquote class="signature restore"><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>
          Now you can spruce up that code more if you want and even style it with CSS if desired. The key thing to remember in case your templates do not merge right in your next upgrade is that you edited a default template to achieve this so make a note of that now .
          *Also here on vb.com they use the postbit_legacy template so there's the column on the left otherwise postbit is the one with all user info at the top going across horizontal and yes each one is slightly different due to that so be sure your editing the right one .


          Former vBulletin Support Staff
          Hacked recently? See my blog post "Recovering a Hacked vBulletin Site".
          Thinking outside the box? Need modification support? Visit www.vBulletin.org and have at it!

          Comment


          • #6
            Well superman you came to rescue. That is where i was at . Oh you know me on vbulletin.org as mmoore5553. I thought that would be the right code but if they put a signature in then the else is overlooked right ?

            also if i want to put an array has that changed from vb3 ? do i need to register anything ? I have around 6 if statements ..here is sample code.


            this is just dummy code used to test : i was going to put it in an array. I am just making custom profile field with drop down to show people what they have . Then it will provide a link to that product. For each thing they choose in that particular drop down they get that particular product and that particular link, which will be different for each product.

            product machine 1 , machine 2, machine 3 , etc.
            link 1, link 2, link 3

            If you show how to do that in an array .i have paypal ready to send a donation.

            Code:
            <vb:if condition="$post['field7'] == 'machine 1' "> Machine: <a href="http://www.google.com">{vb:raw post.field7} </a>
            <br /><br />
            <vb:else />
            
            
            
             <a href="http://www.amazon.com">Machine:{vb:raw post.field7} </a>
            <br /><br /></vb:if>
            Last edited by giovanni40223; Thu 19 Aug '10, 1:33pm.

            Comment


            • #7
              Originally posted by giovanni40223 View Post
              Well superman you came to rescue. That is where i was at . Oh you know me on vbulletin.org as mmoore5553. I thought that would be the right code but if they put a signature in then the else is overlooked right ?

              also if i want to put an array has that changed from vb3 ? do i need to register anything ? I have around 6 if statements ..here is sample code.


              this is just dummy code used to test : i was going to put it in an array. I am just making custom profile field with drop down to show people what they have . Then it will provide a link to that product. For each thing they choose in that particular drop down they get that particular product and that particular link, which will be different for each product.

              product machine 1 , machine 2, machine 3 , etc.
              link 1, link 2, link 3

              If you show how to do that in an array .i have paypal ready to send a donation.

              Code:
              <vb:if condition="$post['field7'] == 'machine 1' "> Machine: <a href="http://www.google.com">{vb:raw post.field7} </a>
              <br /><br />
              <vb:else />
              
              
              
               <a href="http://www.amazon.com">Machine:{vb:raw post.field7} </a>
              <br /><br /></vb:if>
              I own my own business doing vBulletin customizations so I'm always busy but when I post on these forums for vBulletin support it's always free the only catch is I only post when I have a few spare minutes and in between research and development etc. so long story short no PayPal needed .

              Basically yes your right, the else would only show your www link if they did not have a signature however you can add it in regardless above or below the signature i.e.

              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>
              Now the neat thing about that is, it uses div to separate not <br /> tags as I have found them to do spacing slightly different in each browser or at least to my eye it's that way however if it's not spaced do what you know and simply add a <br />. Another tip is you could after the else statement include a link to update their signature and maybe a quick note like: $username you don't currently have a signature! Click here to create one. etc etc.

              I have a mod that will rotate content in the signature here: http://www.vbulletin.org/forum/showthread.php?t=228026 which was inspired by Digital Jedi another good coder from his mod here: http://www.vbulletin.org/forum/showthread.php?t=237867 for the postbit_legacy template so all initial credit goes to DJ for the idea to integrate into vB .

              Explaining how to register variables, arrays etc etc in a simple way... well that's simply is not possible imo as I think you need to learn your own way, the way I learned was via reviewing the files and templates myself along with info another coder posted that was very helpful. Here are some helpful links to that info:

              http://www.vbulletin.org/forum/showthread.php?t=228078
              &
              http://www.vbulletin.com/forum/entry...etin-templates
              &
              http://www.vbulletin.com/forum/entry...in-4-templates

              So basically the way I explain it might confuse you, it's best to read those pages and figure it out on your own otherwise you'll be just another copy/paste'r OR someone who drains their PayPal account and you can do it yourself and save money .
              Last edited by TheLastSuperman; Thu 19 Aug '10, 3:27pm.


              Former vBulletin Support Staff
              Hacked recently? See my blog post "Recovering a Hacked vBulletin Site".
              Thinking outside the box? Need modification support? Visit www.vBulletin.org and have at it!

              Comment


              • #8
                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
                Last edited by giovanni40223; Thu 19 Aug '10, 4:03pm.

                Comment


                • #9
                  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?


                  Former vBulletin Support Staff
                  Hacked recently? See my blog post "Recovering a Hacked vBulletin Site".
                  Thinking outside the box? Need modification support? Visit www.vBulletin.org and have at it!

                  Comment


                  • #10
                    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.

                    Comment


                    • #11
                      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.


                      Former vBulletin Support Staff
                      Hacked recently? See my blog post "Recovering a Hacked vBulletin Site".
                      Thinking outside the box? Need modification support? Visit www.vBulletin.org and have at it!

                      Comment


                      • #12
                        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>

                        Comment


                        • #13
                          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.

                          Comment


                          • #14
                            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...


                            Former vBulletin Support Staff
                            Hacked recently? See my blog post "Recovering a Hacked vBulletin Site".
                            Thinking outside the box? Need modification support? Visit www.vBulletin.org and have at it!

                            Comment


                            • #15
                              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.


                              Former vBulletin Support Staff
                              Hacked recently? See my blog post "Recovering a Hacked vBulletin Site".
                              Thinking outside the box? Need modification support? Visit www.vBulletin.org and have at it!

                              Comment

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