Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Now Available => Topic started by: [SiNaN] on August 18, 2008, 11:19:04 AM

Title: Gender Member Color Link
Post by: [SiNaN] on August 18, 2008, 11:19:04 AM
Question: How do make the member color links gender based?
Original Topic: -

../Sources/Load.php

Find:

Code: [Select]
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $profile['ID_MEMBER'] . '" title="' . $txt[92] . ' ' . $profile['realName'] . '">' . $profile['realName'] . '</a>',
Replace:

Code: [Select]
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $profile['ID_MEMBER'] . '" title="' . $txt[92] . ' ' . $profile['realName'] . '">' . (!empty($profile['gender']) ? '<span style="color: #' . ($profile['gender'] == 1 ? '0000FF' : 'FF0000') . ';">' : '') . $profile['realName'] . (!empty($profile['gender']) ? '</span>' : '') . '</a>',
../Sources/BoardIndex.php

Find:

Code: [Select]
mg.onlineColor, mg.ID_GROUP, mg.groupName
Replace:

Code: [Select]
mg.onlineColor, mg.ID_GROUP, mg.groupName, mem.gender
Find:

Code: [Select]
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a>';
Replace:

Code: [Select]
if(!empty($row['gender']))
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '" style="color: #' . ($row['gender'] == 1 ? '0000FF' : 'FF0000') . ';">' . $row['realName'] . '</a>';
else
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a>';

Change 0000FF as hex color for male and FF0000 as hex color for female.
Title: Re: Gender Member Color Link
Post by: BuЯЯЯЯaK on August 18, 2008, 11:21:09 AM
Thanks Sinan :)

Nice tip =)
Title: Re: Gender Member Color Link
Post by: remi_naija on May 22, 2009, 06:59:21 AM
Found this useful too.
Thanks Sinan
Title: Re: Gender Member Color Link
Post by: 1Chope on June 09, 2009, 06:38:26 AM
Thanks,It is useful.
Title: Re: Gender Member Color Link
Post by: kaewjung on July 03, 2009, 02:29:19 AM
ok thank you so much
Title: Re: Gender Member Color Link
Post by: _Anthony_ on July 03, 2009, 03:32:40 AM
i have an smf 2.0 mod for this located at http://custom.simplemachines.org/mods/index.php?mod=1878
Title: Re: Gender Member Color Link
Post by: Hayalet Sürücü on September 23, 2009, 10:02:26 AM
Thanks, good job
Title: Re: Gender Member Color Link
Post by: abdull@h on November 06, 2009, 03:29:43 PM
Thanks  :) nice tip