how do i add gender icons to profiles?

Mod that adds a extra field to the users profile, the gender is displayed beside the posts

Moderator: Moderators

Forum rules
The content in this forum is dated Dec. 21 2005 and can be used as Archive only. This Forum is LOCKED and READ ONLY !

how do i add gender icons to profiles?

Postby Hotrocket on Thu 07. Oct, 2004 11:25

Hello, :D
I would like to add the gender icon images to the members profiles next to the text "male" - "female"

How do I do this?..I think I know but can't seen to locate the code that calls the images..anyone know?

thanks!
Hotrocket
Poster
Poster
 
Posts: 2
Joined: Wed 29. Sep, 2004 09:50

Postby kooky on Thu 07. Oct, 2004 20:30

gender's images variables are $images['icon_minigender_male'] and $images['icon_minigender_female']
Take a look in viewtopic :)
kooky
brilliant supporter
 
Posts: 1329
Joined: Tue 31. Dec, 2002 17:52
Location: Au pays des rêves

Postby Hotrocket on Thu 07. Oct, 2004 23:20

excellent! thanks for the quick reply too!
:D
Hotrocket
Poster
Poster
 
Posts: 2
Joined: Wed 29. Sep, 2004 09:50

Postby nopeekiepeekie on Wed 13. Apr, 2005 16:13

i'm a real newbie at coding, i don't quite understand how you get the icon to show up in the user's profile. if possible, could you explain this a little more?

thanks in advance

C~
nopeekiepeekie
Poster
Poster
 
Posts: 2
Joined: Mon 28. Mar, 2005 16:54

Postby kooky on Fri 15. Apr, 2005 16:37

First, we declare $image variable in common.php
$images = array();
-> an array is table, refer to PHP manual for further information

Now we can use $images['xxxx'] which return the path of the image, see in
your_theme.cfg

if in PHP you use echo '<img src="' . $images['value'] . '" />'
You will have the image value in your page

in your viewtopic.php you have this:
Code: Select all
      // Start add - Gender Mod
      switch ($postrow[$i]['user_gender'])
      {
         case 1:
            $gender_image = $lang['Gender'] . ': <img src="' . $images['icon_minigender_male'] . '" alt="' . $lang['Male'] . '" title="' . $lang['Male'] . '" border="0" /><br />';
            break;
         case 2:
            $gender_image = $lang['Gender'] . ': <img src="' . $images['icon_minigender_female'] . '" alt="' . $lang['Female'] . '" title="' . $lang['Female'] . '" border="0" /><br />';
            break;
         default:
            $gender_image = '';
            break;
      }
      // End add - Gender Mod

Do the same for your usercp_viewprofile.php :roll:
kooky
brilliant supporter
 
Posts: 1329
Joined: Tue 31. Dec, 2002 17:52
Location: Au pays des rêves

Postby nopeekiepeekie on Mon 18. Apr, 2005 20:07

okay i think i have the code in the right spot. now i'm looking in my profile_view_body.tpl what code to i stick there to make the image show up? i've tried GENDER_IMAGE & POSTER_GENDER and neither work.
nopeekiepeekie
Poster
Poster
 
Posts: 2
Joined: Mon 28. Mar, 2005 16:54

Postby kooky on Wed 20. Apr, 2005 18:17

in your php file, what is the variable name which you assigned this $gender_image?
In your template(array(...

Use this key in tpl like {GENDER_IMAGE}
kooky
brilliant supporter
 
Posts: 1329
Joined: Tue 31. Dec, 2002 17:52
Location: Au pays des rêves


Return to Gender [2.0.10/EM]

Who is online

Users browsing this forum: No registered users and 1 guest

cron