MyBB Community Forums

Full Version: Is there a way to do this in the Postbit?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there a way to do this? (see below):

[Image: untitled137jq.th.png]
Well yeah it is
u will need to make custom profile fields for each , this is step one

then open functions_post

find
PHP Code:
if($post['avatar'] != "" && $mybb->user['showavatars'] != "no"

above it add

PHP Code:
//the sex
��������$sex $db->fetch_array($db->query("SELECT fid3 FROM ".TABLE_PREFIX."userfields WHERE ufid='$post[uid]'"));
��������if($sex[fid3] == "Male"){
������������$sex "Sex: <img src=\"images/male.gif\" alt=\"Male\">";
��������}elseif($sex[fid3] == "Female"){
������������$sex "Sex: <img src=\"images/female.gif\" alt=\"Female\">";
��������}elseif($sex[fid3] == "Other"){
������������$sex "Sex: <img src=\"images/othersex.gif\" alt=\"Other\">";
��������}else{
������������$sex "";
��������}
        
// the birth sign
������$bsign $db->fetch_array($db->query("SELECT fid5 FROM ".TABLE_PREFIX."userfields WHERE ufid='$post[uid]'"));
��������if($bsign[fid5] == "sd"){
������������$bsign "Birth Sign: <img src=\"images/dono.gif\" alt=\"sd\">";
��������}elseif($bsign[fid5] == "sds"){
������������$bsign "Birth Sign: <img src=\"images/dono.gif\" alt=\"sds\">";
��������}elseif($bsign[fid5] == "something"){
������������$bsign "Birth Sign: <img src=\"images/dono.gif\" alt=\"somethg\">";
��������}else{
������������$bsign "";
��������}
        
//the star sign
         
$ssign $db->fetch_array($db->query("SELECT fid6 FROM ".TABLE_PREFIX."userfields WHERE ufid='$post[uid]'"));
��������if($ssign[fid6] == "sd"){
������������$ssign "Star Sign: <img src=\"images/dono.gif\" alt=\"sd\">";
��������}elseif($ssign[fid6] == "sds"){
������������$ssign "Star��Sign: <img src=\"images/dono.gif\" alt=\"sds\">";
��������}elseif($ssign[fid6] == "something"){
������������$ssign "Star��Sign: <img src=\"images/dono.gif\" alt=\"somethg\">";
��������}else{
������������$ssign "";
��������}
        
//the mood
        
$mood $db->fetch_array($db->query("SELECT fid7 FROM ".TABLE_PREFIX."userfields WHERE ufid='$post[uid]'"));
��������if($mood[fid7] == "sd"){
������������$mood "mood: <img src=\"images/dono.gif\" alt=\"sd\">";
��������}elseif($mood[fid7] == "sds"){
������������$mood "mood: <img src=\"images/dono.gif\" alt=\"sds\">";
��������}elseif($mood[fid7] == "something"){
������������$mood "mood: <img src=\"images/dono.gif\" alt=\"somethg\">";
��������}else{
������������$mood "";
��������

pls make sure to change fidX to the correspondence of those u have added

u will have to get the photos ur self i dont have them :$

just replace then also in the php code i have provided! for example replace dono.gif , by happy.gif

then in postbit tempates

add

Code:
$mood <br>
$ssign <br>
$bsign <br>
$sex <br>

regards
the Birth and Star Sign can be done so it does that by the birth date you enter in your usercp
Massacre Wrote:the Birth and Star Sign can be done so it does that by the birth date you enter in your usercp
How? I'd like to do that.
zaher1988's way will add a query for each of the items for each post. You don't need to do this, as the makepostbit function is passed all of the user profile fields along with the user.

For example, the sex:
switch($post['fid3'])
{
	case "Male":	
		$sex = "Sex: <img src=\"images/male.gif\" alt=\"Male\">";
		break;
	case "Female":
		$sex = "Sex: <img src=\"images/female.gif\" alt=\"Female\">";
		break;
	case "Other":
		$sex = "Sex: <img src=\"images/othersex.gif\" alt=\"Other\">";
		break;
	default:
		$sex = "";
}
It worked! Thanks!
Can u highlight line 745/746 ?
I got it taken care of. It was a typo on my part! Toungue

Is there a way to change "status: online/offline" to "status: (online/offline graphics)? Some of my users have trouble seeing the text.
Thanks! ^_^