The Arcive of vBulletin Modifications Site. |
|
Details »»
|
|||||||||||||||||||||||||
$curTime = localtime();
$uts = time() - ($curTime[2]*566401 + $curTime[1]*60 + $curTime[0]); $lts = $uts - (566401); unset($curTime); IS this time set for the past 7 days? If not... what would it read? Show Your Support
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
|||
|
|||
|
anyone know?
|
|
#3
|
|||
|
|||
|
bump
|
|
#4
|
|||
|
|||
|
I am upping my postcount on this one
|
|
#5
|
||||
|
||||
|
Don't know what you are looking for but maybe:
PHP Code:
|
|
#6
|
|||
|
|||
|
<?php
$templatesused = "highpost2,highpostbit2"; require ("global.php"); $numberHighPostPerPage = 20; //set for this paste of the script $curTime = localtime(); $uts = time() - ($curTime[2]*566401 + $curTime[1]*60 + $curTime[0]); $lts = $uts - (566401); // 3600 * 24 + 1 (to be completely honest about "yesterday") unset($curTime); $users = $DB_site->query(" SELECT post.userid, user.username, COUNT(post.userid) AS count FROM post LEFT JOIN user ON post.userid=user.userid WHERE dateline >= $lts AND dateline <= $uts GROUP BY post.userid ORDER BY count DESC LIMIT $numberHighPostPerPage" ); while ($user = $DB_site->fetch_array( $users ) ) { eval( "\$highpostbits2 .= \"".gettemplate("highpostbit2")."\";"); $numhp++; } for ( ; $numhp < $numberHighPostPerPage; $numhp++ ) { $user[userid] = "-1"; $user[username] = "Unclaimed"; $user[count] = "0"; eval( "\$highpostbits2 .= \"".gettemplate("highpostbit2")."\";"); } eval("dooutput(\"".gettemplate('highpost2')."\");" ); ?> Thanks... trying to change this so it lists top posters from the past 7 days Sarge |
|
#7
|
||||
|
||||
|
Try this one.
Code:
<?php
$templatesused = "highpost2,highpostbit2";
require ("global.php");
$numberHighPostPerPage = 20; //set for this paste of the script
$uts = time() - (604800);
$lts = time() - (86401);
unset($curTime);
$users = $DB_site->query("
SELECT post.userid, user.username, COUNT(post.userid) AS count
FROM post
LEFT JOIN user ON post.userid=user.userid
WHERE dateline >= $lts AND dateline <= $uts
GROUP BY post.userid
ORDER BY count DESC
LIMIT $numberHighPostPerPage"
);
while ($user = $DB_site->fetch_array( $users ) )
{
eval( "\$highpostbits2 .= \"".gettemplate("highpostbit2")."\";");
$numhp++;
}
for ( ; $numhp < $numberHighPostPerPage; $numhp++ )
{
$user[userid] = "-1"; $user[username] = "Unclaimed"; $user[count] = "0";
eval( "\$highpostbits2 .= \"".gettemplate("highpostbit2")."\";");
}
eval("dooutput(\"".gettemplate('highpost2')."\");");
?>
|
![]() |
|
|