📄 series_list.php
字号:
<?php// requirementsrequire('assoc_to_xml.php');require('mysql_conn.php');?><?php// file_put_contents('sl_post_debug.txt', var_export($_POST, true));$series_list = array();// When the user ask to list series by channel (clicking of the channel thumb, at the upper bar),// flash will send 'channel_id' through POST// $_POST['channel_id'] = 1; // just for testingif(isset($_POST['channel_id'])){ $sql = "select series.sid, series.name, series.series_description, series.series_tags from series, channels where channels.fk_sid=series.sid and channels.fk_chid=".$_POST['channel_id']. " order by series.creation_date desc"; connect(); $result = mysql_query($sql); if ($result) { while ($row = mysql_fetch_array($result)) { $series = array('sid'=>$row['sid'], 'video_id'=>'', 'name'=>$row['name'], 'description'=>$row['series_description'], 'tags'=>$row['series_tags'], 'rating'=>'', 'rating_desc'=>'', 'rating_img'=>'', 'thumb'=>'', 'watched'=>'', 'unseen'=>''); // get thumb, rating, ratingImg $result_content = mysql_query("select wid, fk_rid from series_content where fk_sid=".$row['sid']." and fk_ctid=1 order by series_content.creation_date desc"); if ($result_content) { if ($first_epi = mysql_fetch_array($result_content)) { $result_thumb = mysql_query("select screenshot_image from content_crop where fk_wid=".$first_epi["wid"]); if ($result_thumb) { $first_epi_thumb = mysql_fetch_array($result_thumb); $series['thumb'] = "thumbnails/".$first_epi_thumb["screenshot_image"]; } $result_rating = mysql_query("select rating, description, image_url from ref_series_rating where rid=".$first_epi["fk_rid"]); if ($result_rating) { if ($first_epi_rating = mysql_fetch_array($result_rating)) { $series['rating'] = $first_epi_rating['rating']; $series['rating_desc'] = $first_epi_rating['description']; $series['rating_img'] = $first_epi_rating['image_url']; } } } } // get video_id $result_content = mysql_query("select wid from series_content where fk_sid=".$row['sid']." and fk_ctid=3"); if ($result_content) { if ($promo = mysql_fetch_array($result_content)) $series['video_id'] = $promo['wid']; } // get episode count $result_epi_count = mysql_query("select count(wid) as epi_count from series_content where fk_sid=".$row['sid']." and fk_ctid=1"); if ($result_epi_count) { if ($count_row = mysql_fetch_array($result_epi_count)) $epi_count = $count_row['epi_count']; else $epi_count = 0; } else $epi_count = 0; //$series['watched'] = $series['unseen'] = $epi_count; // get watched number $sql = "select count(distinct channels_viewed_content.fk_wid) as watched from channels_viewed_content, series_content where series_content.fk_sid = ".$row['sid']." and series_content.fk_ctid = 1 and channels_viewed_content.fk_wid = series_content.wid and channels_viewed_content.views>0"; $result_watched = mysql_query($sql); if ($result_watched) { if ($watched_row = mysql_fetch_array($result_watched)) $watched = $watched_row['watched']; else $watched = 0; } else $watched = 0; $series['watched'] = $watched; $series['unseen'] = $epi_count - $watched; $series_list[] = $series; } } close();} // output$xml = assocToXML($series_list);// file_put_contents('sl_res_debug.txt', $xml);echo $xml;?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -