You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 80 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Who is Where [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
Jerfersor
Corporal
Corporal


Joined: Jun 27, 2003
Posts: 53


PostPosted: Wed Jul 02, 2003 10:44 pm Reply with quoteBack to top

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
Code:
      $title = "<A HREF=\"modules.php?name=Your_Account&op=userinfo&uname=$session[username]\" title=\"" . displayTime($session[time]) . "\">$session[username]</a>";

how can i get it to go to the user info...... i tried
Code:
      $title = "<A HREF=\"modules.php?name=Forums&file=profile&mode=viewprofile&u=$session[user_id]\" title=\"" . displayTime($session[time]) . "\">$session[username]</a>";

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");
}

//
// Init
//

$who_online[0] = "";
$who_online[1] = "";
$num[0] = 1;
$num[1] = 1;

/**
 * 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";
   }
   
   if ($guest == 0) {
      $title = "<A HREF=\"modules.php?name=Your_Account&op=userinfo&uname=$session[username]\" title=\"" . displayTime($session[time]) . "\">$session[username]</a>";
   } else {
      //--- Anonymous user
      if (isset($admin)) {
         $title = '<A title="' . displayTime($session[time]) . "\">$session[username]</a>";
      } else {
         $title = '<A title="' . displayTime($session[time]) . '">' . _VISITEUR . '</a>';
      }
   }

   $who_online[$guest] .= "$num[$guest]:&$title -& <a href=\"$session[url]\" target=\"_blank\">$session[module]</a><br>\n";
   $num[$guest]++;
}

//--- Members
if ($who_online[0] != "") {
   $content = "<img src=\"images/Who-is-Where/members.gif\">&<span class=\"content\"><b>"._MEMBRES.":</b></span><br>$who_online[0]<br>";
}

//--- Anonymous
if ($who_online[1] != "") {
   $content .= "<img src=\"images/Who-is-Where/visitors.gif\">&<span class=\"content\"><b>"._VISITEURS.":</b></span><br>$who_online[1]";
}

// 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>";
}
?>
Find all posts by JerfersorView user's profileSend private message
Raven
General
General


Joined: Mar 22, 2003
Posts: 5233

Location: USA

PostPosted: Thu Jul 03, 2003 3:57 am Reply with quoteBack to top

Try this
Code:
<a HREF=\"modules.php?name=Forums&file=profile&mode=viewprofile&u=$memberinfo[user_id]\">$session[uname]</a>

_________________
Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff
Find all posts by RavenView user's profileSend private messageVisit poster's website
Jerfersor
Corporal
Corporal


Joined: Jun 27, 2003
Posts: 53


PostPosted: Thu Jul 03, 2003 9:18 am Reply with quoteBack to top

nope didn't work :S
i tried
Code:
$title = "<A HREF=\"modules.php?name=Forums&file=profile&mode=viewprofile&u=$userinfo[user_id]\" title=\"" . displayTime($session[time]) . "\">$session[username]</a>";


no go aswell.... well sometimes it inserts the name of the person not the id number... wich doesnt take me to the right place anyways

i think i gotta do some query in the db to in order to get the user id.....
wich i really don't know how to..... i've tried but no go.

any other ideas?

btw ty verymuch Raven Very Happy
Find all posts by JerfersorView user's profileSend private message
Raven
General
General


Joined: Mar 22, 2003
Posts: 5233

Location: USA

PostPosted: Thu Jul 03, 2003 9:23 am Reply with quoteBack to top

Sorry, I assumed you had the other pieces in place; just didn't know the link to call. I'm in a hurry right now, but try to make out with this
Code:
         $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);
            }

_________________
Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff
Find all posts by RavenView user's profileSend private messageVisit poster's website
Jerfersor
Corporal
Corporal


Joined: Jun 27, 2003
Posts: 53


PostPosted: Thu Jul 03, 2003 9:57 am Reply with quoteBack to top

I'm really sorry to be taking your time Confused

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 :>
Find all posts by JerfersorView user's profileSend private message
Raven
General
General


Joined: Mar 22, 2003
Posts: 5233

Location: USA

PostPosted: Thu Jul 03, 2003 11:33 am Reply with quoteBack to top

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");
}

//
// Init
//

$who_online[0] = "";
$who_online[1] = "";
$num[0] = 1;
$num[1] = 1;

/**
* 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";
   }

   if ($guest == 0) {
      $title = "<A HREF=\"modules.php?name=Forums&file=profile&mode=viewprofile&u=$memberinfo[user_id]\" title=\"" . displayTime($session[time]) . "\">$session[username]</a>";
   } else {
      //--- Anonymous user
      if (isset($admin)) {
         $title = '<A title="' . displayTime($session[time]) . "\">$session[username]</a>";
      } else {
         $title = '<A title="' . displayTime($session[time]) . '">' . _VISITEUR . '</a>';
      }
   }

   $who_online[$guest] .= "$num[$guest]:&$title -& <a href=\"$session[url]\" target=\"_blank\">$session[module]</a><br>\n";
   $num[$guest]++;
}

//--- Members
if ($who_online[0] != "") {
   $content = "<img src=\"images/Who-is-Where/members.gif\">&<span class=\"content\"><b>"._MEMBRES.":</b></span><br>$who_online[0]<br>";
}

//--- Anonymous
if ($who_online[1] != "") {
   $content .= "<img src=\"images/Who-is-Where/visitors.gif\">&<span class=\"content\"><b>"._VISITEURS.":</b></span><br>$who_online[1]";
}

// 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>";
}
?>

_________________
Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff
Find all posts by RavenView user's profileSend private messageVisit poster's website
Jerfersor
Corporal
Corporal


Joined: Jun 27, 2003
Posts: 53


PostPosted: Thu Jul 03, 2003 1:48 pm Reply with quoteBack to top

Sad

no go

Parse error: parse error in /............./blocks/block-Who-is-Where.php on line 18

(/............./ = edited)

i guess i gotta live with it the way it is :S
Find all posts by JerfersorView user's profileSend private message
Raven
General
General


Joined: Mar 22, 2003
Posts: 5233

Location: USA

PostPosted: Thu Jul 03, 2003 1:52 pm Reply with quoteBack to top

I think it's an error with your copying and pasting. I didn't do anything with that part. Just try to copy this code into yours
Code:
//
// 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";
   }

   if ($guest == 0) {
      $title = "<A HREF=\"modules.php?name=Forums&file=profile&mode=viewprofile&u=$memberinfo[user_id]\" title=\"" . displayTime($session[time]) . "\">$session[username]</a>";

_________________
Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff
Find all posts by RavenView user's profileSend private messageVisit poster's website
Jerfersor
Corporal
Corporal


Joined: Jun 27, 2003
Posts: 53


PostPosted: Thu Jul 03, 2003 2:08 pm Reply with quoteBack to top

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

Crying or Very sad

yeah the error before was mine.....
line 82 =
Code:
$member_result =  $db->sql_query($sql);


can't c anything wrong....
Find all posts by JerfersorView user's profileSend private message
bjamm
Nuke Cadet
Nuke Cadet


Joined: May 24, 2003
Posts: 6


PostPosted: Thu Jul 03, 2003 8:11 pm Reply with quoteBack to top

replying to find out what happens as i'd like to fix this on my site as well, thanks for the hard work
Find all posts by bjammView user's profileSend private message
Raven
General
General


Joined: Mar 22, 2003
Posts: 5233

Location: USA

PostPosted: Thu Jul 03, 2003 8:29 pm Reply with quoteBack to top

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";
   }
   
   if ($guest == 0) {
      $title = "<A HREF=\"modules.php?name=Your_Account&op=userinfo&uname=$session[username]\" title=\"" . displayTime($session[time]) . "\">$session[username]</a>";
   } else {
      //--- Anonymous user
      if (isset($admin)) {
         $title = '<A title="' . displayTime($session[time]) . "\">$session[username]</a>";
      } else {
         $title = '<A title="' . displayTime($session[time]) . '">' . _VISITEUR . '</a>';
      }
   }

   $who_online[$guest] .= "$num[$guest]:&$title -& <a href=\"$session[url]\" target=\"_blank\">$session[module]</a><br>\n";
   $num[$guest]++;
}

to this
Code:

// Display Section
//

while ($session = $db->sql_fetchrow($result)) {
   $sql = "select user_id, username from ".$user_prefix."_users where username='$session[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";
   }

   if ($guest == 0) {
      $title = "<A HREF=\"modules.php?name=Forums&file=profile&mode=viewprofile&u=$memberinfo[user_id]\" title=\"" . displayTime($session[time]) . "\">$session[username]</a>";
   } else {
      //--- Anonymous user
      if (isset($admin)) {
         $title = '<A title="' . displayTime($session[time]) . "\">$session[username]</a>";
      } else {
         $title = '<A title="' . displayTime($session[time]) . '">' . _VISITEUR . '</a>';
      }
   }

   $who_online[$guest] .= "$num[$guest]:&$title -& <a href=\"$session[url]\" target=\"_blank\">$session[module]</a><br>\n";
   $num[$guest]++;
}

_________________
Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff
Find all posts by RavenView user's profileSend private messageVisit poster's website
Jerfersor
Corporal
Corporal


Joined: Jun 27, 2003
Posts: 53


PostPosted: Fri Jul 04, 2003 12:24 am Reply with quoteBack to top

ty verymuch..... but we are still with problems in that line
Code:

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 80

i'm gonna keep on tryoing here
Find all posts by JerfersorView user's profileSend private message
Raven
General
General


Joined: Mar 22, 2003
Posts: 5233

Location: USA

PostPosted: Fri Jul 04, 2003 4:24 am Reply with quoteBack to top

It woks perfectly here. Get this from my site http://gaylenandmargie.com/public/downloads/hack-block-Who-is-Where.zip

This is v2.2 for 6.5

_________________
Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff

Last edited by Raven on Fri Jul 04, 2003 8:59 am; edited 1 time in total
Find all posts by RavenView user's profileSend private messageVisit poster's website
Jerfersor
Corporal
Corporal


Joined: Jun 27, 2003
Posts: 53


PostPosted: Fri Jul 04, 2003 8:55 am Reply with quoteBack to top

i'm sorry but the link is broken Confused

can you check it?

_________________
Nothing like gaming all day!!!
http://www.reallgames.com/
Find all posts by JerfersorView user's profileSend private message
Raven
General
General


Joined: Mar 22, 2003
Posts: 5233

Location: USA

PostPosted: Fri Jul 04, 2003 8:59 am Reply with quoteBack to top

downloads was misspelled in the link above. I corrected it.

_________________
Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff
Find all posts by RavenView user's profileSend private messageVisit poster's website
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next 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



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by · TOGETHER TEAM srl ITALY http://www.togetherteam.it · DONDELEO E-COMMERCE http://www.DonDeLeo.com
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.441 Seconds - 485 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::