Acido
05-16-2004, 07:55 PM
Hi
I'm having problems porting anothers hacks like: Quote of the day, top X posters, New X members.
I found very cool the way to create new módules. It's very easy. But i cant find where insert the necesary querys for thoses hacks.
In Adv_index.php i put querys like this:
// ### TOP STATS ########################################
$limit = 5;
$top_stats = array();
// TOP POSTERS
$top_posters = $DB_site->query("SELECT * FROM ".TABLE_PREFIX."user ORDER BY posts DESC LIMIT 10");
while($top_poster = $DB_site->fetch_array($top_posters))
{
eval('$top_stats[\'top_posters\'] .= "' . fetch_template('top_posters') . '";');
}
unset($top_poster);
$DB_site->free_result($top_posters);
// NEWEST MEMBERS
$newest_members = $DB_site->query("SELECT * FROM ".TABLE_PREFIX."user ORDER BY userid DESC LIMIT $limit");
while($newest_member = $DB_site->fetch_array($newest_members))
{
eval('$top_stats[\'newest_members\'] .= "' . fetch_template('newest_members') . '";');
}
unset($newest_member);
$DB_site->free_result($newest_members);
At the end of the adv_index.php, and the modules ran perfectly
But now i'm pretty confused...
Can someone clarify me this issue?
I'm having problems porting anothers hacks like: Quote of the day, top X posters, New X members.
I found very cool the way to create new módules. It's very easy. But i cant find where insert the necesary querys for thoses hacks.
In Adv_index.php i put querys like this:
// ### TOP STATS ########################################
$limit = 5;
$top_stats = array();
// TOP POSTERS
$top_posters = $DB_site->query("SELECT * FROM ".TABLE_PREFIX."user ORDER BY posts DESC LIMIT 10");
while($top_poster = $DB_site->fetch_array($top_posters))
{
eval('$top_stats[\'top_posters\'] .= "' . fetch_template('top_posters') . '";');
}
unset($top_poster);
$DB_site->free_result($top_posters);
// NEWEST MEMBERS
$newest_members = $DB_site->query("SELECT * FROM ".TABLE_PREFIX."user ORDER BY userid DESC LIMIT $limit");
while($newest_member = $DB_site->fetch_array($newest_members))
{
eval('$top_stats[\'newest_members\'] .= "' . fetch_template('newest_members') . '";');
}
unset($newest_member);
$DB_site->free_result($newest_members);
At the end of the adv_index.php, and the modules ran perfectly
But now i'm pretty confused...
Can someone clarify me this issue?