Thread Rating:
  • 5 Vote(s) - 4.2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tutorial] Adding gender and other things to the postbit
#1
This is something I have been wondering for a long time and I finally figured it out.
   

It turned out to be somewhat easy.
The first step can be ignored if you are using a Windows server or are adding something besides gender (or if you don't want to use images).
Open an FTP client and brows to MyBB's image directory. Find "male.gif" and "female.gif". Change the names to "Male.gif" and "Female.gif". You might want to add your own images for "Other" and "None selected" (make sure they are gif images).

Next, go into your admin CP.
Click "Configuration" then "Custom Profile Fields". Keep this open in a tab for now, the ID numbers will be needed later.
Open an new tab (or browser window) and go to your ACP again.
Click "Templates & Style" then "Templates".
Click the template set that goes along with your current theme (or whatever theme you want to add this to).
Scroll down until you find "Postbit Templates"
There are two templates here that we will worry about. "Postbit" if you want the image/text to show up near the avater/username of the user and "postbit_author_user" if you want it show up at the other end of the postbit.
Examples:
   
(don't ask)
In the "postbit" template, look for:
<td class="post_author">
Immediately following this is the code that returns the username.
<strong><span class="largetext">{$post['profilelink']}</span></strong>
And right after that is the code that returns the online status picture.
{$post['onlinestatus']}
If you want the gender picture to be on the other end of the postbit, go to the "postbit_author_user" template.
There isn't much in this template.
Number of posts:
{$lang->postbit_posts} {$post['postnum']}
Date joined
{$lang->postbit_joined} {$post['userregdate']}
Reputation
{$post['replink']}
Warning level
{$post['warninglevel']}
You can delete these as you see fit and add your own stuff to it.

Put this code where you want the image to be:
<img src="{$mybb->settings['bburl']}/images/{$post['fid3']}.gif" />
NOTE: You might have to adjust this code if you tweak your image directory.
Or, if you don't want to use images
Gender: {$post['fid3']}

If you want to add something else to the postbit, go to the tab with the "Custom Profile Fields" settings open and look at the ID number for what you want to add to the postbit.
Where you want it to come up, put this code:
{$post['fidX']}
Make sure you replace X with the ID number of the custom profile field.
That's about it! It's pretty easy but took me forever to figure out.
I hope that helps!
An error has occured...
Reply
#2
Thanks Man...

it's Fine... Smile
Reply
#3
Anyway to change it so that the Gender Shows after your name?
[Image: Chasingu.png]
Reply
#4
(01-11-2009, 11:49 PM)Chasingu Wrote: Anyway to change it so that the Gender Shows after your name?

Quote:Find:

<strong><span class="largetext">{$post['profilelink']}</span></strong>

Quote:Change To:

<strong><span class="largetext">{$post['profilelink']}</span></strong><img src="{$mybb->settings['bburl']}/images/{$post['fidx']}.gif" />

x = Your 'Custom Field ID'
[Image: aso_banner.png]
Reply
#5
Thanks.
[Image: Chasingu.png]
Reply
#6
*cough* You spelt the .gif extension wrong on Female.gif. You put Female.fig.
Otherwise, nice tutorial.
Reply
#7
(02-11-2009, 09:47 PM)jlong1 Wrote: *cough* You spelt the .gif extension wrong on Female.gif. You put Female.fig.
Otherwise, nice tutorial.
Fixed..
Reply
#8
(02-11-2009, 09:52 PM)TomL Wrote:
(02-11-2009, 09:47 PM)jlong1 Wrote: *cough* You spelt the .gif extension wrong on Female.gif. You put Female.fig.
Otherwise, nice tutorial.
Fixed..

Thanks Big Grin.
Reply
#9
(02-11-2009, 10:27 PM)jlong1 Wrote:
(02-11-2009, 09:52 PM)TomL Wrote:
(02-11-2009, 09:47 PM)jlong1 Wrote: *cough* You spelt the .gif extension wrong on Female.gif. You put Female.fig.
Otherwise, nice tutorial.
Fixed..

Thanks Big Grin.
No problemToungue I never knew there was a .fig extensionConfused lol
Reply
#10
(02-11-2009, 10:29 PM)TomL Wrote:
(02-11-2009, 10:27 PM)jlong1 Wrote:
(02-11-2009, 09:52 PM)TomL Wrote:
(02-11-2009, 09:47 PM)jlong1 Wrote: *cough* You spelt the .gif extension wrong on Female.gif. You put Female.fig.
Otherwise, nice tutorial.
Fixed..

Thanks Big Grin.
No problemToungue I never knew there was a .fig extensionConfused lol

Lol. Maybe it's part of the 'Fruit' application package. xD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)