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";
}
Thanks Deniz
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 :)
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
Awesome code snippet...thanks a heap! I had been trying to figure out how to make this mork, and then you came along!
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 :)
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.
Where i can get a 7x chat script?
http://www.x7chat.com/
ANyway, How can I get this to correspond with the Shouthistory in the Profile section that uses the old shoutbox?
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>';
}
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
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?
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?
Yes, they must be on the same database.
Ah, that explains it. Thanks IchBin!