Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Blocks
Author Message
rafamp
Regular
Regular


Joined: Oct 15, 2005
Posts: 92
Location: Brazil

PostPosted: Wed Nov 09, 2005 10:05 am Reply with quote

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 Only registered users can see links on this board! Get registered or login!            */
/* 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 .= "&nbsp;&nbsp;<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 .= "&nbsp;&nbsp;<a href=\"forum-userprofile-.html$user_id\"><img alt src=\"".$user_avatar."\" border =\"0\" width=\"32\"></a></td>\n";
       break;
   case "3":
       $content .= "&nbsp;&nbsp;<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 .= "&nbsp;&nbsp;<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\">&nbsp;<a href=\"modules.php?name=Forums&amp;file=profile&amp;mode=viewprofile&amp;u=$user_id\"><b>$username</b></a>&nbsp;<br>&nbsp;<a href=\"modules.php?name=Forums&amp;file=search&amp;search_author=$username\">Posts:</a>&nbsp;<br>\n";
$content .= "&nbsp;<a href=\"modules.php?name=Forums&amp;file=search&amp;search_author=$username\">$user_posts</a>&nbsp;</td>\n";
$content .= "</tr>\n";
$zaehler++;

}

$content .= "</table>\n";

?>
 
View user's profile Send private message MSN Messenger
sting
Involved
Involved


Joined: Sep 23, 2003
Posts: 456
Location: Somewhere out there...

PostPosted: Wed Mar 15, 2006 12:42 pm Reply with quote

Did you ever get this working?

-sting

_________________
You see - I told you I wasn't paranoid. They were really out to get me. 
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Blocks

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©