I have a playlist and a player in one script. When click any one of the list it passes a value which i take with GET method($_GET['List_id']
) and then play this specific video. But i need a highlighter to highlight the list item which is playing now.
In twitter bootstrap it needs only to declare class='active'. So i initialize class blank($ive = ''
) and when it matches with $_GET
values it put active into it.
But it won't works, With this code all list items show active. How to put this 'active' within $ive
variable?
Here is my code--
<?php
include "ste_content/connect.php";
//initialize
$subID = $_GET['Subcategory_id'];
$listID = $_GET['List_id'];
$list = "";
$ive = '';
$strSQL = "SELECT * FROM `video_links` WHERE `Subcategory_id`=".
$_GET["Subcategory_id"] ." ORDER BY `Subcategory_id`";
$rs = mysql_query($strSQL);
while($row = mysql_fetch_array($rs)) {
$strTitle = $row['List_title'];
$id = $row['List_id'];
$strLink = "<a href = 'tv.php?List_id=" . $row['List_id']
. "&&Subcategory_id=". $row['Subcategory_id']."'>"
. $strTitle . "</a>";
if(strcmp($listID,$id)==0){
$ive = 'active';
}
$list .= "<li class='$ive'><a href='#'><i class='icon-chevron-right'></i> $strLink </a></li>" ;
}
mysql_close();
?>
I am output this $list variable inside html.