IACOJ & dar63 thanks alot for your help
Can I pick your brains tho for a minute :?
I want to add, under the name where it says "welcome blah blah," a logout part. but as its in php, and I'm still learning it I dont want to change something and start getting errors.
To you guys this is probably easy, but anyway this is the text from that block:
<?php
/************************************************** **********/
/* */
/* 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-block-Site_Info.php",$PHP_SELF)) { Header("Location: index.php"); }
$content = "";
global $nukeurl, $startdate, $user, $cookie, $prefix, $user_prefix, $dbi, $anonymous;
cookiedecode($user);
$ip = getenv("REMOTE_ADDR");
$username = $cookie[1];
if (!isset($username)) {
$username = "$ip";
$guest = 1;
}
$past = time()-900;
sql_query("DELETE FROM $prefix"._session." WHERE time < $past", $dbi);
$result = sql_query("SELECT time FROM $prefix"._session." WHERE uname='$username'", $dbi);
$ctime = time();
if ($row = sql_fetch_array($result, $dbi)) {
sql_query("UPDATE $prefix"._session." SET uname='$username', time='$ctime', host_addr='$ip', guest='$guest' WHERE uname='$username'", $dbi);
} else {
sql_query("INSERT INTO $prefix"._session." (username, time, host_addr, guest) VALUES ('$username', '$ctime', '$ip', '$guest')", $dbi);
}
$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=Forums&file=profile&mode=v iewprofile&u=$session[username]\">$session[username]</a>
\n";
} else {
$who_online_now .= "$i:<A HREF=\"modules.php?name=Forums&file=profile&mode=v iewprofile&u=$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 noshade>\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-1.gif\" height=\"14\" width=\"17\"> <a href=\"modules.php?name=Private_Messages\">
"._BPM."</a>
\n";
$content .= "<img src=\"images/blocks/email-2.gif\" height=\"14\" width=\"17\"> "._BUNREAD.":
$newpms
\n";
$content .= "<img src=\"images/blocks/email-3.gif\" height=\"14\" width=\"17\"> "._BREAD.":
$oldpms
\n<hr noshade>\n";
} else {
$content .= "<img src=\"images/blocks/group-4.gif\" height=\"14\" width=\"17\"> "._BWEL.",
$anonymous\n<hr noshade>";
$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 noshade>";
}
$content .= "<img src=\"images/blocks/group-2.gif\" height=\"14\" width=\"17\">
<u>"._BMEMP.":</u>
\n";
$content .= "<img src=\"images/blocks/user-1.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/user-2.gif\" height=\"14\" width=\"17\"> "._BTD.":
$userCount
\n";
$content .= "<img src=\"images/blocks/user-3.gif\" height=\"14\" width=\"17\"> "._BYD.":
$userCount2
\n";
$content .= "<img src=\"images/blocks/user-4.gif\" height=\"14\" width=\"17\"> "._BOVER.":
$numrows
\n<hr noshade>\n";
$content .= "<img src=\"images/blocks/group-3.gif\" height=\"14\" width=\"17\">
<u>"._BVISIT.":</u>\n
\n";
$content .= "<img src=\"images/blocks/user-5.gif\" height=\"14\" width=\"17\"> "._BVIS.":
$guest_online_num
\n";
$content .= "<img src=\"images/blocks/user-6.gif\" height=\"14\" width=\"17\"> "._BMEM.":
$member_online_num
\n";
$content .= "<img src=\"images/blocks/user-7.gif\" height=\"14\" width=\"17\"> "._BTT.":
$who_online_num\n<hr noshade>\n";
if ($member_online_num > 0) {
$content .= "<img src=\"images/blocks/group-1.gif\" height=\"14\" width=\"17\">
<u>"._BON.":</u>
$who_online_now\n<hr noshade>\n";
}
/* Hits for Today */
$t_time = time();
$t_year = date("Y", $t_time);
$t_month = date("n", $t_time);
$t_date = date("j", $t_time);
$result = sql_query("SELECT hits FROM $prefix"._stats_date." WHERE year='$t_year' AND month='$t_month' AND date='$t_date'", $dbi);
list($today) = sql_fetch_row($result, $dbi);
/* Hits for Yesterday */
$y_time = $t_time - 86400;
$y_year = date("Y", $y_time);
$y_month = date("n", $y_time);
$y_date = date("j", $y_time);
$result = sql_query("SELECT hits FROM $prefix"._stats_date." WHERE year='$y_year' AND month='$y_month' AND date='$y_date'", $dbi);
list($yesterday) = sql_fetch_row($result, $dbi);
/* Hits in Total */
$totalhits = 0;
$result = sql_query("SELECT hits FROM $prefix"._stats_year."", $dbi);
while(list($hits) = sql_fetch_row($result, $dbi)) {
$totalhits = $totalhits + $hits;
}
$content .= "<center>
"._WERECEIVED."
\n";
$content .= "
<a href=\"modules.php?name=Statistics\">$totalhits</a>
\n";
$content .= "
"._PAGESVIEWS."
$startdate</center>";
$content .= "<hr noshade>";
/*$content .= "<center>
<u>..:"._BLATEST." "._BHITS.":..</u>
";*/
$content .= "<center>"._BHITS." "._BTD.":
<a href=\"modules.php?name=Statistics&op=DailyStats&y ear=$t_year&month=$t_month&date=$t_date\">$today</a>
";
$content .= ""._BHITS." "._BYD.":
<a href=\"modules.php?name=Statistics&op=DailyStats&y ear=$y_year&month=$y_month&date=$y_date\">$yesterd ay</a>
</center>";
$content .= "<hr noshade>";
$sdt = date("j F Y\nH:i:s T");
$zone = date("Z")/3600;
if ($zone >= 0) {
$zone = "+".$zone;
}
/*$std = strftime (%e %B %Y
%T %Z);*/
$content .= "<center>"._SERDT."
$sdt (GMT $zone)</center>";
$content .= "</form>";
?>
Can you tell/show me where exactly a logout line would go plz?
Thnx in advance