PageRenderTime 99ms CodeModel.GetById 84ms app.highlight 11ms RepoModel.GetById 1ms app.codeStats 1ms

/tv/php/justintv_main.php

https://code.google.com/p/hdforall/
PHP | 238 lines | 212 code | 25 blank | 1 comment | 15 complexity | 8b5a1bf17a7264dfdf9fd266317e7ca4 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</onRefresh>
 15
 16<mediaDisplay name="threePartsView"
 17	sideLeftWidthPC="0"
 18	sideRightWidthPC="0"
 19
 20	headerImageWidthPC="0"
 21	selectMenuOnRight="no"
 22	autoSelectMenu="no"
 23	autoSelectItem="no"
 24	itemImageHeightPC="0"
 25	itemImageWidthPC="0"
 26	itemXPC="8"
 27	itemYPC="25"
 28	itemWidthPC="50"
 29	itemHeightPC="8"
 30	capXPC="8"
 31	capYPC="25"
 32	capWidthPC="50"
 33	capHeightPC="64"
 34	itemBackgroundColor="0:0:0"
 35	itemPerPage="8"
 36  itemGap="0"
 37	bottomYPC="90"
 38	backgroundColor="0:0:0"
 39	showHeader="no"
 40	showDefaultInfo="no"
 41	imageFocus=""
 42	sliding="no" idleImageXPC="5" idleImageYPC="5" idleImageWidthPC="8" idleImageHeightPC="10"
 43>
 44
 45  	<text align="center" offsetXPC="0" offsetYPC="0" widthPC="100" heightPC="20" fontSize="30" backgroundColor="10:105:150" foregroundColor="100:200:255">
 46		  <script>getPageInfo("pageTitle");</script>
 47		</text>
 48
 49  	<text redraw="yes" offsetXPC="85" offsetYPC="12" widthPC="10" heightPC="6" fontSize="20" backgroundColor="10:105:150" foregroundColor="60:160:205">
 50		  <script>sprintf("%s / ", focus-(-1))+itemCount;</script>
 51		</text>
 52  	<text  redraw="yes" align="center" offsetXPC="0" offsetYPC="90" widthPC="100" heightPC="8" fontSize="17" backgroundColor="10:105:150" foregroundColor="100:200:255">
 53		  <script>print(annotation); annotation;</script>
 54		</text>
 55		<image  redraw="yes" offsetXPC=60 offsetYPC=35 widthPC=30 heightPC=30>
 56  image/tv_radio.png
 57		</image>
 58		<idleImage> image/POPUP_LOADING_01.png </idleImage>
 59		<idleImage> image/POPUP_LOADING_02.png </idleImage>
 60		<idleImage> image/POPUP_LOADING_03.png </idleImage>
 61		<idleImage> image/POPUP_LOADING_04.png </idleImage>
 62		<idleImage> image/POPUP_LOADING_05.png </idleImage>
 63		<idleImage> image/POPUP_LOADING_06.png </idleImage>
 64		<idleImage> image/POPUP_LOADING_07.png </idleImage>
 65		<idleImage> image/POPUP_LOADING_08.png </idleImage>
 66
 67		<itemDisplay>
 68			<text align="left" lines="1" offsetXPC=0 offsetYPC=0 widthPC=100 heightPC=100>
 69				<script>
 70					idx = getQueryItemIndex();
 71					focus = getFocusItemIndex();
 72					if(focus==idx)
 73					{
 74					  annotation = getItemInfo(idx, "title");
 75					}
 76					getItemInfo(idx, "title");
 77				</script>
 78				<fontSize>
 79  				<script>
 80  					idx = getQueryItemIndex();
 81  					focus = getFocusItemIndex();
 82  			    if(focus==idx) "16"; else "14";
 83  				</script>
 84				</fontSize>
 85			  <backgroundColor>
 86  				<script>
 87  					idx = getQueryItemIndex();
 88  					focus = getFocusItemIndex();
 89  			    if(focus==idx) "10:80:120"; else "-1:-1:-1";
 90  				</script>
 91			  </backgroundColor>
 92			  <foregroundColor>
 93  				<script>
 94  					idx = getQueryItemIndex();
 95  					focus = getFocusItemIndex();
 96  			    if(focus==idx) "255:255:255"; else "140:140:140";
 97  				</script>
 98			  </foregroundColor>
 99			</text>
100
101		</itemDisplay>
102
103<onUserInput>
104<script>
105ret = "false";
106userInput = currentUserInput();
107
108if (userInput == "pagedown" || userInput == "pageup")
109{
110  idx = Integer(getFocusItemIndex());
111  if (userInput == "pagedown")
112  {
113    idx -= -8;
114    if(idx &gt;= itemCount)
115      idx = itemCount-1;
116  }
117  else
118  {
119    idx -= 8;
120    if(idx &lt; 0)
121      idx = 0;
122  }
123
124  print("new idx: "+idx);
125  setFocusItemIndex(idx);
126	setItemFocus(0);
127  redrawDisplay();
128  "true";
129}
130ret;
131</script>
132</onUserInput>
133
134	</mediaDisplay>
135
136	<item_template>
137		<mediaDisplay  name="threePartsView" idleImageXPC="5" idleImageYPC="5" idleImageWidthPC="8" idleImageHeightPC="10">
138        <idleImage>image/POPUP_LOADING_01.png</idleImage>
139        <idleImage>image/POPUP_LOADING_02.png</idleImage>
140        <idleImage>image/POPUP_LOADING_03.png</idleImage>
141        <idleImage>image/POPUP_LOADING_04.png</idleImage>
142        <idleImage>image/POPUP_LOADING_05.png</idleImage>
143        <idleImage>image/POPUP_LOADING_06.png</idleImage>
144        <idleImage>image/POPUP_LOADING_07.png</idleImage>
145        <idleImage>image/POPUP_LOADING_08.png</idleImage>
146		</mediaDisplay>
147
148	</item_template>
149  <channel>
150
151    <title>Justin.tv</title>
152
153<item>
154<title>Justin.tv - favorite list</title>
155<link><?php echo $host; ?>/scripts/tv/php/justintv_fav.php</link>
156<media:thumbnail url="image/tv_radio.png" />
157<mediaDisplay name="threePartsView"/>
158</item>
159
160<item>
161<title>Justin.tv - all</title>
162<link><?php echo $host; ?>/scripts/tv/php/justintv.php?query=1,</link>
163<media:thumbnail url="image/tv_radio.png" />
164<mediaDisplay name="threePartsView"/>
165</item>
166
167<item>
168<title>Justin.tv - entertainment</title>
169<link><?php echo $host; ?>/scripts/tv/php/justintv.php?query=1,entertainment</link>
170<media:thumbnail url="image/tv_radio.png" />
171<mediaDisplay name="threePartsView"/>
172</item>
173
174<item>
175<title>Justin.tv - producers</title>
176<link><?php echo $host; ?>/scripts/tv/php/justintv.php?query=1,featured</link>
177<media:thumbnail url="image/tv_radio.png" />
178<mediaDisplay name="threePartsView"/>
179</item>
180<!--
181<item>
182<title>Justin.tv - mobile</title>
183<link><?php echo $host; ?>/scripts/tv/php/justintv.php?query=1,mobile</link>
184<media:thumbnail url="image/tv_radio.png" />
185<mediaDisplay name="threePartsView"/>
186</item>
187-->
188<item>
189<title>Justin.tv - social</title>
190<link><?php echo $host; ?>/scripts/tv/php/justintv.php?query=1,social</link>
191<media:thumbnail url="image/tv_radio.png" />
192<mediaDisplay name="threePartsView"/>
193</item>
194
195<item>
196<title>Justin.tv - gaming</title>
197<link><?php echo $host; ?>/scripts/tv/php/justintv.php?query=1,gaming</link>
198<media:thumbnail url="image/tv_radio.png" />
199<mediaDisplay name="threePartsView"/>
200</item>
201
202<item>
203<title>Justin.tv - sports</title>
204<link><?php echo $host; ?>/scripts/tv/php/justintv.php?query=1,sports</link>
205<media:thumbnail url="image/tv_radio.png" />
206<mediaDisplay name="threePartsView"/>
207</item>
208
209<item>
210<title>Justin.tv - news</title>
211<link><?php echo $host; ?>/scripts/tv/php/justintv.php?query=1,news</link>
212<media:thumbnail url="image/tv_radio.png" />
213<mediaDisplay name="threePartsView"/>
214</item>
215
216<item>
217<title>Justin.tv - animals</title>
218<link><?php echo $host; ?>/scripts/tv/php/justintv.php?query=1,animals</link>
219<media:thumbnail url="image/tv_radio.png" />
220<mediaDisplay name="threePartsView"/>
221</item>
222
223<item>
224<title>Justin.tv - science</title>
225<link><?php echo $host; ?>/scripts/tv/php/justintv.php?query=1,science_tech</link>
226<media:thumbnail url="image/tv_radio.png" />
227<mediaDisplay name="threePartsView"/>
228</item>
229
230<item>
231<title>Justin.tv - other</title>
232<link><?php echo $host; ?>/scripts/tv/php/justintv.php?query=1,other</link>
233<media:thumbnail url="image/tv_radio.png" />
234<mediaDisplay name="threePartsView"/>
235</item>
236
237</channel>
238</rss>