Witam. W jaki sposób zamienić ten kod php aby z bazy byli odczytywani TYLKO użytkownicy on-line. Jest to kod z panelu random_useres i wyświetla losowo użytkowników wszystkich zarejestrowanych, zarówno online jak i offline.
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2005 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
// Check if locale file is available matching the current site locale setting.
if (file_exists(INFUSIONS."random_user_panel/locale/".$settings['locale'].".php")) {
// Load the locale file matching the current site locale setting.
include INFUSIONS."random_user_panel/locale/".$settings['locale'].".php";
} else {
// Load the infusion's default locale file.
include INFUSIONS."random_user_panel/locale/English.php";
}
openside("<center>".$locale['rup001']."</center>");
$query = dbquery("select max(user_id) as count from ".$db_prefix."users");
$array = dbarray($query);
$max = $array['count'];
srand(microtime()*1000000);
$zufall = rand(1,$max);
$query = dbquery("select * from ".$db_prefix."users where user_id=$zufall");
$array = dbarray($query);
$id = $array['user_id'];
$name = $array['user_name'];
if (!isset($id))
{
$query = dbquery("select * from ".$db_prefix."users where user_id=1");
$array = dbarray($query);
$id = $array['user_id'];
$name = $array['user_name'];
}
if ($array['user_avatar'] != "" && file_exists(IMAGES."avatars/".$array['user_avatar']))
$ava = IMAGES."avatars/".$array['user_avatar'];
else
$ava = IMAGES."avatars/noav.png";
$lnk = BASEDIR."profile.php?lookup=".$id;
echo '<center><a href="'.$lnk.'"><img src="'.$ava.'" border="0"></a>';
echo '<br><a href="'.$lnk.'">'.$name.'</a>
<br><br><b>'.$locale['rup002'].'</b><br>'.showdate("longdate", $array['user_joined']).'
<br><b>'.$locale['rup003'].'</b><br>'.$array['user_birthdate'].'
<br><b>'.$locale['rup004'].'</b><br>'.$array['user_location'];
echo '<br><a href="'.$lnk.'">'.$locale['rup005'].'</a></center>';
closeside();
?>
Zwracam się z upzejmą prośbą o pomoc w tej sprawie:D |