Advertisement
Guest User

Untitled

a guest
Nov 29th, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.39 KB | None | 0 0
  1. <?php
  2. date_default_timezone_set('America/Araguaina');
  3. $cache_sec = 10;
  4. $info = array(
  5. 0 => array('Mexico', '04/03/2014')
  6. );
  7.  
  8. $id=0;
  9. $text1 = '
  10. <p>On our server you can share your screen with other players using our Cast Feature, it is based off TibiaCast.</p>
  11. <p>You can enter a live stream by login into the game without entering any account number and password. Just don\'t write anything in those 2 fields and just press enter. A list of all available casts will appear shortly and you choose the one you would like to watch. After login into the cast, you can talk with other audiences and a person that is broadcasting.</p>
  12. <p>To make your own broadcast, you must login to your account and use a command <strong>/cast on</strong>. </p>
  13. <p>Full command list can be found below.</p>
  14. ';
  15. $text2 = '
  16. <p><strong>Currently available commands for spectators:</strong><br />
  17. <i>/name newName</i> - Changes the viewer\'s name<br>
  18. <i>/info</i> - Displays a list of all viewers<br /></p>
  19.  
  20. <p><strong>Available commands for streaming players:</strong><br />
  21. <i>/cast {on/off}</i> - Create or close your own cast<br/>
  22. <i>/cast password |password|</i> - Sets a password for the cast<br/>
  23. <i>/cast desc |description|</i> - Set a description for the cast<br/>
  24. <i>/cast status</i> - Information about your cast (viewer amount, description, password)<br/>
  25. <i>/cast viewers</i> - Displays the name of all viewers<br/>
  26. <i>/cast {ban/unban} "name"</i> - Bans a viewer from joining your cast/Removes the ban<br/>
  27. <i>/cast {mute/unmute} "name"</i> - Mutes a viewer on your cast/Removes the mute<br/>
  28. <i>/cast bans</i> - Displays a list of banned viewers<br/>
  29. <i>/cast mutes</i> - Displays a list of muted viewers<br/>
  30. <i>/cast update</i> - Updates the description and status on the website</p>
  31. ';
  32. if(isset($_POST['world'])) {
  33. $f = null;
  34. foreach($config['site']['worlds'] as $k => $v)
  35. if($v == $_POST['world']) {
  36. $f = true;
  37. $id = $k;
  38. break;
  39. }
  40. if(!$f)
  41. $_POST['world'] = $config['site']['worlds'][0];
  42. } else $_POST['world'] = $config['site']['worlds'][0];
  43.  
  44. $order = 'name_asc';
  45. if(isset($_REQUEST['order']) && in_array($_REQUEST['order'], array('name_desc', 'level_asc','level_desc','vocation_asc','vocation_desc')))
  46. $order = $_REQUEST['order'];
  47.  
  48. if(count($config['site']['worlds']) > 1) {
  49. $main_content =
  50. '<form action="?subtopic=castsystem" method="post">
  51. <div class="TableContainer">
  52. <table class="Table1" cellpadding="0" cellspacing="0">
  53. <div class="CaptionContainer">
  54. <div class="CaptionInnerContainer">
  55. <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span>
  56. <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span>
  57. <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif)"></span>
  58. <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"></span>
  59. <div class="Text">World Selection</div>
  60. <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"></span>
  61. <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif)"></span>
  62. <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span>
  63. <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span>
  64. </div>
  65. </div>
  66. <tr>
  67. <td>
  68. <div class="InnerTableContainer">
  69. <table width="100%">
  70. <tr>
  71. <td style="vertical-align:middle" class="LabelV150">World Name:</td>
  72. <td style="width:170px">
  73. <select size="1" name="world" style="width:165px">';
  74. foreach($config['site']['worlds'] as $v)
  75. $main_content .= '<option value="'.$v.'"'.($v == $_POST['world'] ? ' selected="selected"' : '').'>'.$v.'</option>';
  76. $main_content .= '
  77. </select>
  78. </td>
  79. <td style="text-align:left">
  80. <div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)">
  81. <div onmouseover="MouseOverBigButton(this)" onmouseout="MouseOutBigButton(this)"><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif)"></div>
  82. <input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif"/>
  83. </div>
  84. </div>
  85. </td>
  86. </tr>
  87. </table>
  88. </div>
  89. </td>
  90. </tr>
  91. </table>
  92. </div>
  93. </form><br/>
  94. ';
  95. }
  96. $main_content .=
  97. '<div class="TableContainer">
  98. <table class="Table1" cellpadding="0" cellspacing="0">
  99. <div class="CaptionContainer">
  100. <div class="CaptionInnerContainer">
  101. <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span>
  102. <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span>
  103. <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif)"></span>
  104. <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"></span>
  105. <div class="Text">World Information</div>
  106. <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"></span>
  107. <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif)"></span>
  108. <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span>
  109. <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span>
  110. </div>
  111. </div>
  112. <tr>
  113. <td>
  114. <div class="InnerTableContainer">
  115. <table width="100%">
  116. <tr>
  117. <td class="LabelV150">Status:</td>
  118. <td>O'.($config['status']['serverStatus_online'] == 1 ? 'n' : 'ff').'line</td>
  119. </tr>
  120. <tr>
  121. <td class="LabelV150">Players Casting:</td>
  122. <td>';
  123. $f = 'cache/castsystem-'.$_POST['world'].'-'.$order.'.tmp';
  124. if(file_exists($f) && filemtime($f) > (time() - $cache_sec)) {
  125. $cp = file_get_contents($f);
  126. }
  127. else {
  128. $cp = '';
  129. $n = 0;
  130. $q = 'SELECT name,level,vocation,promotion,castViewers,castDescription, looktype, lookbody, looklegs, lookhead, lookfeet, lookaddons FROM players WHERE world_id='.$id.' AND cast=1';
  131. if(in_array($order, array('name_asc','name_desc','level_asc','level_desc')))
  132. $q .= ' ORDER BY '.str_replace('_', ' ', $order);
  133.  
  134. if(in_array($order, array('vocation_asc','vocation_desc'))) {
  135. $a = array();
  136. $q .= ' ORDER BY level desc';
  137. foreach($SQL->query($q)->fetchAll() as $p)
  138. $a[] = array($p['name'], $p['level'], $vocation_name[$p['promotion']][$p['vocation']], $p['looktype'], $p['lookhead'], $p['lookbody'], $p['looklegs'], $p['lookfeet'], $p['lookaddons'], $p['castViewers']);
  139. function cmp($a, $b) {
  140. return $a[2][0] == $b[2][0] ? 0 :
  141. $GLOBALS['order'] == 'vocation_asc'
  142. ? ($a[2][0] < $b[2][0] ? -1 : 1)
  143. : ($a[2][0] > $b[2][0] ? -1 : 1);
  144. }
  145. usort($a, 'cmp');
  146. foreach($a as $p) {
  147. $n++;
  148. $cp .= '<tr class="'.(is_int($n/2)?'Even':'Odd').'" style="text-align:right"><td><img src="'.$base_link.'/outfit.php?id='.$p[3].'&addons='.$p[8].'&head='.$p[4].'&body='.$p[5].'&legs='.$p[6].'&feet='.$p[7].'" width="64" height="64"/></td><td style="width:70%;text-align:left"><a href="?subtopic=characters&name='.urlencode($p[0]).'">'.$p[0].'</a></td><td style="width:10%">'.$p[1].'</td><td style="width:20%">'.$p[2].'</td><td>'.$p[9].'/50</td></tr>';
  149. }
  150. }
  151. else {
  152. $l = array();
  153. foreach($SQL->query($q)->fetchAll() as $p) {
  154. $n++;
  155. $cp .= '<tr class="'.(is_int($n/2)?'Even':'Odd').'">
  156. <td style="width:32px"><img src="'.$base_link.'/outfit.php?id='.$p['looktype'].'&addons='.$p['lookaddons'].'&head='.$p['lookhead'].'&body='.$p['lookbody'].'&legs='.$p['looklegs'].'&feet='.$p['lookfeet'].'" width="64" height="64"/></td>
  157. <td style="width:40%;text-align:left">';
  158. if($order == 'name_asc') {
  159. $tmp = strtoupper($p['name'][0]);
  160. if(!in_array($tmp, $l)) {
  161. $l[] = $tmp;
  162. $cp .= '<a name="'.$tmp.'"></a>';
  163. }
  164. }
  165. $cp .= '<a href="?subtopic=characters&name='.urlencode($p['name']).'">'.$p['name'].'</a>
  166. <br><small>Level '.$p['level'].' '.$vocation_name[$p['promotion']][$p['vocation']].'</br></td>
  167. <td style="width:40%;text-align:left">'.($p['castDescription'] == "" ? '------' : $p['castDescription']).'</td>
  168. <td><center>'.$p['castViewers'].'/50</center></td></tr>';
  169. }
  170. }
  171. file_put_contents($f, $cp);
  172. }
  173. $main_content .= $n.'</td>
  174. </tr>
  175. </table>
  176. </div>
  177. </td>
  178. </tr>
  179. </table>
  180. </div><br/>
  181. '.$text1.'
  182. <div class="TableContainer">
  183. <table class="Table2" cellpadding="0" cellspacing="0"> <div class="CaptionContainer"> <div class="CaptionInnerContainer"> <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span> <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif)"></span> <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"></span> <div class="Text">Players Casting';
  184. if($order == 'name_asc')
  185. $main_content .= '<span class="TableHeadlineNavigation"> Log in to view screens. </span>';
  186. $main_content .= '</div> <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"></span> <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif)"></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span> </div> </div> <tr> <td> <div class="InnerTableContainer">
  187. <table width="100%"><tr class="LabelH"><td>Outfit</td>
  188. <td>Name<small style="font-weight:normal">[<a href="?subtopic=castsystem&world='.$_POST['world'].'&order=name_'.($order == 'name_asc' ? 'desc' : 'asc').'">sort</a>]</small> <img class="sortarrow" src="'.$layout_name.'/images/'.($order == 'name_asc' ? 'content/order_desc' : ($order == 'name_desc' ? 'content/order_asc' : 'news/blank')).'.gif"/></td>
  189. <td>Description</td>
  190. <td>Viewers</td></tr>'.(strlen($cp) ? $cp : '<tr><td colspan="4" class="Even">There are no players streaming right now.</td></tr>').' </table> </div> </table></div></td></tr>'.$text2.'<br/><form action="?subtopic=characters" method="post"><div class="TableContainer"> <table class="Table1" cellpadding="0" cellspacing="0"> <div class="CaptionContainer"> <div class="CaptionInnerContainer"> <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span> <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif)"></span> <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"></span> <div class="Text">Search Character</div> <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"></span> <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif)"></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span> </div> </div> <tr> <td> <div class="InnerTableContainer"> <table width="100%"><tr><td style="vertical-align:middle" class="LabelV150">Character Name:</td><td style="width:170px"><input style="width:165px" name="name" value="" size="29" maxlength="29"/></td><td><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)"><div onmouseover="MouseOverBigButton(this)" onmouseout="MouseOutBigButton(this)"><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif)"></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif"></div></div></td></tr> </table> </div> </table></div></td></tr></form></center>';
  191. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement