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