Java Popup W/ Custom Profile Fields?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • reefland
    Senior Member
    • Sep 2000
    • 1131

    Java Popup W/ Custom Profile Fields?

    Like the Quick Links pop-up when you click on it...

    I would like to make a little link under the username in the postbit that when clicked would open the little pop-up and display a couple of custom profile fields I use. Any ideas how to acheive this?

    Thanks,
    Scott Z.
    Reefland.com
    sigpic
    Nation of Blue - Kentucky Wildcats Sports


    Some CMS Goodness: Add Avatar to Article
  • Jake Bunce
    Senior Member
    • Dec 2000
    • 46598
    • 3.6.x

    #2
    Edit the appropriate postbit template:

    Admin CP -> Styles & Templates -> Style Manager -> « » -> Postbit Templates -> postbit or postbit_legacy (depending on which layout you are using)

    Add this code where you want the "clickable" text to appear:

    Code:
    <div id="profile_fields_$post[postid]">
    	CLICK ME
    	<script type="text/javascript"> vbmenu_register("profile_fields_$post[postid]", true); </script>
    </div>
    And add this code to the very bottom of the template. This is the menu that pops up when you click the text:

    Code:
    <div class="vbmenu_popup" id="profile_fields_$post[postid]_menu" style="display:none">
    	STUFF HERE
    </div>
    See this thread for instructions on how to add profile fields to the postbit. The last block of code might look like this, for example:

    Code:
    <div class="vbmenu_popup" id="profile_fields_$post[postid]_menu" style="display:none">
    	$post[field1]
    	$post[field2]
    	...
    </div>

    Comment

    • reefland
      Senior Member
      • Sep 2000
      • 1131

      #3
      Excellent Jake, I will give it a shot. One last question, is there a way to only show the clickable link if 1 of the 3 custom profile fields has something in it? None of them are required so if all three fields are blank, I don't need to show the clickable link that will display the pop-up.

      Thanks,
      Scott Z.
      Reefland.com
      sigpic
      Nation of Blue - Kentucky Wildcats Sports


      Some CMS Goodness: Add Avatar to Article

      Comment

      • Jake Bunce
        Senior Member
        • Dec 2000
        • 46598
        • 3.6.x

        #4
        Add the red code to the first block of code:

        Code:
        [color=red]<if condition="$post[field1] OR $post[field2] OR $post[field3]">[/color]
        <div id="profile_fields_$post[postid]">
        	CLICK ME
        	<script type="text/javascript"> vbmenu_register("profile_fields_$post[postid]", true); </script>
        </div>
        [color=red]</if>[/color]
        Change the field indentifiers in the condition, and expand on the condition so it checks all of the relevant profile fields.

        Comment

        • reefland
          Senior Member
          • Sep 2000
          • 1131

          #5
          Thank you for that Jake, works like a charm!

          The last problem I am having is with the alignment of this pop-up. I noticed when I first added it that if someone had a lot of text in one of these profile fields, the box would display off the left of the screen. I thought I mitigated this by reducing it to a 125 charater maximum field but some users are still reporting that it isn't centered.

          In this thread:

          The user in post #1 shows off the left of the screen for me, the user in #2 shows fine. If you would check it out, you can see what I mean. The clickable link is Tank Information located just under the users post count.

          Thanks
          Scott Z.
          sigpic
          Nation of Blue - Kentucky Wildcats Sports


          Some CMS Goodness: Add Avatar to Article

          Comment

          • Jake Bunce
            Senior Member
            • Dec 2000
            • 46598
            • 3.6.x

            #6
            Maybe try specifying a width on the table. That should force the popup to be less wide:

            Code:
            <div class="vbmenu_popup" id="profile_fields_96502_menu" style="display:none">
            	<table [color=red]width="200"[/color] cellpadding="4" cellspacing="1" border="0">
            	<tr>
            
            		<td class="thead">kbsig106's Tank Information</td>
            	</tr>
            
                    <tr><td class="vbmenu_option">
            	<b>Tank and Equipment:</b> 30G w/ PC Orbit Hood (65w x2), 550 Power Head w/ UGF, (2) 170 Bio-Wheels.</td></tr>
            
                    <tr><td class="vbmenu_option">
            	<b>Livestock:</b> 25 Lbs of Fiji Live rock - high coralline growth, (2) Common Clowns, (1) Mandarin, (3) Camel Shrimp, (1) Peppermint Shrimp, (7) Turbo Snails, (2) Limpets and (1) Atlantic Anomie.</td></tr>
            
                    <tr><td class="vbmenu_option">
            	<b>Experience in the Hobby:</b> The tank is 18 months old and I just added the Orbit PC last month. I was lucky to get by with (1) 50/50 40w bulb for 16 months with no major kills or chemical problems. This is my second reef tank - the first was in '94 and lost th who tank due to p</td></tr></table>
            </div>

            Comment

            • reefland
              Senior Member
              • Sep 2000
              • 1131

              #7
              Humm, that didn't do it. I tried the width at both 200 and 90%. Strange that they move off the screen like that?
              sigpic
              Nation of Blue - Kentucky Wildcats Sports


              Some CMS Goodness: Add Avatar to Article

              Comment

              • Jake Bunce
                Senior Member
                • Dec 2000
                • 46598
                • 3.6.x

                #8
                I have no idea why some are off the screen.

                Comment

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