vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Show Thread Enhancements - Profile Fields in a Postbit Dropdown (https://vborg.vbsupport.ru/showthread.php?t=208360)

Wired1 06-09-2010 05:33 PM

Was going to release the 4.0 ugly beta last night after I posted the 4.0 tabs mod, but I decided to get some sleep :)

It'll be out soon. Why not post it now you ask? Because I'm posting from my phone :) Automation needs functionality tweaking.

Dave-M 06-13-2010 11:42 PM

Looking forward to it mate, thanks for it in advance :)

dendrob 06-14-2010 01:14 PM

Quote:

Originally Posted by Wired1 (Post 2036707)
Please be patient!

So, you're saying you want a dropdown with 50 lines?

Yes, exactly... that would be ideal... right now you can put a text box, but it shows up without line breaks. I want one field where when user enters

Line 1
Line 2
Line 3
...
Line 25

currently it will show up without line breaks

Line1Line2Line3...Line25

which is useless

members on my site enter list of animals that they keep so this drop down is very handy to see what a member keeps. Your mod significantly cleans up the signatures...before users would create signatures that are 25lines high, to show the animals they keep. Now it's nice and clean in a drop down.
Thanks for the mod!

dendrob 06-16-2010 05:59 PM

so...any ideas if this is possible or if it will be made in the next update?

Wired1 06-16-2010 10:46 PM

It would be outside the scope of the mod, but it's possible. Something like if profile field 34, then parse lines by line break or special character or something.

cfish 06-18-2010 02:00 PM

1 Attachment(s)
Quote:

Originally Posted by Wired1 (Post 2051119)
Working, but ugly as hell. Probably going to just release it as a beta and see if someone with better CSS skills than I can clean it up.

I just completed a similar hack for my vB4 forum. I even managed to get my head around the styling and have used only existing stylevars for colours, so it will update with different styles. Feel free to use any of this:

Template markup:
I have used a h6 header and a definition list for the different fields and values - semantically, I think that's the best approach.

PHP Code:

<!-- start Computer Details -->
<
vb:if condition="$post['field13'] OR $post['field14'] OR $post['field15'] OR $post['field16'] OR $post['field17'] OR $post['field18'] OR $post['field19'] OR $post['field20']">
        <
div class="popupmenu" style="clear:both">
            <
a href="javascript://" class="popupctrl">Computer Details</a>
            <
dl class="popupbody" style="width:250px">
                <
h6>{vb:raw post.username}'s Computer Details</h6>
            <vb:if condition="$post['
field13']">
                <dt>Operating System:</dt><dd>{vb:raw post.field13}</dd>
            </vb:if>
            <vb:if condition="$post['
field14']">
                <dt>Computer:</dt><dd>{vb:raw post.field14}</dd>
            </vb:if>
            <vb:if condition="$post['
field16']">
                <dt>Motherboard:</dt><dd>{vb:raw post.field16}</dd>
            </vb:if>
            <vb:if condition="$post['
field17']">
                <dt>CPU:</dt><dd>{vb:raw post.field17}</dd>
            </vb:if>
            <vb:if condition="$post['
field18']">
                <dt>RAM:</dt><dd>{vb:raw post.field18}</dd>
            </vb:if>
            <vb:if condition="$post['
field19']">
                <dt>Graphics:</dt><dd>{vb:raw post.field19}</dd>
            </vb:if>
            <vb:if condition="$post['
field20']">
                <dt>Stotage:</dt><dd>{vb:raw post.field20}</dd>
            </vb:if>
            <vb:if condition="$post['
field15']">
                <dt>Monitor:</dt><dd>{vb:raw post.field15}</dd>
            </vb:if>
            </dl>
        </div>

</vb:if>
<!-- end Computer Details --> 

I have added this just below the avatar in the postbit_legacy template (there's no template hook in that location) but I guess it could go at any hook location.

Notice that I had to add one inline style rule (clear:both) to the containing div in order to keep it in place.

I haven't bothered to use language variables.

Resulting HTML markup:

HTML Code:

<!-- start Computer Details -->
                <div class="popupmenu" style="clear:both">
                        <a href="javascript://" class="popupctrl">Computer Details</a>
                        <dl class="popupbody" style="width:220px">
                                <h6>CADTutor's Computer Details</h6>
                                <dt>Operating System:</dt><dd>Windows Vista Home Premium SP2 32bit</dd>
                                <dt>Motherboard:</dt><dd>Asus P5K WS</dd>                       
                                <dt>CPU:</dt><dd>Intel Core2Duo E6850 @ 3.0 GHz</dd>                       
                                <dt>RAM:</dt><dd>4GB PC2-8500 C5 Corsair Dominator</dd>                       
                                <dt>Graphics:</dt><dd>NVIDIA Quadro FX 1700 512 MB</dd>                       
                                <dt>Stotage:</dt><dd>Samsung Spinpoint T166 320 GB</dd>                       
                                <dt>Monitor:</dt><dd>BenQ FP241W 24&quot; Wide</dd>               
                        </dl>
                </div>
<!-- end Computer Details -->

Notice that the definition list has a fixed width. This is because the default "auto" value restricts it to the with of the postbit user info column, so I'm forcing it to be wider.

Additional CSS added at the bottom of the additional.css template:

HTML Code:

/* COMPUTER DETAILS DROP-DOWN */
.popupbody h6 {
font-weight: bold;
color: {vb:stylevar postbithead_color};
background: {vb:stylevar postbithead_background};
padding: 6px 7px;
border: {vb:stylevar postbithead_border};
}
.popupbody dt {
background-color: {vb:stylevar popupmenu_background.backgroundColor};
padding: 3px 7px 4px 7px;
}
.popupbody dd {
background-color: {vb:stylevar formrow_background.backgroundColor};
padding: 3px 7px 4px 7px;
}

In the default style:

Attachment 118586

This is what it looks like in postbit_legacy.

I'm not claiming to be an expert at any of this but I thought it might help progress this mod. I'd be grateful if, in return, you could see any obvious improvements I could make to my hack.

Thanks - keep up the good work!

Wired1 06-18-2010 03:43 PM

Gotta remember to post my code tonight. Looks largely the same, but I didn't have issues with width restrictions. The opposite actually where something would make it really long in testing. JS thing I think.

Dennis B 06-22-2010 03:39 PM

Thanks cfish. :)

cfish 06-22-2010 03:49 PM

Quote:

Originally Posted by Dennis B (Post 2057526)
Thanks cfish. :)

Just one update to the above. I upgraded to vB4.0.4 and the styling on the pop-up vanished! So I moved the custom CSS from the popupmenu.css template to the postbit.css template and now all works well. I'll update the post above accordingly.

dendrob 06-22-2010 06:46 PM

Quote:

Originally Posted by Wired1 (Post 2054719)
It would be outside the scope of the mod, but it's possible. Something like if profile field 34, then parse lines by line break or special character or something.

could you paste the code please. Is that something that needs to be done in your mod or in the postbit template. Doesn't seem like this would be too difficult for you. Even maybe with a special character delimited (say |) if that would be easier


All times are GMT. The time now is 02:41 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01298 seconds
  • Memory Usage 1,777KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_html_printable
  • (1)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete