vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Programming Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=188)
-   -   How To Add Custom Profile Field Information To The Postbit (https://vborg.vbsupport.ru/showthread.php?t=118896)

peterska2 06-16-2006 10:00 PM

How To Add Custom Profile Field Information To The Postbit
 
So you've added some custom profile fields and would like the information to display in the postbit, but how do you go about it? This guide will help you to do this.

Throughout this guide the x in fieldx is to be replaced with the field number as shown in the profile field manager in the name column.

Single Line Text Boxes

To add the contents of a single line text box to the postbit, use one of the following formats:

To use a title for the displayed text (eg Real name: Kerry-Anne)
Code:

<if condition="$post[fieldx]"><div class="smallfont">Label for text: $post[fieldx]</div></if>
To simply display the text (eg Kerry-Anne)
Code:

$post[fieldx]
Multiple Line Text Boxes

While I don't recommend displaying these in the postbit as they can contain a large amount of information, they are done in the exact same way as the single line text box.

Note: The text entered will display all on one line, not in multiple lines as added to the text box and displayed in the profile page.


Single Selection Radio Buttons & Single Selection Menus

These both display text in the same way as the Single Line Text Box so the same format can be applied to these. However, as these are mainly used for fixed options (eg Date of Birth, or Homepage contains adult content here at vB.org) they can also be used to display images (eg the gender in postbit modification).

These examples, using images, assume that you have uploaded the images to your misc image directory for the style that you are using. You can replace
Code:

$stylevar[imgdir_misc]
with the appropriate path to your images if different. They also assume that the file type of the images is gif. If this is different, you will need to alter it in the code by replacing
Code:

.gif
with the appropraite extension. Your image names need to be exactly the same as the profile field options, including capitalization.

To use the contents to display an image, with no label, use the following format:
Code:

<if condition="$post[fieldx]"><div><img src="$stylevar[imgdir_misc]/$post[fieldx].gif" border="0" alt="$post[fieldx]" /></div></if>
To show a label before the image, use the following format:
Code:

<if condition="$post[fieldx]"><div class="smallfont">Label for image: <img src="$stylevar[imgdir_misc]/$post[fieldx].gif" border="0" alt="$post[fieldx]" /></div></if>
Multiple Selection Menus and Checkboxes

I wouldn't recommend using these to display information in the postbit, as to enable them requires long usage of conditionals to translate the code saved in the database into displayable text.


I hope you find this useful. Feel free to ask any questions related to this.

zooki 06-21-2006 10:46 PM

THanks very much Peter :) i will try it out later tomorrow.

Princeton 06-22-2006 12:26 PM

Very helpful! :up:

SDTA 06-22-2006 01:24 PM

:up: Thanks for this.

How would I make the Single Line Text Boxes into a link:

For instance I would like a link that says "MY JOURNAL" to appear in the postbit...

bashy 06-22-2006 08:51 PM

Hi KA

Can you please take a look at my thread HERE It is slightly related to this although i have only just found this thread, I have managed to get mine to show in the postbit but i want more from it, all explained in the thread :)

TiA

Sir_Yaro 07-26-2006 03:52 PM

thank you

Shazz 07-26-2006 03:54 PM

Thanx its helpful, but what if i want to hide something in the postbit?

Like example if i wanted to hide Posts: 175

And they have an option to click yes or no in the profile field...
*Noob question
________
Ford Versailles history

L9IAnime 07-30-2006 09:04 AM

extremely helpful tutorial, exactly what i was looking for, thankyou so much :)

Wired1 08-08-2006 12:08 AM

Hehe, looks like a hack of mine :)

Question: Where is the Profile Field Title stored, and how can one call it, for instance, to replace the "Label for text"?

peterska2 08-08-2006 12:18 AM

In 3.6 it is stored as a phrase in the custom profile fields phrases but this isn't available globally. The best way is to either hard code or to add a custom global phrase for it.


All times are GMT. The time now is 08:49 AM.

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

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01227 seconds
  • Memory Usage 1,736KB
  • 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
  • (6)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (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