Exemplo n.º 1
0
        // Always append session id if cache is enabled
        $old_session_mode = $site_sess->mode;
        $site_sess->mode = 'get';
        // Set $cat_id to 0 to ensure that no category is selected
        $category_dropdown_selfjump = get_category_dropdown(0, 1);
        $site_sess->mode = $old_session_mode;
        save_cache_file($cache_id, $category_dropdown_selfjump);
    }
}
$site_template->register_vars("category_dropdown_selfjump", $category_dropdown_selfjump);
unset($category_dropdown_selfjump);
// -------------------------------------
if (!$cache_enable) {
    $category_dropdown_form = $site_template->parse_template("category_dropdown_form");
} else {
    $cache_id = create_cache_id('data.dropdown_form', array($user_info[$user_table_fields['user_id']], $config['template_dir'], $config['language_dir']));
    if (!($category_dropdown_form = get_cache_file($cache_id))) {
        // Always append session id if cache is enabled
        $old_session_mode = $site_sess->mode;
        $site_sess->mode = 'get';
        $category_dropdown_form = $site_template->parse_template("category_dropdown_form");
        $site_sess->mode = $old_session_mode;
        save_cache_file($cache_id, $category_dropdown_form);
    }
}
$site_template->register_vars("category_dropdown_form", $category_dropdown_form);
unset($category_dropdown_form);
//-----------------------------------------------------
//--- Random Image ------------------------------------
//-----------------------------------------------------
$random_image = defined("SHOW_RANDOM_IMAGE") && SHOW_RANDOM_IMAGE == 0 ? "" : get_random_image();
Exemplo n.º 2
0
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/
$main_template = 'top';
define('GET_CACHES', 1);
define('ROOT_PATH', './');
define('MAIN_SCRIPT', __FILE__);
include ROOT_PATH . 'global.php';
require ROOT_PATH . 'includes/sessions.php';
$user_access = get_permission();
include ROOT_PATH . 'includes/page_header.php';
$cache_id = create_cache_id('page.top', array($user_info[$user_table_fields['user_id']], $cat_id, $config['template_dir'], $config['language_dir']));
if (!$cache_page_top || !($content = get_cache_file($cache_id))) {
    if ($cache_page_top) {
        // Always append session id if cache is enabled
        $old_session_mode = $site_sess->mode;
        $site_sess->mode = 'get';
    }
    ob_start();
    $cat_match_sql = $cat_id && check_permission("auth_viewcat", $cat_id) ? "AND i.cat_id = '{$cat_id}' " : "";
    $register_array = array();
    $cat_id_sql = get_auth_cat_sql("auth_viewcat", "NOTIN");
    // Rating
    $sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_rating, i.image_votes, c.cat_name" . get_user_table_field(", u.", "user_name") . "\n        FROM (" . IMAGES_TABLE . " i, " . CATEGORIES_TABLE . " c)\n        LEFT JOIN " . USERS_TABLE . " u ON (" . get_user_table_field("u.", "user_id") . " = i.user_id)\n        WHERE i.image_active = 1 AND i.cat_id NOT IN ({$cat_id_sql}) AND i.cat_id = c.cat_id\n        {$cat_match_sql}\n        ORDER BY i.image_rating DESC, i.image_name ASC\n        LIMIT 10";
    $result = $site_db->query($sql);
    $top_list = array();
    $i = 1;
Exemplo n.º 3
0
    if (!is_remote($file_name)) {
        global $script_url;
        $url = $script_url . '/' . $url;
    }
    return str_replace('./', '', $url);
}
function get_rss_enclosure($file_name, $image_type, $cat_id)
{
    if (!get_file_path($file_name, $image_type, $cat_id, 0, 0)) {
        return array();
    }
    $file = get_file_path($file_name, $image_type, $cat_id, 0, 1);
    $url = get_file_url($file_name, $image_type, $cat_id);
    return array('url' => $url, 'length' => @filesize($file), 'type' => get_mime_content_type($file));
}
$cache_id = create_cache_id('page.rss', array($user_info[$user_table_fields['user_id']], $action, $image_id, $cat_id, $num_items));
if (!$cache_page_rss || !($content = get_cache_file($cache_id))) {
    $old_session_mode = $site_sess->mode;
    $site_sess->mode = 'cookie';
    ob_start();
    $rss_title = format_rss_text($config['site_name']);
    $rss_link = $site_sess->url($script_url);
    $rss_desc = format_rss_text($config['site_name']);
    $rss_lang = "";
    $rss_image = array();
    $rss_ttl = $cache_page_rss ? $cache_lifetime : 0;
    $rss_cat = array();
    $rss_items = array();
    switch ($action) {
        case 'comments':
            if (!$image_id) {
Exemplo n.º 4
0
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/
$templates_used = 'categories,category_bit,thumbnail_bit';
$main_template = 'categories';
define('GET_CACHES', 1);
define('ROOT_PATH', './');
define('MAIN_SCRIPT', __FILE__);
include ROOT_PATH . 'global.php';
require ROOT_PATH . 'includes/sessions.php';
$user_access = get_permission();
include ROOT_PATH . 'includes/page_header.php';
if (!$cat_id || !isset($cat_cache[$cat_id]) || !check_permission("auth_viewcat", $cat_id)) {
    redirect("index.php");
}
$cache_id = create_cache_id('page.categories', array($user_info[$user_table_fields['user_id']], $cat_id, $page, $perpage, isset($user_info['lightbox_image_ids']) ? substr(md5($user_info['lightbox_image_ids']), 0, 8) : 0, $config['template_dir'], $config['language_dir']));
if (!$cache_page_categories || !($content = get_cache_file($cache_id))) {
    // Always append session id if cache is enabled
    if ($cache_page_categories) {
        $old_session_mode = $site_sess->mode;
        $site_sess->mode = 'get';
    }
    ob_start();
    //-----------------------------------------------------
    //--- SEO variables -----------------------------------
    //-----------------------------------------------------
    $site_template->register_vars(array('prepend_head_title' => $cat_cache[$cat_id]['cat_name'] . " - "));
    //-----------------------------------------------------
    //--- Show Categories ---------------------------------
    //-----------------------------------------------------
    if (!check_permission("auth_upload", $cat_id)) {