PDA

View Full Version : Where can I find this ?


renee1
01-26-2005, 03:42 PM
We are looking for something that tracks the top poster for the day. We would like it to refresh like the posts do so the number shown is current. We would like it to reset at midnight. I really would love it to give the top 3 if possible.

I cant believe this could be that hard... well hard for me but not for some of the people that are around here. I am surprised no one has not asked for this before.

I have searched and sorry in advance if I missed something

Thanks in advance for any help
:squareeyed:

Andreas
01-26-2005, 04:20 PM
SELECT COUNT(postid) AS posts, userid, username FROM post WHERE dateline > UNIX_TIMESTAMP(NOW())-(UNIX_TIMESTAMP(NOW()) % 86400) GROUP BY userid ORDER BY posts DESC LIMIT 3

renee1
01-26-2005, 04:31 PM
Thanks KirbyDE, I bet to most here that is a huge help, sorry to say I don't know enough to know where to go from here. My skill level is at simple edits at this point.

Any chance you could elaborate on this for me some?

Andreas
01-26-2005, 04:43 PM
If you tell me what exactly what you want to have displayed where - sure :)

renee1
01-26-2005, 04:58 PM
well what I had in mind was putting it in the nav bar using the drop down, the main link name being Todays Top and then showing the top three when it drops down, no links just showing their nicks. I found the mod for the dropdowns in the menu.....

Thanks a TON :nervous:

KirbyDE.... help

Andreas
01-27-2005, 03:04 PM
Dunno if this is what you want, but:

Put this in phpinclude_start

$toptodayquery = $DB_site->query("SELECT COUNT(postid) AS posts, userid, username FROM " . TABLE_PREFIX . "post WHERE dateline > UNIX_TIMESTAMP(NOW())-(UNIX_TIMESTAMP(NOW()) % 86400) GROUP BY userid ORDER BY posts DESC LIMIT 3");

$idx = 1;
while ($topposter = $DB_site->fetch_array($toptodayquery))
{
eval('$_GLOBALS[topuser' . $idx . '] = $topposter[username];');
eval('$_GLOBALS[topposts' . $idx . '] = $topposter[posts];');
$idx++;
}

In template navbar FIND

<if condition="$bbuserinfo['userid']">
<td id="usercptools" class="vbmenu_control"><a href="#usercptools">$vbphrase[quick_links]</a> <script type="text/javascript"> vbmenu_register("usercptools"); </script></td>
</if>


BELOW that ADD

<td id="toptoday" class="vbmenu_control"><a href="#topposters">Top Posters</a> <script type="text/javascript"> vbmenu_register("toptoday"); </script></td>


FIND

</div>
<!-- / user cp tools menu -->
</if>


BELOW that ADD

<div class="vbmenu_popup" id="toptoday_menu" style="display:none">
<table cellpadding="4" cellspacing="1" border="0">
<tr><td class="thead">Top Posters</td></tr>
<tr><td class="vbmenu_option">$_GLOBALS[topuser1] ($_GLOBALS[topposts1] posts)</td></tr>
<tr><td class="vbmenu_option">$_GLOBALS[topuser2] ($_GLOBALS[topposts2] posts)</td></tr>
<tr><td class="vbmenu_option">$_GLOBALS[topuser3] ($_GLOBALS[topposts3] posts)</td></tr>
</table>
</div>

renee1
01-27-2005, 04:18 PM
oh Thank You so Much!!!!!
its in and working on one template. I am waiting for someone to make posts that are in the top three to see if the numbers update but looks great!

renee1
01-31-2005, 05:10 PM
I have found something to link the top posters to, their member public profiles. How would I go about getting the userid to insert in the link from the information gotten from this call?


BTW thanks again, this thing is working great. The members all seem to love it and it has been fun watching them compete to be on top of the list. A GREAT job for sure.

:)

renee1
02-09-2005, 11:57 AM
Kirby or anyone else.
I have been trying to get the userid from the above. The intent is to link the top posters listed with their member profile page. How can I come up with the userid?
help?
I am trying to learn here, not really looking for it being done for me but I have tried a lot of things without any luck. So anyone willing to point me in the right direction even would be appreciated.