The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
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> Code:
$post[fieldx] 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] Code:
.gif 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> 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> 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. |
#12
|
||||
|
||||
Just found it, eep, that sucks. Time to use the ol' noggin I wonder if there's a way to let a *.php or template access the custom profile fields phrases, or to somehow auto-copy specified ones to a custom global phrase. Got any ideas?
What about 3.5.x, how does it store the titles? |
#13
|
|||
|
|||
3.5.x doesn't store them as phrases, it just stores the plain text if I recall correctly.
|
#14
|
|||
|
|||
I've been looking all over for something like this. Thank you so much!
|
#15
|
||||
|
||||
can anyone post a global code so post[fieldx] can be used on any page? thx T_T
|
#16
|
|||
|
|||
Great tutorial, thanks for that
|
#17
|
||||
|
||||
Was given this link, as per a request. On VB' .com
Sweet tut' thanks. Only thing to add, may not work on postbit. I found i had to edit postbit legacy too. Ozzy |
#18
|
||||
|
||||
Great tutorial
|
#19
|
|||
|
|||
I have a request about how vB handles language keys and image associations. I had a postbit and user profile mod for phpBB which managed this and I have only just started looking at modding vB.
The simple addition of a country flag illustrates this well. flag_au.GIF --> Australia.GIF works but that requires renaming all the flags according to the names in the list whilst the original bundle already provides a translation key: ... au=Australia ... in phpBB this is done using a language key where anything called for as 'au' shows up as 'Australia'; then the menu list would be the list of keys ... au ... which is an easier job to edit than the actual file names - including the fact that there are spaces and capitalisation in the file names and also some exceptions to the two letter country code etc... There must be some simple code that would allow the supplied list to be used in both the dropdown and the image file translation without a lot of editing? Language key: at=Austria au=Australia aw=Aruba ax=Aaland Drop down menu is then set up as at au aw ax but displays to users as Austria Australia Aruba Aaland and when one is selected by the language key in the profile it translates to: flag_at.GIF flag_au.GIF flag_aw.GIF flag_ax.GIF or flag_$post[fieldX].GIF I hope this is a reasonable place to ask this question. |
#20
|
|||
|
|||
I wanted to use a title for the displayed text option but dont know where i place the code, please help!
|
#21
|
|||
|
|||
[s]I would like to use the custom profile field in other places than the postbit, for use as a Display Name.
Just realized $post[field5] wouldn't work when I went to the "Who's Online" template... $userinfo[field5] and $vbphrase[field5] didn't work either. SOMEONE?! PLEASE?![/s] $bbuserinfo[field5] did the trick. |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|