TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 195,994
  • Total Topics: 21,325
  • Online today: 89
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 90
  • Total: 90

online list for x7chat

Started by deniz, September 25, 2006, 06:23:15 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

deniz

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


Svaha


jklapp

I'm getting adminOver 30 Chat (No space between user and room) using this code

  //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

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

Awesome code snippet...thanks a heap!  I had been trying to figure out how to make this mork, and then you came along!

jklapp

Quote from: jklapp on October 09, 2006, 09:10:39 PM
I'm getting adminOver 30 Chat (No space between user and room) using this code

  //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. :)

//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

#6
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.

Malk

Where i can get a 7x chat script?

kran1um

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

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 '
<a target="_blank" href="http://www.yoursite.com/chat">', $room,
'</a>
';
echo '
<font color="#FFFF00">',$usersonline, '</font>';

}

yjobcreations

how can i integrate the results of this block into the "Menu with Icons" block.

The output will show list of online users using the chatroom under the *Chat link in the menu

yjobcreations

another question:

in the chat room i am hidden (Admin account), but on the chat list i am visible.

i want to be hidden from the list too.

how?

Lotis

I've read through this thread and cannot get this to work inside php box - nothing shows up and if I use a different type of block, I get an error message. 

Will this only work if x7chat is integrated with the SMF database? Mine are on separate dbases (I did make sure to point it to the subdirectory that I have the chat installed in).

Would it have anything to do with using versions of SMF and Tinyportal that are later than when this script was posted?

IchBin

Yes, they must be on the same database.

Lotis

Ah, that explains it.  Thanks IchBin!

This website is proudly hosted on Crocweb Cloud Website Hosting.