Thread: Show Thread Enhancements - Profile Fields in a Postbit Dropdown
View Single Post
  #126  
Old 06-18-2010, 02:00 PM
cfish's Avatar
cfish cfish is offline
 
Join Date: Aug 2006
Location: Hampshire, UK
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Wired1 View Post
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!
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01439 seconds
  • Memory Usage 1,834KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_html
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete