Author
Message
nextgen Worker Joined: Sep 28, 2006 Posts: 135 Location: Maryland
Posted:
Thu Feb 02, 2012 2:38 pm
Does anyone know of a top 5 users by points accumulated block ? Maybe with a link to edit profile, change theme and log out options.
Susann Moderator Joined: Dec 19, 2004 Posts: 3143 Location: Germany:Moderator German NukeSentinel Support
Posted:
Thu Feb 02, 2012 3:10 pm
Welcome back ! I believe I had such a block but I had a different point system in Nuke.
Therefore to help you we need to know what points you are talking about.
nextgen Worker Joined: Sep 28, 2006 Posts: 135 Location: Maryland
Posted:
Thu Feb 02, 2012 3:55 pm
The points system installed by default in Ravennuke.
nextgen Worker Joined: Sep 28, 2006 Posts: 135 Location: Maryland
Posted:
Fri Feb 03, 2012 10:28 am
here is what i found but need it to show the nuke points.
Code: <?php
if (eregi("block-User_Login.php", $_SERVER['PHP_SELF'])) { Header("Location: index.php"); }
global $redirect, $mode, $f, $t, $sitekey, $nukeurl, $user, $cookie, $prefix, $user_prefix, $db, $anonymous, $gfx_chk;
include_once("modules/Your_Account/includes/functions.php");
$ThemeSel = get_theme();
$ya_config = ya_get_configs();
$userinfo = getusrinfo($user);
if (is_user($user)) {
$memname = $cookie[1];
$sqlab = "SELECT points AS dollars FROM ".$prefix."_users WHERE username = '$memname'";
$result = $db->sql_query($sqlab);
$row = $db->sql_fetchrow($result);
$dollars = $row[dollars];
$sqlbc = "SELECT * FROM ".$prefix."_bbconfig";
$resultbc = $db->sql_query($sqlbc);
while ( $rowbc = $db->sql_fetchrow($resultbc) )
{
$board_config[$rowbc['config_name']] = $rowbc['config_value'];
}
if ($userinfo[user_avatar_type] == 1) {
$userinfo[user_avatar] = $board_config['avatar_path']."/".$userinfo[user_avatar];
} elseif ($userinfo[user_avatar_type] == 2) {
$userinfo[user_avatar] = $userinfo[user_avatar];
} else {
$userinfo[user_avatar] = $board_config[avatar_gallery_path]."/".$userinfo[user_avatar];
}
if ($userinfo[user_avatar]) {
$sqlde = "SELECT user_posts AS postz FROM ".$prefix."_users WHERE username = '$memname'";
$result = $db->sql_query($sqlde);
$row = $db->sql_fetchrow($result);
$postz = $row[postz];
$content .= "<center><img src=\"$userinfo[user_avatar]\" alt=\"\" height=\"90\" width=\"90\"></center>\n";
$content .= "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=\"95%\"><tr><TD class=\"rowx\"> <b></td></tr></table>\n";
$content .= "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=\"95%\">\n";
$content .= "<img src=\"themes/$ThemeSel/images/menu/meminfo.gif\" border=\"0\" alt=\"Your account information.\">\n";
$content .= "<TR><TD class=\"rowx\"> Welcome: $memname<br><br>\n";
if(is_active("Private_Messages")) {
list($uid) = $db->sql_fetchrow($db->sql_query("select user_id from $user_prefix"._users." where username='$memname'"));
$newpms = $db->sql_numrows($db->sql_query("select privmsgs_to_userid from $prefix"._bbprivmsgs." where privmsgs_to_userid='$uid' and (privmsgs_type='1' OR privmsgs_type='5')"));
$savpms = $db->sql_numrows($db->sql_query("select privmsgs_to_userid from $prefix"._bbprivmsgs." where privmsgs_to_userid='$uid' and privmsgs_type='3'"));
$oldpms = $db->sql_numrows($db->sql_query("select privmsgs_to_userid from $prefix"._bbprivmsgs." where privmsgs_to_userid='$uid' and privmsgs_type='0'"));
$totpms = $newpms + $oldpms + $savpms;
$content .= "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=\"100%\"><TR><TD class=\"rowx\"> <a href=\"modules.php?name=Private_Messages\"><b>Messages:</b></a></td><td align=\"right\"><a href=\"modules.php?name=Private_Messages\">$newpms</a></span></td></tr></table>";
$content .= "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=\"100%\"><TR><TD class=\"rowx\"> <b>Total Points:</b></a></td><td align=\"right\">$points</span></td></tr></table>";
$content .= "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=\"100%\"><TR><TD class=\"rowx\"> <b>Your Posts:</b></a></td><td align=\"right\">$postz</span></td></tr></table>";
//$content .= "<TR><TD class=\"rowx\"> Forum Posts:<font color=\"#ffffff\"> $postz</font></TD></TR>\n";
$content .= "<TR><TD class=\"rowx\"> </TD></TR>\n";
$content .= "<TR><TD class=\"rowx\"> <a href=\"forums.html&file=profile&mode=editprofile\" target=_self>Edit your Profile</a></TD></TR>\n";
$content .= "<TR><TD class=\"rowx\"> <a href=\"modules.php?name=Your_Account&op=chgtheme\" target=_self>Change Theme</a></TD></TR>\n";
$content .= "<TR><TD class=\"rowx\"> <a href=\"modules.php?name=Your_Account&op=logout\">"._BLOGOUT." </a><br><br>\n";
//$content .= "<TR><TD class=\"rowx\"> </TD></TR>\n";
$content .= "<img src=\"themes/$ThemeSel/images/menu/top5.gif\" border=\"0\" alt=\"Your account information.\">\n";
$query='SELECT username, user_id, points FROM '.$prefix."_users WHERE `user_id`>'1' ORDER BY `points` DESC LIMIT 5";
$result=$db->sql_query($query);
//$content = "<TR><TD class=\"rowx\"> Member</b></TD><TD><TR><b>Points</b></TD></TR>";
for($i = 1;$h = $db->sql_fetchrow($result);$i++)
{
$id = $h['user_id'];
$name = $h['username'];
$points = $h['points'];
$content .= "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=\"100%\"><TR><TD class=\"rowx\">$i. <a href=\"forums.html&file=profile&mode=viewprofile&u=$id\">$name</a></td><td align=\"right\">$points</span></td></tr></table>";
}
$content .= "</table>\n";
}
}
} else {
mt_srand ((double)microtime()*1000000);
$maxran = 10 * intval($ya_config['codesize']);
$random_num = mt_rand(0, $maxran);
$content .= "<img src=\"themes/$ThemeSel/images/menu/regged.gif\" border=\"0\" alt=\"Member Login\">\n";
$content .= "<table border=0 cellpadding=0 cellspacing=0>\n";
$content .= "<tr><form action=\"modules.php?name=Your_Account\" method=\"post\">\n";
$content .= "<td><input type=\"text\" name=\"username\" size=\"11\" maxlength=\"25\"><br>\n";
$content .= "<input type=\"password\" name=\"user_password\" size=\"11\" maxlength=\"20\" AutoComplete=\"off\"><br>\n";
if (extension_loaded("gd") AND ($ya_config['usegfxcheck'] == 2 OR $ya_config['usegfxcheck'] == 3)) {
$content .=""._BCODE.": <img src='?gfx=gfx&random_num=$random_num' border='0' alt='"._SECURITYCODE."' title='"._SECURITYCODE."'><br>\n";
$content .="<input type=\"text\" NAME=\"gfx_check\" SIZE=\"11\" MAXLENGTH=\"10\" AutoComplete=\"off\"><br>\n";
$content .="<input type=\"hidden\" name=\"random_num\" value=\"$random_num\">\n";
}
$content .="<input type=\"hidden\" name=\"redirect\" value=$redirect>\n";
$content .="<input type=\"hidden\" name=\"mode\" value=$mode>\n";
$content .="<input type=\"hidden\" name=\"f\" value=$f>\n";
$content .="<input type=\"hidden\" name=\"t\" value=$t>\n";
$content .="<input type=\"hidden\" name=\"op\" value=\"login\">\n";
$content .= "<input type=\"submit\" value=\""._BLOGIN."\">\n";
$content .= "</td>\n";
$content .= "</form></tr>\n";
$content .= "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=\"95%\"><tr><TD class=\"rowx\"><a href=\"modules.php?name=Your_Account&op=new_user\"><img src=\"themes/$ThemeSel/images/menu/registernow.gif\" border=\"0\" alt=\"Register as new User!\"></a></TD></TR>\n";
$content .= "</table>\n";
}
?>
Palbin Site Admin Joined: Mar 30, 2006 Posts: 2456 Location: Pittsburgh, Pennsylvania
Posted:
Fri Feb 03, 2012 12:34 pm
I did not try it, but give this rewrite a go.
Code:
<?php
if ( !defined('BLOCK_FILE') ) {
Header('Location: ../index.php');
die();
}
global $db, $prefix, $user, $user_prefix;
include_once 'modules/Your_Account/includes/functions.php';
$ThemeSel = get_theme();
$ya_config = ya_get_configs();
if (is_user($user)) {
$userinfo = getusrinfo($user);
$sql = 'SELECT `points` FROM `' . $user_prefix . '_users` WHERE `username` = "' . $userinfo['username'] . '"';
$result = $db->sql_query($sql);
list($points)= $db->sql_fetchrow($result, SQL_NUM);
$sql = 'SELECT * FROM `' . $prefix . '_bbconfig`';
$result = $db->sql_query($sql);
while ( $row = $db->sql_fetchrow($result, SQL_ASSOC) ) {
$board_config[$row['config_name']] = $row['config_value'];
}
if ($userinfo['user_avatar_type'] == 1) {
$userinfo['user_avatar'] = $board_config['avatar_path'] . '/' . $userinfo['user_avatar'];
} elseif ($userinfo['user_avatar_type'] == 2) {
$userinfo['user_avatar'] = $userinfo['user_avatar'];
} else {
$userinfo['user_avatar'] = $board_config['avatar_gallery_path'] . '/' . $userinfo['user_avatar'];
}
if ($userinfo['user_avatar']) {
$sql = 'SELECT `user_posts` FROM `' . $user_prefix . '_users` WHERE `username` = "' . $userinfo['username'] . '"';
$result = $db->sql_query($sql);
list($postz) = $db->sql_fetchrow($result, SQL_NUM);
$content .= '<center><img src="' . $userinfo['user_avatar'] . '" alt="" height="90" width="90"></center>' . "\n"
. '<table border="0" cellpadding="0" cellspacing="0" width="95%"><tr><td class="rowx"> <b></td></tr></table>' . "\n"
. '<table border="0" cellpadding="0" cellspacing="0" width="95%">' . "\n"
. '<img src="themes/' . $themesel . '/images/menu/meminfo.gif" border="0" alt="your account information.">' . "\n"
. '<tr><td class="rowx"> welcome: ' . $userinfo['username'] . '<br><br>' . "\n";
if(is_active('Private_Messages')) {
$newpms = $db->sql_numrows($db->sql_query('SELECT `privmsgs_to_userid` FROM `' . $prefix . '_bbprivmsgs` WHERE `privmsgs_to_userid`="' . $userinfo['user_id'] . '"'
. 'AND privmsgs_type IN(1,5)'));
$content .= '<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td class="rowx"> <a href="modules.php?name=private_messages"><b>messages:</b></a></td>'
. '<td align="right"><a href="modules.php?name=private_messages">' . $newpms . '</a></span></td></tr></table>'
. '<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td class="rowx"> <b>total points:</b></a></td><td align="right">' . $points . '</span></td></tr></table>'
. '<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td class="rowx"> <b>your posts:</b></a></td><td align="right">' . $postz . '</span></td></tr></table>'
. '<tr><td class="rowx"> </td></tr>' . "\n"
. '<tr><td class="rowx"> <a href="modules.php?name=forums&file=profile&mode=editprofile" target="_self">edit your profile</a></td></tr>' . "\n"
. '<tr><td class="rowx"> <a href="modules.php?name=your_account&op=chgtheme" target="_self">change theme</a></td></tr>' . "\n"
. '<tr><td class="rowx"> <a href="modules.php?name=your_account&op=logout">' . _blogout . ' </a><br><br>' . "\n"
. '<img src="themes/' . $themesel . '/images/menu/top5.gif" border="0" alt="your account information.">' . "\n";
$query='SELECT `username`, `user_id`, `points` FROM `' . $user_prefix . '_users` WHERE `user_id` > "1" ORDER BY `points` DESC LIMIT 5';
$result = $db->sql_query($query);
for($i = 1; list($name, $id, $points) = $db->sql_fetchrow($result, SQL_NUM); $i++) {
$content .= '<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td class="rowx">' . $i . '. '
. '<a href="modules.php?name=forums&file=profile&mode=viewprofile&u=' . $id . '">' . $name . '</a></td><td align="right">' . $points . '</span></td></tr></table>';
}
$content .= '</table>' . "\n";
}
}
} else {
$content .= '<img src="themes/' . $ThemeSel . '/images/menu/regged.gif" border="0" alt="Member Login">' . "\n"
. '<table border="0" cellpadding="0" cellspacing="0">' . "\n"
. '<tr><form action="modules.php?name=Your_Account" method="post">' . "\n"
. '<td><input type="text" name="username" size="11" maxlength="25"><br>' . "\n"
. '<input type="password" name="user_password" size="11" maxlength="20" AutoComplete="off"><br>' . "\n"
. security_code(array(2,4,5,7), 'stacked')
. '<input type="hidden" name="op" value="login">' . "\n"
. '<input type="submit" value="' . _BLOGIN . '">' . "\n"
. '</td>' . "\n"
. '</form></tr>' . "\n"
. '<table border="0" cellpadding="0" cellspacing="0" width="95%"><tr><td class="rowx"><a href="modules.php?name=your_account&op=new_user">'
. '<img src="themes/' . $themesel . '/images/menu/registernow.gif" border="0" alt="register as new user!"></a></td></tr>' . "\n"
. '</table>' . "\n";
}
?>
nextgen Worker Joined: Sep 28, 2006 Posts: 135 Location: Maryland
Posted:
Fri Feb 03, 2012 2:19 pm
nextgen Worker Joined: Sep 28, 2006 Posts: 135 Location: Maryland
Posted:
Fri Feb 03, 2012 2:23 pm
Palbin, it works perfectly. Thank you so very much.
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