TinyPortal

Development => Block Codes => Topic started by: deniz on September 24, 2006, 11:23:15 PM

Title: online list for x7chat
Post by: deniz 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";
   
}

Title: Re: online list for x7chat
Post by: Svaha on September 26, 2006, 07:34:56 AM
Thanks Deniz
Title: Re: online list for x7chat
Post by: jklapp 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 :)
Title: Re: online list for x7chat
Post by: crazypal24x7 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
Title: Re: online list for x7chat
Post by: technodragon73 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!
Title: Re: online list for x7chat
Post by: jklapp 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 :)
Title: Re: online list for x7chat
Post by: kran1um 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.
Title: Re: online list for x7chat
Post by: Malk on November 29, 2006, 05:56:59 AM
Where i can get a 7x chat script?
Title: Re: online list for x7chat
Post by: kran1um 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?
Title: Re: online list for x7chat
Post by: tavoo 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>';

}
Title: Re: online list for x7chat
Post by: yjobcreations on February 14, 2007, 04:13:17 PM
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
Title: Re: online list for x7chat
Post by: yjobcreations on February 26, 2007, 02:31:11 PM
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?
Title: Re: online list for x7chat
Post by: Lotis on July 17, 2007, 05:32:28 PM
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?
Title: Re: online list for x7chat
Post by: IchBin on July 17, 2007, 07:56:18 PM
Yes, they must be on the same database.
Title: Re: online list for x7chat
Post by: Lotis on July 17, 2007, 08:00:29 PM
Ah, that explains it.  Thanks IchBin!