Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> News Module Hack - Enhancement Requests
Author Message
pimpoff
New Member
New Member



Joined: Sep 25, 2003
Posts: 21

PostPosted: Sat Oct 11, 2003 2:45 pm Reply with quote

Hello, what I am trying to do is just edit my current Site Info block to some how show forum admins or site admins etc. What would be perfect is something at this site.
http://www.sunandshadows.com/
just Offline admins wouldn't be nesessary. So maybe just that small image by the name of each online admin. I found the source of block at nukecops.com forums just it works weird. Instaed of just name and image it like writes, private message username etc without any images. if you want I can paste that source here. Currently my souce is:


<?php

/************************************************************/
/* Added user_avatar - 18 July 2003 Gaylen Fraley */
/* website http://www.gaylenandmargie.com/phpwebsite */
/* */
/* Update for PHP-Nuke 6.5 - 30 July 2003 Gaylen Fraley */
/* website http://www.gaylenandmargie.com/phpwebsite */
/* */
/* Update for PHP-Nuke 6.5 - 05 March 2003 Gaylen Fraley */
/* website http://www.gaylenandmargie.com/phpwebsite */
/* */
/* Updated for PHP-Nuke 5.6 - 18 Jun 2002 NukeScripts */
/* website http://www.nukescripts.com */
/* */
/* Updated for PHP-Nuke 5.5 - 24/03/2002 Rugeri */
/* website http://newsportal.homip.net */
/* */
/* (C) 2002 */
/* All rights beyond the GPL are reserved */
/* */
/* Please give a link back to my site somewhere in your own */
/* */
/************************************************************/

if (eregi("block-Site_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 = "";

mt_srand ((double)microtime()*1000000);
global $dbi, $nukeurl, $startdate, $user, $cookie, $prefix, $user_prefix, $db, $anonymous, $mode, $t, $f, $redirect, $random_num, $admin;
mt_srand ((double)microtime()*1000000);
$maxran = 1000000;
$random_num = mt_rand(0, $maxran);
$datekey = date("F j");
$rcode = hexdec(md5($_SERVER[HTTP_USER_AGENT] . $sitekey . $random_num . $datekey));
$code = substr($rcode, 2, 10);
cookiedecode($user);
$uname = $cookie[1];

$sql = "SELECT username,user_id FROM $user_prefix"._users." ORDER BY user_id DESC LIMIT 0,1";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);

$lastusername = $row[username];
$lastuser = $row[user_id];
$numrows = $db->sql_numrows($db->sql_query("SELECT user_id FROM $user_prefix"._users.""));
$numrows1 = $numrows-1;
$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)) {
$sql = "select user_id, username from ".$user_prefix."_users where username='$session[uname]'";
$member_result = $db->sql_query($sql);
if (sql_num_rows($member_result, $dbi) == 1) {
$memberinfo = sql_fetch_array($member_result, $dbi);
}

if ($i < 10) $zi = "0$i";
else $zi = $i;
$who_online_now .= "$zi:&nbsp;<a href=\"modules.php?name=Your_Account&op=userinfo&username=$session[uname]\"><img src=\"images/blocks/icon_mini_profile.gif\" borde$
$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 = "";
while ($session = $db->sql_fetchrow($result)) {
if (isset($session["guest"]) and $session["guest"] == 1) {
if ($i < 10) $zi = "0$i";
else $zi = $i;
$gwho_online_now .= "$zi:&nbsp;<a href=\"http://www.samspade.org/t/lookat?a=". convertIP($session[uname])."\" target=\"_blank\">". convertIP($session[uname$
$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
$test = mktime (0,0,0,$pmonth,$pmday,$pyear,1);
$curDate2 = "%".$month[0].$month[1].$month[2]."%".$mday."%".$year."%";
$preday = strftime ("%d",$test);
$premonth = strftime ("%B",$test);
$preyear = strftime ("%Y",$test);
$curDate3 = "%".$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 Yesterday
$sql = "SELECT COUNT(user_id) AS userCount FROM $user_prefix"._users." WHERE user_regdate LIKE '$curDate3'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$userCount2 = $row[userCount];
//end

$sql = "SELECT uname FROM ".$prefix."_session WHERE guest=1";
$result = $db->sql_query($sql);
$guest_online_num = $db->sql_numrows($result);
$sql = "SELECT uname FROM ".$prefix."_session WHERE guest=0";
$result = $db->sql_query($sql);
$member_online_num = $db->sql_numrows($result);
$who_online_num = $guest_online_num + $member_online_num;

$sql = "SELECT username FROM ".$prefix."_users_temp";
$result = $db->sql_query($sql);

$content .= "<form action=\"account.html\" method=\"post\">";

if (is_user($user)) {
$sqlp = "SELECT user_posts AS posts FROM $user_prefix"._users." WHERE username = '$uname'";
$result = $db->sql_query($sqlp);
$row = $db->sql_fetchrow($result);
$posts = $row[posts];
$sql = "SELECT user_avatar FROM " . $prefix."_users WHERE username='$uname' AND user_avatar IS NOT NULL";
$result = $db->sql_query($sql);
if ($result) {
$userinfo = $db->sql_fetchrow($result);
if ( ereg( "(http)", $userinfo[user_avatar]) ) {
$content .= "<br /><center><img src=\"$userinfo[user_avatar]\" /></center>\n";
}
else
if ($userinfo[user_avatar]) {
$content .= "<br /><center><img src=\"modules/Forums/images/avatars/$userinfo[user_avatar]\" /></center>\n";
}
}
if ($posts>0) $content .= "<br /><center>$posts post(s)</center>\n";
$content .= "<br /><img src=\"images/blocks/group-4.gif\" height=\"14\" width=\"17\"> "._BWEL.", <b>$uname</b>.<br />\n\n";
$content .= "<a href=\"modules.php?name=Your_Account&amp;op=logout\"><img src=\"images/blocks/arrow-blk.gif\" width=\"17\" border=0>&nbsp;Logout</a>\n<hr>\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];
$sql = "SELECT privmsgs_to_userid FROM $prefix"._bbprivmsgs." WHERE privmsgs_to_userid='$uid' AND privmsgs_type='5'";
$result = $db->sql_query($sql);
$een = $db->sql_numrows($result);
$sql = "SELECT privmsgs_to_userid FROM $prefix"._bbprivmsgs." WHERE privmsgs_to_userid='$uid' AND privmsgs_type='1'";
$result = $db->sql_query($sql);
$twee = $db->sql_numrows($result);
$newpms = $een + $twee;
$sql = "SELECT privmsgs_to_userid FROM $prefix"._bbprivmsgs." WHERE privmsgs_to_userid='$uid' AND privmsgs_type='0'";
$result = $db->sql_query($sql);
$oldpms = $db->sql_numrows($result);
$content .= "<img src=\"images/blocks/email-y.gif\" height=\"10\" width=\"14\"> <a href=\"messages.html\"><b>"._BPM."</b></a><br />\n";
$content .= "<img src=\"images/blocks/email-r.gif\" height=\"10\" width=\"14\"> "._BUNREAD.": <b>$newpms</b><br />\n";
$content .= "<img src=\"images/blocks/email-g.gif\" height=\"10\" width=\"14\"> "._BREAD.": <b>$oldpms</b><br />\n<hr>\n";
} else {
$content .= "<img src=\"images/blocks/group-4.gif\" height=\"14\" width=\"17\"> "._BWEL.", <b>$anonymous</b>\n<hr>";
$content .= "<table><tr><td>"._NICKNAME."</td><td><input type=\"text\" name=\"username\" size=\"10\" maxlength=\"25\"></td></tr>";
$content .= "<tr><td>"._PASSWORD."</td><td><input type=\"password\" name=\"user_password\" size=\"10\" maxlength=\"20\"></td></tr></table>";
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' alt='"._SECURITYCODE."' title='"._SECU$
$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 (<a href=\"modules.php?name=Your_Account&amp;op=new_user\">"._BREG."</a>)<br><br>";

}
$content .= "<img src=\"images/blocks/group-2.gif\" height=\"14\" width=\"17\"> <b><u>"._BMEMP.":</u></b><br />\n";
$content .= "<img src=\"images/blocks/ur-moderator.gif\" height=\"14\" width=\"17\"> "._BLATEST.": <a href=\"modules.php?name=Your_Account&op=userinfo&username=$lastus$
$content .= "<img src=\"images/blocks/ur-author.gif\" height=\"14\" width=\"17\"> "._BTD.": <b>$userCount</b><br />\n";
$content .= "<img src=\"images/blocks/ur-admin.gif\" height=\"14\" width=\"17\"> "._BYD.": <b>$userCount2</b><br />\n";
$content .= "<img src=\"images/blocks/ur-guest.gif\" height=\"14\" width=\"17\"> "._BOVER.": <b>$numrows1</b><br />\n<hr>\n";
$content .= "<img src=\"images/blocks/group-3.gif\" height=\"14\" width=\"17\"> <b><u>"._BVISIT.":</u></b>\n<br />\n";
$content .= "<img src=\"images/blocks/ur-anony.gif\" height=\"14\" width=\"17\"> "._BVIS.": <b>$guest_online_num</b><br />\n";
$content .= "<img src=\"images/blocks/ur-member.gif\" height=\"14\" width=\"17\"> "._BMEM.": <b>$member_online_num</b><br />\n";
$content .= "<img src=\"images/blocks/ur-registered.gif\" height=\"14\" width=\"17\"> "._BTT.": <b>$who_online_num</b><br />\n<hr noshade>\n";
if ($member_online_num > 0) {
$content .= "<img src=\"images/blocks/group-1.gif\" height=\"14\" width=\"17\" align=\"middle\"> <b><u>"._BON.":</u></b><br />$who_online_now";
$hr = "\n<hr noshade>\n";
}
if ($gmember_online_num > 0) {
$content .= "<br />$gwho_online_now";
$hr = "\n<hr noshade>\n";
}

/*$content .= "<center>"._SERDT."<br />$sdt (GMT $zone)</center>";*/
/*$content .= "</form>";*/

?>
 
View user's profile Send private message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Sun Oct 12, 2003 10:21 am Reply with quote

That is not hard to do but I'm on the road right now with not much time to play (also on a s-l-o-w dial-up) and will be back Monday night or Tuesday. If you don't have an answer by then, I will provide you the code. Actually, I think I will just add that in my info block. I like that idea Wink
 
View user's profile Send private message
pimpoff







PostPosted: Tue Oct 14, 2003 1:09 am Reply with quote

lol, Yeah im surprised it hasn't been added already =P. But umm at http://www.mtechnik.net/ there have been posts about it, just they added it to old Site Info versions and I like mine so just going to wait it out.
 
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> News Module Hack - Enhancement Requests

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 ©