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.
Here's an example without the use of JS:
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
$sql = $db ->query( "SELECT * FROM cot_streams" )->fetchAll();
if ( $sql )
{
foreach ( $sql as $data )
{
$stream = json_decode( $json );
if ( $stream ->stream)
{
$t ->assign( array (
'STREAMS_ID' => $data [ 'id' ],
'STREAMS_USER_ID' => $data [ 'userid' ],
'STREAMS_USER_TWITCHNAME' => $data [ 'teststream' ]
));
$t ->parse( 'MAIN.STREAM_ROW' );
}
}
}
|