PDA

View Full Version : Sig with Ts


jeeep
08-05-2006, 17:02
I'm in the process of making a sig with flash. There are different sections to the sig and one I would like to have some info about my ts on there (other than ip). Maybe some dynamic user info content or perhaps even something similar to a ts viewer. Anyone have any ideas as to where I might be able to get started? Thanks

Slacker.
11-05-2006, 02:09
http://cyts.midlink.org/

jeeep
29-06-2006, 06:14
thanks for that! it was precisely what i was looking for. although i cant seem to figure this section of php code out. the script works fine when people are online, yet when people are off line and no one is in the server it shows this: " Invalid argument supplied for foreach() in etc......) online 31". does anyone know a fix?

<?php
require("cyts.class.php");
$cyts = new cyts;
$cyts->connect("xxx.xx.xxx.xx", 51234, xxxx) or print "Cannot connect to server.";
$cyts->login("admin", "password");
$list = $cyts->info_channelList();
$users = $cyts->admin_dbUserList();
$tsusers = $cyts->info_playerList();
$tsuser = $cyts->info_playerNameList();
$tsserv = $cyts->info_serverInfo();
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\" class=\"team\">";
$server=false;
if ($tsserv[server_name] == NULL) $server=true;
if ($server == true) { echo "<tr><td>The server is Offline</td></tr>"; } else { echo "
<tr>
<td colspan=\"3\" align=\"left\" nowrap=\"nowrap\">
<img src=\"images/teamspeak_online.png\" alt=\"TS server\" width=\"16\" height=\"16\" />
$tsserv[server_name]
</td>
</tr>";}
foreach ($list as $channel) {
echo "
<tr>
<td nowrap=\"nowrap\" align=\"left\">
<img src=\"images/treeimage4.png\" alt=\"blank\" width=\"16\" height=\"16\" />
<img src=\"images/channel.png\" alt=\"TS channel\" width=\"16\" height=\"16\" />
$channel[name]:
</td>
</tr>";
$chanUsers = $cyts->info_channelUser($channel["id"]);
foreach ($chanUsers as $user) {
echo "
<tr>
<td nowrap=\"nowrap\" align=\"left\">
<img src=\"images/treeimage4.png\" alt=\"blank\" width=\"16\" height=\"16\" />
<img src=\"images/treeimage3.png\" alt=\"tree\" width=\"16\" height=\"16\" />
<img src=\"images/online.gif\" alt=\"online\" width=\"16\" height=\"16\" />
$user[nick]
</td>
</tr> ";
}

}
echo "
<tr>
<td height=\"12\">
<br />
<p>
<img src=\"images/black.gif\" width=100 height=1 vspace=1 alt=\"line\">
<br /> Members Offline:<br />
<img src=\"images/black.gif\" width=100 height=1 vspace=1 alt=\"line\">
</p>
</td>
</tr>";

foreach ($users as $offline) {
//Go through the memberlist
$online = false;
//At first we believe he/she is offline
foreach ($tsusers as $tsuser)
{
//Go through the list of users which are online in TS
if ($tsuser["loginname"] == $offline[5]) $online = true;
//If someone who is online in TS is logged in with the member's loginname change the status to true
}


//If he is online print nothing else print offline
if ($online ==false) echo "
<tr>
<td title=\"last login $offline[4]\" align=\"left\" valign=\"middle\">
<img src=\"images/treeimage4.png\" alt=\"blank\" width=\"16\" height=\"16\" />
<img src=\"images/treeimage4.png\" alt=\"blank\" width=\"16\" height=\"16\" />
<img src=\"images/offline.gif\" alt=\"offline\" width=\"16\" height=\"16\" />
$offline[5]
</td>
</tr>
";
} echo"</table>
<br />";
?>

Cyrus
29-06-2006, 14:29
just put

if (is_array($chanUsers)) {

}



around the foreach statement