示例#1
0
function render_page($template)
{
    global $dir_path, $theme_path, $header_links, $admin_links, $copyright, $start, $limit, $id, $type, $category;
    $template = file_get_contents($dir_path . $theme_path . "templates/" . $template);
    if (!isset($_SESSION['identity'])) {
        $admin_links = NULL;
    }
    if (@$type == "blog") {
        $item = render_single_blog($id);
    } else {
        $item = render_single_article($id);
    }
    $search = array('<$css_path$>', '<$image_path$>', '<$misc_path$>', '<$header_links$>', '<$admin_links$>', '<$blogs$>', '<$copyright$>', '<$item$>', '<$comments$>', '<$downloads$>', '<$links$>', '<$articles$>', '<$id$>', '<$type$>');
    $replace = array($dir_path . $theme_path . "stylesheets/", $dir_path . $theme_path . "images/", $dir_path . $theme_path . "misc/", $header_links, $admin_links, render_many_blogs($start, $limit, $blog), $copyright, $item, render_comments($id, $type), render_downloads($id, $category), render_links($id, $category), render_articles($id, $category), $id, $type);
    $template = str_replace($search, $replace, $template);
    print $template;
}
示例#2
0
    $info['download_nav'] = makepagenav($_GET['rowstart'], $dl_settings['download_pagination'], $info['download_max_rows'], 3, $page_nav_link);
}
if (!empty($info['download_rows'])) {
    while ($data = dbarray($result)) {
        $data = array_merge($data, parseInfo($data));
        $info['download_item'][$data['download_id']] = $data;
    }
}
$author_result = dbquery("SELECT b.download_title, b.download_user, count(b.download_id) as download_count, u.user_id, u.user_name, u.user_status\n\t\t\t\tFROM " . DB_DOWNLOADS . " b\n\t\t\t\tINNER JOIN " . DB_USERS . " u on (b.download_user = u.user_id)\n\t\t\t\tGROUP BY b.download_user ORDER BY b.download_user ASC\n\t\t\t\t");
if (dbrows($author_result)) {
    while ($at_data = dbarray($author_result)) {
        $active = isset($_GET['author']) && $_GET['author'] == $at_data['download_user'] ? 1 : 0;
        $info['download_author'][$at_data['download_user']] = array('title' => $at_data['user_name'], 'link' => INFUSIONS . "downloads/downloads.php?author=" . $at_data['download_user'], 'count' => $at_data['download_count'], 'active' => $active);
    }
}
render_downloads($info);
require_once THEMES . "templates/footer.php";
/**
 * Returns Downloads Category Hierarchy Tree Data
 * @return array
 */
function get_downloadCat()
{
    return \PHPFusion\Downloads\Functions::get_downloadCatsData();
}
/**
 * Get Downloads Hierarchy Index
 * @return array
 */
function get_downloadCatsIndex()
{