Advertisement:

Author Topic: Gender Member Color Link  (Read 29454 times)

Offline [SiNaN]

  • SMF Super Hero
  • *******
  • Posts: 11,509
  • Young and Foolish
    • SimplePortal
Gender Member Color Link
« 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.
« Last Edit: August 18, 2008, 11:20:32 AM by H »
Former SMF Core Developer | My Mods | My Anime List | SimplePortal | Samanyolu Fanları

Offline BuЯЯЯЯaK

  • SMF Hero
  • ******
  • Posts: 2,121
  • Gender: Male
  • Burak
    • dinle sevgili
Re: Gender Member Color Link
« Reply #1 on: August 18, 2008, 11:21:09 AM »
Thanks Sinan :)

Nice tip =)

Offline remi_naija

  • Jr. Member
  • **
  • Posts: 131
    • The Nigerian Forum
Re: Gender Member Color Link
« Reply #2 on: May 22, 2009, 06:59:21 AM »
Found this useful too.
Thanks Sinan

Offline Wanchope

  • Jr. Member
  • **
  • Posts: 147
    • Serg Forum
Re: Gender Member Color Link
« Reply #3 on: June 09, 2009, 06:38:26 AM »
Thanks,It is useful.

Offline kaewjung

  • Semi-Newbie
  • *
  • Posts: 10
Re: Gender Member Color Link
« Reply #4 on: July 03, 2009, 02:29:19 AM »
ok thank you so much

Offline _Anthony_

  • Full Member
  • ***
  • Posts: 547
Re: Gender Member Color Link
« Reply #5 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

Offline Hayalet Sürücü

  • Semi-Newbie
  • *
  • Posts: 25
Re: Gender Member Color Link
« Reply #6 on: September 23, 2009, 10:02:26 AM »
Thanks, good job

Offline abdull@h

  • Full Member
  • ***
  • Posts: 436
  • Gender: Male
    • Arsivlik.Net
Re: Gender Member Color Link
« Reply #7 on: November 06, 2009, 03:29:43 PM »
Thanks  :) nice tip