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
candy
Worker
Worker



Joined: Dec 21, 2004
Posts: 225
Location: Kansas City metro

PostPosted: Mon Jan 21, 2008 12:21 am Reply with quote

i recently activated the Points system on my site to assign points for different things like forum posts, dowloads, page views, etc but I want to find out how I would go about excluding my user account from accruing points.

Here is the block code:

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_User_Points.php                                            */
/* ===========================                                          */
/* Copyright (c) 2003 by chatserv (chatserv@nukeresources.com)          */
/* http://nukeresources.com                                             */
/* modified by Imago for nukewire.com                                   */
/************************************************************************/

if (eregi("block-Top_User_Points.php", $_SERVER['PHP_SELF'])) {
    Header("Location: index.php");
    die();
}
    $plimit = 10;
    global $user_prefix, $db;
    $result=$db->sql_query("SELECT user_id, username, user_website, points FROM ".$user_prefix."_users WHERE user_id !='1' AND user_id !='2' ORDER BY points DESC LIMIT 0,$plimit");
    while(list($user_id, $username, $user_website, $points) = $db->sql_fetchrow($result)) {
    $user_id = intval($user_id);
    $points = intval($points);
    $content .= "<a href=\"userinfo-$username.html\"><img src=\"images/star.gif\" border=\"0\" alt=\"$username's User Info\"></a>&nbsp;<a href=\"$user_website\"><b>$username</b></a>: <a href=\"modules.php?name=Forums&amp;file=profile&amp;mode=viewprofile&amp;u=$user_id\">$points</a><br>";
}

?>
[/quote]
 
View user's profile Send private message
fkelly
Former Moderator in Good Standing



Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY

PostPosted: Mon Jan 21, 2008 11:41 am Reply with quote

All the block that you've quoted is doing is reporting the user points already acquired. If you wanted to exclude a user_id from that report you could add it to the where clause in the SQL statement "AND user_id != 'x'" where x is the user_that you want excluded. However that wouldn't keep that user from accruing points. To do that you'd need to find the point in the system where points are accumulated and exclude the id there. I can't help with that since I have never even looked at the points area. In fact, if I did my own distribution I'd rip all that junk and the ratings out of the system.

Keep in mind that if you modify the system like that you'll have to remember to remodify it the next time you update.
 
View user's profile Send private message Visit poster's website
candy







PostPosted: Mon Jan 21, 2008 11:46 am Reply with quote

thanks i will try that. i don't care if the user accrues points, just don't want them to be displayed in the block. Smile
 
candy







PostPosted: Mon Jan 21, 2008 6:24 pm Reply with quote

here's my code but i think i am missing something..the block is still not excluding the user "candy". Thanks.

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_User_Points.php                                            */
/* ===========================                                          */
/* Copyright (c) 2003 by chatserv (chatserv@nukeresources.com)          */
/* http://nukeresources.com                                             */
/* modified by Imago for nukewire.com                                   */
/************************************************************************/

if (eregi("block-Top_User_Points.php", $_SERVER['PHP_SELF'])) {
    Header("Location: index.php");
    die();
}
    $plimit = 10;
    global $user_prefix, $db;
    $result=$db->sql_query("SELECT user_id, username, user_website, points FROM ".$user_prefix."_users WHERE user_id !='1' AND user_id !='2' AND user_id != 'candy' ORDER BY points DESC LIMIT 0,$plimit");
    while(list($user_id, $username, $user_website, $points) = $db->sql_fetchrow($result)) {
    $user_id = intval($user_id);
    $points = intval($points);
    $content .= "<a href=\"userinfo-$username.html\"><img src=\"images/star.gif\" border=\"0\" alt=\"$username's User Info\"></a>&nbsp;<a href=\"$user_website\"><b>$username</b></a>: <a href=\"modules.php?name=Forums&amp;file=profile&amp;mode=viewprofile&amp;u=$user_id\">$points</a><br>";
}

?>
 
fkelly







PostPosted: Mon Jan 21, 2008 6:43 pm Reply with quote

Candy is username, not user_id. You'll need to look up Candy's user_id and plug that in there.
 
candy







PostPosted: Mon Jan 21, 2008 11:23 pm Reply with quote

thank you SO much...that totally worked! Smile I truly appreciate your help!

RavensScripts

Razz
 
fkelly







PostPosted: Mon Jan 21, 2008 11:52 pm Reply with quote

No problem, glad to help. Just make a note about what happens when updates come in.
 
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 ©