PageRenderTime 22ms CodeModel.GetById 11ms app.highlight 3ms RepoModel.GetById 2ms app.codeStats 0ms

/tv/tv_radio.php

https://code.google.com/p/hdforall/
PHP | 326 lines | 304 code | 21 blank | 1 comment | 84 complexity | 43bd379ba424eb2119efa607aba661c7 MD5 | raw file
  1#!/usr/local/bin/Resource/www/cgi-bin/php
  2<?php echo "<?xml version='1.0' encoding='UTF-8' ?>";
  3$host = "http://127.0.0.1/cgi-bin";
  4?>
  5<rss version="2.0">
  6<onEnter>
  7  startitem = "middle";
  8  setRefreshTime(1);
  9</onEnter>
 10
 11<onRefresh>
 12  setRefreshTime(-1);
 13  itemCount = getPageInfo("itemCount");
 14  redrawDisplay();
 15</onRefresh>
 16
 17	<mediaDisplay name=photoView
 18	  centerXPC=5
 19		centerYPC=5
 20		centerHeightPC=70
 21      columnCount=3
 22	  rowCount=2
 23		menuBorderColor="55:55:55"
 24		sideColorBottom="0:0:0"
 25		sideColorTop="0:0:0"
 26	  backgroundColor="0:0:0"
 27		imageBorderColor="10:105:150"
 28		imageBorderPC="0"
 29		itemBackgroundColor="0:0:0"
 30		itemGapXPC=5
 31		itemGapYPC=0
 32		sideTopHeightPC=0
 33		bottomYPC=100
 34		sliding=yes
 35		showHeader=no
 36		showDefaultInfo=no
 37		idleImageWidthPC="8" idleImageHeightPC="10" idleImageXPC="5" idleImageYPC="5">
 38<!--
 39  	<text align="center" offsetXPC="0" offsetYPC="0" widthPC="100" heightPC="20" fontSize="30" backgroundColor="10:105:150" foregroundColor="100:200:255">
 40		  <script>getPageInfo("pageTitle");</script>
 41		</text>
 42
 43  	<text redraw="yes" offsetXPC="85" offsetYPC="12" widthPC="10" heightPC="6" fontSize="20" backgroundColor="10:105:150" foregroundColor="60:160:205">
 44		  <script>sprintf("%s / ", focus-(-1))+itemCount;</script>
 45		</text>
 46-->
 47		<!--  lines="5" fontSize=15 -->
 48		<text align="center" redraw="yes"
 49  lines=3 fontSize=17
 50		      offsetXPC=5 offsetYPC=80 widthPC=90 heightPC=15
 51		      backgroundColor=0:0:0 foregroundColor=120:120:120>
 52			<script>print(annotation); annotation;</script>
 53		</text>
 54<!--
 55		<text align="center" redraw="yes" offsetXPC=10 offsetYPC=85 widthPC=80 heightPC=10 fontSize=15 backgroundColor=0:0:0 foregroundColor=75:75:75>
 56			<script>print(location); location;</script>
 57		</text>
 58-->
 59        <idleImage>image/POPUP_LOADING_01.png</idleImage>
 60        <idleImage>image/POPUP_LOADING_02.png</idleImage>
 61        <idleImage>image/POPUP_LOADING_03.png</idleImage>
 62        <idleImage>image/POPUP_LOADING_04.png</idleImage>
 63        <idleImage>image/POPUP_LOADING_05.png</idleImage>
 64        <idleImage>image/POPUP_LOADING_06.png</idleImage>
 65        <idleImage>image/POPUP_LOADING_07.png</idleImage>
 66        <idleImage>image/POPUP_LOADING_08.png</idleImage>
 67		<itemDisplay>
 68			<image>
 69				<script>
 70					idx = getQueryItemIndex();
 71					focus = getFocusItemIndex();
 72					if(focus==idx)
 73					{
 74					  location = getItemInfo(idx, "location");
 75					  annotation = getItemInfo(idx, "annotation");
 76					}
 77					getItemInfo(idx, "image");
 78				</script>
 79			 <offsetXPC>
 80			   <script>
 81					idx = getQueryItemIndex();
 82					focus = getFocusItemIndex();
 83			    if(focus==idx) 5; else 12;
 84			   </script>
 85			 </offsetXPC>
 86			 <offsetYPC>
 87			   <script>
 88					idx = getQueryItemIndex();
 89					focus = getFocusItemIndex();
 90			    if(focus==idx) 4; else 6;
 91			   </script>
 92			 </offsetYPC>
 93			 <widthPC>
 94			   <script>
 95					idx = getQueryItemIndex();
 96					focus = getFocusItemIndex();
 97			    if(focus==idx) 90; else 75;
 98			   </script>
 99			 </widthPC>
100			 <heightPC>
101			   <script>
102					idx = getQueryItemIndex();
103					focus = getFocusItemIndex();
104			    if(focus==idx) 70; else 60;
105			   </script>
106			 </heightPC>
107			</image>
108
109			<text align="center" lines="1" offsetXPC=0 offsetYPC=82 widthPC=100 heightPC=12 useBackgroundSurface=yes>
110				<script>
111					idx = getQueryItemIndex();
112					getItemInfo(idx, "title");
113				</script>
114				<fontSize>
115  				<script>
116  					idx = getQueryItemIndex();
117  					focus = getFocusItemIndex();
118  			    if(focus==idx) "18"; else "14";
119  				</script>
120				</fontSize>
121			  <foregroundColor>
122  				<script>
123  					idx = getQueryItemIndex();
124  					focus = getFocusItemIndex();
125  			    if(focus==idx) "255:255:255"; else "75:75:75";
126  				</script>
127			  </foregroundColor>
128			</text>
129
130		</itemDisplay>
131
132  <onUserInput>
133    <script>
134      ret = "false";
135      userInput = currentUserInput();
136      majorContext = getPageInfo("majorContext");
137
138      print("*** majorContext=",majorContext);
139      print("*** userInput=",userInput);
140
141      if(userInput == "one" || userInput == "1")
142      {
143        if(itemCount &gt;= 1)
144        {
145          setFocusItemIndex(0);
146          redrawDisplay();
147        }
148      }
149      else if(userInput == "two" || userInput == "2")
150      {
151        if(itemCount &gt;= 2)
152        {
153          setFocusItemIndex(1);
154          redrawDisplay();
155        }
156      }
157      else if(userInput == "three" || userInput == "3")
158      {
159        if(itemCount &gt;= 3)
160        {
161          setFocusItemIndex(2);
162          redrawDisplay();
163        }
164      }
165      else if(userInput == "four" || userInput == "4")
166      {
167        if(itemCount &gt;= 4)
168        {
169          setFocusItemIndex(3);
170          redrawDisplay();
171        }
172      }
173      else if(userInput == "five" || userInput == "5")
174      {
175        if(itemCount &gt;= 5)
176        {
177          setFocusItemIndex(4);
178          redrawDisplay();
179        }
180      }
181      else if(userInput == "six" || userInput == "6")
182      {
183        if(itemCount &gt;= 6)
184        {
185          setFocusItemIndex(5);
186          redrawDisplay();
187        }
188      }
189      else if(userInput == "seven" || userInput == "7")
190      {
191        if(itemCount &gt;= 7)
192        {
193          setFocusItemIndex(6);
194          redrawDisplay();
195        }
196      }
197      else if(userInput == "eight" || userInput == "8")
198      {
199        if(itemCount &gt;= 8)
200        {
201          setFocusItemIndex(7);
202          redrawDisplay();
203        }
204      }
205      else if(userInput == "nine" || userInput == "9")
206      {
207        if(itemCount &gt;= 9)
208        {
209          setFocusItemIndex(8);
210          redrawDisplay();
211        }
212      }
213      if(userInput == "zero" || userInput == "0")
214      {
215        if(itemCount &gt;= 10)
216        {
217          setFocusItemIndex(9);
218          redrawDisplay();
219        }
220      }
221      else if (userInput == "pagedown" || userInput == "pageup" || userInput == "PD" || userInput == "PG")
222      {
223        itemSize = getPageInfo("itemCount");
224        idx = Integer(getFocusItemIndex());
225        if (userInput == "pagedown")
226        {
227          idx -= -5;
228          if(idx &gt;= itemSize)
229            idx = itemSize-1;
230        }
231        else
232        {
233          idx -= 5;
234          if(idx &lt; 0)
235            idx = 0;
236        }
237        setFocusItemIndex(idx);
238        setItemFocus(idx);
239        redrawDisplay();
240        ret = "true";
241      }
242
243      ret;
244    </script>
245  </onUserInput>
246
247	</mediaDisplay>
248
249	<item_template>
250		<mediaDisplay  name="threePartsView" idleImageXPC="5" idleImageYPC="5" idleImageWidthPC="8" idleImageHeightPC="10">
251        <idleImage>image/POPUP_LOADING_01.png</idleImage>
252        <idleImage>image/POPUP_LOADING_02.png</idleImage>
253        <idleImage>image/POPUP_LOADING_03.png</idleImage>
254        <idleImage>image/POPUP_LOADING_04.png</idleImage>
255        <idleImage>image/POPUP_LOADING_05.png</idleImage>
256        <idleImage>image/POPUP_LOADING_06.png</idleImage>
257        <idleImage>image/POPUP_LOADING_07.png</idleImage>
258        <idleImage>image/POPUP_LOADING_08.png</idleImage>
259		</mediaDisplay>
260	</item_template>
261  <channel>
262
263    <title>TV, Radio ?i emisiuni înregistrate</title>
264
265<item>
266<title>TV Live</title>
267<link><?php echo $host; ?>/scripts/tv/tv_live.php</link>
268<media:thumbnail url="/usr/local/etc/www/cgi-bin/scripts/tv/image/tvlive.png" />
269<image>/usr/local/etc/www/cgi-bin/scripts/tv/image/tvlive.png</image>
270<location></location>
271<annotation>Posturi TV române?ti ?i interna?ionale. Canale de ?tiri, muzic?, sport, HD</annotation>
272</item>
273
274<item>
275<title>Radio Online </title>
276<link>/usr/local/etc/www/cgi-bin/scripts/tv/radio.rss</link>
277<media:thumbnail url="../etc/translate/rss/image/radio_online.jpg" />
278<image>../etc/translate/rss/image/radio_online.jpg</image>
279<location></location>
280<annotation>Posturi de radio</annotation>
281<mediaDisplay name="photoView" />
282</item>
283
284<item>
285<title>OneHD</title>
286<link><?php echo $host; ?>/scripts/tv/prahovahd.php</link>
287<media:thumbnail url="/usr/local/etc/www/cgi-bin/scripts/tv/image/onehd.png" />
288<image>/usr/local/etc/www/cgi-bin/scripts/tv/image/onehd.png</image>
289<location>http://live.1hd.ro/</location>
290<annotation>One HD: concerte, divertisment, business, turism, experimente, disponibile în     High Definition atât live cât ?i on-demand (VOD)</annotation>
291</item>
292
293<item>
294<title>Posturi na?ionale</title>
295<link><?php echo $host; ?>/scripts/tv/nationale.php</link>
296<media:thumbnail url="image/tv_radio.png" />
297<image>image/tv_radio.png</image>
298<location></location>
299<annotation>Înregistr?ri ale unor emisiuni TV emise de posturile na?ionale</annotation>
300<mediaDisplay name="photoView"/>
301</item>
302
303<item>
304<title>Posturi locale</title>
305<link><?php echo $host; ?>/scripts/tv/locale.php</link>
306<media:thumbnail url="image/tv_radio.png" />
307<image>image/tv_radio.png</image>
308<location></location>
309<annotation>?tiri ?i emisiuni înregistrate, difuzate de posturile TV locale</annotation>
310<mediaDisplay name="photoView"/>
311</item>
312
313<item>
314<title>Emisiuni Sportive</title>
315<link><?php echo $host; ?>/scripts/tv/tv_sport.php</link>
316<media:thumbnail url="/usr/local/etc/www/cgi-bin/scripts/tv/image/sport.jpg" />
317<image>/usr/local/etc/www/cgi-bin/scripts/tv/image/sport.jpg</image>
318<location></location>
319<annotation>Înregistr?ri evenimente sportive: fotbal ?i nu numai</annotation>
320<mediaDisplay name="photoView"/>
321</item>
322
323
324
325</channel>
326</rss>