Guest User

Untitled

a guest
May 24th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.25 KB | None | 0 0
  1. <?php
  2.  
  3. if(isset($_GET['action'])) $action = $_GET['action'];
  4. else $action = '';
  5.  
  6. if($action == 'save') {
  7. $_language->read_module('liveshow');
  8. if(!$loggedin) die($_language->module['no_access']); #
  9. $title = $_POST['title'];
  10. $id = $_POST['id'];
  11. $type = $_POST['type'];
  12. $active = $_POST['active'];
  13. if($active == 'on') { $active = 1; }
  14. else { $active == 0; }
  15. $active = get_streamactive($active);
  16. if(!isanyadmin($userID)) { $active = 2; }
  17. safe_query("INSERT INTO ".PREFIX."liveshow (title, id, type, active, userID) values ('".$title."', '".$id."', '".$type."', '".$active."', '".$userID."')");
  18. echo '<meta http-equiv="refresh" content="0; url=index.php?site=liveshow">';
  19.  
  20. } elseif($action == 'saveedit') {
  21. $_language->read_module('liveshow');
  22. if(!get_streamaccess()) die($_language->module['no_access']); #
  23. $title = $_POST['title'];
  24. $id = $_POST['id'];
  25. $type = $_POST['type'];
  26. $u_id = $_POST['userID'];
  27. $livID = $_POST['livID'];
  28. $active = $_POST['active'];
  29. if($active == 'on') { $active = 1; }
  30. else { $active == 0; }
  31. $active = get_streamactive($active);
  32. safe_query("UPDATE ".PREFIX."liveshow SET title='".$title."', id='".$id."', type='".$type."', active='".$active."', userID='".$u_id."' WHERE livID='".$livID."' ");
  33. echo '<meta http-equiv="refresh" content="0; url=index.php?site=liveshow">';
  34.  
  35. } elseif($action == 'saveactive') {
  36. $_language->read_module('liveshow');
  37. if(!get_streamaccess()) die($_language->module['no_access']); #
  38. $active_pst = $_POST['active'];
  39.  
  40. if(isanyadmin($userID)) { safe_query("UPDATE ".PREFIX."liveshow SET active='0' WHERE active='1' "); }
  41. else { safe_query("UPDATE ".PREFIX."liveshow SET active='0' WHERE active='1' AND userID='".$userID."' "); }
  42.  
  43. foreach($active_pst as $key => $active) {
  44. $ds=mysql_fetch_array(safe_query("SELECT userID, active FROM ".PREFIX."liveshow WHERE livID='".$active."'"));
  45. $id = $ds['userID'];
  46. $actived = $ds['active'];
  47. if(isanyadmin($userID) OR ($userID == $id AND $actived != '2')) {
  48. safe_query("UPDATE ".PREFIX."liveshow SET active='1' WHERE livID='".$active."' ");
  49. }
  50. }
  51. echo '<meta http-equiv="refresh" content="0; url=index.php?site=liveshow">';
  52. } elseif($action == 'new') {
  53. $_language->read_module('liveshow');
  54. if(!get_streamaccess()) die($_language->module['no_access']); #
  55. $streams = get_streamlist();
  56. $active = '';
  57. $bg1 = BG_1;
  58. if(isanyadmin($userID)) { $active = '<tr align="left">
  59. <td bgcolor="'.$bg1.'"><b>'.$_language->module['active'].'?</b></td>
  60. <td bgcolor="'.$bg1.'"><input type="checkbox" name="active" checked="checked" /></td>
  61. </tr>'; }
  62. eval ("\$liveshow_new = \"".gettemplate("liveshow_new")."\";");
  63. echo $liveshow_new;
  64.  
  65. } elseif($action == 'edit') {
  66. $_language->read_module('liveshow');
  67. if(!get_streamaccess()) die($_language->module['no_access']); #
  68. $sql_abfrage = "AND userID='".$userID."'";
  69. if(isanyadmin($userID)) { $sql_abfrage = ''; }
  70. $ergebnis = safe_query("SELECT * FROM ".PREFIX."liveshow WHERE livID='".$_GET['livID']."' ".$sql_abfrage);
  71. while($ds=mysql_fetch_array($ergebnis)) {
  72. $title = $ds['title'];
  73. $streams = get_streamlist();
  74. $active_stream = $ds['type'];
  75. $streams = str_replace('value="'.$active_stream.'"', 'value="'.$active_stream.'" selected="selected"', $streams);
  76. $id = $ds['id'];
  77. $u_id = $ds['userID'];
  78. $livID = $_GET['livID'];
  79. $checked = '';
  80. $bg1 = BG_1;
  81. if($ds['active'] == 1) { $checked = 'checked="checked"'; }
  82. eval ("\$liveshow_edit = \"".gettemplate("liveshow_edit")."\";");
  83. echo $liveshow_edit;
  84. }
  85.  
  86. } elseif($action == 'settings') {
  87. $_language->read_module('liveshow');
  88. $title_head = '&raquo; '.$_language->module['settings'];
  89. eval ("\$title_liveshow = \"".gettemplate("title_liveshow")."\";");
  90. echo $title_liveshow;
  91.  
  92. if(!isanyadmin($userID)) die($_language->module['no_access']);
  93. $ergebnis = safe_query("SELECT * FROM ".PREFIX."liveshow_settings WHERE lID='1'");
  94. while($ds=mysql_fetch_array($ergebnis)) {
  95. $active = $ds['active'];
  96. $access_saved = $ds['access'];
  97. $width = $ds['width'];
  98. if($active) { $checked_1 = 'checked="checked"'; $checked_0 = ''; }
  99. else { $checked_1 = ''; $checked_0 = 'checked="checked"'; }
  100. $bg1 = BG_1;
  101. $access = '<option value="1">'.$_language->module['registered'].'</option>
  102. <option value="2">'.$_language->module['clanmembers'].'</option>
  103. <option value="3">'.$_language->module['admins'].'</option>';
  104. $access = str_replace('value="'.$access_saved.'"', 'value="'.$access_saved.'" selected="selected"', $access);
  105. eval ("\$liveshow_settings = \"".gettemplate("liveshow_settings")."\";");
  106. echo $liveshow_settings;
  107. }
  108.  
  109. } elseif($action == 'settingssave') {
  110. $_language->read_module('liveshow');
  111. if(!isanyadmin($userID)) die($_language->module['no_access']);
  112. $access = $_POST['access'];
  113. $active = $_POST['active'];
  114. $width = $_POST['width'];
  115. safe_query("UPDATE ".PREFIX."liveshow_settings SET active='".$active."', access='".$access."', `width`='".$width."' WHERE lID='1' ");
  116. echo '<meta http-equiv="refresh" content="0; url=index.php?site=liveshow">';
  117.  
  118. } elseif($action == 'delete') {
  119. $_language->read_module('liveshow');
  120. if(!get_streamaccess()) die($_language->module['no_access']);
  121. $ds=mysql_fetch_array(safe_query("SELECT userID FROM ".PREFIX."liveshow WHERE livID='".$_GET['livID']."'"));
  122. if(isanyadmin($userID) OR $userID == $ds['userID']) {
  123. safe_query("DELETE FROM ".PREFIX."liveshow WHERE livID='".$_GET['livID']."'");
  124. }
  125. echo '<meta http-equiv="refresh" content="0; url=index.php?site=liveshow">';
  126.  
  127. } elseif($action == 'show') {
  128. $_language->read_module('liveshow');
  129. echo '<input type="button" onclick="MM_goToURL(\'parent\',\'index.php?site=liveshow\');return document.MM_returnValue;" value="Online Liveshow" /> ';
  130. $ergebnis = safe_query("SELECT * FROM ".PREFIX."liveshow WHERE livID='".$_GET['livID']."'");
  131. while($ds=mysql_fetch_array($ergebnis)) {
  132. if(($userID == $ds['userID'] AND get_streamaccess() AND $ds['active'] !=2) OR isanyadmin($userID)) { echo '<input type="button" onclick="MM_goToURL(\'parent\',\'index.php?site=liveshow&action=edit&livID='.$_GET['livID'].'\');return document.MM_returnValue;" value="'.$_language->module['edit_liveshow'].'" /> <input type="button" onclick="MM_confirm(\''.$_language->module['really_delete'].'\', \'index.php?site=liveshow&action=delete&livID='.$_GET['livID'].'\');" value="'.$_language->module['delete'].'" />'; }
  133. $title_head = '&raquo; '.$ds['title'];
  134. eval ("\$title_liveshow = \"".gettemplate("title_liveshow")."\";");
  135. echo $title_liveshow;
  136. $title = $ds['title'];
  137.  
  138. $code = get_streaminfo($ds['id'], $ds['type'], 'embed');
  139. eval ("\$liveshow_show = \"".gettemplate("liveshow_show")."\";");
  140. echo $liveshow_show;
  141. }
  142.  
  143. } else {
  144. $_language->read_module('liveshow');
  145. $title_head = '';
  146. eval ("\$title_liveshow = \"".gettemplate("title_liveshow")."\";");
  147. echo $title_liveshow;
  148. if(get_streamaccess()) { echo '<input type="button" onclick="MM_goToURL(\'parent\',\'index.php?site=liveshow&action=new\');return document.MM_returnValue;" value="'.$_language->module['new_liveshow'].'" />'; }
  149. if(isanyadmin($userID)) { echo ' <input type="button" onclick="MM_goToURL(\'parent\',\'index.php?site=liveshow&action=settings\');return document.MM_returnValue;" value="'.$_language->module['settings'].'" />'; }
  150. echo '<br />';
  151. $sql_abfrage = "WHERE active='1'";
  152. if(get_streamaccess()) { $sql_abfrage = "WHERE active='1' OR userID='".$userID."'"; }
  153. if(isanyadmin($userID)) { $sql_abfrage = ''; }
  154. $ergebnis = safe_query("SELECT * FROM ".PREFIX."liveshow ".$sql_abfrage);
  155. eval ("\$liveshow_head = \"".gettemplate("liveshow_head")."\";");
  156. echo $liveshow_head;
  157. $n=1;
  158. while($ds=mysql_fetch_array($ergebnis)) {
  159. if($n%2) {
  160. $bg1=BG_1;
  161. }
  162. else {
  163. $bg1=BG_3;
  164. }
  165. $online = get_streaminfo($ds['id'], $ds['type'], 'live');
  166. $views = get_streaminfo($ds['id'], $ds['type'], 'views');
  167. if($online) { $live = '<font color="#00FF00">ONLINE</font>'; }
  168. else { $live = '<font color="#FF0000">OFFLINE</font>'; }
  169. $livID = $ds['livID'];
  170. $checkbox_show = '';
  171. $checked = '';
  172. $active_bgcolor = '';
  173. if($ds['active'] == 2) { $bg1 = '#FF9900'; }
  174. if($ds['active'] == 1) { $checked = 'checked="checked"'; }
  175. if(($userID == $ds['userID'] AND get_streamaccess() AND $ds['active'] !=2) OR isanyadmin($userID)) { $checkbox_show = '<input type="checkbox" name="active[]" value="'.$livID.'" '.$checked.' />'; }
  176. $title = '<a href="index.php?site=liveshow&action=show&livID='.$ds['livID'].'">'.$ds['title'].'</a>';
  177.  
  178.  
  179. eval ("\$liveshow_content = \"".gettemplate("liveshow_content")."\";");
  180. echo $liveshow_content;
  181. $n++;
  182. }
  183. $adminaction = '';
  184. $sql_abfrage = "WHERE active='2' AND userID='".$userID."'";
  185. if(isanyadmin($userID)) { $sql_abfrage = "WHERE active='2'"; }
  186. $info = '';
  187. $anz=mysql_num_rows(safe_query("SELECT livID FROM `".PREFIX."liveshow` ".$sql_abfrage));
  188. if($anz) { $info = '<tr><td colspan="4" bgcolor="'.BG_2.'" align="center" style="padding:4px">'.$_language->module['info'].'</td></tr>'; }
  189. if(get_streamaccess()) { $adminaction = '<tr><td bgcolor="'.BG_2.'" colspan="5" align="right">'.$vis_inputs.'<input type="submit" value="'.$_language->module['save'].'" /> </td></tr>'; }
  190. eval ("\$liveshow_foot = \"".gettemplate("liveshow_foot")."\";");
  191. echo $liveshow_foot;
  192. }
  193.  
  194. ?>
Add Comment
Please, Sign In to add comment