/**
  * -------------------------------------------------------------------------
  */
 public function __construct($title)
 {
     $this->title = $title;
     $this->homePageLink = SERVER_HOST_AND_PATH . "php/index.php";
     $this->stringHeaderBarGoHome = resourceString("header_menu_home");
     $this->stringHeaderBarAddBookmark = resourceString("header_menu_add_bookmark");
 }
function fetchCategories()
{
    global $template;
    //Get principal page and parse categories side bar
    $content = file_get_contents("http://www.myvod.tv");
    $newlines = array("\t", "\n", "\r", "  ", "", "\v");
    $content = str_replace($newlines, "", html_entity_decode($content));
    //Gets sidebar
    preg_match("/<div id=\"l_sidebar\">(.*)<\\/div>/siU", $content, $div);
    $div = $div[1];
    //Get category links
    preg_match_all("/<a href=\"(.*)\" title=\"(.*)\">(.*)</siU", $div, $links, PREG_SET_ORDER);
    $template->setSearch(array(resourceString("search_by") . "...", resourceString("search_by") . "...", "rss_command://search", SCRAPER_URL . "index.php?search=%s" . URL_AMP . "title=" . base64_encode(resourceString("search_by")) . URL_AMP . "PHPSESID=" . session_id(), ""));
    foreach ($links as $link) {
        $name = htmlspecialchars_decode($link[3], ENT_QUOTES);
        $template->addItem($name, "", SCRAPER_URL . "index.php?type=" . base64_encode($link[1]) . URL_AMP . "title=" . base64_encode($name) . URL_AMP . "PHPSESID=" . session_id(), "");
    }
    $template->generateView(MyvodtvTemplate::VIEW_CATEGORY, "myvod.tv");
}
function fetchCategoryItems($type, $title)
{
    $template = new KinostreamingTemplate();
    //Start session
    if (isset($_GET["PHPSESID"])) {
        session_id($_GET["PHPSESID"]);
    }
    session_start();
    //If page equal "x" goto page number list, in other case process actual category page
    if (isset($_GET["page"]) && $_GET["page"] == "x") {
        $maxPages = $_GET["pages"];
        for ($i = 1; $i <= $maxPages; ++$i) {
            $template->addItem($i, resourceString("goto_page") . $i, SCRAPER_URL . "index.php?type=" . base64_encode($type) . URL_AMP . "page=" . $i . URL_AMP . "pages=" . $maxPages, "");
        }
        $template->generateView(KinostreamingTemplate::VIEW_PAGE_NUMBERS);
    } else {
        if (!isset($_GET["page"])) {
            $pages = getPages($type . "-1-3");
            $template->setActualPage(1);
            $template->setMaxPages($pages[1]);
            $content = $pages[0];
        } else {
            $template->setActualPage($_GET["page"]);
            $template->setMaxPages($_GET["pages"]);
            $content = file_get_contents($type . "-" . $_GET["page"] . "-3");
            $newlines = array("\t", "\n", "\r", "  ", "", "\v");
            $content = str_replace($newlines, "", html_entity_decode($content));
        }
        preg_match_all("/<div class\\=\"eTitle\"(.*)><a href\\=\"(.*)\">(.*)<\\/a>(.*)<img src\\=\"(.*)\"/U", $content, $links, PREG_SET_ORDER);
        if ($links) {
            foreach ($links as $value) {
                $image = $value[5];
                if (!$image) {
                    $image = XTREAMER_IMAGE_PATH . "background/nocover.jpg";
                }
                $template->addItem(utf8_decode($value[3]), "", SCRAPER_URL . "index.php?item=" . base64_encode($value[2]) . URL_AMP . "title=" . base64_encode($value[3]) . URL_AMP . "image=" . base64_encode($image) . URL_AMP . "PHPSESID=" . session_id(), $image);
            }
        }
        $template->generateView(KinostreamingTemplate::VIEW_MOVIE, "");
    }
}
/**
 * Get category movies and pages.
 */
function fetchCategoryItems($title)
{
    $template = new Anime44MoviesTemplate();
    $template->setLetter($letter);
    //If page equal "x" goto page number list, in other case process actual category page
    if (isset($_GET["page"]) && $_GET["page"] == "x") {
        $maxPages = $_GET["pages"];
        for ($i = 1; $i <= $maxPages; ++$i) {
            $template->addItem($i, resourceString("goto_page") . $i, SCRAPER_URL . "movies.php?letter=" . $letter . URL_AMP . "title=" . base64_encode($title) . URL_AMP . "page=" . $i . URL_AMP . "pages=" . $maxPages . URL_AMP . "PHPSESID=" . session_id(), "");
        }
        $template->generateView(Anime44MoviesTemplate::VIEW_PAGE_NUMBERS);
    } else {
        if (!isset($_GET["page"])) {
            $pages = getPages();
            $template->setActualPage(1);
            $template->setMaxPages($pages[1]);
            $content = $pages[0];
            $showSearch = true;
        } else {
            $page = $_GET["page"];
            $template->setActualPage($_GET["page"]);
            $template->setMaxPages($_GET["pages"]);
            $content = file_get_contents("http://www.anime44.com/category/anime-movies/page/" . $page);
            $showSearch = false;
        }
        //Show search link on first page only
        if ($showSearch) {
            $template->setSearch(array(resourceString("search_by") . "...", resourceString("search_by") . "...", "rss_command://search", SCRAPER_URL . "movies.php?search=%s" . URL_AMP . "title=" . base64_encode(resourceString("search_by") . "...") . URL_AMP . "PHPSESID=" . session_id(), ""));
        }
        //
        $newlines = array("\t", "\n", "\r", "  ", "", "\v");
        $content = str_replace($newlines, "", html_entity_decode($content, ENT_QUOTES, "UTF-8"));
        preg_match_all("/<div class=\"postlist\"><a href=\"(.*)\" rel=\"bookmark\" title=\"(.*)\">(.*)<\\/a>/siU", $content, $links, PREG_SET_ORDER);
        if ($links) {
            foreach ($links as $value) {
                $template->addItem($value[3], "", SCRAPER_URL . "movies.php?title=" . base64_encode($value[3]) . URL_AMP . "item=" . base64_encode($value[1]) . URL_AMP . "PHPSESID=" . session_id(), "");
            }
        }
        $template->generateView(Anime44MoviesTemplate::VIEW_MOVIE, "");
    }
}
    /**
     * -------------------------------------------------------------------------
     */
    private function getPlayHeader()
    {
        ?>
<script>
    SwitchViewer(0);
    SwitchViewer(7);
</script>
<mediaDisplay name="threePartsView"
              showDefaultInfo="no" bottomYPC="0" itemGap="0" itemPerPage="7"
              showHeader="no" fontSize="14" itemBorderColor="-1:-1:-1" menuBorderColor="-1:-1:-1"
              itemImageXPC="72" itemImageHeightPC="0" itemImageWidthPC="0"
              imageFocus="null" imageUnFocus="null" imageParentFocus="null"
              itemXPC="72" itemYPC="5" itemWidthPC="26" itemHeightPC="14" capWidthPC="58"
              unFocusFontColor="101:101:101" focusFontColor="255:255:255"
              idleImageXPC="90" idleImageYPC="5" idleImageWidthPC="5" idleImageHeightPC="8"
              backgroundColor="0:0:0" drawItemText="no" imageBorderPC="0">
                          <?php 
        xVoDLoader();
        ?>

    <!-- RSS PUZZLE, MOVIE PART -->
    <image redraw="no" offsetXPC="0" offsetYPC="0" widthPC="71.65" heightPC="100" backgroundColor="-1:-1:-1" >
                <?php 
        echo XTREAMER_IMAGE_PATH;
        ?>
background/movies-inlist-noright.jpg
    </image>

    <!-- TOP MENU TITLES -->
    <text redraw="no"
          backgroundColor="-1:-1:-1" foregroundColor="255:255:255"
          offsetXPC="5.5" offsetYPC="3.1" widthPC="10" heightPC="3" fontSize="10" lines="1">
        <![CDATA[<?php 
        echo resourceString("header_menu_categories");
        ?>
]]>
    </text>

    <!-- COVER IMAGE -->
    <image redraw="no" offsetXPC="2.8" offsetYPC="23.8" widthPC="18.9" heightPC="48.1" backgroundColor="-1:-1:-1" >
                <?php 
        echo $this->image;
        ?>
    </image>

    <!-- MOVIE TITLE -->
    <text redraw="no"
          backgroundColor="-1:-1:-1" foregroundColor="0:154:205"
          offsetXPC="23" offsetYPC="23.5" widthPC="50" heightPC="5" fontSize="16" lines="1">
                      <?php 
        echo strtoupper($this->movieTitle);
        ?>
    </text>

    <!-- MOVIE ITEM TITLE -->
    <text redraw="yes"
          backgroundColor="0:0:0" foregroundColor="255:255:255"
          offsetXPC="23.6" offsetYPC="33.2" widthPC="20" heightPC="10" fontSize="12" lines="3">
        <script>
            getItemInfo("title");
        </script>
    </text>

    <itemDisplay>
        <image redraw="yes" offsetXPC="0" offsetYPC="0" widthPC="100" heightPC="100" >
            <script>
                if( getFocusItemIndex() == getItemInfo(-1,"itemid") )
                    "<?php 
        echo XTREAMER_IMAGE_PATH;
        ?>
background/top-bar-focus_300.png";
                else
                    "<?php 
        echo XTREAMER_IMAGE_PATH;
        ?>
background/top-bar-unfocus_300.png";
            </script>
        </image>
        <text redraw="no"
              backgroundColor="-1:-1:-1" foregroundColor="255:255:255"
              offsetXPC="3" offsetYPC="12" widthPC="94" heightPC="76" fontSize="12" lines="3">
            <script>
                getItemInfo(-1,"title");
            </script>
        </text>
    </itemDisplay>

    <onUserInput>
        <script>
            userInput = currentUserInput();
            if ( userInput == "zero" )      {
                showIdle();
                jumpToLink("homePageLink");
                redrawDisplay();
            }
        </script>
    </onUserInput>

</mediaDisplay>

<homePageLink>
    <link>
            <?php 
        echo SCRAPER_URL . "series.php" . URL_AMP . "PHPSESID=" . session_id();
        ?>
    </link>
</homePageLink>

        <?php 
    }
/**
 * Get category movies and pages.
 */
function fetchLetterItems($type, $letter, $title)
{
    $template = new AnivideSeriesTemplate();
    $template->setType($type);
    $template->setLetter($letter);
    //If page equal "x" goto page number list, in other case process actual category page
    if (isset($_GET["page"]) && $_GET["page"] == "x") {
        $maxPages = $_GET["pages"];
        for ($i = 1; $i <= $maxPages; ++$i) {
            $template->addItem($i, resourceString("goto_page") . $i, SCRAPER_URL . "series.php?letter=" . $letter . URL_AMP . "title=" . base64_encode($title) . URL_AMP . "page=" . $i . URL_AMP . "pages=" . $maxPages . URL_AMP . "PHPSESID=" . session_id(), "");
        }
        $template->generateView(AnivideSeriesTemplate::VIEW_PAGE_NUMBERS);
    } else {
        if (!isset($_GET["page"])) {
            $pages = getPages($type, $letter);
            $template->setActualPage(1);
            $template->setMaxPages($pages[1]);
            $content = $pages[0];
        } else {
            $page = $_GET["page"];
            $template->setActualPage($_GET["page"]);
            $template->setMaxPages($_GET["pages"]);
            if ($letter == "all") {
                $url = "http://www.anivide.com/index.html?list=anime&type=series&page=" . $page;
            } else {
                if ($letter == "new") {
                    $url = "http://www.anivide.com/index.html?list=anime&view=new&page=" . $page;
                } else {
                    $url = "http://www.anivide.com/index.html?list=anime&type=series&letter=" . $letter . "&page=" . $page;
                }
            }
            $content = file_get_contents($url);
        }
        //Remove backslashes
        $content = html_entity_decode($content);
        preg_match_all("/<div class=\"animelist\"><a href=\"(.*)\"><img src=\"(.*)\" border=\"0\"><br><br><b>(.*)<\\/b><br>(.*)</U", $content, $links, PREG_SET_ORDER);
        if ($links) {
            foreach ($links as $value) {
                $title = html_entity_decode(utf8_decode($value[2]));
                $template->addItem($value[3], $value[4], SCRAPER_URL . "series.php?serie=" . base64_encode($value[1]) . URL_AMP . "title=" . base64_encode($value[3]) . URL_AMP . "PHPSESID=" . session_id(), $value[2]);
            }
        }
        $template->generateView(AnivideSeriesTemplate::VIEW_SERIE, "");
    }
}
/**
 * Get category movies and pages.
 */
function fetchCategoryItems($type, $letter, $title)
{
    $template = new KinotoTemplate();
    $template->setType($type);
    $template->setLetter($letter);
    //If page equal "x" goto page number list, in other case process actual category page
    if (isset($_GET["page"]) && $_GET["page"] == "x") {
        $maxPages = $_GET["pages"];
        for ($i = 1; $i <= $maxPages; ++$i) {
            $template->addItem($i, resourceString("goto_page") . $i, SCRAPER_URL . "movies.php?type=" . base64_encode($type) . URL_AMP . "letter=" . $letter . URL_AMP . "title=" . base64_encode($title) . URL_AMP . "page=" . $i . URL_AMP . "pages=" . $maxPages . URL_AMP . "PHPSESID=" . session_id(), "");
        }
        $template->generateView(KinotoTemplate::VIEW_PAGE_NUMBERS);
    } else {
        if (!isset($_GET["page"])) {
            $pages = getPages($type, $letter);
            $template->setActualPage(1);
            $template->setMaxPages($pages[1]);
            $content = $pages[0];
        } else {
            $page = $_GET["page"];
            $template->setActualPage($_GET["page"]);
            $template->setMaxPages($_GET["pages"]);
            $content = file_get_contents(getMovieListLink($type, $letter, $page), false, getExplorerContext(getSiteHash()));
        }
        //Remove backslashes
        $content = str_replace("\\", "", $content);
        //var_dump($content);
        preg_match_all("/(movie|documentation)\",\"<a href=\"\\/(.*)\" title=\"(.*)\" onclick=\"return false;\">(.*)<\\/a>/U", $content, $links, PREG_SET_ORDER);
        //var_dump($links);
        if ($links) {
            foreach ($links as $value) {
                $itemUrl = "/" . $value[2];
                if (strpos($itemUrl, '"')) {
                    $itemUrl = substr($itemUrl, 0, strpos($itemUrl, '"'));
                }
                $template->addItem(html_entity_decode($value[3], ENT_QUOTES, "UTF-8"), "", SCRAPER_URL . "movies.php?title=" . base64_encode($value[3]) . URL_AMP . "item=" . base64_encode($itemUrl) . URL_AMP . "PHPSESID=" . session_id(), "");
            }
            $template->generateView(KinotoTemplate::VIEW_MOVIE, "");
        }
    }
}
function printHeader()
{
    ?>
<mediaDisplay name="photoView"
              showHeader="no" rowCount="5" columnCount="1" drawItemText="no" showDefaultInfo="no"
              itemImageXPC="100" itemImageYPC="100" itemOffsetXPC="18" itemOffsetYPC="10" sliding="yes"
              itemWidthPC="80" itemHeightPC="8" itemBorderColor="-1:-1:-1"
              idleImageXPC="90" idleImageYPC="5" idleImageWidthPC="5" idleImageHeightPC="8"
              bottomYPC="88" sideTopHeightPC="20" itemBackgroundColor="-1:-1:-1"
              backgroundColor="-1:-1:-1" sideColorBottom="-1:-1:-1" sideColorTop="-1:-1:-1"
              fontSize="18" imageBorderPC="0">
                      <?php 
    xVoDLoader();
    ?>

        <?php 
    if (COOKIE_STATE_ACTIVATED) {
        ?>
    <image redraw="no" offsetXPC="1" offsetYPC="20" widthPC="18" heightPC="32.5" >
                <?php 
        echo XTREAMER_IMAGE_PATH;
        ?>
img/megaupload-act.png
    </image>
    <text redraw="no"
          backgroundColor="-1:-1:-1" foregroundColor="255:255:255"
          offsetXPC="4" offsetYPC="54" widthPC="14" heightPC="4" fontSize="16" lines="1">
                      <?php 
        echo resourceString("title_cookie_on");
        ?>
    </text>

            <?php 
    } else {
        ?>
    <image redraw="no" offsetXPC="1" offsetYPC="20" widthPC="18" heightPC="32.5" >
                <?php 
        echo XTREAMER_IMAGE_PATH;
        ?>
img/megaupload-des.png
    </image>
    <text redraw="no"
          backgroundColor="-1:-1:-1" foregroundColor="255:255:255"
          offsetXPC="2" offsetYPC="54" widthPC="16" heightPC="4" fontSize="16" lines="1">
                      <?php 
        echo resourceString("title_cookie_off");
        ?>
    </text>

            <?php 
    }
    ?>

    <text redraw="no"
          backgroundColor="-1:-1:-1" foregroundColor="255:102:19"
          offsetXPC="25" offsetYPC="50" widthPC="80" heightPC="16" fontSize="14" lines="4">
                  <![CDATA[<?php 
    echo resourceString("title_modify_cookie_help");
    ?>
]]>
    </text>

    <itemDisplay>
        <text redraw="yes"
              backgroundColor="-1:-1:-1"
              offsetXPC="0" offsetYPC="10" widthPC="100" heightPC="80" fontSize="16" lines="1">
            <script>
                getItemInfo(-1,"title");
            </script>
            <foregroundColor>
            	<script>
            		if( getFocusItemIndex() == getItemInfo(-1,"itemid") )
            			"0:154:205";
            		else
            			"255:255:255";
            	</script>
            </foregroundColor>
        </text>
    </itemDisplay>

    <backgroundDisplay>
        <image  offsetXPC="0" offsetYPC="0" widthPC="100" heightPC="100">
                <?php 
    echo XTREAMER_IMAGE_PATH;
    ?>
background/setup.jpg
        </image>
    </backgroundDisplay>
</mediaDisplay>
    <?php 
}
 private function getAboutLink($itemid)
 {
     $name = resourceString("about");
     $image = SERVER_HOST_AND_PATH . "image/img/group.png";
     $imageover = SERVER_HOST_AND_PATH . "image/img/group_over.png";
     $url = SERVER_HOST_AND_PATH . "php/index.php?action=" . ViewAboutPageAction::getActionName() . URL_AMP . "PHPSESID=" . session_id();
     return '<item>' . "\n" . '   <title><![CDATA[' . $name . ']]></title>' . "\n" . '   <subtitle>' . strtoupper($name) . '</subtitle>' . "\n" . '   <description><![CDATA[' . resourceString("show") . " " . $name . ']]></description>' . "\n" . '   <link>' . $url . '</link>' . "\n" . '   <itemid>' . $itemid . '</itemid>' . "\n" . '   <media:thumbnail url="' . $image . '" />' . "\n" . '   <image>' . $image . '</image>' . "\n" . '   <imageover>' . $imageover . '</imageover>' . "\n" . '</item>' . "\n";
 }
    /**
     * -------------------------------------------------------------------------
     */
    private function getPlayHeader()
    {
        ?>
<script>
    SwitchViewer(0);
    SwitchViewer(7);
</script>
<mediaDisplay name="threePartsView"
              showDefaultInfo="no" bottomYPC="0" itemGap="0" itemPerPage="18"
              showHeader="no" fontSize="14" itemBorderColor="-1:-1:-1" menuBorderColor="-1:-1:-1"
              itemImageXPC="72" itemImageHeightPC="0" itemImageWidthPC="0"
              imageFocus="null" imageUnFocus="null" imageParentFocus="null"
              itemXPC="72" itemYPC="5" itemWidthPC="26" itemHeightPC="14" capWidthPC="58"
              unFocusFontColor="101:101:101" focusFontColor="255:255:255"
              idleImageXPC="90" idleImageYPC="5" idleImageWidthPC="5" idleImageHeightPC="8"
              backgroundColor="0:0:0" drawItemText="no" imageBorderPC="0">
                          <?php 
        xVoDLoader();
        ?>

    <!-- RSS PUZZLE, MOVIE PART -->
    <image redraw="no" offsetXPC="0" offsetYPC="0" widthPC="71.65" heightPC="100" backgroundColor="-1:-1:-1" >
                <?php 
        echo XTREAMER_IMAGE_PATH;
        ?>
background/movies-inlist-noright2.jpg
    </image>

    <!-- TOP MENU TITLES -->
    <text redraw="no"
          backgroundColor="-1:-1:-1" foregroundColor="255:255:255"
          offsetXPC="5.5" offsetYPC="3.1" widthPC="10" heightPC="3" fontSize="10" lines="1">
        <![CDATA[<?php 
        echo resourceString("header_menu_categories");
        ?>
]]>
    </text>

    <text redraw="no"
          backgroundColor="-1:-1:-1" foregroundColor="255:255:255"
          offsetXPC="20.5" offsetYPC="3.4" widthPC="14" heightPC="3" fontSize="10" lines="1">
        DOWNLOAD VIDEO
    </text>

    <!-- MOVIE TITLE -->
    <text redraw="yes"
          backgroundColor="0:0:0" foregroundColor="255:255:255"
          offsetXPC="23.6" offsetYPC="33.2" widthPC="20" heightPC="10" fontSize="12" lines="3">
        <script>
            getItemInfo("title");
        </script>
    </text>

    <itemDisplay>
        <image redraw="yes" offsetXPC="0" offsetYPC="0" widthPC="100" heightPC="100" >
            <script>
                if( getFocusItemIndex() == getItemInfo(-1,"itemid") )
                    "<?php 
        echo XTREAMER_IMAGE_PATH;
        ?>
background/top-bar-focus_300.png";
                else
                    "<?php 
        echo XTREAMER_IMAGE_PATH;
        ?>
background/top-bar-unfocus_300.png";
            </script>
        </image>
        <text redraw="no"
              backgroundColor="-1:-1:-1" foregroundColor="255:255:255"
              offsetXPC="3" offsetYPC="12" widthPC="94" heightPC="76" fontSize="12" lines="3">
            <script>
                getItemInfo(-1,"title");
            </script>
        </text>
    </itemDisplay>

    <onUserInput>
        <script>
            userInput = currentUserInput();
            if ( userInput == "zero" )      {
                showIdle();
                jumpToLink("homePageLink");
                redrawDisplay();
            }
	   if ( userInput == "two" )      {
               index = getFocusItemIndex();
               itemLink = getItemInfo(index, "link");
               rss = "rss_file://../rss/downloadDialog.rss";
               ret = doModalRss(rss);           
               if (ret == "Confirm")    {
                  writeStringToFile("/tmp/xvod_links.txt", itemLink);
                  startDownloadUrl = "<?php 
        echo SCRAPER_URL . "index.php?download";
        ?>
";
                  dummy = getURL( startDownloadUrl );
              }
           "false";
            }
        </script>
    </onUserInput>

</mediaDisplay>

<homePageLink>
    <link>
            <?php 
        echo SCRAPER_URL . "anime.php?type=" . $this->type;
        ?>
    </link>
</homePageLink>

        <?php 
    }
    /**
     * -------------------------------------------------------------------------
     */
    private function getEpisodeHeader()
    {
        ?>
<script>
    SwitchViewer(0);
    SwitchViewer(7);
</script>
<mediaDisplay name="photoView"
              showHeader="no" showDefaultInfo="no" drawItemText="yes"
              itemImageXPC="0" itemImageYPC="0" itemOffsetXPC="84" itemOffsetYPC="65" sliding="yes"
              itemWidthPC="3" itemHeightPC="2.9" rowCount="1" fontSize="11"
              backgroundColor="0:0:0" sideColorBottom="-1:-1:-1" sideColorTop="-1:-1:-1"
              idleImageXPC="90" idleImageYPC="5" idleImageWidthPC="5" idleImageHeightPC="8">
                          <?php 
        xVoDLoader();
        ?>

    <!-- HEADER SERIE IMAGE -->
    <image redraw="no" offsetXPC="0" offsetYPC="0" widthPC="100" heightPC="44" backgroundColor="-1:-1:-1" >
                <?php 
        echo $this->headerImage . "\n";
        ?>
    </image>

    <!-- BACKGROUND IMAGE -->
    <image redraw="no" offsetXPC="0" offsetYPC="0" widthPC="100" heightPC="51.11">
                <?php 
        echo XTREAMER_IMAGE_PATH;
        ?>
background/movie-detail_1.png
    </image>

    <!-- COVER SERIE IMAGE -->
    <image redraw="no" offsetXPC="4.8" offsetYPC="36.5" widthPC="20.8" heightPC="52.5" backgroundColor="-1:-1:-1" >
                <?php 
        echo $this->coverImage . "\n";
        ?>
    </image>

    <!-- RSS PUZZLE, EPISODES PART -->
    <image redraw="yes" offsetXPC="83.5" offsetYPC="57" widthPC="16.5" heightPC="43" backgroundColor="-1:-1:-1" >
                <?php 
        echo XTREAMER_IMAGE_PATH;
        ?>
background/movie-detail-puzzle.bmp
    </image>

    <!-- TOP MENU TITLES -->
    <text redraw="no"
          backgroundColor="-1:-1:-1" foregroundColor="255:255:255"
          offsetXPC="6.4" offsetYPC="3.1" widthPC="14" heightPC="3" fontSize="10" lines="1">
        <![CDATA[<?php 
        echo resourceString("header_menu_series");
        ?>
]]>
    </text>

    <!-- SHOW PLAY BUTTON ON HEADER -->
    <image redraw="no" offsetXPC="15.6" offsetYPC="2.8" widthPC="1.88" heightPC="3.34" backgroundColor="-1:-1:-1" >
                <?php 
        echo XTREAMER_IMAGE_PATH;
        ?>
background/play_btn.png
    </image>
    <text redraw="no"
          backgroundColor="-1:-1:-1" foregroundColor="255:255:255"
          offsetXPC="18" offsetYPC="3.2" widthPC="18" heightPC="3" fontSize="10" lines="1">
        <![CDATA[<?php 
        echo resourceString("header_menu_play");
        ?>
]]>
    </text>

    <!-- SERIE TITLE -->
    <text redraw="yes"
          backgroundColor="-1:-1:-1" foregroundColor="0:154:205"
          offsetXPC="28" offsetYPC="50" widthPC="50" heightPC="10" fontSize="18" lines="1">
        <![CDATA[<?php 
        echo strtoupper($this->title);
        ?>
]]>
    </text>

    <!-- SEASON LIST -->
            <?php 
        $offy = 57.8;
        $offset = $this->selectedSeason - 6;
        if ($offset < 0) {
            $offset = 0;
        }
        for ($i = 0; $i < 12; ++$i) {
            $val = array_slice($this->serie, $offset + $i, 1);
            if ($val) {
                $val = $val[0];
                $val = array_keys($this->serie, $val);
                $val = $val[0];
                ?>
    <text redraw="no"
          backgroundColor="-1:-1:-1" foregroundColor="<?php 
                echo $val == $this->selectedSeason ? "0:154:205" : "255:255:255";
                ?>
"
          offsetXPC="74.8" offsetYPC="<?php 
                echo $offy;
                ?>
" widthPC="12" heightPC="4" fontSize="10" lines="1">
        <![CDATA[<?php 
                echo "SEASON " . $val;
                ?>
]]>
    </text>
                    <?php 
                $offy += 4;
            }
        }
        ?>

    <!-- EPISODE NUMBER LIST -->
            <?php 
        $offx = 85.40000000000001;
        $offy = 68;
        $i = 0;
        foreach ($this->episode as $episodeNumber => $value) {
            $episodeName = $value[0];
            ?>
    <text redraw="yes"
          backgroundColor="-1:-1:-1" 
          offsetXPC="<?php 
            echo $offx;
            ?>
" offsetYPC="<?php 
            echo $offy;
            ?>
"
          widthPC="3.6" heightPC="4" fontSize="11" lines="1">
                          <?php 
            echo sprintf("%02d", $episodeNumber);
            ?>
        <foregroundColor>
            <script>
                if( <?php 
            echo $i;
            ?>
 == getFocusItemIndex() ){
                    "0:154:205";
                }else{
                    "255:255:255";
                }
            </script>
        </foregroundColor>
    </text>
                <?php 
            ++$i;
            $offx += 3.6;
            if ($offx > 97) {
                $offx = 85.40000000000001;
                $offy += 4;
            }
        }
        ?>
    <!-- SEASON NUMBER -->
    <text redraw="yes"
          backgroundColor="-1:-1:-1" foregroundColor="0:154:205"
          offsetXPC="83.5" offsetYPC="56.5" widthPC="15" heightPC="6" fontSize="12" lines="1">
        <script>
            "<?php 
        echo resourceString("screen_string_season") . " " . $this->selectedSeason;
        ?>
";
        </script>
    </text>

    <!-- SEASON LIST TITLE -->
    <text redraw="yes"
          backgroundColor="-1:-1:-1" foregroundColor="255:255:255"
          offsetXPC="83.5" offsetYPC="60.7" widthPC="15" heightPC="6" fontSize="11" lines="1">
        <script>
            "<?php 
        echo resourceString("screen_string_chapters_list");
        ?>
";
        </script>
    </text>

    <!-- EPISODE NAME -->
    <text redraw="yes" itemAlignt="right"
          backgroundColor="0:0:0" foregroundColor="0:154:205"
          offsetXPC="27.5" offsetYPC="45" widthPC="60" heightPC="5" fontSize="15" lines="1">
        <script>
            "<?php 
        echo resourceString("screen_string_season") . " " . $this->selectedSeason . ". " . resourceString("screen_string_episode");
        ?>
 " + getItemInfo("title") + ": " + getItemInfo("description");
        </script>
    </text>

    <!-- SERIE DESCRIPTION -->
    <text redraw="no"
          backgroundColor="-1:-1:-1" foregroundColor="255:255:255"
          offsetXPC="28" offsetYPC="58.5" widthPC="35" heightPC="40" fontSize="10" lines="12">
        <![CDATA[<?php 
        echo strtoupper($this->description);
        ?>
]]>
    </text>

    <onUserInput>
        <script>
            userInput = currentUserInput();
	    if(userInput == "U"){
                if( getFocusItemIndex() &gt; 3 ){
                    setFocusItemIndex(-4+getFocusItemIndex());
		    redrawDisplay();
		    "true";
                }

            }else if(userInput == "D"){
                if( getFocusItemIndex() &lt; <?php 
        echo count($this->episode) - 4;
        ?>
 ){
                    setFocusItemIndex(4+getFocusItemIndex());
		    redrawDisplay();
		    "true";
                }

            }else if ( userInput == "0" )      {
                showIdle();
                jumpToLink("homePageLink");
                redrawDisplay();

            }else if(userInput == "video_play"){
                showIdle();
                playUrl = getURL("<?php 
        echo SCRAPER_URL . "enclosure.php?link=";
        ?>
" + getItemInfo("link"));
                if(playUrl == "ERROR"){
                    cancelIdle();
                    redrawDisplay();
                }else{
                    playItemURL(playUrl,0);
                }
            }
        </script>
    </onUserInput>

    <backgroundDisplay>
        <image offsetXPC="0" offsetYPC="51.25" widthPC="100" heightPC="48.75">
                    <?php 
        echo XTREAMER_IMAGE_PATH;
        ?>
background/movie-detail_2.bmp
        </image>
    </backgroundDisplay>
</mediaDisplay>

<homePageLink>
    <link>
            <?php 
        echo SCRAPER_URL . "index.php";
        ?>
    </link>
</homePageLink>
        <?php 
    }
    private function showHeader()
    {
        echo "  <script>\n";
        foreach ($this->bookmarks as $bookmark) {
            echo '      titleArray  = pushBackStringArray( titleArray,  "' . utf8_encode($bookmark->getName()) . '" );' . "\n";
        }
        echo "  </script>\n";
        ?>

<mediaDisplay  name="photoView"
               rowCount="5" columnCount="3" drawItemText="no" showHeader="no" showDefaultInfo="no"
               menuBorderColor="0:0:0" sideColorBottom="-1:-1:-1" sideColorTop="-1:-1:-1"
               itemWidthPC="0" itemHeightPC="0" itemOffsetXPC="100" itemOffsetYPC="100"
               itemImageWidthPC="0" itemImageHeightPC="0" itemImageXPC="100"
               backgroundColor="-1:-1:-1" sliding="no" itemGap="1" slidingItemText="yes"
               imageUnFocus="null" imageParentFocus="null" imageBorderPC="0"
               idleImageXPC="90" idleImageYPC="5" idleImageWidthPC="5" idleImageHeightPC="8">
                           <?php 
        xVoDLoader();
        ?>

    <image redraw="yes" offsetXPC="43.9" offsetYPC="71.6" widthPC="56.1" heightPC="6" backgroundColor="-1:-1:-1" >
                <?php 
        echo XTREAMER_IMAGE_PATH;
        ?>
background/websites_title.jpg
    </image>

    <image redraw="yes" offsetXPC="29.88" offsetYPC="28.95" widthPC="70.13" heightPC="34.86">
                <?php 
        echo XTREAMER_IMAGE_PATH;
        ?>
background/bookmarks_items.jpg
    </image>

    <text redraw="yes" backgroundColor="-1:-1:-1" foregroundColor="0:0:0"
          offsetXPC="46" offsetYPC="65.4" widthPC="50" heightPC="18" fontSize="20" lines="1">
        <script>
            getItemInfo(-1,"title");
        </script>
    </text>

    <image redraw="yes" offsetXPC="6.55" offsetYPC="11.43" widthPC="17.86" heightPC="41.62" backgroundColor="-1:-1:-1" >
        <script>
            getItemInfo(-1,"image");
        </script>
    </image>

    <!-- HEADER BUTTON TITLES -->
    <text redraw="no" backgroundColor="-1:-1:-1" foregroundColor="255:255:255"
          offsetXPC="5.95" offsetYPC="2.6" widthPC="12" heightPC="2.4" fontSize="12" lines="1">
                      <?php 
        echo resourceString("header_menu_home") . "\n";
        ?>
    </text>
    <text redraw="no" backgroundColor="-1:-1:-1" foregroundColor="255:255:255"
          offsetXPC="20" offsetYPC="2.6" widthPC="30" heightPC="2.4" fontSize="12" lines="1">
                      <?php 
        echo resourceString("header_menu_remove_bookmark") . "\n";
        ?>
    </text>

            <?php 
        $y = 0;
        $x = 0;
        for ($i = 0; $i < 15; ++$i) {
            $script = "\n                        temp = " . $i . " + (15 * getItemInfo(\"pagenum\"));\n                        title = getStringArrayAt(titleArray, temp);\n                        title;";
            $this->showScreenDisplayText($script, 30 + $x * 23, 30 + $y * 6, 23, 10);
            if ($y > 0 && ($y + 1) % 5 == 0) {
                ++$x;
                $y = 0;
            } else {
                ++$y;
            }
        }
        ?>

    <onUserInput>
        <script>
        <?php 
        RssScriptUtil::showDeleteBookmarkScript();
        ?>
            if( userInput == "three" ){
                jumpToLink("bookmarksLink");
                redrawDisplay();
            }
            if(userInput == "zero"){
                showIdle();
                jumpToLink("homePageLink");
                redrawDisplay();
            }
        </script>
    </onUserInput>

    <backgroundDisplay>        
        <image offsetXPC="0" offsetYPC="0" widthPC="100" heightPC="100">
                    <?php 
        echo XTREAMER_IMAGE_PATH;
        ?>
background/bookmarks.jpg
        </image>
    </backgroundDisplay>
</mediaDisplay>

<homePageLink>
    <link>
            <?php 
        echo SERVER_HOST_AND_PATH . "php/index.php";
        ?>
    </link>
</homePageLink>

<bookmarksLink>
    <link>
            <?php 
        echo SERVER_HOST_AND_PATH . "php/index.php?action=" . ViewBookmarksPageAction::getActionName();
        ?>
    </link>
</bookmarksLink>
        <?php 
    }
Example #13
0
function fetchMovieCategoryItems($type, $category, $title)
{
    $template = new MegavideolinkTemplate();
    $template->setCategory($category);
    $template->setType($type);
    //If page equal "x" goto page number list, in other case process actual category page
    if (isset($_GET["page"]) && $_GET["page"] == "x") {
        $maxPages = $_GET["pages"];
        for ($i = 1; $i <= $maxPages; ++$i) {
            $template->addItem($i, resourceString("goto_page") . $i, SCRAPER_URL . "index.php?type=" . $type . URL_AMP . "cat=" . base64_encode($category) . URL_AMP . "page=" . $i . URL_AMP . "pages=" . $maxPages . URL_AMP . "PHPSESID=" . session_id(), "");
        }
        $template->generateView(MegavideolinkTemplate::VIEW_PAGE_NUMBERS);
    } else {
        if (!isset($_GET["page"])) {
            $pages = getPages($category);
            $template->setActualPage(1);
            $template->setMaxPages($pages[1]);
            $content = $pages[0];
        } else {
            $template->setActualPage($_GET["page"]);
            $template->setMaxPages($_GET["pages"]);
            $content = @file_get_contents($category . "page/" . $_GET["page"] . "/");
            $_SESSION["megavideolinkLastReferer"] = $category . "page/" . $_GET["page"] . "/";
            $newlines = array("\t", "\n", "\r", "  ", "", "\v");
            $content = str_replace($newlines, "", html_entity_decode($content, ENT_QUOTES));
        }
        preg_match_all("/<div class\\=\"Styleazer2\">(.*)<\\/table>/siU", $content, $links, PREG_SET_ORDER);
        if ($links) {
            foreach ($links as $value) {
                //Link and Title
                preg_match("/<h3><a href\\=\"(.*)\">(.*)</siU", $value[1], $matches);
                $movieLink = $matches[1];
                $movieTitle = $matches[2];
                //Image
                preg_match("/<img alt\\=\"film streaming\" src\\=\"(.*)\"/siU", $value[1], $matches);
                if (!$matches) {
                    $image = XTREAMER_IMAGE_PATH . "background/transparent_square.png";
                } else {
                    $image = $matches[1];
                }
                //Description
                preg_match("/<\\/h3><p>(.*)<\\/p><p>(.*)<\\/p><p>(.*)<\\/p>/siU", $value[1], $matches);
                if ($matches) {
                    $movieDescription = $matches[count($matches) - 1];
                }
                $template->addItem(utf8_decode($movieTitle), utf8_decode($movieDescription), SCRAPER_URL . "index.php?type={$type}" . URL_AMP . "item=" . base64_encode($movieLink) . URL_AMP . "title=" . base64_encode($movieTitle) . URL_AMP . "image=" . base64_encode($image) . URL_AMP . "PHPSESID=" . session_id(), $image);
            }
        }
        $template->generateView(MegavideolinkTemplate::VIEW_MOVIE, "");
    }
}
function showPodcastsHeader()
{
    ?>
<script>
    SwitchViewer(0);
    SwitchViewer(7);
</script>
<mediaDisplay name="photoView" 
              showHeader="no" drawItemText="no" showDefaultInfo="no" rowCount="2" columnCount="6"
              menuBorderColor="-1:-1:-1" sideColorBottom="-1:-1:-1" sideColorTop="-1:-1:-1" backgroundColor="-1:-1:-1"
              itemImageXPC="8" itemOffsetXPC="2" itemOffsetYPC="9"
              itemBackgroundColor="0:0:0" sliding="yes"
              fontSize="14" itemImageWidthPC="15" itemImageHeightPC="19" itemWidthPC="15" itemHeightPC="19"
              widthPC="60" heightPC="90"
              idleImageXPC="90" idleImageYPC="5" idleImageWidthPC="5" idleImageHeightPC="8">
                      <?php 
    xVoDLoader();
    ?>

    <!-- TOP MENU TITLES -->
    <text redraw="no"
          backgroundColor="0:0:0" foregroundColor="255:255:255"
          offsetXPC="15" offsetYPC="2" widthPC="37" heightPC="5" fontSize="10" lines="1">

    </text>
    <text redraw="no"
          backgroundColor="0:0:0" foregroundColor="255:255:255"
          offsetXPC="67" offsetYPC="2" widthPC="7" heightPC="5" fontSize="10" lines="1">
    </text>
    <text redraw="no"
          backgroundColor="-1:-1:-1" foregroundColor="255:255:255"
          offsetXPC="5.4" offsetYPC="3.1" widthPC="14" heightPC="3" fontSize="10" lines="1">
        <![CDATA[<?php 
    echo resourceString("header_menu_home");
    ?>
]]>
    </text>
    <text redraw="no"
          backgroundColor="0:0:0" foregroundColor="255:255:255"
          offsetXPC="76" offsetYPC="3.1" widthPC="18" heightPC="3" fontSize="10" lines="1">
    </text>

    <!-- SHOW TITLE AND DESCRIPTION -->
    <text redraw="yes"
          offsetXPC="20" offsetYPC="52" widthPC="75" heightPC="40" fontSize="12"
          backgroundColor="0:0:0" foregroundColor="255:255:255" lines="16">
        <script>
            getItemInfo("description");
        </script>
    </text>

    <!-- ACTUAL SELECTED ITEM AND NUMBER -->
    <text redraw="yes"
          backgroundColor="0:0:0" foregroundColor="255:255:255"
          offsetXPC="90" offsetYPC="93" widthPC="10" heightPC="5" fontSize="16" lines="1">
        <script>
            getFocusItemIndex();
        </script>
    </text>

    <!-- CATEGORY TITLE -->
    <text redraw="yes"
          backgroundColor="0:0:0" foregroundColor="255:255:255"
          offsetXPC="30" offsetYPC="93" widthPC="60" heightPC="5" fontSize="16" lines="1">
        <script>
            getItemInfo("title");
        </script>
    </text>

    <onUserInput>
        <script>
            userInput = currentUserInput();
            if ( userInput == "zero" )      {
                showIdle();
                jumpToLink("homePageLink");
                redrawDisplay();
            }
        </script>
    </onUserInput>

    <backgroundDisplay>
        <image  offsetXPC="0" offsetYPC="0" widthPC="100" heightPC="100">
                    <?php 
    echo XTREAMER_IMAGE_PATH;
    ?>
background/movies-black.jpg
        </image>
    </backgroundDisplay>
</mediaDisplay>

<homePageLink>
    <link>
        <?php 
    echo SERVER_HOST_AND_PATH . "php/index.php?action=viewWebsitesPage";
    ?>
    </link>
</homePageLink>
    <?php 
}
Example #15
0
/**
 */
function fetchAllMovieByLetters()
{
    $template = new HdboxTemplate();
    $letters = array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "0");
    foreach ($letters as $letter) {
        $template->addItem($letter, resourceString("goto_letter") . $letter, SCRAPER_URL . "index.php?letter=" . $letter, "");
    }
    $template->generateView(HdboxTemplate::VIEW_PAGE_NUMBERS);
}
Example #16
0
/**
 * Get given serie category pages, first page items or page number list.
 */
function fetchSerieCategoryItems($type, $category, $title)
{
    //Init template
    $template = new CinetubeTemplate();
    $template->setCategory($category);
    $template->setType($type);
    //If page equal "x" goto page number list, in other case process actual category page
    if (isset($_GET["page"]) && $_GET["page"] == "x") {
        $maxPages = $_GET["pages"];
        for ($i = 1; $i <= $maxPages; ++$i) {
            $template->addItem($i, resourceString("goto_page") . $i, SCRAPER_URL . "index.php?type=" . $type . URL_AMP . "cat=" . base64_encode($category) . URL_AMP . "page=" . $i . URL_AMP . "pages=" . $maxPages . URL_AMP . "PHPSESID=" . session_id(), "");
        }
        $template->generateView(CinetubeTemplate::VIEW_PAGE_NUMBERS);
    } else {
        if (!isset($_GET["page"])) {
            $pages = getPages($category);
            $template->setActualPage(1);
            $template->setMaxPages($pages[1]);
            $content = $pages[0];
        } else {
            $template->setActualPage($_GET["page"]);
            $template->setMaxPages($_GET["pages"]);
            $content = file_get_contents(CINETUBE_URL . $category . $_GET["page"] . ".html");
        }
        //Parse first page series
        $newlines = array("\t", "\n", "\r", "  ", "", "\v");
        $input = str_replace($newlines, "", $content);
        preg_match("/<ul class\\=\"ver_series_list( ver_series_list_puntos)?\">(.*)<\\/ul>/siU", $input, $divs);
        preg_match_all("/<li>(.*)<\\/li>/siU", $divs[0], $divs, PREG_SET_ORDER);
        //For new serie releases dont works
        if ($category != "series/") {
            if ($divs) {
                //$divs = $divs[0];
                foreach ($divs as $movie) {
                    $movie = $movie[1];
                    preg_match_all("/(<a href=\"(.*)\">)*\\s*<img\\s*src=\"(.*)\" alt=\"(.*)\"\\s(\\/)*>\\s*(<\\/a>)*|<p class\\=\"tit_ficha\">(.*)<\\/p>/siU", $movie, $info, PREG_SET_ORDER);
                    //Get info
                    $movieIcons = array();
                    foreach ($info as $key => $detail) {
                        if ($key == 0) {
                            if (strpos($detail[2], '"')) {
                                $movieLink = substr($detail[2], 0, strpos($detail[2], '"'));
                            } else {
                                $movieLink = $detail[2];
                            }
                            $movieThumbnail = html_entity_decode($detail[3]);
                        } else {
                            if (count($detail) == 8) {
                                $movieTitle = $detail[7];
                            } else {
                                if ($detail[4]) {
                                    if (!strpos($detail[4], "escarga")) {
                                        array_push($movieIcons, html_entity_decode($detail[4]));
                                    }
                                } else {
                                    //megavideo, veoh, tutv, google
                                    array_push($movieIcons, html_entity_decode(substr($detail[3], strrpos($detail[3], "/") + 1, strrpos($detail[3], "\\.") - 4)));
                                }
                            }
                        }
                    }
                    //Add video
                    $template->addItem($movieTitle, strtoupper(getArrayString($movieIcons) . ""), SCRAPER_URL . "index.php?type=ser" . URL_AMP . "item=" . base64_encode($movieLink) . URL_AMP . "title=" . base64_encode($title) . URL_AMP . "PHPSESID=" . session_id(), $movieThumbnail);
                }
            }
            $template->generateView(CinetubeTemplate::VIEW_SERIE, $title);
        } else {
            if ($divs) {
                //$divs = $divs[0];
                foreach ($divs as $movie) {
                    $movie = $movie[1];
                    preg_match_all("/<img src\\=\"(.*)\"(.*)<a class\\=\"tit_ficha\"(.*)href\\=\"(.*)\">(.*)<\\/a>(.*)<p class\\=\"tem_fich\">(.*)<\\/p>/siU", $movie, $info, PREG_SET_ORDER);
                    $info = $info[0];
                    if (strpos($info[7], "Cap")) {
                        $template->addItem(html_entity_decode($info[5]), $info[7], SCRAPER_URL . "index.php?type=" . $type . URL_AMP . "episodeName=" . base64_encode($info[7]) . URL_AMP . "episode=" . base64_encode($info[4]) . URL_AMP . "seasonNum=" . URL_AMP . "image=" . base64_encode($info[1]) . URL_AMP . "serieTitle=" . base64_encode($info[5]) . URL_AMP . "PHPSESID=" . session_id(), $info[1]);
                    } else {
                    }
                }
            }
            $template->generateView(CinetubeTemplate::VIEW_SERIE, $title);
        }
    }
}
    /**
     * Generate rss page config header.
     */
    private function showHeader()
    {
        //Set change types
        switch ($this->showType) {
            case "all":
                $nextType = "movie";
                $previousType = "mixed";
                break;
            case "movie":
                $nextType = "serie";
                $previousType = "all";
                break;
            case "serie":
                $nextType = "documentary";
                $previousType = "movie";
                break;
            case "documentary":
                $nextType = "anime";
                $previousType = "serie";
                break;
            case "anime":
                $nextType = "mixed";
                $previousType = "documentary";
                break;
            case "mixed":
                $nextType = "all";
                $previousType = "anime";
                break;
        }
        ?>

<mediaDisplay name="photoView"
              rowCount="7" columnCount="3" drawItemText="no" showHeader="no" showDefaultInfo="no"
              menuBorderColor="0:0:0" sideColorBottom="-1:-1:-1" sideColorTop="-1:-1:-1"
              itemOffsetXPC="14" itemOffsetYPC="22.9" itemWidthPC="26" itemHeightPC="3.8"
              sliding="no" backgroundColor="-1:-1:-1" itemBorderColor="-1:-1:-1" imageBorderPC="0"
              idleImageXPC="90" idleImageYPC="5" idleImageWidthPC="5" idleImageHeightPC="8">
                          <?php 
        xVoDLoader();
        ?>
    <!-- IMAGE PUZZLE -->
    <image redraw="yes" offsetXPC="43.9" offsetYPC="71.6" widthPC="56.1" heightPC="6" backgroundColor="-1:-1:-1" >
                <?php 
        echo XTREAMER_IMAGE_PATH;
        ?>
background/websites_title.jpg
    </image>

    <!-- SELECTED ITEM LOGO -->
    <image redraw="yes" offsetXPC="1" offsetYPC="22.9" widthPC="10" heightPC="13" >
        <script>
            getItemInfo("thumbnailover");
        </script>
    </image>

    <!-- SELECTED WEBSITE ICON CONTENT TYPE -->
    <image redraw="yes" offsetXPC="47" offsetYPC="71.68" widthPC="3.8" heightPC="6" backgroundColor="-1:-1:-1" >
        <script>
            getItemInfo("image");
        </script>
    </image>
    <!-- SELECTED WEBSITE DESCRIPTION -->
    <text redraw="yes" backgroundColor="0:0:0" foregroundColor="0:154:205"
          offsetXPC="14.6" offsetYPC="59" widthPC="80" heightPC="7.6" fontSize="12" lines="2">
        <script>
            getItemInfo("description");
        </script>
    </text>
    <!-- SELECTED WEBSITE BOTTOM BAR TITLE -->
    <text redraw="yes" backgroundColor="-1:-1:-1" foregroundColor="0:0:0"
          offsetXPC="50" offsetYPC="67.4" widthPC="50" heightPC="14" fontSize="20" lines="1">
        <script>
            getItemInfo("subtitle");
        </script>
    </text>
    <!-- LOGO ICON HISTORY -->
    <image redraw="no" offsetXPC="5" offsetYPC="11.5" widthPC="2.25" heightPC="4" backgroundColor="-1:-1:-1" >
                <?php 
        echo XTREAMER_IMAGE_PATH;
        ?>
background/pgup_btn.png
    </image>

    <image redraw="no" offsetXPC="10" offsetYPC="11" widthPC="2.75" heightPC="5" backgroundColor="-1:-1:-1" >
                <?php 
        echo XTREAMER_IMAGE_PATH;
        ?>
img/all.png
    </image>
    <text redraw="no" backgroundColor="-1:-1:-1"
          foregroundColor="<?php 
        echo $this->showType == "all" ? "255:102:19" : "230:230:255";
        ?>
"
          offsetXPC="13" offsetYPC="11" widthPC="9" heightPC="5" fontSize="10" lines="1">
                      <?php 
        echo resourceString("header_menu_all") . "\n";
        ?>
    </text>

    <image redraw="no" offsetXPC="22" offsetYPC="11" widthPC="2.75" heightPC="5" backgroundColor="-1:-1:-1" >
                <?php 
        echo XTREAMER_IMAGE_PATH;
        ?>
img/movie.png
    </image>
    <text redraw="no" backgroundColor="-1:-1:-1"
          foregroundColor="<?php 
        echo $this->showType == "movie" ? "255:102:19" : "230:230:255";
        ?>
"
          offsetXPC="25" offsetYPC="11" widthPC="10" heightPC="5" fontSize="10" lines="1">
                      <?php 
        echo resourceString("header_menu_movies") . "\n";
        ?>
    </text>

    <image redraw="no" offsetXPC="35" offsetYPC="11" widthPC="2.75" heightPC="5" backgroundColor="-1:-1:-1" >
                <?php 
        echo XTREAMER_IMAGE_PATH;
        ?>
img/serie.png
    </image>
    <text redraw="no" backgroundColor="-1:-1:-1"
          foregroundColor="<?php 
        echo $this->showType == "serie" ? "255:102:19" : "230:230:255";
        ?>
"
          offsetXPC="38" offsetYPC="11" widthPC="9" heightPC="5" fontSize="10" lines="1">
                      <?php 
        echo resourceString("header_menu_series") . "\n";
        ?>
    </text>

    <image redraw="no" offsetXPC="47" offsetYPC="11" widthPC="2.75" heightPC="5" backgroundColor="-1:-1:-1" >
                <?php 
        echo XTREAMER_IMAGE_PATH;
        ?>
img/documentary.png
    </image>
    <text redraw="no" backgroundColor="-1:-1:-1"
          foregroundColor="<?php 
        echo $this->showType == "documentary" ? "255:102:19" : "230:230:255";
        ?>
"
          offsetXPC="50" offsetYPC="11" widthPC="12" heightPC="5" fontSize="10" lines="1">
                      <?php 
        echo resourceString("header_menu_documentaries") . "\n";
        ?>
    </text>

    <image redraw="no" offsetXPC="62" offsetYPC="11" widthPC="2.75" heightPC="5" backgroundColor="-1:-1:-1" >
                <?php 
        echo XTREAMER_IMAGE_PATH;
        ?>
img/anime.png
    </image>
    <text redraw="no" backgroundColor="-1:-1:-1"
          foregroundColor="<?php 
        echo $this->showType == "anime" ? "255:102:19" : "230:230:255";
        ?>
"
          offsetXPC="65" offsetYPC="11" widthPC="10" heightPC="5" fontSize="10" lines="1">
                      <?php 
        echo resourceString("header_menu_anime") . "\n";
        ?>
    </text>

    <image redraw="no" offsetXPC="75" offsetYPC="11" widthPC="2.75" heightPC="5" backgroundColor="-1:-1:-1" >
                <?php 
        echo XTREAMER_IMAGE_PATH;
        ?>
img/mixed.png
    </image>
    <text redraw="no" backgroundColor="-1:-1:-1"
          foregroundColor="<?php 
        echo $this->showType == "mixed" ? "255:102:19" : "230:230:255";
        ?>
"
          offsetXPC="78" offsetYPC="11" widthPC="10" heightPC="5" fontSize="10" lines="1">
                      <?php 
        echo resourceString("header_menu_mixed") . "\n";
        ?>
    </text>

    <image redraw="no" offsetXPC="92.5" offsetYPC="11.5" widthPC="2.25" heightPC="4" backgroundColor="-1:-1:-1" >
                <?php 
        echo XTREAMER_IMAGE_PATH;
        ?>
background/pgdn_btn.png
    </image>

    <!-- HEADER BUTTON TITLES -->
    <text redraw="no" backgroundColor="-1:-1:-1" foregroundColor="255:255:255"
          offsetXPC="5.95" offsetYPC="2.6" widthPC="12" heightPC="2.4" fontSize="12" lines="1">
                      <?php 
        echo resourceString("header_menu_home") . "\n";
        ?>
    </text>
    <text redraw="no" backgroundColor="-1:-1:-1" foregroundColor="255:255:255"
          offsetXPC="20" offsetYPC="2.6" widthPC="30" heightPC="2.4" fontSize="12" lines="1">
                      <?php 
        echo resourceString("header_menu_websites_mark_favourite") . "\n";
        ?>
    </text>

    <itemDisplay>
        <text redraw="yes" offsetXPC="1" offsetYPC="1" widthPC="98" heightPC="98">
            <backgroundColor>
                <script>
                    focusidx = getFocusItemIndex();
                    if ( focusidx == getItemInfo(-1,"itemid") ){
                        "255:192:192";
                    }else{
                        "32:32:32";
                    }
                </script>
            </backgroundColor>
        </text>
        <text redraw="yes" offsetXPC="1" offsetYPC="1" widthPC="1" heightPC="6" backgroundColor="0:0:0">
        </text>
        <text redraw="yes" offsetXPC="98" offsetYPC="1" widthPC="1" heightPC="6" backgroundColor="0:0:0">
        </text>
        <text redraw="yes" offsetXPC="1" offsetYPC="93" widthPC="1" heightPC="6" backgroundColor="0:0:0">
        </text>
        <text redraw="yes" offsetXPC="98" offsetYPC="93" widthPC="1" heightPC="6" backgroundColor="0:0:0">
        </text>
        <text redraw="yes" offsetXPC="36" offsetYPC="0" widthPC="60" heightPC="100" fontSize="12" lines="1"
              backgroundColor="-1:-1:-1" foregroundColor="255:255:255">
            <script>
                getItemInfo(-1,"title");
            </script>
            <foregroundColor>
                <script>
                    if ( focusidx == getItemInfo(-1,"itemid") ){
                        "0:0:0";
                    }else{
                        "255:255:255";
                    }
                </script>
            </foregroundColor>
        </text>
        <!-- ITEM FAVOURITE ICON -->
                <?php 
        $connection = ConnectionFactory::getDataConnection();
        $websites = $connection->getWebsiteFavourites();
        foreach ($websites as $id => $favourite) {
            switch ($favourite->getType()) {
                case "movie":
                    $movie = $id;
                    break;
                case "serie":
                    $serie = $id;
                    break;
                case "documentary":
                    $documentary = $id;
                    break;
                case "anime":
                    $anime = $id;
                    break;
            }
        }
        $condition = '( getItemInfo(-1,"scraperid") == "' . $movie . '" ) || ' . '( getItemInfo(-1,"scraperid") == "' . $serie . '" ) || ' . '( getItemInfo(-1,"scraperid") == "' . $documentary . '" ) || ' . '( getItemInfo(-1,"scraperid") == "' . $anime . '" )';
        ?>
        <image redraw="no" offsetXPC="2" offsetYPC="4" widthPC="8" heightPC="92">
            <script>
                if( <?php 
        echo $condition;
        ?>
 )
                "<?php 
        echo XTREAMER_IMAGE_PATH;
        ?>
img/star.png";
                else
                    "";
            </script>
        </image>
        <!-- ITEM CONTENT TYPE ICON -->
        <image redraw="no" offsetXPC="12" offsetYPC="0" widthPC="10" heightPC="100">
            <script>
                getItemInfo(-1,"image");
            </script>
        </image>
        <!-- ITEM CONTENT LANGUAGE FLAG ICON -->
        <text redraw="no" offsetXPC="24" offsetYPC="2" widthPC="10" heightPC="96" fontSize="12">
            <script>
                getItemInfo(-1,"scraperlanguage");
            </script>
            <foregroundColor>
                <script>
                    if ( focusidx == getItemInfo(-1,"itemid") ){
                        "0:0:0";
                    }else{
                        "255:255:255";
                    }
                </script>
            </foregroundColor>
            <backgroundColor>
                <script>
                    if ( focusidx == getItemInfo(-1,"itemid") ){
                        "192:192:255";
                    }else{
                        "64:64:255";
                    }
                </script>
            </backgroundColor>
        </text>
    </itemDisplay>

    <onUserInput>
        <script>
            userInput = currentUserInput();
            if( userInput == "one" ){
                showIdle();
                result = getURL("<?php 
        echo SERVER_HOST_AND_PATH . "php/index.php?action=" . SaveFavouriteWebsiteAction::getActionName() . URL_AMP . "id=";
        ?>
" + getItemInfo("scraperid"));
                jumpToLink("websitesPageLink");
                redrawDisplay();
            }
            if(userInput == "zero"){
                showIdle();
                jumpToLink("homePageLink");
                redrawDisplay();
            }
            if(userInput == "pageup"){
                showIdle();
                changeType = "<?php 
        echo $previousType;
        ?>
";
                jumpToLink("websitesChangeTypeLink");
                redrawDisplay();
            }
            if(userInput == "pagedown"){
                showIdle();
                changeType = "<?php 
        echo $nextType;
        ?>
";
                jumpToLink("websitesChangeTypeLink");
                redrawDisplay();
            }
        </script>
    </onUserInput>

    <backgroundDisplay>
        <image offsetXPC="0" offsetYPC="0" widthPC="100" heightPC="100">
                    <?php 
        echo XTREAMER_IMAGE_PATH;
        ?>
background/websites.jpg
        </image>
    </backgroundDisplay>

</mediaDisplay>

<websitesPageLink>
    <link>
            <?php 
        echo SERVER_HOST_AND_PATH . "php/index.php?action=" . ViewWebsitesPageAction::getActionName();
        ?>
    </link>
</websitesPageLink>

<websitesChangeTypeLink>
    <link>
    <script>
        "<?php 
        echo SERVER_HOST_AND_PATH . "php/index.php?action=" . ViewWebsitesPageAction::getActionName() . URL_AMP . "type=";
        ?>
" + changeType;
    </script>
    </link>
</websitesChangeTypeLink>

<homePageLink>
    <link>
            <?php 
        echo SERVER_HOST_AND_PATH . "php/index.php";
        ?>
    </link>
</homePageLink>

        <?php 
    }
Example #18
0
/**
 */
function fetchMovieCategoryItems($category, $title, $search = null)
{
    $template = new MarocTemplate();
    $template->setCategory($category);
    //Check for name ordered
    if (!strpos($category, "orderby")) {
        $category = $category . "&orderby=titleA";
    }
    //If page equal "x" goto page number list, in other case process actual category page
    if (isset($_GET["page"]) && $_GET["page"] == "x") {
        $maxPages = $_GET["pages"];
        for ($i = 1; $i <= $maxPages; ++$i) {
            $template->addItem($i, resourceString("goto_page") . $i, SCRAPER_URL . "index.php?cat=" . base64_encode($category) . URL_AMP . "page=" . $i . URL_AMP . "pages=" . $maxPages . URL_AMP . "PHPSESID=" . session_id(), "");
        }
        $template->generateView(MarocTemplate::VIEW_PAGE_NUMBERS);
    } else {
        if (!isset($_GET["page"])) {
            $pages = getPages($category);
            $template->setActualPage(1);
            $template->setMaxPages($pages[1]);
            $content = $pages[0];
        } else {
            $template->setActualPage($_GET["page"]);
            $template->setMaxPages($_GET["pages"]);
            $content = @file_get_contents($category . "&start=" . ((int) $_GET["page"] - 1) * 10 . "/");
            $newlines = array("\t", "\n", "\r", "  ", "", "\v");
            $content = str_replace($newlines, "", html_entity_decode($content, ENT_QUOTES, "UTF-8"));
        }
        //Get movies block
        $content = strstr($content, "<!-- Start link loop -->");
        $content = substr($content, 0, strpos($content, "<!-- End link loop -->"));
        preg_match_all("/<div style=\"float: left; padding: 0 4px 4px 0;\">(.*)<a href=\"(.*)\" target=\"\"><img src=\"(.*)\"(.*)title=\"(.*)\"/siU", $content, $links, PREG_SET_ORDER);
        //var_dump($links);
        if ($links) {
            foreach ($links as $link) {
                $template->addItem($link[5], $movieDescription, SCRAPER_URL . "index.php?title=" . base64_encode($link[5]) . URL_AMP . "item=" . base64_encode($link[2]) . URL_AMP . "image=" . base64_encode($link[3]) . URL_AMP . "PHPSESID=" . session_id(), $link[3]);
            }
        }
        $template->generateView(MarocTemplate::VIEW_MOVIE, "");
    }
}
    /**
     * -------------------------------------------------------------------------
     */
    private function showViewHeader()
    {
        ?>
<mediaDisplay name="threePartsView"
              showDefaultInfo="no" drawItemText="no" showHeader="no" bottomYPC="0" itemGap="0"
              itemPerPage="8" fontSize="14" itemBorderColor="-1:-1:-1" menuBorderColor="-1:-1:-1"
              itemImageXPC="42.86" itemImageYPC="54" itemImageWidthPC="48.40" itemImageHeightPC="6"
              itemXPC="42.86" itemYPC="54" itemWidthPC="48.40" itemHeightPC="6" capWidthPC="0"
              imageFocus="null" imageUnFocus="null" imageParentFocus="null"
              unFocusFontColor="-1:-1:-1" focusFontColor="-1:-1:-1" itemBackgroundColor="-1:-1:-1" mainPartColor="-1:-1:-1"
              idleImageXPC="90" idleImageYPC="5" idleImageWidthPC="5" idleImageHeightPC="8"
              backgroundColor="-1:-1:-1" imageBorderPC="0">
                          <?php 
        xVoDLoader();
        ?>

    <!-- HEADER BUTTON TITLES -->
    <text redraw="no" backgroundColor="-1:-1:-1" foregroundColor="255:255:255"
          offsetXPC="5.95" offsetYPC="2.6" widthPC="12" heightPC="2.4" fontSize="12" lines="1">
                      <?php 
        echo resourceString("header_menu_home") . "\n";
        ?>
    </text>

    <!-- FIRST OPTION INSERT MEGAVIDEO ID TO PLAY -->
    <text redraw="no"
          backgroundColor="-1:-1:-1" foregroundColor="255:255:255" align="center"
          offsetXPC="9.82" offsetYPC="13" widthPC="26.31" heightPC="6.60" fontSize="14" lines="2">
        <script>
            "<?php 
        echo resourceString("megavideo_scraper_btn_play");
        ?>
";
        </script>
    </text>

    <!-- SECOND OPTION INSERT AND SAVE MEGAVIDEO ID TO PLAY -->
    <text redraw="no"
          backgroundColor="-1:-1:-1" foregroundColor="255:255:255" align="center"
          offsetXPC="9.82" offsetYPC="28.5" widthPC="26.31" heightPC="6.60" fontSize="14" lines="2">
        <script>
            "<?php 
        echo resourceString("megavideo_scraper_btn_play_save");
        ?>
";
        </script>
    </text>

            <?php 
        if ($this->megavideoLink) {
            ?>
    <!-- Show link info -->
    <text redraw="no" backgroundColor="-1:-1:-1" foregroundColor="26:115:204" align="right"
          offsetXPC="42.86" offsetYPC="15" widthPC="14" heightPC="3.5" fontSize="12" lines="1">
        <script>
            "<?php 
            echo resourceString("megavideo_scraper_des_title");
            ?>
";
        </script>
    </text>
    <text redraw="no" backgroundColor="-1:-1:-1" foregroundColor="0:0:0"
          offsetXPC="58" offsetYPC="15" widthPC="35" heightPC="6" fontSize="12" lines="2">
        <script>
            "<?php 
            echo $this->megavideoLink->getTitle();
            ?>
";
        </script>
    </text>

    <text redraw="no" backgroundColor="-1:-1:-1" foregroundColor="26:115:204" align="right"
          offsetXPC="42.86" offsetYPC="22" widthPC="14" heightPC="3.5" fontSize="12" lines="1">
        <script>
            "<?php 
            echo resourceString("megavideo_scraper_des_description");
            ?>
";
        </script>
    </text>
    <text redraw="no" backgroundColor="-1:-1:-1" foregroundColor="0:0:0"
          offsetXPC="58" offsetYPC="22" widthPC="35" heightPC="12" fontSize="12" lines="4">
        <script>
            "<?php 
            echo $this->megavideoLink->getDescription();
            ?>
";
        </script>
    </text>

    <text redraw="no" backgroundColor="-1:-1:-1" foregroundColor="26:115:204" align="right"
          offsetXPC="42.86" offsetYPC="34" widthPC="14" heightPC="5" fontSize="12" lines="1">
        <script>
            "<?php 
            echo resourceString("megavideo_scraper_des_user");
            ?>
";
        </script>
    </text>
    <text redraw="no" backgroundColor="-1:-1:-1" foregroundColor="0:0:0"
          offsetXPC="58" offsetYPC="34" widthPC="30" heightPC="5" fontSize="12" lines="1">
        <script>
            "<?php 
            echo $this->megavideoLink->getUser();
            ?>
";
        </script>
    </text>

    <text redraw="no" backgroundColor="-1:-1:-1" foregroundColor="26:115:204" align="right"
          offsetXPC="42.86" offsetYPC="40" widthPC="14" heightPC="5" fontSize="12" lines="1">
        <script>
            "<?php 
            echo resourceString("megavideo_scraper_des_views");
            ?>
";
        </script>
    </text>
    <text redraw="no" backgroundColor="-1:-1:-1" foregroundColor="0:0:0"
          offsetXPC="58" offsetYPC="40" widthPC="30" heightPC="5" fontSize="12" lines="1">
        <script>
            "<?php 
            echo $this->megavideoLink->getViews();
            ?>
";
        </script>
    </text>

    <text redraw="no" backgroundColor="-1:-1:-1" foregroundColor="26:115:204" align="right"
          offsetXPC="42.86" offsetYPC="46" widthPC="14" heightPC="5" fontSize="12" lines="1">
        <script>
            "<?php 
            echo resourceString("megavideo_scraper_des_date");
            ?>
";
        </script>
    </text>
    <text redraw="no" backgroundColor="-1:-1:-1" foregroundColor="0:0:0"
          offsetXPC="58" offsetYPC="46" widthPC="30" heightPC="5" fontSize="12" lines="1">
        <script>
            "<?php 
            echo $this->megavideoLink->getDateAdded();
            ?>
";
        </script>
    </text>

    <image redraw="no" offsetXPC="72" offsetYPC="35" widthPC="18" heightPC="17.72" backgroundColor="-1:-1:-1">
        <script>
            "<?php 
            echo $this->megavideoLink->getImage();
            ?>
";
        </script>
    </image>
                <?php 
        }
        ?>

    <!-- PLAY ITEM COMPONENTS -->
    <image redraw="yes" offsetXPC="42.86" offsetYPC="56" widthPC="48.40" heightPC="6" backgroundColor="240:237:230">
        <script>
            "<?php 
        echo XTREAMER_IMAGE_PATH;
        ?>
background/megavideo_bg_bar.jpg";
        </script>
    </image>
    <text redraw="yes" backgroundColor="-1:-1:-1" foregroundColor="128:0:0"  align="center"
          offsetXPC="45" offsetYPC="56.24" widthPC="43.56" heightPC="3" fontSize="12" lines="1">
        <script>
            "<?php 
        echo resourceString("megavideo_scraper_des_button");
        ?>
";
        </script>
    </text>
    <text redraw="yes" backgroundColor="-1:-1:-1" foregroundColor="0:0:0" align="center"
          offsetXPC="45" offsetYPC="59.24" widthPC="43.56" heightPC="1.8" fontSize="10" lines="1">
        <script>
            getItemInfo(-1,"title");
        </script>
    </text>

    <itemDisplay>
    </itemDisplay>

    <onUserInput>
        <script>
            userInput = currentUserInput();
            if(userInput == "zero"){
                showIdle();
                jumpToLink("homePageLink");
                redrawDisplay();
            }
        </script>
    </onUserInput>

    <backgroundDisplay>
        <image  offsetXPC="0" offsetYPC="0" widthPC="100" heightPC="100">
                    <?php 
        echo XTREAMER_IMAGE_PATH;
        ?>
background/megavideo_bg.jpg
        </image>
    </backgroundDisplay>

</mediaDisplay>
<homePageLink>
    <link>
            <?php 
        echo SCRAPER_URL . "index.php?PHPSESID" . session_id();
        ?>
    </link>
</homePageLink>
        <?php 
    }