Customizing SMF > Now Available
Gender Member Color Link
[SiNaN]:
Question: How do make the member color links gender based?
Original Topic: -
../Sources/Load.php
Find:
--- Code: --- 'link' => '<a href="' . $scripturl . '?action=profile;u=' . $profile['ID_MEMBER'] . '" title="' . $txt[92] . ' ' . $profile['realName'] . '">' . $profile['realName'] . '</a>',
--- End code ---
Replace:
--- Code: --- '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>',
--- End code ---
../Sources/BoardIndex.php
Find:
--- Code: --- mg.onlineColor, mg.ID_GROUP, mg.groupName
--- End code ---
Replace:
--- Code: --- mg.onlineColor, mg.ID_GROUP, mg.groupName, mem.gender
--- End code ---
Find:
--- Code: --- $link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a>';
--- End code ---
Replace:
--- Code: --- 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>';
--- End code ---
Change 0000FF as hex color for male and FF0000 as hex color for female.
BuЯЯЯЯaK:
Thanks Sinan :)
Nice tip =)
remi_naija:
Found this useful too.
Thanks Sinan
Wanchope:
Thanks,It is useful.
kaewjung:
ok thank you so much
Navigation
[0] Message Index
[#] Next page
Go to full version