Author
Message
GanjaUK Life Cycles Becoming CPU Cycles Joined: Feb 14, 2004 Posts: 633 Location: England
Posted:
Mon Mar 08, 2004 12:20 pm
Any chance you can help me out with something raven, tell me what code to put in my user info block for avatar to show on a nuke 7.1, I have tried so many times now I lost count, it never seems to work. Always getting errors. I tried using the active users block code, you know, showing the top 5 posters, but cant seem to get it right.
I downloaded the one you use on this site also, and took it apart and tried that, but I dont think it works with 7.1. All I need is the avatar code because I have already modified the block a lot, so I dont want to put a new one in.
Here is the user info block I use:
Code: if (eregi("block-User_Info.php",$_SERVER['PHP_SELF'])) { Header("Location: index.php");}
function convertIP ($xip) {
global $admin;
if (is_admin($admin)) return $xip;
$xipx = explode('.',$xip);
for ($i=2;$i<count($xipx);$i++) {
$xipx[$i] = preg_replace ('/(0|1|2|3|4|5|6|7|8|9)/', "x", $xipx[$i]);
}
return implode('.',$xipx);
}
$content = "";
global $dbi, $nukeurl, $startdate, $user, $cookie, $prefix, $user_prefix, $db, $anonymous, $mode, $t, $f, $redirect, $random_num;
cookiedecode($user);
$uname = $cookie[1];
$sql = "SELECT username FROM $user_prefix"._users." ORDER BY user_id DESC LIMIT 0,1";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$lastuser = $row[username];
$numrows = $db->sql_numrows($db->sql_query("SELECT user_id FROM $user_prefix"._users.""));
$sql = "SELECT uname, guest FROM $prefix"._session." WHERE guest=0";
$result = $db->sql_query($sql);
$member_online_num = $db->sql_numrows($result);
$who_online_now = "";
$i = 1;
while ($session = $db->sql_fetchrow($result)) {
if (isset($session["guest"]) and $session["guest"] == 0) {
if ($i < 10) {
$who_online_now .= "0$i: <A HREF=\"userinfo-$session[uname].html\">$session[uname]</a><br>\n";
} else {
$who_online_now .= "$i: <A HREF=\"userinfo-$session[uname].html\">$session[uname]</a><br>\n";
}
$who_online_now .= ($i != $member_online_num ? " " : "");
$i++;
}
}
$sql = "SELECT uname, guest FROM $prefix"._session." WHERE guest=1";
$result = $db->sql_query($sql);
$gmember_online_num = $db->sql_numrows($result);
$gwho_online_now = "";
$i = 1;
while ($session = $db->sql_fetchrow($result)) {
if (isset($session["guest"]) and $session["guest"] == 1) {
if ($i < 10) {
$gwho_online_now .= "0$i: ".convertIP($session[uname])."<br>\n";
} else {
$gwho_online_now .= "$i: ".convertIP($session[uname])."<br>\n";
}
$gwho_online_now .= ($i != $gmember_online_num ? " " : "");
$i++;
}
}
$Today = getdate();
//Formatting Current Date
$month = $Today['month'];
$mday = $Today['mday'];
$year = $Today['year'];
//Formatting Previous Date
$pmonth = $Today['month'];
$pmday = $Today['mday'];
$pmday = $mday-1;
$pyear = $Today['year'];
//Month conversion into numeric mode
if ($pmonth=="January") { $pmonth=1; } else
if ($pmonth=="February") { $pmonth=2; } else
if ($pmonth=="March") { $pmonth=3; } else
if ($pmonth=="April") { $pmonth=4; } else
if ($pmonth=="May") { $pmonth=5; } else
if ($pmonth=="June") { $pmonth=6; } else
if ($pmonth=="July") { $pmonth=7; } else
if ($pmonth=="August") { $pmonth=8; } else
if ($pmonth=="September") { $pmonth=9; } else
if ($pmonth=="October") { $pmonth=10; } else
if ($pmonth=="November") { $pmonth=11; } else
if ($pmonth=="December") { $pmonth=12; };
$test = mktime (0,0,0,$pmonth,$pmday,$pyear,1);
//Creating SQL parameter
$curDate2 = "%".$month[0].$month[1].$month[2]."%".$mday."%".$year."%";
$preday = strftime ("%d",$test);
$premonth = strftime ("%B",$test);
$preyear = strftime ("%Y",$test);
$curDateP = "%".$premonth[0].$premonth[1].$premonth[2]."%".$preday."%".$preyear."%";
//Executing SQL Today
$sql = "SELECT COUNT(user_id) AS userCount FROM $user_prefix"._users." WHERE user_regdate LIKE '$curDate2'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$userCount = $row[userCount];
//end
//Executing SQL Today
$sql = "SELECT COUNT(user_id) AS userCount FROM $user_prefix"._users." WHERE user_regdate LIKE '$curDateP'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$userCount2 = $row[userCount];
//end
$guest_online_num = $db->sql_numrows($db->sql_query("SELECT uname FROM ".$prefix."_session WHERE guest=1"));
$member_online_num = $db->sql_numrows($db->sql_query("SELECT uname FROM ".$prefix."_session WHERE guest=0"));
$who_online_num = $guest_online_num + $member_online_num;
$content .= "<form action=\"modules.php?name=Your_Account\" method=\"post\">";
if (is_user($user)) {
$content .= " "._BWEL.", <b>$uname</b>.<br><br>\n";
$sql = "SELECT user_id FROM $user_prefix"._users." WHERE username='$uname'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$uid = $row[user_id];
$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')"));
$oldpms = $db->sql_numrows($db->sql_query("SELECT privmsgs_to_userid FROM $prefix"._bbprivmsgs." WHERE privmsgs_to_userid='$uid' AND privmsgs_type='0'"));
$content .= "<img src=\"images/blocks/email-spin.gif\" height=\"10\" width=\"14\"> <a href=\"messages.html\" onMouseOver=\"stm(Text[10],Style[0])\" onMouseOut=\"htm()\"><b>"._BPM."</b></a><br>\n";
$content .= " "._BUNREAD.": <b>$newpms</b><br>\n";
$content .= " "._BREAD.": <b>$oldpms</b><br>\n<br>\n";
} else {
$content .= "<img src=\"images/blocks/group-4.gif\" height=\"14\" width=\"17\"> "._BWEL.", <b>$anonymous</b>\n<br><br><center>";
$content .= ""._NICKNAME." <br><input type=\"text\" name=\"username\" size=\"10\" maxlength=\"25\"><br>";
$content .= ""._PASSWORD." <br><input type=\"password\" name=\"user_password\" size=\"10\" maxlength=\"20\"><br>";
if (extension_loaded("gd")) {
mt_srand ((double)microtime()*1000000);
$maxran = 1000000;
$random_num = mt_rand(0, $maxran);
$content .=""._SECURITYCODE.": <img src='modules.php?name=Your_Account&op=gfx&random_num=$random_num' border='1' onMouseOver=\"stm(Text[19],Style[0])\" onMouseOut=\"htm()\" title='"._SECURITYCODE."'>\n";
$content .="<br />"._TYPESECCODE.": <input type=\"text\" NAME=\"gfx_check\" SIZE=\"11\" MAXLENGTH=\"10\"><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\">";
$content .= "<input type=\"submit\" value=\""._LOGIN."\">\n <br>Don't have an account yet? You can <a href=\"account-new_user.html\">create one</a>. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.<br><br></center>";
}
$content .= "<img src=\"images/blocks/green-man.gif\" height=\"14\" width=\"17\"> <b><u>"._BMEMP.":</u></b><br>\n";
$content .= " "._BLATEST.": <A HREF=\"userinfo-$lastuser.html\"><b>$lastuser</b></a><br>\n";
$content .= " "._BTD.": <b>$userCount</b><br>\n";
$content .= " "._BYD.": <b>$userCount2</b><br>\n";
$content .= " "._BOVER.": <b>$numrows</b><br>\n<br>\n";
$content .= "<img src=\"images/blocks/green-man.gif\" height=\"14\" width=\"17\"> <b><u>"._BVISIT.":</u></b>\n<br>\n";
$content .= " "._BVIS.": <b>$guest_online_num</b><br>\n";
$content .= " "._BMEM.": <b>$member_online_num</b><br>\n";
$content .= " "._BTT.": <b>$who_online_num</b>\n<br><br>\n";
if ($member_online_num > 0) {
$content .= "<img src=\"images/blocks/connect.gif\" height=\"14\" width=\"17\"> <b><u>"._BON.":</u></b><br>$who_online_now";
$hr = "\n<br>\n";
}
if ($gmember_online_num > 0) {
$content .= "<img src=\"images/blocks/connect.gif\" height=\"14\" width=\"17\"> <b><u>"._BON.":</u></b><br>$gwho_online_now";
// $content .= "<br>$gwho_online_now";
$hr = "\n<br>\n";
}
$content .= "</form>";
Raven Site Admin/Owner Joined: Aug 27, 2002 Posts: 16987 Location: Kansas
Posted:
Mon Mar 08, 2004 2:03 pm
Hmmm. I use mine (the site visitor's block) on 7.1 and it works ok.
GanjaUK Life Cycles Becoming CPU Cycles Joined: Feb 14, 2004 Posts: 633 Location: England
Posted:
Mon Mar 08, 2004 2:32 pm
I tried using the avatar sections from it on my own, but it didnt work. I probably missed something.
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