Hello!!
i got this nice block very cool... but when i click on the persons name it doesnt take me to to the profile of the person properly....
it says
"There is no available info for"
my guess is .. that it requests for a the Your account and i want it to go to the user info... the problem is on this line
but it didnt work :S
and id like to add in this very same blok on the top a Logout with a lil arrow (that i have already) would anyone be kind enough and help me?
tx in advance
here is the hole code
Code:
<?php
// who is where v2.1.x
//--- by surf (http://www.surf4all.net - contact@surf4all.net)
//--- Update by Will (http://www.ig-2000.com - willlau@easynet.fr)
//--- > Do not display headers when no connection,
//--- > Just one query instead of two.
//--- > Display the time human free, delete the _PAR define.
if (eregi("block-Who-is-Where.php",$PHP_SELF)) { Header("Location: index.php"); }
$content = '';
global $admin, $user, $cookie, $prefix, $user_prefix, $dbi, $anonymous,$name,$lang;
//
// language system
//
define('_MIN','' ');
define('_SEC','&');
if ($lang=='french') {
define("_MEMBRES","Membres ");
define("_VISITEURS","Visiteurs ");
define("_VISITEUR","Visiteur ");
} else if ($lang=='russian') {
define("_MEMBRES","×ëåíû");
define("_VISITEURS","Ïîñåòèòåëè");
define("_VISITEUR","Ïîñåòèòåëè");
} else if ($lang=='spanish') {
define("_MEMBRES","Miembro");
define("_VISITEURS","Visitante");
define("_VISITEUR","Visitantes");
} else if ($lang=='italian') {
define("_MEMBRES","Membri");
define("_VISITEURS","Ospiti");
define("_VISITEUR","Ospite");
} else if ($lang=='portuguese') {
define("_MEMBRES","Miembro");
define("_VISITEURS","Visitantes");
define("_VISITEUR","Visitante");
} else {
define("_MEMBRES","Members");
define("_VISITEURS","Visitors");
define("_VISITEUR","Visitor");
}
/**
* function that displays
* int timeSec : time in seconds
* @return String timeDisplay
*/
function displayTime($sec) {
$minutes = floor($sec / 60);
$seconds = $sec % 60;
if ($minutes == 0) {
return $seconds . _SEC;
}
return $minutes . _MIN . $seconds . _SEC;
}
//
// Query
//
$result = sql_query("SELECT username, guest, module, url, UNIX_TIMESTAMP(now())-time AS time FROM $prefix"._whoiswhere." order by username", $dbi);
$member_online_num = sql_num_rows($result, $dbi);
//
// Display Section
//
while ($session = sql_fetch_array($result, $dbi)) {
//--- guest can only be 0 or 1
$guest = $session["guest"];
if ($num[$guest] < 10) {
$who_online[$guest] .= "0";
}
// the link will be display only for anonymous user...
// please let it for my future work on this funny block
// it's a copyright don't remove it
if (!isset($user)) {
$content .= "<center>".ucfirst(_BY)." <a href=\"http://www.surf4all.net\" target=\"_blank\">Surf</a></center>";
}
?>
i hate it i try my best and just ask when i really can't figure by myself...
the last code you gave me can you please tell me where i should insert ?
because either im inserting in the wrong place or it's not working
sry and ty :>
Raven General
Joined: Mar 22, 2003
Posts: 5233
Location: USA
Posted:
Thu Jul 03, 2003 11:33 am
I do not use this and won't install it on my system as it is to unstable for my liking. However, I tried to guess where the code might work. try this
Code:
<?php
// who is where v2.1.x
//--- by surf (http://www.surf4all.net - contact@surf4all.net)
//--- Update by Will (http://www.ig-2000.com - willlau@easynet.fr)
//--- > Do not display headers when no connection,
//--- > Just one query instead of two.
//--- > Display the time human free, delete the _PAR define.
if (eregi("block-Who-is-Where.php",$PHP_SELF)) { Header("Location: index.php"); }
$content = '';
global $admin, $user, $cookie, $prefix, $user_prefix, $dbi, $anonymous,$name,$lang;
//
// language system
//
define('_MIN','' ');
define('_SEC','&');
if ($lang=='french') {
define("_MEMBRES","Membres ");
define("_VISITEURS","Visiteurs ");
define("_VISITEUR","Visiteur ");
} else if ($lang=='russian') {
define("_MEMBRES","×ëåíû");
define("_VISITEURS","Ïîñåòèòåëè");
define("_VISITEUR","Ïîñåòèòåëè");
} else if ($lang=='spanish') {
define("_MEMBRES","Miembro");
define("_VISITEURS","Visitante");
define("_VISITEUR","Visitantes");
} else if ($lang=='italian') {
define("_MEMBRES","Membri");
define("_VISITEURS","Ospiti");
define("_VISITEUR","Ospite");
} else if ($lang=='portuguese') {
define("_MEMBRES","Miembro");
define("_VISITEURS","Visitantes");
define("_VISITEUR","Visitante");
} else {
define("_MEMBRES","Members");
define("_VISITEURS","Visitors");
define("_VISITEUR","Visitor");
}
/**
* function that displays
* int timeSec : time in seconds
* @return String timeDisplay
*/
function displayTime($sec) {
$minutes = floor($sec / 60);
$seconds = $sec % 60;
if ($minutes == 0) {
return $seconds . _SEC;
}
return $minutes . _MIN . $seconds . _SEC;
}
//
// Query
//
$result = sql_query("SELECT username, guest, module, url, UNIX_TIMESTAMP(now())-time AS time FROM $prefix"._whoiswhere." order by username", $dbi);
$member_online_num = sql_num_rows($result, $dbi);
//
// Display Section
//
while ($session = sql_fetch_array($result, $dbi)) {
$sql = "select user_id from ".$user_prefix."_users where username='$username'";
$member_result = $db->sql_query($sql);
if (sql_num_rows($member_result, $dbi) == 1) {
$memberinfo = sql_fetch_array($member_result, $dbi);
}
//--- guest can only be 0 or 1
$guest = $session["guest"];
if ($num[$guest] < 10) {
$who_online[$guest] .= "0";
}
// the link will be display only for anonymous user...
// please let it for my future work on this funny block
// it's a copyright don't remove it
if (!isset($user)) {
$content .= "<center>".ucfirst(_BY)." <a href=\"http://www.surf4all.net\" target=\"_blank\">Surf</a></center>";
}
?>
Fatal error: Call to a member function on a non-object in /home/discandj/public_html/realls/blocks/block-Who-is-Where.php on line 82
yeah the error before was mine.....
line 82 =
Code:
$member_result = $db->sql_query($sql);
can't c anything wrong....
bjamm Nuke Cadet
Joined: May 24, 2003
Posts: 6
Posted:
Thu Jul 03, 2003 8:11 pm
replying to find out what happens as i'd like to fix this on my site as well, thanks for the hard work
Raven General
Joined: Mar 22, 2003
Posts: 5233
Location: USA
Posted:
Thu Jul 03, 2003 8:29 pm
Change this code
Code:
//
// Display Section
//
while ($session = sql_fetch_array($result, $dbi)) {
//--- guest can only be 0 or 1
$guest = $session["guest"];
if ($num[$guest] < 10) {
$who_online[$guest] .= "0";
}
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