<?xml version='1.0' encoding='UTF-8'?>
<rss version='2.0'>
	<channel>
		<title>cotonti.com : Plugin Stream =&gt; My nightmare</title>
		<link>https://www.cotonti.com</link>
		<description>Neueste Themenbeiträge</description>
		<generator>Cotonti</generator>
		<language>en</language>
		<pubDate>Fri, 17 Apr 2026 19:13:28 -0000</pubDate>

		<item>
			<title>Twiebie</title>
			<description><![CDATA[<p>You're welcome!</p>
]]></description>
			<pubDate>Sa, 26 Apr 2014 22:00:29 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/de/forums?m=posts&q=7728&d=0#post39482]]></link>
		</item>
		<item>
			<title>Harker</title>
			<description><![CDATA[<p>I modified my code with your and now it works marvelously !!</p>

<p><strong>One very very thank you for your help</strong> :)</p>
]]></description>
			<pubDate>Sa, 26 Apr 2014 21:16:51 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/de/forums?m=posts&q=7728&d=0#post39481]]></link>
		</item>
		<item>
			<title>Twiebie</title>
			<description><![CDATA[<p>I think you need to re-arrange your code a bit as you are now parsing all streams to the TPL regardless of if they are online or not.</p>

<p>Here's an example without the use of JS:</p>

<pre class="brush:php;">
$sql = $db-&gt;query("SELECT * FROM cot_streams")-&gt;fetchAll();

if ($sql)
{
    foreach ($sql as $data)
    {
        $json   = file_get_contents('https://api.twitch.tv/kraken/streams/'.$data['streams_name']);
        $stream = json_decode($json);

        if ($stream-&gt;stream)
        {
            $t-&gt;assign(array(
                'STREAMS_ID'              =&gt; $data['id'],
                'STREAMS_USER_ID'         =&gt; $data['userid'],
                'STREAMS_USER_TWITCHNAME' =&gt; $data['teststream']
            ));
            $t-&gt;parse('MAIN.STREAM_ROW');
        }
    }
}</pre>

<p> </p>
]]></description>
			<pubDate>Sa, 26 Apr 2014 20:54:36 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/de/forums?m=posts&q=7728&d=0#post39480]]></link>
		</item>
		<item>
			<title>Harker</title>
			<description><![CDATA[<p>Hello to all,</p>

<p>I created a plugin which allows me to see the status of the streams of my members. It works very well but I do not manage to have that I want in spite of my nights white and my liters of coffee.</p>

<p>At present, my page shows all the on-line and off-line streams. I would need your help so that my plugin shows only the on-line streams.</p>

<p> </p>

<p><strong>PHP</strong></p>

<pre class="brush:as3;">
$sql = $db-&gt;query("SELECT * FROM cot_streams");
while ($data = $sql-&gt;fetch())
	{
	$data['teststream'] = '&lt;a class="ltwitch" href="https://www.cotonti.com/#" data-tnick="'.$data['streams_name'].'"&gt;'.$data['streams_name'].'&lt;/a&gt; (&lt;span&gt;...&lt;/span&gt;)';
	$t-&gt; assign(array(
	'STREAMS_ID' =&gt; $data['id'],
	'STREAMS_USER_ID' =&gt; $data['userid'],
	'STREAMS_USER_TWITCHNAME' =&gt; $data['teststream']
		
	));

	$t-&gt;parse('MAIN.STREAM_ROW');
}</pre>

<p><strong>TPL</strong></p>

<pre class="brush:as3;">
&lt;!-- BEGIN: STREAM_ROW --&gt;
	&lt;div&gt;{STREAMS_ID}&lt;/div&gt;
	&lt;div&gt;{STREAMS_USER_ID}&lt;/div&gt;
	&lt;div&gt;{STREAMS_USER_TWITCHNAME}&lt;/div&gt;
&lt;!-- END: STREAM_ROW --&gt;</pre>

<p><strong>JS</strong></p>

<pre class="brush:as3;">
jQuery(document).ready(function ($) {
    $('.ltwitch').each(function () {
        var tnick = $(this).data('tnick');
        var span = $(this).next();
        $.getJSON("https://api.twitch.tv/kraken/streams/" + tnick + ".json?callback=?", function (c) {
            if (c.stream == null) {
                span.html("Offline");
            } else {
                span.html("Online");
            }
        });
    });
});</pre>

<p> </p>

<p>PLLLLeeeeeaaassseeee Help me to transform my nightmares, I do not sleep any more ^^</p>
]]></description>
			<pubDate>Sa, 26 Apr 2014 14:58:50 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/de/forums?m=posts&q=7728&d=0#post39479]]></link>
		</item>
	</channel>
</rss>