TinyPortal

Development => Block Codes => Topic started by: THUNDERxRAGE on September 06, 2007, 01:45:22 AM

Title: Post Count for Current Month
Post by: THUNDERxRAGE on September 06, 2007, 01:45:22 AM
JD, where can I find that mod block for the post count of the current month?
Title: Post Count for Current Month
Post by: THUNDERxRAGE on September 06, 2007, 01:49:43 AM
Not member of the month.  I"m talking about the one that displays the post counts made by members for the current month.  Also, is it possible to have one that shows current post count for previous month?
Title: Post Count for Current Month
Post by: THUNDERxRAGE on September 06, 2007, 01:50:08 AM
What? You deleted your post already? LoL
Title: Post Count for Current Month
Post by: jdvarner on September 06, 2007, 01:50:39 AM
Not sure where i saw it here but, I just put the following in block: (you can convert time here: http://www.onlineconversion.com/unix_time.htm


global $db_prefix, $scripturl;

$starttime = 1188608400; // Change this to the time you want the contest to start
$endtime = 1191196799;  // Change this to the time you want the contest to end

$count= array();
$poster_number = array();
$query = db_query(
   "SELECT posterName, {$db_prefix}messages.ID_MEMBER, ID_GROUP
    FROM {$db_prefix}members
    JOIN {$db_prefix}messages
    ON {$db_prefix}members.ID_MEMBER = {$db_prefix}messages.ID_MEMBER
   
    AND posterTime > $starttime
    AND posterTime < $endtime", __FILE__, __LINE__);

while ($row = mysql_fetch_assoc($query))
{
 if (!isset($count[$row['posterName']]))
   $count[$row['posterName']] = 0;
 ++$count[$row['posterName']];
   $poster_number[$row['posterName']] = $row['ID_MEMBER'];
}

arsort($count);
$list_number = 0;
foreach ($count as $key => $value)
{
 echo '<a class="normaltext" href="' . $scripturl . '?action=profile;u=' . $poster_number[$key] . '">' . $key . '</a> (' . $value . ')<br />';
 ++$list_number;
 if ($list_number > 9)  
   break;
}
Title: Post Count for Current Month
Post by: jdvarner on September 06, 2007, 01:51:04 AM
Quote from: THUNDERxRAGE on September 06, 2007, 01:50:08 AM
What? You deleted your post already? LoL

i read your request wrong and posted the wrong thing at first.
Title: Post Count for Current Month
Post by: THUNDERxRAGE on September 06, 2007, 01:51:34 AM
Okay, what kind of block do I put this in?
Title: Post Count for Current Month
Post by: jdvarner on September 06, 2007, 01:56:32 AM
php box "think we better jumper off this thread before getting in trouble"> :)

pm if you like.
Title: Post Count for Current Month
Post by: THUNDERxRAGE on September 06, 2007, 01:57:18 AM
Okay, thanks!  I'll give this a try.