예제 #1
0
<?php

/* 
	Header Include include.

	$title -> The page title of serving webpage, if not set Default value will be printed.
	$template -> Used to load Custome CSS/JS or any additional files. If not set Default styles will only be loaded.
*/
$template = 0;
$current_cat_id = category_id_from_url($url);
$category_data = category_data($current_cat_id);
$post_per_page = $category_data->cat_list_size;
$list_template = $category_data->cat_list_template;
if (empty($_GET["page"]) == true && isset($_GET["page"]) == false) {
    $page = 0;
    $start = 0;
    $title = $category_data->cat_name;
    $description = $category_data->cat_desc;
} else {
    $page = $_GET["page"];
    $start = $page * $post_per_page;
    //Sets the starting post from the page number
    if ($page < 2) {
        $page = 0;
        $start = 0;
    }
    $title = $category_data->cat_name . " : - Page -" . $page;
    $description = $category_data->cat_desc . " - Page -" . $page;
}
$keywords = $category_data->cat_keywords;
include '_includes/header.php';
예제 #2
0
function categories_list($name = "All Articles")
{
    /**
    *  Last Published Article
    *
    * Returns the unique ID of last Published article according to calender
    *
    * Arguments ( $selection , <category> )
    * --------------------------------------
    *
    * $name 		 -> Url for 
    *
    **/
    $data = array();
    $query = "SELECT * FROM categories WHERE PARENT_SEC = 0000 AND ACTIVE = 1";
    $data = mysql_query($query);
    echo '<ul class="cat-list">';
    while ($category_data = mysql_fetch_array($data, MYSQL_ASSOC)) {
        $cat_data = category_data($category_data['SL_NO']);
        echo '			<li> <a href="' . static_url('main', 1) . $cat_data->cat_url . '"';
        if ($name == $cat_data->cat_name) {
            echo 'class = "active" ';
        }
        echo '>' . $cat_data->cat_name . '</a></li>';
    }
    echo '</ul>';
}