我对 HTML、PHP 等等还是很陌生,但我有一个基本的了解,我意识到显然有按数字/字母排序的功能。但是我想要的功能我真的找不到任何东西,也没有搜索正确的术语来找到我正在寻找的指南
基本上我有一个部落成员的自定义流页面,每个流上方是文本和图像流状态:在线/离线,当人流它会从在线变为离线时,此功能 100% 工作
但是所有的流都混乱了,在线的流在页面底部或随机位置找到
我希望它将当前在线的流带到顶部,这甚至可能吗?
<?php
$channelName = htmlspecialchars($_GET['channel'], ENT_QUOTES);
$clientId = ''; // Register your application and get a client ID at http://www.twitch.tv/settings?section=applications
$online = 'online.png'; // Set online image here
$offline = 'offline.png'; // Set offline image here
$json_array = json_decode(file_get_contents('https://api.twitch.tv/kraken/streams/'.strtolower($channelName).'?client_id='.$clientId), true);
if ($json_array['stream'] != NULL) {
$channelTitle = $json_array['stream']['channel']['display_name'];
$streamTitle = $json_array['stream']['channel']['status'];
$currentGame = $json_array['stream']['channel']['game'];
echo "$channelTitle is <img src='$online' alt='Online' /> playing $currentGame";
} else {
echo "$channelName is <img src='$offline' alt='Offline' />";
}
?>
是我用来拉流状态&
<A NAME="SADMAN"><center><font size="3" color="red"><span style="color:#FFFFFF">Konvict</span> - Sadmanwhosane - <span style="color:#CEE3F6">Stream status:</span> <img src="http://teamewix.com/stream.php?streamuser=sadmanwhosane87"></font>
我所做的一切都是为了展示它