PageRenderTime 50ms CodeModel.GetById 45ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/news/news.php

https://code.google.com/p/hdforall/
PHP | 391 lines | 370 code | 20 blank | 1 comment | 84 complexity | 92c4fa44db95b58269982cfdb87734ba MD5 | raw file
  1#!/usr/local/bin/Resource/www/cgi-bin/php
  2<?php echo "<?xml version='1.0' encoding='UTF8' ?>";
  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=7
 19		centerYPC=25
 20		centerHeightPC=40
 21columnCount=4
 22	  rowCount=1
 23		menuBorderColor="55:55:55"
 24		sideColorBottom="0:0:0"
 25		sideColorTop="0:0:0"
 26	  backgroundColor="0:0:0"
 27		imageBorderColor="0:0:0"
 28		itemBackgroundColor="0:0:0"
 29		itemGapXPC=0
 30		itemGapYPC=1
 31		sideTopHeightPC=22
 32		bottomYPC=85
 33		sliding=yes
 34		showHeader=no
 35		showDefaultInfo=no
 36		idleImageXPC="5" idleImageYPC="5" idleImageWidthPC="8" idleImageHeightPC="10">
 37
 38  	<text align="center" offsetXPC="0" offsetYPC="0" widthPC="100" heightPC="20" fontSize="30" backgroundColor="10:105:150" foregroundColor="100:200:255">
 39		  <script>getPageInfo("pageTitle");</script>
 40		</text>
 41
 42  	<text redraw="yes" offsetXPC="85" offsetYPC="12" widthPC="10" heightPC="6" fontSize="20" backgroundColor="10:105:150" foregroundColor="60:160:205">
 43		  <script>sprintf("%s / ", focus-(-1))+itemCount;</script>
 44		</text>
 45
 46		<!--  lines="5" fontSize=15 -->
 47		<text align="center" redraw="yes"
 48  lines=3 fontSize=17
 49		      offsetXPC=5 offsetYPC=65 widthPC=90 heightPC=20
 50		      backgroundColor=0:0:0 foregroundColor=120:120:120>
 51			<script>print(annotation); annotation;</script>
 52		</text>
 53
 54		<text align="center" redraw="yes" offsetXPC=10 offsetYPC=85 widthPC=80 heightPC=10 fontSize=15 backgroundColor=0:0:0 foregroundColor=75:75:75>
 55			<script>print(location); location;</script>
 56		</text>
 57        <idleImage>image/POPUP_LOADING_01.png</idleImage>
 58        <idleImage>image/POPUP_LOADING_02.png</idleImage>
 59        <idleImage>image/POPUP_LOADING_03.png</idleImage>
 60        <idleImage>image/POPUP_LOADING_04.png</idleImage>
 61        <idleImage>image/POPUP_LOADING_05.png</idleImage>
 62        <idleImage>image/POPUP_LOADING_06.png</idleImage>
 63        <idleImage>image/POPUP_LOADING_07.png</idleImage>
 64        <idleImage>image/POPUP_LOADING_08.png</idleImage>
 65		<itemDisplay>
 66			<image>
 67				<script>
 68					idx = getQueryItemIndex();
 69					focus = getFocusItemIndex();
 70					if(focus==idx)
 71					{
 72					  location = getItemInfo(idx, "location");
 73					  annotation = getItemInfo(idx, "annotation");
 74					}
 75					getItemInfo(idx, "image");
 76				</script>
 77			 <offsetXPC>
 78			   <script>
 79					idx = getQueryItemIndex();
 80					focus = getFocusItemIndex();
 81			    if(focus==idx) 0; else 12;
 82			   </script>
 83			 </offsetXPC>
 84			 <offsetYPC>
 85			   <script>
 86					idx = getQueryItemIndex();
 87					focus = getFocusItemIndex();
 88			    if(focus==idx) 0; else 6;
 89			   </script>
 90			 </offsetYPC>
 91			 <widthPC>
 92			   <script>
 93					idx = getQueryItemIndex();
 94					focus = getFocusItemIndex();
 95			    if(focus==idx) 100; else 75;
 96			   </script>
 97			 </widthPC>
 98			 <heightPC>
 99			   <script>
100					idx = getQueryItemIndex();
101					focus = getFocusItemIndex();
102			    if(focus==idx) 50; else 37;
103			   </script>
104			 </heightPC>
105			</image>
106
107			<text align="center" lines="4" offsetXPC=0 offsetYPC=55 widthPC=100 heightPC=45 backgroundColor=-1:-1:-1>
108				<script>
109					idx = getQueryItemIndex();
110					getItemInfo(idx, "title");
111				</script>
112				<fontSize>
113  				<script>
114  					idx = getQueryItemIndex();
115  					focus = getFocusItemIndex();
116  			    if(focus==idx) "18"; else "14";
117  				</script>
118				</fontSize>
119			  <foregroundColor>
120  				<script>
121  					idx = getQueryItemIndex();
122  					focus = getFocusItemIndex();
123  			    if(focus==idx) "255:255:255"; else "75:75:75";
124  				</script>
125			  </foregroundColor>
126			</text>
127
128		</itemDisplay>
129
130  <onUserInput>
131    <script>
132      ret = "false";
133      userInput = currentUserInput();
134      majorContext = getPageInfo("majorContext");
135
136      print("*** majorContext=",majorContext);
137      print("*** userInput=",userInput);
138
139      if(userInput == "one" || userInput == "1")
140      {
141        if(itemCount &gt;= 1)
142        {
143          setFocusItemIndex(0);
144          redrawDisplay();
145        }
146      }
147      else if(userInput == "two" || userInput == "2")
148      {
149        if(itemCount &gt;= 2)
150        {
151          setFocusItemIndex(1);
152          redrawDisplay();
153        }
154      }
155      else if(userInput == "three" || userInput == "3")
156      {
157        if(itemCount &gt;= 3)
158        {
159          setFocusItemIndex(2);
160          redrawDisplay();
161        }
162      }
163      else if(userInput == "four" || userInput == "4")
164      {
165        if(itemCount &gt;= 4)
166        {
167          setFocusItemIndex(3);
168          redrawDisplay();
169        }
170      }
171      else if(userInput == "five" || userInput == "5")
172      {
173        if(itemCount &gt;= 5)
174        {
175          setFocusItemIndex(4);
176          redrawDisplay();
177        }
178      }
179      else if(userInput == "six" || userInput == "6")
180      {
181        if(itemCount &gt;= 6)
182        {
183          setFocusItemIndex(5);
184          redrawDisplay();
185        }
186      }
187      else if(userInput == "seven" || userInput == "7")
188      {
189        if(itemCount &gt;= 7)
190        {
191          setFocusItemIndex(6);
192          redrawDisplay();
193        }
194      }
195      else if(userInput == "eight" || userInput == "8")
196      {
197        if(itemCount &gt;= 8)
198        {
199          setFocusItemIndex(7);
200          redrawDisplay();
201        }
202      }
203      else if(userInput == "nine" || userInput == "9")
204      {
205        if(itemCount &gt;= 9)
206        {
207          setFocusItemIndex(8);
208          redrawDisplay();
209        }
210      }
211      if(userInput == "zero" || userInput == "0")
212      {
213        if(itemCount &gt;= 10)
214        {
215          setFocusItemIndex(9);
216          redrawDisplay();
217        }
218      }
219      else if (userInput == "pagedown" || userInput == "pageup" || userInput == "PD" || userInput == "PG")
220      {
221        itemSize = getPageInfo("itemCount");
222        idx = Integer(getFocusItemIndex());
223        if (userInput == "pagedown")
224        {
225          idx -= -10;
226          if(idx &gt;= itemSize)
227            idx = itemSize-1;
228        }
229        else
230        {
231          idx -= 10;
232          if(idx &lt; 0)
233            idx = 0;
234        }
235        setFocusItemIndex(idx);
236        setItemFocus(idx);
237        redrawDisplay();
238        ret = "true";
239      }
240
241      ret;
242    </script>
243  </onUserInput>
244
245	</mediaDisplay>
246
247	<item_template>
248		<mediaDisplay  name="threePartsView" idleImageWidthPC="8" idleImageHeightPC="10">
249        <idleImage>image/POPUP_LOADING_01.png</idleImage>
250        <idleImage>image/POPUP_LOADING_02.png</idleImage>
251        <idleImage>image/POPUP_LOADING_03.png</idleImage>
252        <idleImage>image/POPUP_LOADING_04.png</idleImage>
253        <idleImage>image/POPUP_LOADING_05.png</idleImage>
254        <idleImage>image/POPUP_LOADING_06.png</idleImage>
255        <idleImage>image/POPUP_LOADING_07.png</idleImage>
256        <idleImage>image/POPUP_LOADING_08.png</idleImage>
257		</mediaDisplay>
258	</item_template>
259  <channel>
260
261    <title>?tiri ?i alte informa?ii</title>
262
263<item>
264<title>TvBlog: orarul serialelor</title>
265<link><?php echo $host; ?>/scripts/news/php/tvblog.php</link>
266<media:thumbnail url="/usr/local/etc/www/cgi-bin/scripts/news/image/tvblog.jpg" />
267<image>/usr/local/etc/www/cgi-bin/scripts/news/image/tvblog.jpg</image>
268<location>http://www.tvblog.ro</location>
269<annotation>TvBlog, blogul iubitorilor de seriale TV</annotation>
270<mediaDisplay name="threePartsView"/>
271</item>
272
273<item>
274<title>Vremea în România</title>
275<link><?php echo $host; ?>/scripts/news/php/weather.php</link>
276<media:thumbnail url="image/mele/weather.png" />
277<image>image/mele/weather.png</image>
278<location>http://vremea.meteoromania.ro/</location>
279<annotation>Starea vremii în diferite localit??i</annotation>
280</item>
281
282<item>
283<title>Curs Valutar</title>
284<link><?php echo $host; ?>/scripts/news/php/curs.php</link>
285<media:thumbnail url="/usr/local/etc/www/cgi-bin/scripts/news/image/curs.png" />
286<image>/usr/local/etc/www/cgi-bin/scripts/news/image/curs.png</image>
287<location>http://bnr.ro</location>
288<annotation>Cursul oficial pentru principalele valute</annotation>
289<mediaDisplay name="threePartsView"/>
290</item>
291
292<item>
293<title>port.ro: programul TV</title>
294<link><?php echo $host; ?>/scripts/news/php/port.php</link>
295<media:thumbnail url="/usr/local/etc/www/cgi-bin/scripts/news/image/program_tv.png" />
296<image>/usr/local/etc/www/cgi-bin/scripts/news/image/program_tv.png</image>
297<location>http://port.ro</location>
298<annotation>Programul TV pentru mai mult de 100 de posturi</annotation>
299<mediaDisplay name="threePartsView"/>
300</item>
301<!--
302<item>
303<title>Program-Tv.ro :: Acum la televizor</title>
304<link>http://www.program-tv.ro/acum-la-tv.rss</link>
305<media:thumbnail url="image/tv_radio.png" />
306<image>image/tv_radio.png</image>
307<location>http://www.program-tv.ro</location>
308<annotation>Program TV, Ghid Pentru Posturile Tv, Cinematografe Si Teatre. Ofera Detalii Pentru Fiecare Film, Teatru Sau Emisiune.</annotation>
309<mediaDisplay name="threePartsView" 
310	itemBackgroundColor="0:0:0" 
311	backgroundColor="0:0:0" 
312	sideLeftWidthPC="0" 
313	itemImageXPC="5" 
314	itemXPC="20" 
315	itemYPC="20" 
316	itemWidthPC="65" 
317	capWidthPC="70" 
318	unFocusFontColor="101:101:101" 
319	focusFontColor="255:255:255" 
320	idleImageXPC="45" 
321	idleImageYPC="42" 
322	idleImageWidthPC="20" 
323	idleImageHeightPC="26">
324	<idleImage>image/busy1.png</idleImage>
325	<idleImage>image/busy2.png</idleImage>
326	<idleImage>image/busy3.png</idleImage>
327	<idleImage>image/busy4.png</idleImage>
328	<idleImage>image/busy5.png</idleImage>
329	<idleImage>image/busy6.png</idleImage>
330	<idleImage>image/busy7.png</idleImage>
331	<idleImage>image/busy8.png</idleImage>
332		<backgroundDisplay>
333			<image  offsetXPC=0 offsetYPC=0 widthPC=100 heightPC=100>
334			image/mele/backgd.jpg
335			</image>  
336		</backgroundDisplay>
337		<image  offsetXPC=0 offsetYPC=2.8 widthPC=100 heightPC=15.6>
338		image/mele/rss_title.jpg
339		</image>
340		<text  offsetXPC=20 offsetYPC=8 widthPC=70 heightPC=10 fontSize=20 backgroundColor=-1:-1:-1 foregroundColor=255:255:255>
341		Program-Tv.ro :: Acum la televizor
342		</text>			
343</mediaDisplay>
344</item>
345
346<item>
347<title>Program-Tv.ro :: Urmeaza la televizor</title>
348<link>http://www.program-tv.ro/urmeaza-la-tv.rss</link>
349<media:thumbnail url="image/tv_radio.png" />
350<image>image/tv_radio.png</image>
351<location>http://www.program-tv.ro</location>
352<annotation>Program TV, Ghid Pentru Posturile Tv, Cinematografe Si Teatre. Ofera Detalii Pentru Fiecare Film, Teatru Sau Emisiune.</annotation>
353<mediaDisplay name="threePartsView" 
354	itemBackgroundColor="0:0:0" 
355	backgroundColor="0:0:0" 
356	sideLeftWidthPC="0" 
357	itemImageXPC="5" 
358	itemXPC="20" 
359	itemYPC="20" 
360	itemWidthPC="65" 
361	capWidthPC="70" 
362	unFocusFontColor="101:101:101" 
363	focusFontColor="255:255:255" 
364	idleImageXPC="45" 
365	idleImageYPC="42" 
366	idleImageWidthPC="20" 
367	idleImageHeightPC="26">
368	<idleImage>image/busy1.png</idleImage>
369	<idleImage>image/busy2.png</idleImage>
370	<idleImage>image/busy3.png</idleImage>
371	<idleImage>image/busy4.png</idleImage>
372	<idleImage>image/busy5.png</idleImage>
373	<idleImage>image/busy6.png</idleImage>
374	<idleImage>image/busy7.png</idleImage>
375	<idleImage>image/busy8.png</idleImage>
376		<backgroundDisplay>
377			<image  offsetXPC=0 offsetYPC=0 widthPC=100 heightPC=100>
378			image/mele/backgd.jpg
379			</image>  
380		</backgroundDisplay>
381		<image  offsetXPC=0 offsetYPC=2.8 widthPC=100 heightPC=15.6>
382		image/mele/rss_title.jpg
383		</image>
384		<text  offsetXPC=20 offsetYPC=8 widthPC=70 heightPC=10 fontSize=20 backgroundColor=-1:-1:-1 foregroundColor=255:255:255>
385		Program-Tv.ro :: Urmeaza la televizor
386		</text>			
387</mediaDisplay>
388</item>
389-->
390</channel>
391</rss>