Author |
Message |
candy
Worker


Joined: Dec 21, 2004
Posts: 225
Location: Kansas City metro
|
Posted:
Mon Jan 21, 2008 12:21 am |
|
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> <a href=\"$user_website\"><b>$username</b></a>: <a href=\"modules.php?name=Forums&file=profile&mode=viewprofile&u=$user_id\">$points</a><br>";
}
?>
| [/quote] |
|
|
|
 |
fkelly
Former Moderator in Good Standing

Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY
|
Posted:
Mon Jan 21, 2008 11:41 am |
|
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. |
|
|
|
 |
candy

|
Posted:
Mon Jan 21, 2008 11:46 am |
|
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.  |
|
|
|
 |
candy

|
Posted:
Mon Jan 21, 2008 6:24 pm |
|
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> <a href=\"$user_website\"><b>$username</b></a>: <a href=\"modules.php?name=Forums&file=profile&mode=viewprofile&u=$user_id\">$points</a><br>";
}
?>
|
|
|
|
|
 |
fkelly

|
Posted:
Mon Jan 21, 2008 6:43 pm |
|
Candy is username, not user_id. You'll need to look up Candy's user_id and plug that in there. |
|
|
|
 |
candy

|
Posted:
Mon Jan 21, 2008 11:23 pm |
|
thank you SO much...that totally worked! I truly appreciate your help!
 |
|
|
|
 |
fkelly

|
Posted:
Mon Jan 21, 2008 11:52 pm |
|
No problem, glad to help. Just make a note about what happens when updates come in. |
|
|
|
 |
|