/filme/php/vplay_main_main.php
PHP | 284 lines | 261 code | 19 blank | 4 comment | 24 complexity | 6608666c6169fe8e905b2e101e19a3ee MD5 | raw file
- #!/usr/local/bin/Resource/www/cgi-bin/php
- <?php echo "<?xml version='1.0' encoding='UTF8' ?>";
- $host = "http://127.0.0.1/cgi-bin";
- ?>
- <rss version="2.0">
- <onEnter>
- startitem = "middle";
- setRefreshTime(1);
- </onEnter>
- <onRefresh>
- setRefreshTime(-1);
- itemCount = getPageInfo("itemCount");
- </onRefresh>
- <mediaDisplay name="threePartsView"
- sideLeftWidthPC="0"
- sideRightWidthPC="0"
-
- headerImageWidthPC="0"
- selectMenuOnRight="no"
- autoSelectMenu="no"
- autoSelectItem="no"
- itemImageHeightPC="0"
- itemImageWidthPC="0"
- itemXPC="8"
- itemYPC="25"
- itemWidthPC="30"
- itemHeightPC="8"
- capXPC="8"
- capYPC="25"
- capWidthPC="30"
- capHeightPC="64"
- itemBackgroundColor="0:0:0"
- itemPerPage="8"
- itemGap="0"
- bottomYPC="90"
- backgroundColor="0:0:0"
- showHeader="no"
- showDefaultInfo="no"
- imageFocus=""
- sliding="no"
- idleImageXPC="5" idleImageYPC="5" idleImageWidthPC="8" idleImageHeightPC="10"
- >
-
- <text align="center" offsetXPC="0" offsetYPC="0" widthPC="100" heightPC="20" fontSize="30" backgroundColor="10:105:150" foregroundColor="100:200:255">
- <script>getPageInfo("pageTitle");</script>
- </text>
- <text redraw="yes" offsetXPC="85" offsetYPC="12" widthPC="10" heightPC="6" fontSize="20" backgroundColor="10:105:150" foregroundColor="60:160:205">
- <script>sprintf("%s / ", focus-(-1))+itemCount;</script>
- </text>
- <text align="center" redraw="yes"
- lines="10" fontSize=17
- offsetXPC=55 offsetYPC=55 widthPC=40 heightPC=42
- backgroundColor=0:0:0 foregroundColor=200:200:200>
- <script>print(annotation); annotation;</script>
- </text>
- <image redraw="yes" offsetXPC=60 offsetYPC=25 widthPC=30 heightPC=20>
- /usr/local/etc/www/cgi-bin/scripts/clip/image/vplay.jpg
- </image>
- <idleImage>image/POPUP_LOADING_01.png</idleImage>
- <idleImage>image/POPUP_LOADING_02.png</idleImage>
- <idleImage>image/POPUP_LOADING_03.png</idleImage>
- <idleImage>image/POPUP_LOADING_04.png</idleImage>
- <idleImage>image/POPUP_LOADING_05.png</idleImage>
- <idleImage>image/POPUP_LOADING_06.png</idleImage>
- <idleImage>image/POPUP_LOADING_07.png</idleImage>
- <idleImage>image/POPUP_LOADING_08.png</idleImage>
- <itemDisplay>
- <text align="left" lines="1" offsetXPC=0 offsetYPC=0 widthPC=100 heightPC=100>
- <script>
- idx = getQueryItemIndex();
- focus = getFocusItemIndex();
- if(focus==idx)
- {
- location = getItemInfo(idx, "location");
- annotation = getItemInfo(idx, "annotation");
- }
- getItemInfo(idx, "title");
- </script>
- <fontSize>
- <script>
- idx = getQueryItemIndex();
- focus = getFocusItemIndex();
- if(focus==idx) "16"; else "14";
- </script>
- </fontSize>
- <backgroundColor>
- <script>
- idx = getQueryItemIndex();
- focus = getFocusItemIndex();
- if(focus==idx) "10:80:120"; else "-1:-1:-1";
- </script>
- </backgroundColor>
- <foregroundColor>
- <script>
- idx = getQueryItemIndex();
- focus = getFocusItemIndex();
- if(focus==idx) "255:255:255"; else "140:140:140";
- </script>
- </foregroundColor>
- </text>
- </itemDisplay>
-
- <onUserInput>
- <script>
- ret = "false";
- userInput = currentUserInput();
- if (userInput == "pagedown" || userInput == "pageup")
- {
- idx = Integer(getFocusItemIndex());
- if (userInput == "pagedown")
- {
- idx -= -8;
- if(idx >= itemCount)
- idx = itemCount-1;
- }
- else
- {
- idx -= 8;
- if(idx < 0)
- idx = 0;
- }
- print("new idx: "+idx);
- setFocusItemIndex(idx);
- setItemFocus(0);
- redrawDisplay();
- "true";
- }
- ret;
- </script>
- </onUserInput>
-
- </mediaDisplay>
-
- <item_template>
- <mediaDisplay name="threePartsView" idleImageXPC="5" idleImageYPC="5" idleImageWidthPC="8" idleImageHeightPC="10">
- <idleImage>image/POPUP_LOADING_01.png</idleImage>
- <idleImage>image/POPUP_LOADING_02.png</idleImage>
- <idleImage>image/POPUP_LOADING_03.png</idleImage>
- <idleImage>image/POPUP_LOADING_04.png</idleImage>
- <idleImage>image/POPUP_LOADING_05.png</idleImage>
- <idleImage>image/POPUP_LOADING_06.png</idleImage>
- <idleImage>image/POPUP_LOADING_07.png</idleImage>
- <idleImage>image/POPUP_LOADING_08.png</idleImage>
- </mediaDisplay>
- </item_template>
- <searchLink>
- <link>
- <script>"<?php echo $host."/scripts/filme/php/vplay_search.php?query="; ?>" + urlEncode(keyword);</script>
- </link>
- </searchLink>
- <channel>
- <title>vplay - seriale</title>
- <menu>main menu</menu>
- <?php
- function str_between($string, $start, $end){
- $string = " ".$string; $ini = strpos($string,$start);
- if ($ini == 0) return ""; $ini += strlen($start); $len = strpos($string,$end,$ini) - $ini;
- return substr($string,$ini,$len);
- }
- //necesita inregistrare pe site
- //vplay.txt are o singura linie de forma
- //username@pass
- $filename = "/usr/local/etc/dvdplayer/vplay.txt";
- $cookie="D://vplay_c.txt";
- $cookie="/tmp/vplay_c.txt";
- if (file_exists($filename)) {
- $handle = fopen($filename, "r");
- $c = fread($handle, filesize($filename));
- fclose($handle);
- $a=explode("@",$c);
- $user=$a[0];
- $pass=trim($a[1]);
- if (!file_exists($cookie)) {
- $l="http://vplay.ro/in";
- $post="usr_vplay=".$user."&pwd=".$pass."&rbm=1";
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $l);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 GTB5');
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1);
- curl_setopt($ch,CURLOPT_REFERER,"http://vplay.ro/login/");
- curl_setopt ($ch, CURLOPT_POST, 1);
- curl_setopt ($ch, CURLOPT_POSTFIELDS, $post);
- curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
- curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
- $html = curl_exec($ch);
- curl_close($ch);
- }
- }
- $link="http://vplay.ro/coll/";
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $link);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 GTB5');
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1);
- curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
- $html = curl_exec($ch);
- curl_close($ch);
- $html1 = str_between($html,"<h2>Colec","</ul>");
- if ($html1 <> "") {
- echo '
- <item>
- <title>Lista ta de favorite</title>
- <link>'.$host.'/scripts/filme/php/vplay_fav.php</link>
- <annotation>Lista ta de favorite</annotation>
- <mediaDisplay name="threePartsView"/>
- </item>
- ';
- echo '
- <item>
- <title>Cele mai urm?rite de tine</title>
- <link>'.$host.'/scripts/filme/php/vplay_main1.php</link>
- <annotation>Cele mai urm?rite de tine</annotation>
- <mediaDisplay name="threePartsView"/>
- </item>
- ';
- echo '
- <item>
- <title>C?utare serial</title>
- <annotation>C?utare serial</annotation>
- <onClick>
- keyword = getInput();
- if (keyword != null)
- {
- jumpToLink("searchLink");
- }
- </onClick>
- </item>
- ';
- }
- $videos = explode('option value="', $html);
- unset($videos[0]);
- $videos = array_values($videos);
- $n=0;
- foreach($videos as $video) {
- $t1=explode('"',$video);
- $l=$t1[0];
- if ($l == "")
- $link="http://vplay.ro/coll/";
- else
- $link="http://vplay.ro/coll/g/".$l."/";
-
- $t1=explode(">",$video);
- $t2=explode("<",$t1[1]);
- $title=$t2[0];
- if ($title=="-----") $title="Toate";
- $n++;
- echo '
- <item>
- <title>'.$title.'</title>
- <link>'.$host.'/scripts/filme/php/vplay_main.php?query=1,'.$link.','.urlencode($title).'</link>
- <annotation>'.$title.'</annotation>
- <mediaDisplay name="threePartsView"/>
- </item>
- ';
- }
- if ($n==0) {
- $link = "/usr/local/etc/www/cgi-bin/scripts/filme/php/vplay.rss";
- $description="Pentru a accesa acest site trebuie s? ave?i un cont pe vplay.ro (este gratis). Completa?i userul ?i parola în acest formular ?i apoi ap?sa?i Return, Return dup? care accesa?i din nou aceast? pagin?. Dac? userul ?i parola sunt corecte ve?i vedea lista serialelor.";
- echo '
- <item>
- <title>Logare</title>
- <link>'.$link.'</link>
- <annotation>'.$description.'</annotation>
- <mediaDisplay name="onePartView" />
- </item>
- ';
- }
- ?>
- </channel>
- </rss>