|
» Online Users: 76 |
| 0 members and 76 guests |
| No Members online |
| Most users ever online was 611, 03-21-2008 at 10:10 PM. |
|
» .::. |
Web Hosting - web hosting, dedicated servers and web design services
|
Online Degree - search for 1000+ online degrees, online colleges & online universities.
|
tattoo - we are a group of tattoo enthusiasts
|
Gexa Energy - your absolute best choice in electric service
|
|
|
Rimonabant - combat obesity and smoking at the same time
|
|
|
|
|
Poker Chips - Clay and composite poker chips for home games.
|
|
|
About this Page This is a discussion on Need Help making with my user block within the Purged Topics forums, part of the NM Staff category; I have been tryin to edit my user block myself and make it work but i really am not good ... |
|
 |
 |
|
 |

03-05-2003, 05:31 PM
|
|
Junior Member
|
|
Join Date: Mar 2003
Posts: 11
|
|
|
Need Help making with my user block
I have been tryin to edit my user block myself and make it work but i really am not good with php at all. I was wondering if some could lend a hand editing some code. I have a user block different then this site with phpbb ported forums but the user block i have doesn't display if you have private messages proporly. I would really appreciate if someone could fix the block i have.
|
Code:
|
<?php
if (eregi("block-block-User_Info.php",$PHP_SELF)) { Header("Location: index.php"); }
$content = "";
global $user, $cookie, $prefix, $user_prefix, $dbi, $anonymous;
cookiedecode($user);
$username = $cookie[1];
$result = sql_query("select uname from $user_prefix"._users." order by uid DESC limit 0,1", $dbi);
list($lastuser) = sql_fetch_row($result, $dbi);
$numrows = sql_num_rows(sql_query("select uid from $user_prefix"._users."", $dbi), $dbi);
$result2 = sql_query("SELECT uname,guest FROM $prefix"._session." where guest=0", $dbi);
$member_online_num = sql_num_rows($result2, $dbi);
$who_online_now = "";
$i = 1;
while ($session = sql_fetch_array($result2, $dbi)) {
if (isset($session["guest"]) and $session["guest"] == 0) {
if ($i < 10) {
$who_online_now .= "0$i:<A HREF=\"modules.php?name=Your_Account&op=userinfo&uname=$session[username]\">$session[username]</a>
\n";
} else {
$who_online_now .= "$i:<A HREF=\"modules.php?name=Your_Account&op=userinfo&uname=$session[username]\">$session[username]</a>
\n";
}
$who_online_now .= ($i != $member_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
$result2 = sql_query("SELECT COUNT(UID) AS userCount from $user_prefix"._users." WHERE user_regdate LIKE '$curDate2'", $dbi);
list($userCount) = sql_fetch_row($result2, $dbi);
//end
//Executing SQL Today
$result3 = sql_query("SELECT COUNT(UID) AS userCount from $user_prefix"._users." WHERE user_regdate LIKE '$curDateP'", $dbi);
list($userCount2) = sql_fetch_row($result3, $dbi);
//end
$result = sql_query("SELECT uname FROM ".$prefix."_session where guest=1", $dbi);
$guest_online_num = sql_num_rows($result, $dbi);
$result = sql_query("SELECT uname FROM ".$prefix."_session where guest=0", $dbi);
$member_online_num = sql_num_rows($result, $dbi);
$who_online_num = $guest_online_num + $member_online_num;
$content .= "<form action=\"modules.php?name=Your_Account\" method=\"post\">";
if (is_user($user)) {
$content .= "
<img src=\"images/blocks/group-4.gif\" height=\"14\" width=\"17\"> "._BWEL.", $username.
\n<hr>\n";
$result = sql_query("select uid from $user_prefix"._users." where uname='$username'", $dbi);
list($uid) = sql_fetch_row($result, $dbi);
$result2 = sql_query("select to_userid from $prefix"._priv_msgs." where to_userid='$uid' and read_msg='0'", $dbi);
$newpms = sql_num_rows($result2, $dbi);
$result3 = sql_query("select to_userid from $prefix"._priv_msgs." where to_userid='$uid' and read_msg='1'", $dbi);
$oldpms = sql_num_rows($result3, $dbi);
$content .= "<img src=\"images/blocks/email-y.gif\" height=\"10\" width=\"14\"> <a href=\"modules.php?name=Private_Messages\">"._BPM."</a>
\n";
$content .= "<img src=\"images/blocks/email-r.gif\" height=\"10\" width=\"14\"> "._BUNREAD.": $newpms
\n";
$content .= "<img src=\"images/blocks/email-g.gif\" height=\"10\" width=\"14\"> "._BREAD.": $oldpms
\n<hr>\n";
} else {
$content .= "<img src=\"images/blocks/group-4.gif\" height=\"14\" width=\"17\"> "._BWEL.", $anonymous\n<hr>";
$content .= ""._NICKNAME." <input type=\"text\" name=\"uname\" size=\"10\" maxlength=\"25\">
";
$content .= ""._PASSWORD." <input type=\"password\" name=\"pass\" size=\"10\" maxlength=\"20\">
";
$content .= "<input type=\"hidden\" name=\"op\" value=\"login\">";
$content .= "<input type=\"submit\" value=\""._LOGIN."\">\n (<a href=\"modules.php?name=Your_Account&op=new_user\">"._BREG."</a>)<hr>";
}
$content .= "<img src=\"images/blocks/group-2.gif\" height=\"14\" width=\"17\"> <u>"._BMEMP.":</u>
\n";
$content .= "<img src=\"images/blocks/ur-moderator.gif\" height=\"14\" width=\"17\"> "._BLATEST.": <A HREF=\"modules.php?name=Your_Account&op=userinfo&uname=$lastuser\">$lastuser</a>
\n";
$content .= "<img src=\"images/blocks/ur-author.gif\" height=\"14\" width=\"17\"> "._BTD.": $userCount
\n";
$content .= "<img src=\"images/blocks/ur-admin.gif\" height=\"14\" width=\"17\"> "._BYD.": $userCount2
\n";
$content .= "<img src=\"images/blocks/ur-guest.gif\" height=\"14\" width=\"17\"> "._BOVER.": $numrows
\n<hr>\n";
$content .= "<img src=\"images/blocks/group-3.gif\" height=\"14\" width=\"17\"> <u>"._BVISIT.":</u>\n
\n";
$content .= "<img src=\"images/blocks/ur-anony.gif\" height=\"14\" width=\"17\"> "._BVIS.": $guest_online_num
\n";
$content .= "<img src=\"images/blocks/ur-member.gif\" height=\"14\" width=\"17\"> "._BMEM.": $member_online_num
\n";
$content .= "<img src=\"images/blocks/ur-registered.gif\" height=\"14\" width=\"17\"> "._BTT.": $who_online_num
\n";
if ($member_online_num > 0) {
$content .= "<hr>\n<img src=\"images/blocks/group-1.gif\" height=\"14\" width=\"17\"> <u>"._BON.":</u>
$who_online_now";
}
$content .= "</form>";
?> |
|

03-05-2003, 06:41 PM
|
|
Senior Member
|
|
Join Date: Oct 2002
Location: Alabama, USA
Posts: 619
|
|
|
I suggest using the one from this site in downloads.
|

03-09-2003, 05:23 PM
|
|
Junior Member
|
|
Join Date: Mar 2003
Posts: 11
|
|
|
I downloaded it and tryid it but i do not like the way it lloks and i don'y know how to edit it proporly
|

03-09-2003, 09:47 PM
|
|
Junior Member
|
|
Join Date: Dec 2002
Location: Adelaide, Australia
Posts: 34
|
|
Ill have a go at editing it for you, i aint very good either, but ill give it a shot 
|

03-09-2003, 09:49 PM
|
|
Junior Member
|
|
Join Date: Mar 2003
Posts: 11
|
|
|
Thanks man, i have been tryin for a whikle but i jsut keep makin everuthing worse
|

03-09-2003, 10:01 PM
|
|
Junior Member
|
|
Join Date: Dec 2002
Location: Adelaide, Australia
Posts: 34
|
|
|
Quote:
|
<?php
if (eregi("block-User_Info_TnT.php",$PHP_SELF)) { Header("Location: index.php"); }
$content = "";
global $user, $cookie, $prefix, $user_prefix, $dbi, $anonymous;
cookiedecode($user);
$username = $cookie[1];
$result = sql_query("select uname from $user_prefix"._users." order by uid DESC limit 0,1", $dbi);
list($lastuser) = sql_fetch_row($result, $dbi);
$numrows = sql_num_rows(sql_query("select uid from $user_prefix"._users."", $dbi), $dbi);
$result2 = sql_query("SELECT uname,guest FROM $prefix"._session." where guest=0", $dbi);
$member_online_num = sql_num_rows($result2, $dbi);
$who_online_now = "";
$i = 1;
while ($session = sql_fetch_array($result2, $dbi)) {
if (isset($session["guest"]) and $session["guest"] == 0) {
if ($i < 10) {
$who_online_now .= "0$i:<A
HREF=\"modules.php?name=Your_Account&op=userin fo&uname=$session[username]\">$session[username]</a>
\n";
} else {
$who_online_now .= "$i:<A
HREF=\"modules.php?name=Your_Account&op=userin fo&uname=$session[username]\">$session[username]</a>
\n";
}
$who_online_now .= ($i != $member_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
$result2 = sql_query("SELECT COUNT(UID) AS userCount from $user_prefix"._users." WHERE user_regdate LIKE '$curDate2'", $dbi);
list($userCount) = sql_fetch_row($result2, $dbi);
//end
//Executing SQL Today
$result3 = sql_query("SELECT COUNT(UID) AS userCount from $user_prefix"._users." WHERE user_regdate LIKE '$curDateP'", $dbi);
list($userCount2) = sql_fetch_row($result3, $dbi);
//end
$result = sql_query("SELECT uname FROM ".$prefix."_session where guest=1", $dbi);
$guest_online_num = sql_num_rows($result, $dbi);
$result = sql_query("SELECT uname FROM ".$prefix."_session where guest=0", $dbi);
$member_online_num = sql_num_rows($result, $dbi);
$who_online_num = $guest_online_num + $member_online_num;
$content .= "<form action=\"modules.php?name=Your_Account\" method=\"post\">";
if (is_user($user)) {
$content .= "
<img src=\"images/blocks/group-4.gif\" height=\"14\" width=\"17\"> "._BWEL.", $username.
\n<hr>\n";
$result = sql_query("select uid from $user_prefix"._users." where uname='$username'", $dbi);
list($uid) = sql_fetch_row($result, $dbi);
$result2 = sql_query( "select privmsgs_type from $prefix"._bbprivmsgs." where privmsgs_to_userid='$uid' AND (privmsgs_type='1' or privmsgs_type='5')",
$dbi);
$newpms = sql_num_rows($result2);
$result3 = sql_query( "select privmsgs_type from $prefix"._bbprivmsgs." where privmsgs_to_userid='$uid' AND (privmsgs_type='0')", $dbi);
$oldpms = sql_num_rows($result3);
$content .= "<img src=\"images/blocks/email-y.gif\" height=\"10\" width=\"14\"> <a href=\"modules.php?name=Private_Messages\">"._BPM."</a>
\n";
$content .= "<img src=\"images/blocks/email-r.gif\" height=\"10\" width=\"14\"> "._BUNREAD.": ".$newpms."
\n";
$content .= "<img src=\"images/blocks/email-g.gif\" height=\"10\" width=\"14\"> "._BREAD.": ".$oldpms."
\n<hr>\n";
} else {
$content .= "<img src=\"images/blocks/group-4.gif\" height=\"14\" width=\"17\"> "._BWEL.", $anonymous\n<hr>";
$content .= ""._NICKNAME." <input type=\"text\" name=\"uname\" size=\"10\" maxlength=\"25\">
";
$content .= ""._PASSWORD." <input type=\"password\" name=\"pass\" size=\"10\" maxlength=\"20\">
";
$content .= "<input type=\"hidden\" name=\"op\" value=\"login\">";
$content .= "<input type=\"submit\" value=\""._LOGIN."\">\n (<a href=\"modules.php?name=Your_Account&op=new_us er\">"._BREG."</a>)<hr>";
}
$content .= "<img src=\"images/blocks/group-2.gif\" height=\"14\" width=\"17\"> <u>"._BMEMP.":</u>
\n";
$content .= "<img src=\"images/blocks/ur-moderator.gif\" height=\"14\" width=\"17\"> "._BLATEST.": <A
HREF=\"modules.php?name=Your_Account&op=userin fo&uname=$lastuser\">$lastuser</a>
\n";
$content .= "<img src=\"images/blocks/ur-author.gif\" height=\"14\" width=\"17\"> "._BTD.": $userCount
\n";
$content .= "<img src=\"images/blocks/ur-admin.gif\" height=\"14\" width=\"17\"> "._BYD.": $userCount2
\n";
$content .= "<img src=\"images/blocks/ur-guest.gif\" height=\"14\" width=\"17\"> "._BOVER.": $numrows
\n<hr>\n";
$content .= "<img src=\"images/blocks/group-3.gif\" height=\"14\" width=\"17\"> <u>"._BVISIT.":</u>\n
\n";
$content .= "<img src=\"images/blocks/ur-anony.gif\" height=\"14\" width=\"17\"> "._BVIS.": $guest_online_num
\n";
$content .= "<img src=\"images/blocks/ur-member.gif\" height=\"14\" width=\"17\"> "._BMEM.": $member_online_num
\n";
$content .= "<img src=\"images/blocks/ur-registered.gif\" height=\"14\" width=\"17\"> "._BTT.": $who_online_num
\n";
if ($member_online_num > 0) {
$content .= "<hr>\n<img src=\"images/blocks/group-1.gif\" height=\"14\" width=\"17\"> <u>"._BON.":</u>
$who_online_now";
}
$content .= "</form>";
?>
|
Thats the code 
|
 |
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|