PageRenderTime 25ms CodeModel.GetById 19ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/tv/bing_sport.php

https://code.google.com/p/hdforall/
PHP | 197 lines | 176 code | 20 blank | 1 comment | 15 complexity | 464584097ae2880c3c16606ba25c1faf 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$img = "/usr/local/etc/www/cgi-bin/scripts/tv/image/bing.jpg";
  5?>
  6<rss version="2.0">
  7<onEnter>
  8  startitem = "middle";
  9  setRefreshTime(1);
 10</onEnter>
 11
 12<onRefresh>
 13  setRefreshTime(-1);
 14  itemCount = getPageInfo("itemCount");
 15</onRefresh>
 16
 17<mediaDisplay name="threePartsView"
 18	sideLeftWidthPC="0"
 19	sideRightWidthPC="0"
 20
 21	headerImageWidthPC="0"
 22	selectMenuOnRight="no"
 23	autoSelectMenu="no"
 24	autoSelectItem="no"
 25	itemImageHeightPC="0"
 26	itemImageWidthPC="0"
 27	itemXPC="8"
 28	itemYPC="25"
 29	itemWidthPC="50"
 30	itemHeightPC="8"
 31	capXPC="8"
 32	capYPC="25"
 33	capWidthPC="50"
 34	capHeightPC="64"
 35	itemBackgroundColor="0:0:0"
 36	itemPerPage="8"
 37  itemGap="0"
 38	bottomYPC="90"
 39	backgroundColor="0:0:0"
 40	showHeader="no"
 41	showDefaultInfo="no"
 42	imageFocus=""
 43	sliding="no"
 44>
 45
 46  	<text align="center" offsetXPC="0" offsetYPC="0" widthPC="100" heightPC="20" fontSize="30" backgroundColor="10:105:150" foregroundColor="100:200:255">
 47		  <script>getPageInfo("pageTitle");</script>
 48		</text>
 49
 50  	<text redraw="yes" offsetXPC="85" offsetYPC="12" widthPC="10" heightPC="6" fontSize="20" backgroundColor="10:105:150" foregroundColor="60:160:205">
 51		  <script>sprintf("%s / ", focus-(-1))+itemCount;</script>
 52		</text>
 53  	<text  redraw="yes" align="center" offsetXPC="0" offsetYPC="90" widthPC="100" heightPC="8" fontSize="17" backgroundColor="10:105:150" foregroundColor="100:200:255">
 54		  <script>print(annotation); annotation;</script>
 55		</text>
 56		<image  redraw="yes" offsetXPC=60 offsetYPC=35 widthPC=30 heightPC=30>
 57  <?php echo $img; ?>
 58		</image>
 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
 68		<itemDisplay>
 69			<text align="left" lines="1" offsetXPC=0 offsetYPC=0 widthPC=100 heightPC=100>
 70				<script>
 71					idx = getQueryItemIndex();
 72					focus = getFocusItemIndex();
 73					if(focus==idx)
 74					{
 75					  location = getItemInfo(idx, "location");
 76					  annotation = getItemInfo(idx, "title");
 77					}
 78					getItemInfo(idx, "title");
 79				</script>
 80				<fontSize>
 81  				<script>
 82  					idx = getQueryItemIndex();
 83  					focus = getFocusItemIndex();
 84  			    if(focus==idx) "16"; else "14";
 85  				</script>
 86				</fontSize>
 87			  <backgroundColor>
 88  				<script>
 89  					idx = getQueryItemIndex();
 90  					focus = getFocusItemIndex();
 91  			    if(focus==idx) "10:80:120"; else "-1:-1:-1";
 92  				</script>
 93			  </backgroundColor>
 94			  <foregroundColor>
 95  				<script>
 96  					idx = getQueryItemIndex();
 97  					focus = getFocusItemIndex();
 98  			    if(focus==idx) "255:255:255"; else "140:140:140";
 99  				</script>
100			  </foregroundColor>
101			</text>
102
103		</itemDisplay>
104
105<onUserInput>
106<script>
107ret = "false";
108userInput = currentUserInput();
109
110if (userInput == "pagedown" || userInput == "pageup")
111{
112  idx = Integer(getFocusItemIndex());
113  if (userInput == "pagedown")
114  {
115    idx -= -8;
116    if(idx &gt;= itemCount)
117      idx = itemCount-1;
118  }
119  else
120  {
121    idx -= 8;
122    if(idx &lt; 0)
123      idx = 0;
124  }
125
126  print("new idx: "+idx);
127  setFocusItemIndex(idx);
128	setItemFocus(0);
129  redrawDisplay();
130  "true";
131}
132ret;
133</script>
134</onUserInput>
135
136	</mediaDisplay>
137	<item_template>
138		<mediaDisplay  name="threePartsView" idleImageXPC="5" idleImageYPC="5" idleImageWidthPC="8" idleImageHeightPC="10">
139        <idleImage>image/POPUP_LOADING_01.png</idleImage>
140        <idleImage>image/POPUP_LOADING_02.png</idleImage>
141        <idleImage>image/POPUP_LOADING_03.png</idleImage>
142        <idleImage>image/POPUP_LOADING_04.png</idleImage>
143        <idleImage>image/POPUP_LOADING_05.png</idleImage>
144        <idleImage>image/POPUP_LOADING_06.png</idleImage>
145        <idleImage>image/POPUP_LOADING_07.png</idleImage>
146        <idleImage>image/POPUP_LOADING_08.png</idleImage>
147		</mediaDisplay>
148
149	</item_template>
150<channel>
151<title>Bing</title>
152
153<item>
154<title>FOX Soccer Channel</title>
155<link><?php echo $host; ?>/scripts/tv/php/bing1.php</link>
156<media:thumbnail url="/usr/local/etc/www/cgi-bin/scripts/tv/image/bing.jpg" />
157</item>
158
159<item>
160<title>NBA</title>
161<link><?php echo $host; ?>/scripts/tv/php/bing.php?file=http://www.bing.com/videos/browse/sports/nba?q=browse:sports/nba,NBA</link>
162<media:thumbnail url="/usr/local/etc/www/cgi-bin/scripts/tv/image/bing.jpg" />
163</item>
164
165<item>
166<title>MLB</title>
167<link><?php echo $host; ?>/scripts/tv/php/bing.php?file=http://www.bing.com/videos/browse/sports/mlb?q=browse:sports/mlb,MLB</link>
168<media:thumbnail url="/usr/local/etc/www/cgi-bin/scripts/tv/image/bing.jpg" />
169</item>
170
171<item>
172<title>NHL</title>
173<link><?php echo $host; ?>/scripts/tv/php/bing.php?file=http://www.bing.com/videos/browse/sports/nhl?q=browse:sports/nhl,NHL</link>
174<media:thumbnail url="/usr/local/etc/www/cgi-bin/scripts/tv/image/bing.jpg" />
175</item>
176
177<item>
178<title>NFL</title>
179<link><?php echo $host; ?>/scripts/tv/php/bing.php?file=http://www.bing.com/videos/browse/sports/nfl?q=browse:sports/nfl,NFL</link>
180<media:thumbnail url="/usr/local/etc/www/cgi-bin/scripts/tv/image/bing.jpg" />
181</item>
182
183<item>
184<title>College Football</title>
185<link><?php echo $host; ?>/scripts/tv/php/bing.php?file=http://www.bing.com/videos/browse/sports/college-football?q=browse:sports/college-football,College+football</link>
186<media:thumbnail url="/usr/local/etc/www/cgi-bin/scripts/tv/image/bing.jpg" />
187</item>
188
189<item>
190<title>
191College Basketball</title>
192<link><?php echo $host; ?>/scripts/tv/php/bing.php?file=http://www.bing.com/videos/browse/sports/college-basketball?q=browse:sports/college-basketball,College+basketball</link>
193<media:thumbnail url="/usr/local/etc/www/cgi-bin/scripts/tv/image/bing.jpg" />
194</item>
195
196</channel>
197</rss>