Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > Programming Articles
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
How To Place Profile Info In Fieldset Style Boxes In postbit_legacy
peterska2
Join Date: Oct 2003
Posts: 6,504

 

Manchester, UK
Show Printable Version Email this Page Subscription
peterska2 peterska2 is offline 06-22-2006, 10:00 PM

This tutorial explains how to box profile information into individual fieldsets using two different methods in postbit_legacy.

I recommend using either one or the other of these effects as using them together will have a negative impact on the resulting postbit_legacy layout.

While this tutorial deals soley with the posts and join date part of the template, it gives easy to follow steps to use this on all your postbit information.


Fieldsets With Legends (no conditionals)

In your postbit_legacy template find
Code:
<div>
$vbphrase[posts]: $post[posts]
</div>
and replace with
Code:
<div>
<fieldset>
<legend>$vbphrase[posts]</legend>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td class="smallfont" align="center">$post[posts]</td>
</tr>
</table>
</fieldset>
</div>
There are a number of important details in this replacement code, so now we will look at each of them in turn.

Firstly, we have retained the
Code:
<div>
as this is used to place each piece of information on a new line. If this is omitted, then the layout will be compromised.

Next we have the
Code:
<fieldset>
This tells us that we are creating a fieldset box and everything until this is exited will be included within the box.

This is followed by
Code:
<legend>$vbphrase[posts]</legend>
This creates the title for the box which is emedded into the box border. You can place anything that you wish to use as the title for the box between the legend tags.

Now we move onto the content. In order to populate the box, we must first create a table to place the contents in. To do this we use the following code:
Code:
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td class="smallfont" align="center">
This tells us that we are creating a content table to fill the width of the fieldset box, with no border, no cellspacing and no cellpadding. We do not need to use cellspacing or cellpadding as the fieldset has padding included automatically. You will also notice that there is no class specified apart from smallfont. This is because we want it to use the same class as that section of the postbit (usually alt2). The smallfont class is used to ensure that the text remains a set style throughout the template. Finally in this section is the alignment for the content (in this case center). If you wish to have the content left aligned, then just remove this part of the code.

The next thing to be added is the actual content for the cell we have created. In this case we are using
Code:
$post[posts]
to display the postcount.

Finally, we need to close everything that we have opened, otherwise the rest of the page will attempt to nest itself within the first fieldset of the first post on the page. To do this, add
Code:
</td>
</tr>
</table>
</fieldset>
</div>
to the end of your content.

You will now have a box in your postbit that looks like this:





Fieldsets With Legends (using conditionals)

These are done in exactly the same manner, but the conditional must remain around the outside of the code.

An example of this is the join date information included in the above image.

The code used to generate this is
Code:
<if condition="$post['joindate']">
<div>
<fieldset>
<legend>$vbphrase[join_date]</legend>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td align="center" class="smallfont">
$post[joindate]
</td>
</tr>
</table>
</fieldset>
</div>
</if>
You will notice that the rest of the code is identical to that used for ths post count, apart from the conditional, the phrase to use in the legend, and the actual content.



Fieldsets Without Legends

If you like this effect, but don't want the labels to be separated from the information, then you can use the exact same methods used in the above examples apart from a couple of changes. This then provides a solid border around the information.

Looking at the post count code again, the replacement code would be
Code:
<div>
<fieldset>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td align="center" class="smallfont">
$vbphrase[posts]: $post[posts]
</td>
</tr>
</table>
</fieldset>
</div>
You will notice that this time we have not included a legend and have left the label next to the details to be posted.

Again, using the items that have conditionals simply involves placing this code within the if code.

The resulting effect using this method is:




I hope that you find this technique useful. If you use it and would like to be added as a live demo for this effect please post the URL to a page on your site where this is in action.
Reply With Quote
  #12  
Old 09-07-2006, 09:17 PM
Ohiosweetheart Ohiosweetheart is offline
 
Join Date: Dec 2005
Location: N.E. Ohio
Posts: 2,291
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm bumping this, hoping someone will have an answer?
Reply With Quote
  #13  
Old 09-23-2006, 02:50 PM
Ohiosweetheart Ohiosweetheart is offline
 
Join Date: Dec 2005
Location: N.E. Ohio
Posts: 2,291
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

aaaaaand asking again?
Reply With Quote
  #14  
Old 09-23-2006, 06:11 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

FYI, KA is offliine for a few weeks, so she is not likely to answer you.
Reply With Quote
  #15  
Old 09-29-2006, 03:42 AM
Ohiosweetheart Ohiosweetheart is offline
 
Join Date: Dec 2005
Location: N.E. Ohio
Posts: 2,291
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you Paul
Reply With Quote
  #16  
Old 10-18-2006, 10:16 PM
Ohiosweetheart Ohiosweetheart is offline
 
Join Date: Dec 2005
Location: N.E. Ohio
Posts: 2,291
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok Kerry-Anne, now that you're back............ please can you guide me here??
Reply With Quote
  #17  
Old 10-18-2006, 11:06 PM
peterska2 peterska2 is offline
 
Join Date: Oct 2003
Location: Manchester, UK
Posts: 6,504
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'll get to it in a few days. Still not really here proper (moving house again on friday), nor got a proper net connection. Poke me in a week if I haven't got back to you by then.
Reply With Quote
  #18  
Old 10-18-2006, 11:17 PM
Ohiosweetheart Ohiosweetheart is offline
 
Join Date: Dec 2005
Location: N.E. Ohio
Posts: 2,291
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you!
Reply With Quote
  #19  
Old 10-26-2006, 01:18 PM
scdurwood scdurwood is offline
 
Join Date: Aug 2006
Posts: 69
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just add a <fieldset> tag right after the <td> tag for the left side of the postbit...

....then close the </fieldset> right before the </td>.
Reply With Quote
  #20  
Old 10-26-2006, 02:05 PM
engager's Avatar
engager engager is offline
 
Join Date: Aug 2006
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Kerry-Ann, this is a nice bit of code, and I've done the simple changes, but I need your help on converting this please to Fieldsets With Legends (no conditionals)

Code:
<!-- Start Post Thank You Hack -->
<if condition="$post[userid]">
<br />
$vbphrase[post_thanks_thanks]: $post[post_thanks_user_amount]
<br />
<if condition="$post[post_thanks_thanked_times_on] == 1">
$vbphrase[post_thanks_time_post]
<else />
<if condition="$post[post_thanks_thanked_posts_on] == 1">
<phrase 1="$post[post_thanks_thanked_times]">$vbphrase[post_thanks_times_post]</phrase>
<else />
<phrase 1="$post[post_thanks_thanked_times]" 2="$post[post_thanks_thanked_posts]">$vbphrase[post_thanks_times_posts]</phrase>
</if>
</if>
</if>

<!-- End Post Thank You Hack -->
I'd appreciate your input!:nervous:

Thanks!
Reply With Quote
  #21  
Old 10-26-2006, 11:04 PM
Ohiosweetheart Ohiosweetheart is offline
 
Join Date: Dec 2005
Location: N.E. Ohio
Posts: 2,291
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by scdurwood
Just add a <fieldset> tag right after the <td> tag for the left side of the postbit...

....then close the </fieldset> right before the </td>.
Thank you very much scdurwood!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:54 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.04515 seconds
  • Memory Usage 2,307KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (11)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • 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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete