function getChildCategories($categories, $id, $recursive = true)
{
    if ($categories == NULL) {
        $categories = fetchCategories();
    }
    $n = count($categories);
    $child = array();
    for ($i = 0; $i < $n; $i++) {
        $catId = $categories[$i]['cat_id'];
        $parentId = $categories[$i]['cat_parent_id'];
        if ($parentId == $id) {
            $child[] = $catId;
            if ($recursive) {
                $child = array_merge($child, getChildCategories($categories, $catId));
            }
        }
    }
    return $child;
}
Beispiel #2
0
text-decoration: none;
color: #666666;
width:160px;
}

#vertmenu ul li a:hover, #vertmenu ul li a:focus {
color: #000000;
background-color: #eeeeee;
}

</style><?php 
if (!defined('WEB_ROOT')) {
    exit;
}
// get all categories
$categories = fetchCategories();
// format the categories for display
$categories = formatCategories($categories, $catId);
?>
<ul>
<font size="+2">
<li style="line-height:35px"><a href="<?php 
echo $_SERVER['PHP_SELF'];
?>
" style="text-decoration:none">All Category</a></li>
<?php 
foreach ($categories as $category) {
    extract($category);
    // now we have $cat_id, $cat_parent_id, $cat_name
    $level = $cat_parent_id == 0 ? 1 : 2;
    $url = $_SERVER['PHP_SELF'] . "?c={$cat_id}";
                        $type = $_GET["type"];
                        $category = base64_decode($_GET["cat"]);
                        $title = base64_decode($_GET["title"]);
                        switch ($type) {
                            case "mov":
                                fetchMovieCategoryItems($type, $category, $title);
                                break;
                            case "ser":
                                fetchSerieCategoryItems($type, $category, $title);
                                break;
                        }
                    } else {
                        if (isset($_GET["type"])) {
                            // Category list view ---------------------
                            $type = $_GET["type"];
                            fetchCategories($type);
                        } else {
                            // Show home principal view ---------------------------------------
                            fetchHome();
                        }
                    }
                }
            }
        }
    }
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
function fetchHome()
{
        if (isset($_GET["serie"])) {
            $serie = base64_decode($_GET["serie"]);
            $title = base64_decode($_GET["title"]);
            fetchSerieEpisodes($serie, $title);
        } else {
            if (isset($_GET["episode"])) {
                $episode = base64_decode($_GET["episode"]);
                $title = base64_decode($_GET["title"]);
                fetchSerieSeasonEpisodeLinks($episode, $title);
            } else {
                if (isset($_GET["host"])) {
                    $host = base64_decode($_GET["host"]);
                    $link = base64_decode($_GET["link"]);
                    fetchPlayEpisode($host, $link);
                } else {
                    fetchCategories();
                }
            }
        }
    }
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
/**
 * Show initial categories.
 */
function fetchCategories()
{
    $template = new AnivideSeriesTemplate();
    $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", "~");
Beispiel #5
0
	<!-- Navigationsleiste -->
	<div class="navigation" id="navigationSkip">
		<a href="index.html" class="navlink">Home</a>
		<a href="about.php" class="navlink">About</a>
		<a href="about2.html" class="navlink">Company</a>
		<a href="news.php" class="navlink">News</a>
		<a href="article.html" class="navlink">Article</a>
        <a href="backend.php" class="navlink">Backend</a>
	</div>
</header>
	<!-- Linkes Menu -->
	<div id="menuSkip" class="menu">
		<button onclick="toogleDiv('menu')"><img src="buttons/button1.svg" alt="button1"/></button>
		<ul>
            <?php 
$list = fetchCategories();
$length = count($list);
for ($i = 0; $i < $length; $i += 1) {
    echo "<li>\r\n                            <a href=\"article.html\">" . $list[$i][1] . "</a><br />";
    $subList = fetchNewsByCategories($list[$i][0]);
    for ($z = 0; $z < count($subList); $z += 1) {
        echo "<a href=\"article.html\">" . $subList[$z][3] . "</a><br />";
    }
    echo "</li>";
}
?>
		</ul>
	</div>
	<!-- Aufeinander Folgende Articles -->
	<div id="articlesSkip" class="newsflash">
        <!-- Erstellt die Reihe an Artikeln. -->