Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome, Guest. Please login or register.
Did you miss your activation email?

December 03, 2022, 11:17:29 PM

Login with username, password and session length
Members
  • Total Members: 3853
  • Latest: tty456
Stats
  • Total Posts: 193625
  • Total Topics: 21107
  • Online today: 118
  • Online ever: 3540
  • (September 02, 2022, 06:38:54 PM)
Users Online
Users: 0
Guests: 69
Total: 69

Author Topic: online list for x7chat  (Read 11524 times)

0 Members and 1 Guest are viewing this topic.

deniz

  • Guest
online list for x7chat
« on: September 24, 2006, 11:23:15 PM »
this code lists online users in x7chat.
just put in php script block:

Quote
//select the table, should be right if you didn't change the prefix in the data base
$result = mysql_query("select * from x7chat2_online");


$expire_time = 5;
$exp_time = time()-$expire_time;
      $q = mysql_query("DELETE FROM x7chat2_online WHERE time<'$exp_time'");

//grab all the content


while($r=mysql_fetch_array($result))
{

   //modify these to match your mysql table columns that you want to display

   $usersonline=$r["name"];
   $room=$r["room"];


   //display the row
echo ' â–º';   
echo "$usersonline";
   
}

« Last Edit: September 24, 2006, 11:34:27 PM by deniz »

Svaha

  • Guest
Re: online list for x7chat
« Reply #1 on: September 26, 2006, 07:34:56 AM »
Thanks Deniz

jklapp

  • Guest
Re: online list for x7chat
« Reply #2 on: October 09, 2006, 02:10:39 PM »
I'm getting adminOver 30 Chat (No space between user and room) using this code

Code: [Select]
  //display the row

echo "$usersonline";
echo "$room";

It should be:

admin Over 30 Chat

Also, is there a way to make a link to the rooms and the users to their profiles?

Thank you :)

crazypal24x7

  • Guest
Re: online list for x7chat
« Reply #3 on: October 18, 2006, 11:58:00 PM »
heeyaaaaa mate !!!!!!1

I m gettin parse error

Parse error: syntax error, unexpected '/' in /home2/ace24x7/public_html/forum/Sources/Load.php(1613) : eval()'d code(35) : eval()'d code on line 1


any solution ?????

adios

technodragon73

  • Guest
Re: online list for x7chat
« Reply #4 on: October 19, 2006, 07:28:47 AM »
Awesome code snippet...thanks a heap!  I had been trying to figure out how to make this mork, and then you came along!

jklapp

  • Guest
Re: online list for x7chat
« Reply #5 on: October 19, 2006, 10:58:18 AM »
I'm getting adminOver 30 Chat (No space between user and room) using this code

Code: [Select]
  //display the row

echo "$usersonline";
echo "$room";

It should be:

admin Over 30 Chat

Also, is there a way to make a link to the rooms and the users to their profiles?

Thank you :)

Since no one responded, this was my solution to the problem. :)

Code: [Select]
//display the row

echo '<strong><font color="#FFFF00">',$usersonline, '</font></strong>';
echo '<br><strong><a
href="http://www.yoursite.com/portal/x7chat/index.php">', $room,
'</a></strong>';

It's basic, but it works :)

kran1um

  • Guest
Re: online list for x7chat
« Reply #6 on: November 26, 2006, 05:59:42 PM »
How do you make the Xchat a Popup so you still can use the original webpage?


Nevermind I got it... How about I got that Parse error that is stated above.
« Last Edit: November 26, 2006, 06:19:37 PM by kran1um »

Malk

  • Guest
Re: online list for x7chat
« Reply #7 on: November 29, 2006, 05:56:59 AM »
Where i can get a 7x chat script?

kran1um

  • Guest
Re: online list for x7chat
« Reply #8 on: November 29, 2006, 10:43:27 AM »
http://www.x7chat.com/


ANyway, How can I get this to correspond with the Shouthistory in the Profile section that uses the old shoutbox?

tavoo

  • Guest
Re: online list for x7chat
« Reply #9 on: February 09, 2007, 04:20:09 PM »
This works for me...

//select the table, should be right if you didn't change the prefix in the data base
$result = mysql_query("select * from x7chat2_online");


$expire_time = 5;
$exp_time = time()-$expire_time;
      $q = mysql_query("DELETE FROM x7chat2_online WHERE time<'$exp_time'");

//grab all the content


while($r=mysql_fetch_array($result))

{

   //modify these to match your mysql table columns that you want to display (I didn't change this)

   $room=$r["room"];
   $usersonline=$r["name"];


   //display the row (change the link to where you have the chat program installed to)

echo '<strong>
<a target="_blank" href="http://www.yoursite.com/chat">', $room,
'[/url]</strong>';
echo '
<strong><font color="#FFFF00">',$usersonline, '</font></strong>';

}