News:

Wondering if this will always be free?  See why free is better.

Main Menu

Birthday color in messages?

Started by hcfwesker, January 21, 2011, 04:27:25 PM

Previous topic - Next topic

hcfwesker

I'm kinda confused, since this was done on SMF1, but on SMF RC4, the member's name is the default color when viewing messages.  The birthday color appears everywhere else , except when reading posts/messages.  again, this was doable on SMF1 with no effort.

I've searched high & low on the site, and couldn't find anything on the subject.

I do have the following MOds installed that should have helped with this.

Member Color Link ,


My SMF2 RC4 test site http://www.brawldomain.com/AASMF2/index.php

hcfwesker


Acans

It should be in (Admin > Features and options > Member color Link)
"The Book of Arantor, 17:3-5
  And I said unto him, thy database query shalt always be sent by the messenger of $smcFunc
  And $smcFunc shall protect you against injections and evil
  And so it came to pass that mysql_query was declared deprecated and even though he says he is not
  dead yet, the time was soon to come to pass when mysql_query shall be gone and no more

hcfwesker

Yes, I understand that, which is why I included that in my OP.

Attached images below.  I tested in all 3 of my themes, including the default, and all were the same.  Showing the default member color in the post/messages page.

coloroptions.png shows my settings.  the 3 unchecked boxes I tested, but those changed nothing, so left them unchecked.

BIcolor.png, color changes in Board Index just fine

postcolor.png , the color does not change :(






hcfwesker


hcfwesker


hcfwesker


Joker™

As far as i can see the option in the Member color link says

QuoteThe Birthday Links of the Members (Calendar and Boardindex)
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

hcfwesker

Yeah, but it also changes them on the Message Index, too, which isn't specified in the MOD page.  Only file it won't affect right now is the
Display.template .   Also, it's done on SMF1 with no effort, so shouldn't be any reason why it wouldn't work on SMF2 , i would assume :(


Joker™

Quote from: hcfwesker on January 31, 2011, 10:25:00 AM
Yeah, but it also changes them on the Message Index, too, which isn't specified in the MOD page.  Only file it won't affect right now is the
Display.template .   Also, it's done on SMF1 with no effort, so shouldn't be any reason why it wouldn't work on SMF2 , i would assume :(
You got a valid point. I'll surely give this a look today.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

hcfwesker

Hey, Joker™ :)  Was wondering if there might be any developments.  I know you're a busy guy, just wanted to check in.

"Support Helper of the Month"  <<<  very well deserved, my friend.

Joker™

Quote from: hcfwesker on February 03, 2011, 12:20:17 PM
Hey, Joker™ :)  Was wondering if there might be any developments.  I know you're a busy guy, just wanted to check in.
Yeah got stuck up in RL.

Quote
"Support Helper of the Month"  <<<  very well deserved, my friend.
Thanks a lot bro ;).


Back to post, try this code

Sources\Display.php (make backup of file before editing it)

Find:
lo.id_member, lo.log_time, mem.real_name, mem.member_name, mem.show_online,



Replace it with:
lo.id_member, lo.log_time, mem.real_name, mem.member_name, mem.show_online, mem.birthdate,



Find:
if (!empty($row['online_color']) && !empty($modSettings['MemberColorWhoIsOnline']))
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '" style="color: ' . $row['online_color'] . ';">' . $row['real_name'] . '</a>';
else
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>';



Replace it with:
if(!empty($modSettings['MemberColorBirthdayColor']) && !empty($row['birthdate']) && compare_colorBirthdate($row['birthdate']))
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '" style="color: ' . $modSettings['MemberColorBirthdayColor'] . ';">' . $row['real_name'] . '</a>';

elseif (!empty($row['online_color']) && !empty($modSettings['MemberColorWhoIsOnline']))
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '" style="color: ' . $row['online_color'] . ';">' . $row['real_name'] . '</a>';

else
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>';


I've not tried the code but most probably it'll work.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

hcfwesker

It looked promissing, but didn't work.  Is there any chance that having members profiles set with Pretty URLs would have interupted your edits?

Joker™

Quote from: hcfwesker on February 04, 2011, 05:53:33 PM
It looked promissing, but didn't work.  Is there any chance that having members profiles set with Pretty URLs would have interupted your edits?
No pretty url's don't have concern with the code above. I'm amazed that the code didn't worked. Lol most of the times this happens when I don't test the code :P.

I'll look into this tonight.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Joker™

Ok I don't know what I did but this seems to work (I serious don't know it's after effects also)

In Load.php

Find: $user_profile[$row['id_member']] = $row;
//Happy Birthday Color to this user :D
if(!empty($modSettings['MemberColorBirthdayColor']) && !empty($data['birthdate']) && compare_colorBirthdate($data['birthdate'])) {
$user_profile[$row['id_member']]['post_group_color'] = $modSettings['MemberColorBirthdayColor'];
$user_profile[$row['id_member']]['member_group_color'] = $modSettings['MemberColorBirthdayColor'];
}
//Color Banned user, replace there color... hope they are not moderators ;P?
if(!empty($modSettings['MemberColorBanned']) && isset($row['is_activated']) && $row['is_activated'] >= 10) {
$user_profile[$row['id_member']]['post_group_color'] = $modSettings['MemberColorBanned'];
$user_profile[$row['id_member']]['member_group_color'] = $modSettings['MemberColorBanned'];
}
//Memeber Color Link will used Chached Data, too wheee.
if($set == 'normal' || $set == 'profile') //This are the only sets with the info the mod need.
$color_profile[$row['id_member']] = array(
'id_member' => $row['id_member'],
'real_name' => $row['real_name'],
'member_group_color' => $user_profile[$row['id_member']]['member_group_color'],
'post_group_color' => $user_profile[$row['id_member']]['post_group_color'],
);



Replace it with:
$user_profile[$row['id_member']] = $row;
//Happy Birthday Color to this user :D
if(!empty($modSettings['MemberColorBirthdayColor']) && !empty($data['birthdate']) && compare_colorBirthdate($data['birthdate'])) {
$user_profile[$row['id_member']]['post_group_color'] = $modSettings['MemberColorBirthdayColor'];
$user_profile[$row['id_member']]['member_group_color'] = $modSettings['MemberColorBirthdayColor'];
}
//Color Banned user, replace there color... hope they are not moderators ;P?
if(!empty($modSettings['MemberColorBanned']) && isset($row['is_activated']) && $row['is_activated'] >= 10) {
$user_profile[$row['id_member']]['post_group_color'] = $modSettings['MemberColorBanned'];
$user_profile[$row['id_member']]['member_group_color'] = $modSettings['MemberColorBanned'];
}
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

hcfwesker

Would I keep the previous changes you suggested yesterday, in Sources\Display.php ?  Or remove those, then add these?

Joker™

Quote from: hcfwesker on February 05, 2011, 01:56:57 PM
Would I keep the previous changes you suggested yesterday, in Sources\Display.php ?  Or remove those, then add these?
Remove those ones, and try new ones.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

hcfwesker

A true gem you are, bud.  :)  Works just as it should, and no errors popping up in the error log.

It's these little details that makes the members happy.  Thank you so much! :)

Joker™

But bookmark this topic as if face any problem regarding color for members you should be able to reverse the changes you have made.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Advertisement: