index.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416
  1. {// 引入标签库 }
  2. <tagLib name="html" />
  3. <include file="Public:header" />
  4. <PHP>
  5. function live_status($status,$video){
  6. if($status==1){
  7. //return "<a href='__ROOT__/video.php?channelid=".$video['channelid']."' target='_blank'>直播中</a>";
  8. return "<a href=\"javascript:get_video_preview('".$video['id']."')\">直播中</a>";
  9. }elseif($status==2){
  10. return "正在创建直播";
  11. }elseif($status==3){
  12. return "历史";
  13. }else{
  14. return "直播结束";
  15. }
  16. }
  17. function push($id,$video){
  18. return "<a href=\"javascript:push_anchor('".$id."')\">粉丝推送</a>";
  19. }
  20. function push_all($id,$video){
  21. return "<a href=\"javascript:push_anchor_all('".$id."')\">全服推送</a>";
  22. }
  23. function stick($id,$video){
  24. if(intval(defined('OPEN_STICK') && OPEN_STICK)){
  25. if($video['stick']==1){
  26. return "<a href=\"javascript:stick('".$id."')\">取消手动置顶</a>";
  27. }else{
  28. return "<a href=\"javascript:stick('".$id."')\">手动置顶</a>";
  29. }}
  30. }
  31. function close($id,$video){
  32. if($video['live_in']==1){
  33. return "<a href=\"javascript:close_live('".$video['user_id']."','".$video["id"]."')\">关闭房间</a>";
  34. }else{
  35. return "<a href=\"javascript:demand_video_status('".$id."')\">下线</a>";
  36. }
  37. }
  38. function forbid_send_msg($id,$video){
  39. return "<a href=\"javascript:forbid('".$id."')\">被禁言观众</a>";
  40. }
  41. function get_level($id){
  42. $get_level=$GLOBALS['db']->getOne("select ul.name from ".DB_PREFIX."user_level as ul left join ".DB_PREFIX."user as u on u.user_level = ul.level where u.id=".$id);
  43. return $get_level;
  44. }
  45. function get_nickname($id){
  46. $get_nickname=$GLOBALS['db']->getOne("select nick_name from ".DB_PREFIX."user where id=".$id);
  47. return emoji_decode($get_nickname);
  48. }
  49. function get_preview($id)
  50. {
  51. return "<a href=\"javascript:get_video_preview('".$id."')\">查看</a>";
  52. }
  53. function get_room_type($room_type){
  54. if($room_type==1){
  55. return "私密";
  56. }elseif($room_type==2){
  57. return "聊天室";
  58. }elseif($room_type==3){
  59. return "互动聊天室";
  60. }else{
  61. return "公开";
  62. }
  63. }
  64. function live_pay($is_live_pay){
  65. if($is_live_pay==0){
  66. return "否";
  67. }elseif($is_live_pay==1){
  68. return "是";
  69. }}
  70. function live_stick($stick){
  71. if($stick==0){
  72. return "否";
  73. }elseif($stick==1){
  74. return "是";
  75. }}
  76. function live_pay_type($live_pay_type,$video){
  77. if($video['is_live_pay']==1){
  78. if($live_pay_type==1){
  79. return "按场收费";
  80. }elseif($live_pay_type==0){
  81. return "按时收费";
  82. }elseif($live_pay_type==2){
  83. return "暂未收费";
  84. }
  85. }
  86. }
  87. function set_live_pay($id,$video){
  88. if($video['pay_editable']==1){
  89. return "<a href=\"javascript:set_live_pay('".$id."')\">付费设置</a>";
  90. }
  91. }
  92. </PHP>
  93. <script>
  94. function del_child_room(id)
  95. {
  96. if(!id)
  97. {
  98. idBox = $(".key:checked");
  99. if(idBox.length == 0)
  100. {
  101. alert(LANG['DELETE_EMPTY_WARNING']);
  102. return;
  103. }
  104. idArray = new Array();
  105. $.each( idBox, function(i, n){
  106. idArray.push($(n).val());
  107. });
  108. id = idArray.join(",");
  109. }
  110. if(confirm(LANG['CONFIRM_DELETE']))
  111. $.ajax({
  112. url: ROOT+"?"+VAR_MODULE+"="+MODULE_NAME+"&"+VAR_ACTION+"=del_video&id="+id,
  113. data: "ajax=1",
  114. dataType: "json",
  115. success: function(obj){
  116. alert(obj.info);
  117. func();
  118. function func(){
  119. if(obj.status==1){
  120. location.href=location.href;
  121. }
  122. }
  123. }
  124. });
  125. }
  126. function demand_video_status(id)
  127. {
  128. if(confirm("确定要修改状态?"))
  129. $.ajax({
  130. url: ROOT+"?"+VAR_MODULE+"="+MODULE_NAME+"&"+VAR_ACTION+"=set_demand_video_status&id="+id,
  131. data: "ajax=1",
  132. dataType: "json",
  133. success: function(obj){
  134. alert(obj.info);
  135. func();
  136. function func(){
  137. if(obj.status==1){
  138. location.href=location.href;
  139. }
  140. }
  141. }
  142. });
  143. }
  144. function forbid(id){
  145. location.href = ROOT+"?"+VAR_MODULE+"="+MODULE_NAME+"&"+VAR_ACTION+"=forbid&id="+id;
  146. }
  147. function get_video_preview(id){
  148. window.open(ROOT+"?"+VAR_MODULE+"=Video&"+VAR_ACTION+"=play&id="+id);
  149. }
  150. function virtual(id){
  151. location.href = ROOT+"?"+VAR_MODULE+"="+MODULE_NAME+"&"+VAR_ACTION+"=list_virtual&id="+id;
  152. }
  153. function tipoff_list(id){
  154. location.href = ROOT+"?"+VAR_MODULE+"=Tipoff&"+VAR_ACTION+"=index&video_id="+id;
  155. }
  156. function stick(id){
  157. $.ajax({
  158. url: ROOT+"?"+VAR_MODULE+"="+MODULE_NAME+"&"+VAR_ACTION+"=stick&id="+id,
  159. data: "",
  160. dataType: "json",
  161. success: function(obj){
  162. alert(obj.info);
  163. func();
  164. function func(){
  165. if(obj.status==1){
  166. location.href=location.href;
  167. }
  168. }
  169. }
  170. });
  171. }
  172. function push_anchor(id){
  173. $.ajax({
  174. url: ROOT+"?"+VAR_MODULE+"="+MODULE_NAME+"&"+VAR_ACTION+"=push_anchor&id="+id,
  175. data: "",
  176. dataType: "json",
  177. success: function(obj){
  178. console.log(obj);
  179. $("#info").html(obj.info);
  180. if(obj.status==1){
  181. if(obj.info){
  182. alert(obj.info);
  183. }
  184. else{
  185. alert('操作成功');
  186. }
  187. }
  188. else{
  189. if(obj.info){
  190. alert(obj.info);
  191. }
  192. else{
  193. alert('操作成功');
  194. }
  195. }
  196. }
  197. });
  198. }
  199. function push_anchor_all(id){
  200. $.ajax({
  201. url: ROOT+"?"+VAR_MODULE+"="+MODULE_NAME+"&"+VAR_ACTION+"=push_anchor_all&id="+id,
  202. data: "",
  203. dataType: "json",
  204. success: function(obj){
  205. $("#info").html(obj.info);
  206. if(obj.status==1){
  207. if(obj.info){
  208. alert(obj.info);
  209. }
  210. else{
  211. alert('操作成功');
  212. }
  213. }
  214. else{
  215. if(obj.info){
  216. alert(obj.info);
  217. }
  218. else{
  219. alert('操作成功');
  220. }
  221. }
  222. }
  223. });
  224. }
  225. function refresh(){
  226. $(document).ready(function(){
  227. window.location.reload();
  228. });
  229. }
  230. function close_live($user_id,$room_id){
  231. var r=confirm("确定关闭这个直播??");
  232. if (r==true){
  233. $.ajax({
  234. url: ROOT+"?"+VAR_MODULE+"="+MODULE_NAME+"&"+VAR_ACTION+"=close_live&user_id="+$user_id+"&room_id="+$room_id,
  235. data: "",
  236. dataType: "json",
  237. success: function(obj){
  238. $("#info").html(obj.info);
  239. if(obj.status==1){
  240. if(obj.info){
  241. alert(obj.info);
  242. refresh();
  243. }
  244. else{
  245. alert('操作成功');
  246. refresh();
  247. }
  248. }
  249. else{
  250. if(obj.info){
  251. alert(obj.info);
  252. refresh();
  253. }
  254. else{
  255. alert('操作成功');
  256. refresh();
  257. }
  258. }
  259. }
  260. });
  261. }else{
  262. }
  263. }
  264. //直播设置
  265. function video_set(id)
  266. {
  267. $.ajax({
  268. url: ROOT+"?"+VAR_MODULE+"="+MODULE_NAME+"&"+VAR_ACTION+"=video_set&id="+id,
  269. data: "ajax=1",
  270. dataType: "json",
  271. success: function(msg){
  272. if(msg.status==0){
  273. alert(msg.info);
  274. }
  275. },
  276. error: function(){
  277. $.weeboxs.open(ROOT+'?'+VAR_MODULE+'='+MODULE_NAME+'&'+VAR_ACTION+'=video_set&id='+id, {contentType:'ajax',showButton:false,title:LANG['USER_VIDEO_SET'],width:600,height:260});
  278. }
  279. });
  280. }
  281. //推送地址
  282. function push_url(id)
  283. {
  284. $.ajax({
  285. url: ROOT+"?"+VAR_MODULE+"="+MODULE_NAME+"&"+VAR_ACTION+"=push_url&id="+id,
  286. data: "ajax=1",
  287. dataType: "json",
  288. success: function(msg){
  289. if(msg.status==0){
  290. alert(msg.info);
  291. }
  292. },
  293. error: function(){
  294. $.weeboxs.open(ROOT+'?'+VAR_MODULE+'='+MODULE_NAME+'&'+VAR_ACTION+'=push_url&id='+id, {contentType:'ajax',showButton:false,title:'推流地址',width:1024,height:300});
  295. }
  296. });
  297. }
  298. function set_live_pay(id){
  299. $.ajax({
  300. url: ROOT+"?"+VAR_MODULE+"="+MODULE_NAME+"&"+VAR_ACTION+"=set_live_pay&id="+id,
  301. data: "ajax=1",
  302. dataType: "json",
  303. success: function(msg){
  304. if(msg.status==0){
  305. alert(msg.info);
  306. }
  307. },
  308. error: function(){
  309. $.weeboxs.open(ROOT+'?'+VAR_MODULE+'='+MODULE_NAME+'&'+VAR_ACTION+'=set_live_pay&id='+id, {contentType:'ajax',showButton:false,title:'付费设置',width:600,height:200});
  310. }
  311. });
  312. }
  313. //添加子房间
  314. function add_child_room(){
  315. location.href = ROOT+"?"+VAR_MODULE+"="+MODULE_NAME+"&"+VAR_ACTION+"=add_child_room";
  316. }
  317. //编辑子房间
  318. function edit_child_room(id){
  319. location.href = ROOT+"?"+VAR_MODULE+"="+MODULE_NAME+"&"+VAR_ACTION+"=edit_child_room&child_room_id="+id;
  320. }
  321. //观众列表
  322. function viewer_list(id){
  323. location.href = ROOT+"?"+VAR_MODULE+"="+MODULE_NAME+"&"+VAR_ACTION+"=viewer_list&child_room_id="+id;
  324. }
  325. //礼物列表
  326. function prop_list(id){
  327. location.href = ROOT+"?"+VAR_MODULE+"="+MODULE_NAME+"&"+VAR_ACTION+"=prop_list&room_id="+id;
  328. }
  329. //付费列表
  330. function pay_list(id){
  331. location.href = ROOT+"?"+VAR_MODULE+"="+MODULE_NAME+"&"+VAR_ACTION+"=pay_list&room_id="+id;
  332. }
  333. </script>
  334. <load href='__TMPL__Common/js/jquery.bgiframe.js' />
  335. <load href='__TMPL__Common/js/jquery.weebox.js' />
  336. <load href='__TMPL__Common/js/deal.js' />
  337. <load href='__TMPL__Common/js/user.js' />
  338. <load href='__TMPL__Common/style/weebox.css' />
  339. <script type="text/javascript" src="__TMPL__Common/js/calendar/calendar.php?lang=zh-cn" ></script>
  340. <load href='__TMPL__Common/js/calendar/calendar.css' />
  341. <load href='__TMPL__Common/js/calendar/calendar.js' />
  342. <div class="main">
  343. <div class="main_title_list"><div class="list-line-ico"></div>子房间列表<a href="/{$url_name}?m=ChildRoom&a=index&&">刷新</a></div>
  344. <div class="search_row">
  345. <form name="search" action="__APP__" method="get" class="clearfix">
  346. <div>主播ID: <input type="text" class="textbox" name="user_id" value="{:trim($_REQUEST['user_id'])}" style="width:100px;" /></div>
  347. <div>主播昵称:<input type="text" class="textbox" name="nick_name" value="{:trim($_REQUEST['nick_name'])}" style="width:100px;" /></div>
  348. <div>话题:<select name="cate_id">
  349. <option value="0">全部</option>
  350. <foreach name="cate_list" item="cate_item">
  351. <option value="{$cate_item.id}" <if condition="$_REQUEST['cate_id'] eq $cate_item['id']">selected="selected"</if>>{$cate_item.title}</option>
  352. </foreach>
  353. </select></div>
  354. <div>分类:<select name="classified_id">
  355. <option value="0">全部</option>
  356. <foreach name="classified_list" item="classified_item">
  357. <option value="{$classified_item.id}" <if condition="$_REQUEST['classified_id'] eq $classified_item['id']">selected="selected"</if>>{$classified_item.title}</option>
  358. </foreach>
  359. </select></div>
  360. <div>创建时间:<span><input type="text" class="textbox" name="create_time_1" id="create_time_1" value="{$_REQUEST['create_time_1']}" onfocus="this.blur(); return showCalendar('create_time_1', '%Y-%m-%d', false, false, 'btn_create_time_1');" /><input type="button" class="button" id="btn_create_time_1" value="{%SELECT_TIME}" onclick="return showCalendar('create_time_1', '%Y-%m-%d', false, false, 'btn_create_time_1');" /></span> - <span><input type="text" class="textbox" name="create_time_2" id="create_time_2" value="{$_REQUEST['create_time_2']}" onfocus="this.blur(); return showCalendar('create_time_2', '%Y-%m-%d', false, false, 'btn_create_time_2');" /><input type="button" class="button" id="btn_create_time_2" value="{%SELECT_TIME}" onclick="return showCalendar('create_time_2', '%Y-%m-%d', false, false, 'btn_create_time_2');" /></span><input type="hidden" value="ChildRoom" name="m" /><input type="hidden" value="index" name="a" /><input type="submit" class="button" value="{%SEARCH}" /></div>
  361. </form>
  362. </div>
  363. <html:list
  364. id="dataTable"
  365. style="dataTable"
  366. name="video"
  367. checkbox="true"
  368. action="true"
  369. datasource="list"
  370. show="id:子房间号
  371. ,parent_id:父房间号
  372. ,user_id:主播ID
  373. ,user_id|get_nickname=$video['user_id']:主播
  374. ,vote_number:{%TICKET}|50px
  375. ,all_watch_number:前端显示人数
  376. ,watch_number:实际累计观看人数
  377. ,max_watch:洪峰观看人数
  378. ,virtual_watch_number:当前机器人数
  379. ,robot_num:当前机器人头数量
  380. ,live_in|live_status=$video:直播状态:preview
  381. ,room_type|get_room_type=$video['room_type']:直播类型
  382. ,is_live_pay|live_pay:是否收费
  383. ,live_pay_type|live_pay_type=$video:收费类型
  384. ,create_time|to_date:创建时间
  385. ,tipoff_count:举报次数:tipoff_list
  386. ,sort|get_sort=$video['id']:{%SORT}
  387. ,sort_num:热门"
  388. actionlist="id|set_live_pay=$video,video_set:{%USER_VIDEO_SET},edit_child_room:{%EDIT},id|close=$video,viewer_list:观众列表,prop_list:礼物日志,pay_list:付费列表" />
  389. <table class="dataTable">
  390. <tbody>
  391. <td colspan="11">
  392. <input type="button" class="button button-add" value="{%ADD}" onclick="add_child_room();" />
  393. <!--<input type="button" class="button button-del" value="{%DEL}" onclick="del_child_room();" />-->
  394. </td>
  395. </tbody>
  396. </table>
  397. <div class="page">{$page}</div><!--(数值越大在app热门直播中越靠前) ,vote_number:{%TICKET}-->
  398. </div>
  399. <include file="Public:footer" />