rafamp
Regular


Joined: Oct 15, 2005
Posts: 92
Location: Brazil
|
Posted:
Wed Nov 09, 2005 10:05 am |
|
hi... i woud like to edit the top_users block, to make it like top 5 posters;
top 10 user points (top 10 usuários) and top flooders (top_posters):
Only registered users can see links on this board! Get registered or login!
i want to get the top 10 user points like the top flooders block, because just that point system is... too simple....
i want to get at least the avatar appearing, and the <hr> code;
block-top_users.php (second)
Code:<?php
/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2002 by Francisco Burzi (fbc@mandrakesoft.com) */
/* http://phpnuke.org */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/
if (eregi("block-top_users.php", $PHP_SELF)) {
Header("Location: index.php");
die();
}
global $dbi, $prefix, $nukeurl;
$result = sql_query("select username, points from ".$prefix."_users order by points DESC limit 0,10", $dbi);
if (sql_num_rows($result, $dbi)>0) {
$lugar=1;
while(list($username, $points) = sql_fetch_row($result, $dbi)) {
if($points>0) {
$content .= "<a href=\"$nukeurl/modules.php?name=Your_Account&op=userinfo&username=$username\">$username</a><br><i>Pontos: $points</i><br>\n";
$lugar++;
}
}
}
?>
|
block-Top_Posters.php (top flooders)
Code:<?php
/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2002 by Francisco Burzi (fbc@mandrakesoft.com) */
/* http://phpnuke.org */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/
/************************************************************************/
/* block-Top_Posters.php */
/* =========================== */
/* */
/* Copyright (c) 2003 by chatserv (chatserv@nukeresources.com) */
/* http://nukeresources.com */
/************************************************************************/
/* Cosmetic changes by dvsDave at webmaster@controlbooth.com */
/* http://controlbooth.com */
/************************************************************************/
/* Fix showing Remote avatars */
/* Netrioter http://www.die-pernodler.de */
/************************************************************************/
if (eregi("block-Top_Posters.php", $_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}
global $prefix, $db;
$sql = "SELECT * FROM ".$prefix."_bbconfig";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
$forum_conf[$row['config_name']] = $row['config_value'];
}
$sql = "SELECT user_id, username, user_posts, user_avatar, user_avatar_type FROM ".$prefix."_users ORDER BY user_posts DESC LIMIT 0,5";
$result = $db->sql_query($sql);
$content .= "<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"0\">\n";
$zaehler = 0;
while(list($user_id, $username, $user_posts, $user_avatar, $user_avatar_type) = $db->sql_fetchrow($result)) {
if ($zaehler != 0)
{
$content .= "<tr><td colspan=\"2\"><hr></td></tr>\n";
}
$content .= "<tr>\n";
$content .= "<td align=\"left\" valign=\"middle\">";
switch($user_avatar_type)
{
case "1":
$content .= " <a href=\"forum-userprofile-.html$user_id\"><img alt src=\"".$forum_conf['avatar_path']."/".$user_avatar."\" border =\"0\" width=\"32\"></a></td>\n";
break;
case "2":
$content .= " <a href=\"forum-userprofile-.html$user_id\"><img alt src=\"".$user_avatar."\" border =\"0\" width=\"32\"></a></td>\n";
break;
case "3":
$content .= " <a href=\"forum-userprofile-.html$user_id\"><img alt src=\"".$forum_conf['avatar_gallery_path']."/".$user_avatar."\" border =\"0\" width=\"32\"></a></td>\n";
break;
default:
$content .= " <a href=\"forum-userprofile-.html$user_id\"><img alt src=\"".$forum_conf['avatar_gallery_path']."/blank.gif\" border =\"0\" width=\"32\"></a></td>\n";
break;
}
$content .= "<td align=\"center\" valign=\"middle\"> <a href=\"modules.php?name=Forums&file=profile&mode=viewprofile&u=$user_id\"><b>$username</b></a> <br> <a href=\"modules.php?name=Forums&file=search&search_author=$username\">Posts:</a> <br>\n";
$content .= " <a href=\"modules.php?name=Forums&file=search&search_author=$username\">$user_posts</a> </td>\n";
$content .= "</tr>\n";
$zaehler++;
}
$content .= "</table>\n";
?>
|
|
|
|