I try to replace my line by your's
But have sql errors
I've add sql query and have sql errors
her is code from bloc scroll seen
Code:
<?php
/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2001 by Francisco Burzi (fbc@mandrakesoft.com) */
/* http://phpnuke.org */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/* */
/* PHP-Nuke Version: 5.5 */
/************************************************************************/
######################################################################
# Questo e un collage da due blocchi
# block-Last_Seen.php
# block-Newest_Link
# mi ero stufato di un blocco cosi lungo
# http://www.hwsolution.net
# All rights beyond the GPL are reserved
######################################################################
if (eregi("block-Last_Seen.php",$PHP_SELF)) {
Header("Location: index.php");
die();
}
global $cookie, $user, $userinfo, $prefix;
$numusers = 20;
$username = $cookie[1];
mysql_query("CREATE TABLE IF NOT EXISTS $prefix"._lastseen." (id INT (15) not null AUTO_INCREMENT, uname TEXT not null, date INT(15) not null, ip CHAR(50), PRIMARY KEY (id), UNIQUE (id))");
if (isset($username)) {
$ip = getenv("REMOTE_HOST");
if (empty($ip)) {
$ip = getenv("REMOTE_ADDR");
}
$result = mysql_query("SELECT * FROM $prefix"._lastseen." WHERE uname = \"$username\"");
if (mysql_num_rows($result) > 0) {
mysql_query("UPDATE $prefix"._lastseen." SET date = " . time() . " WHERE uname = \"$username\"");
} else {
mysql_query("INSERT INTO $prefix"._lastseen." VALUES (\"\", \"$username\", ".time().", \"".$ip."\")");
}
}
$content = "";
$content = " <A name= \"scrollingCode\"></A>
<MARQUEE behavior= \"scroll\" align= \"center\" direction= \"up\" height=\"120\" scrollamount= \"2\" scrolldelay= \"90\" onmouseover='this.stop()' onmouseout='this.start()'>
<table width=\"100%\">";
$content .= "<tr><td></td></tr>";
$content .= "$show";
$content .= "</table>";
$a++;$result = mysql_query("SELECT uname, date FROM $prefix"._lastseen." ORDER BY date DESC");
while (list($uname, $date) = mysql_fetch_row($result)) {
if ($uname != $username) {
$realtime = time() - $date;
$dont = false;
// how many days ago?
if ($realtime >= (60*60*24*2)) { // if it's been more than 2 days
$days = floor($realtime / (60*60*24));
$dont = true;
}
else if ($realtime >= (60*60*24)) { // if it's been less than 2 days
$days = 1;
$realtime -= (60*60*24);
}
if (!$dont) {
// how many hours ago?
if ($realtime >= (60*60)) {
//$content .= " ($realtime) ";
$hours = floor($realtime / (60*60));
$realtime -= (60*60*$hours);
}
// how many minutes ago?
if ($realtime >= 60) {
$mins = floor($realtime / 60);
$realtime -= (60*$mins);
}
// just a little precation, although I don't *think* mins will ever be 60...
if ($mins == 60) {
$mins = 0;
$hours += 1;
}
}
$content .= "<font class=tiny><a href=\"modules.php?name=Your_Account&op=userinfo&&uname=".$uname."\">".$uname."</a>:";
if ($dont) {
$content .= " ".$days." jours";
} else {
if ($days > 0) {
$content .= " ".$days." jour".(($hours == 0 && $mins == 0)?(""):(","));
}
if ($hours > 0) {
$content .= " ".$hours." ".(($hours > 1)?("heures"):("heure")).(($mins == 0)?(""):(","));
}
if ($mins > 0) {
$content .= " ".$mins." ".(($mins > 1)?("minutes"):("minute"))."";
} else { // less than a minute :)
$content .= " ".$realtime." secondes";
}
}
$content .= " déjÃÂÂÂ*</font>
";
$days = 0;
$hours = 0;
$mins = 0;
$dont = false;
}
}
$content .= "";
?>
I've found in bloc lastseen
Code:
$myresult = sql_query("select uid from nuke_users where (uname='$uname')", $dbi);
list($uid) = sql_fetch_row($myresult, $dbi);
$content .= "<font class=tiny><a href=\"modules.php?name=Forums&file=profile&mode=viewprofile&u=".$uid."\">".$uname."</a>:";
I don't know how to modify my bloc
I try, try, try...................I will become crazy 8O