Post count when hovering username

Started by Owdy, February 18, 2006, 12:27:12 PM

Previous topic - Next topic

Owdy

Is it possible do it like that? I mean when you hover mouse over username in posts, it would show that users post count. Now it says title="View profile of ...", but instead of that, it would show "user has made 10 posts" or similar. Dont ask why i need this, i just do :D
Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

kegobeer

I'm sure it's possible, it would just mean a bunch of extra queries to calculate each poster's post count.  I'll look around today and see what I can whip up.
"The truth of the matter is that you always know the right thing to do. The hard part is doing it." - Norman Schwarzkopf
Posting and you (Click "WATCH THIS MOVIE")

Thantos

#2
Where do you want to display it Owdy?  I mean doing it on the MessageIndex would be near trivial as the information is already there.  Doing on a user search page would take more changes.

kegobeer there is nothing to calculate, its stored in the members table.  Just have to include that in the query and put it in the array.

Edit:  Doh just re-read.  Ok in the MessageIndex... give me a minute

Edit #2:  My mistake, Display not MessageIndex

Thantos

Ok the title is in Load.php.

Find: (around line 1017)
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $profile['ID_MEMBER'] . '" title="' . $txt[92] . ' ' . $profile['realName'] . '">' . $profile['realName'] . '</a>'

'link' => '<a href="' . $scripturl . '?action=profile;u=' . $profile['ID_MEMBER'] . '" title="User has spammed the board'. $profile['posts'] . ' times">' . $profile['realName'] . '</a>'

Owdy

Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

Owdy

Okay, now i have this.

'link' => '<a href="' . $scripturl . '?action=profile;u=' . $profile['ID_MEMBER'] . '" title="' . $profile['realName'] . ' has sended '. $profile['posts'] . ' messages.">' . $profile['realName'] . '</a>',
and it prints 'username has sended 345 messages'. How to ad register date or even better total days logged in to that?

I mean ' username has sended 6576 messages and his been around 465 days now' or similar?  :D
Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

Thantos

'link' => '<a href="' $scripturl '?action=profile;u=' $profile['ID_MEMBER'] . '" title="' $profile['realName'] . ' has sent '$profile['posts'] . ' messages and has been around ' sprintf('%0.1f', (time()-$profile['dateRegistered'])/86400) . '.">' $profile['realName'] . '</a>',

Owdy

Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

Thantos

Oh wait you might want to change '.">' to ' days.">'

Owdy

Yeah, i use finnish so i have to modify it anyways. Thanks again!
Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

Owdy

Hmmm, can we remove that one desimal after days? Now it is 123,1 days ago.
Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

Thantos

Sure, change
sprintf('%0.1f', (time()-$profile['dateRegistered'])/86400) to (int)((time()-$profile['dateRegistered'])/86400)  Though of course that means you can get some zero day people :P

Owdy

Quote from: Thantos on February 19, 2006, 10:21:22 AM
Though of course that means you can get some zero day people :P
You mean those who are just registered?
Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

Thantos


Advertisement: