Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2012
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.76 KB | None | 0 0
  1. <?php
  2. // Valid execution check
  3. defined('_JEXEC') or die('Restricted Access');
  4.  
  5. /*
  6. * Filename: default.php (Part of CM Broadcast Scheduler, Joomla Component)
  7. * Author: Athanasios Theodorou
  8. * Version: 2.1.4
  9. * License: GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
  10. * Support: http://forum.computerman.gr/
  11. * Copyright (C) 2009-2012, Computerman.gr. All Rights Reserved.
  12. */
  13.  
  14. // Get the API
  15. $doc = JFactory::getDocument();
  16. $language = &JFactory::getLanguage();
  17. $language->load('com_cmbroadcastscheduler');
  18.  
  19. // Include Scripts
  20. $baseURI = JURI::base()."components/com_cmbroadcastscheduler";
  21. $doc->addStylesheet( $baseURI.'/css/cmbroadcast_style_modified.css' );
  22.  
  23.  
  24. // Start Rendering
  25. if( $this->params->get('show_page_heading', 1)) : ?>
  26. <div class="item-page<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
  27. <h2 class="item-page-title"><?php echo $this->escape($this->params->get('page_heading')); ?></h2>
  28. </div>
  29.  
  30. <?php endif; ?>
  31.  
  32. <script type="text/javascript">
  33. jQuery(document).ready(function(){
  34. jQuery("#navlist li").click(function(){
  35. var clicked = jQuery(this).attr('rel');
  36. jQuery.post(
  37. 'programs.php',
  38. {date: clicked},
  39. function(responseText){
  40. jQuery("#viewSchedule").html(responseText);
  41. },
  42. "html"
  43. );
  44. });
  45. });
  46. </script>
  47.  
  48. <div class="cmschedule-wrapper">
  49. <?php
  50. // With a component parameter, the user will
  51. // be able to choose to display the day form
  52. // on the TOP or on the BOTTOM of the component.?>
  53.  
  54. <?php
  55. if (!empty($_POST['ddate'])) {
  56. $currentday = (date("l", strtotime($_POST['ddate'])));
  57. } else {
  58. $currentday = date("l");
  59. }
  60. ?>
  61. <?php $currenttime = (date("H")); ?>
  62.  
  63. <?php if($this->items): ?>
  64.  
  65.  
  66.  
  67.  
  68. <div class="date-input-form">
  69. <form action="" method="post" id="ddateform">
  70. <input type="hidden" name="ddate" id="ddate" size="11" maxlength="10" value="" />
  71. <?php echo JHTML::_( 'form.token' ); ?>
  72. </form>
  73. </div>
  74.  
  75.  
  76. <div id="navcontainer">
  77.  
  78. <ul id="navlist">
  79. <?php if($currentday=="Monday") : ; ?>
  80. <li class="currentday"><?php echo $currentday; ?></li>
  81. <?php else : ?>
  82. <li><a href="#" rel="<?php echo date('Y-m-d', strtotime('monday')); ?>"></a></li>
  83. <?php endif; ?>
  84.  
  85. <?php if($currentday=="Tuesday") : ; ?>
  86. <li class="currentday"><?php echo $currentday; ?></li>
  87. <?php else : ?>
  88. <li><a href="#" rel="<?php echo date('Y-m-d', strtotime('tuesday')); ?>"></a></li>
  89. <?php endif; ?>
  90.  
  91. <?php if($currentday=="Wednesday") : ; ?>
  92. <li class="currentday"><?php echo $currentday; ?></li>
  93. <?php else : ?>
  94. <li><a href="#" rel="<?php echo date('Y-m-d', strtotime('wednesday')); ?>"></a></li>
  95. <?php endif; ?>
  96.  
  97. <?php if($currentday=="Thursday") : ; ?>
  98. <li class="currentday"><?php echo $currentday; ?></li>
  99. <?php else : ?>
  100. <li><a href="#" rel="<?php echo date('Y-m-d', strtotime('thursday')); ?>"></a></li>
  101. <?php endif; ?>
  102.  
  103. <?php if($currentday=="Friday") : ; ?>
  104. <li class="currentday"><?php echo $currentday; ?></li>
  105. <?php else : ?>
  106. <li><a href="#" rel="<?php echo date('Y-m-d', strtotime('friday')); ?>"></a></li>
  107. <?php endif; ?>
  108.  
  109. <?php if($currentday=="Saturday") : ; ?>
  110. <li class="currentday"><?php echo $currentday; ?></li>
  111. <?php else : ?>
  112. <li><a href="#" rel="<?php echo date('Y-m-d', strtotime('saturday')); ?>"></a></li>
  113. <?php endif; ?>
  114.  
  115. <?php if($currentday=="Sunday") : ; ?>
  116. <li class="currentday"><?php echo $currentday; ?></li>
  117. <?php else : ?>
  118. <li><a href="#" rel="<?php echo date('Y-m-d', strtotime('sunday')); ?>"></a></li>
  119. <?php endif; ?>
  120.  
  121. </ul>
  122. </div>
  123.  
  124. <div class="show-item-black">
  125. </div>
  126.  
  127.  
  128.  
  129.  
  130. <div class="cmschedule" id="viewSchedule">
  131. <?php if($this->items) : ?>
  132. <ul>
  133. <?php foreach($this->items as $item) : ?>
  134. <?php
  135. // Create Slugs
  136. $item['slug'] = $item['alias'] ? ($item['s_id'].'-'.$item['alias']) : $item['s_id'];
  137. ?>
  138. <?php if(empty($item['onair'])) : ?>
  139. <li class="show-item-grey">
  140.  
  141. <div class="show-item-wrapper">
  142. <div class="show-item-details">
  143. <span><?php echo date( "g:ia", strtotime($item['showstart'])); ?></span>
  144. </div>
  145. <div class="show-item-desc">
  146. <div id="show_name_and_onairlogo">
  147. <div style="float:left; height:auto;">
  148. <span><b><?php echo $item['show_name']; ?></b></span>
  149. </div>
  150. <div style="float:right;">
  151. </div>
  152. </div>
  153. <div style="clear:both;">
  154. </div>
  155.  
  156. <div id="host_name_and_full_desc">
  157. <span>with <a href="/hosts#<?php $moreinfo = json_decode($item['moreinfo']); $str = $moreinfo->casthost; $hoststring = str_replace(' ','',$str); echo $hoststring; ?>"><?php $moreinfo = json_decode($item['moreinfo']); echo $moreinfo->casthost; ?></a></span>
  158. <?php if(!empty($item['full_desc'])) : ?><span style="padding-top:9px;"><?php echo $item['full_desc']; ?></span> <?php endif; ?>
  159.  
  160. </div>
  161. </div>
  162. </div>
  163.  
  164. <div class="clearfix"></div>
  165. </li>
  166. <?php elseif(!empty($item['onair']) && $currenttime < 2359) : ?>
  167.  
  168.  
  169. <li class="show-item-red">
  170.  
  171. <div class="show-item-wrapper">
  172. <div class="show-item-details">
  173. <span><?php echo date( "g:ia", strtotime($item['showstart'])); ?></span>
  174. </div>
  175. <div class="show-item-desc">
  176. <div id="show_name_and_onairlogo">
  177. <div style="float:left; height:auto;">
  178. <span><b><?php echo $item['show_name']; ?></b></span>
  179. </div>
  180. <div style="float:right;">
  181. <img src="<?php echo $baseURI; ?>/images/on_air_now.png" height="15px" alt="item-graphics" />
  182. </div>
  183. </div>
  184. <div style="clear:both;">
  185. </div>
  186.  
  187. <div id="host_name_and_full_desc">
  188. <span>with <a href="/hosts#<?php $moreinfo = json_decode($item['moreinfo']); $str = $moreinfo->casthost; $hoststring = str_replace(' ','',$str); echo $hoststring; ?>"><?php $moreinfo = json_decode($item['moreinfo']); echo $moreinfo->casthost; ?></a></span>
  189. <?php if(!empty($item['full_desc'])) : ?><span style="padding-top:9px;"><?php echo $item['full_desc']; ?></span> <?php endif; ?>
  190. </div>
  191. </div>
  192. </div>
  193. <?php if($this->params->get('streaming_link') != '#' && $this->params->get('streaming_link') != '') : ?>
  194. <span class="strlink" style="float:right; text-wrap: none;"><a href="<?php echo $this->params->get('streaming_link'); ?>" title="Live Stream"><?php echo JText::_( "STREAMLINK" ); ?></a></span>
  195. <?php endif; ?>
  196. <div class="clearfix"></div>
  197. </li>
  198.  
  199. <?php elseif(!empty($item['onair']) && $currenttime > 2359 && $currenttime < 0300) : ?>
  200.  
  201. <li class="goodnight">
  202.  
  203. <div class="show-item-wrapper">
  204. <div class="show-item-details">
  205. <span>12:00am</span>
  206. </div>
  207. <div class="show-item-desc">
  208. <div id="show_name_and_onairlogo">
  209. <div style="float:left; height:auto;">
  210. <span><b>OFF THE AIR</b></span>
  211. </div>
  212. <div style="float:right;">
  213. </div>
  214. </div>
  215. <div style="clear:both;">
  216. </div>
  217.  
  218. <div id="host_name_and_full_desc">
  219. <span>QCCR will resume broadcasting the next day at 7:00am.</span>
  220. </div>
  221. </div>
  222. </div>
  223. <?php endif; ?>
  224. <?php endforeach; ?>
  225. <?php endif; ?>
  226. </div>
  227.  
  228. <li class="goodnight">
  229.  
  230. <div class="show-item-wrapper">
  231. <div class="show-item-details">
  232. <span>12:00am</span>
  233. </div>
  234. <div class="show-item-desc">
  235. <div id="show_name_and_onairlogo">
  236. <div style="float:left; height:auto;">
  237. <span><b>OFF THE AIR</b></span>
  238. </div>
  239. <div style="float:right;">
  240. </div>
  241. </div>
  242. <div style="clear:both;">
  243. </div>
  244.  
  245. <div id="host_name_and_full_desc">
  246. <span>QCCR will resume broadcasting the next day at 7:00am.</span>
  247. </div>
  248. </div>
  249. </div>
  250. <?php if($this->params->get('streaming_link') != '#' && $this->params->get('streaming_link') != '') : ?>
  251. <span class="strlink" style="float:right; text-wrap: none;"><a href="<?php echo $this->params->get('streaming_link'); ?>" title="Live Stream"><?php echo JText::_( "STREAMLINK" ); ?></a></span>
  252. <?php endif; ?>
  253. <div class="clearfix"></div>
  254. </li>
  255. </ul>
  256.  
  257. <?php else: ?>
  258.  
  259. <div class="date-input-form">
  260. <form action="" method="post" id="ddateform">
  261. <input type="hidden" name="ddate" id="ddate" size="11" maxlength="10" value="" />
  262. <?php echo JHTML::_( 'form.token' ); ?>
  263. </form>
  264. </div>
  265. <div id="navcontainer">
  266.  
  267. <ul id="navlist">
  268. <?php if($currentday=="Monday") : ; ?>
  269. <li class="currentday"><?php echo $currentday; ?></li>
  270. <?php else : ?>
  271. <li><a href="#" rel="<?php echo date('Y-m-d', strtotime('monday')); ?>"></a></li>
  272. <?php endif; ?>
  273.  
  274. <?php if($currentday=="Tuesday") : ; ?>
  275. <li class="currentday"><?php echo $currentday; ?></li>
  276. <?php else : ?>
  277. <li><a href="#" rel="<?php echo date('Y-m-d', strtotime('tuesday')); ?>"></a></li>
  278. <?php endif; ?>
  279.  
  280. <?php if($currentday=="Wednesday") : ; ?>
  281. <li class="currentday"><?php echo $currentday; ?></li>
  282. <?php else : ?>
  283. <li><a href="#" rel="<?php echo date('Y-m-d', strtotime('wednesday')); ?>"></a></li>
  284. <?php endif; ?>
  285.  
  286. <?php if($currentday=="Thursday") : ; ?>
  287. <li class="currentday"><?php echo $currentday; ?></li>
  288. <?php else : ?>
  289. <li><a href="#" rel="<?php echo date('Y-m-d', strtotime('thursday')); ?>"></a></li>
  290. <?php endif; ?>
  291.  
  292. <?php if($currentday=="Friday") : ; ?>
  293. <li class="currentday"><?php echo $currentday; ?></li>
  294. <?php else : ?>
  295. <li><a href="#" rel="<?php echo date('Y-m-d', strtotime('friday')); ?>"></a></li>
  296. <?php endif; ?>
  297.  
  298. <?php if($currentday=="Saturday") : ; ?>
  299. <li class="currentday"><?php echo $currentday; ?></li>
  300. <?php else : ?>
  301. <li><a href="#" rel="<?php echo date('Y-m-d', strtotime('saturday')); ?>"></a></li>
  302. <?php endif; ?>
  303.  
  304. <?php if($currentday=="Sunday") : ; ?>
  305. <li class="currentday"><?php echo $currentday; ?></li>
  306. <?php else : ?>
  307. <li><a href="#" rel="<?php echo date('Y-m-d', strtotime('sunday')); ?>"></a></li>
  308. <?php endif; ?>
  309.  
  310. </ul>
  311. </div>
  312. <div class="show-item-black">
  313. </div>
  314. <h3 style="padding-top:20px; padding-left:10px;">There are no shows scheduled for today.</h3>
  315.  
  316. <?php endif; ?>
  317. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement