mode; $site_sess->mode = 'get'; } ob_start(); //----------------------------------------------------- //--- Show Categories --------------------------------- //----------------------------------------------------- if (!check_permission("auth_upload", $cat_id)) { $upload_url = ""; $upload_button = "\"\""; } else { $upload_url = $site_sess->url(ROOT_PATH."member.php?action=uploadform&".URL_CAT_ID."=".$cat_id); $upload_button = "\"\""; } $random_cat_image = (defined("SHOW_RANDOM_IMAGE") && SHOW_RANDOM_IMAGE == 0) ? "" : get_random_image($cat_id); $site_template->register_vars(array( "categories" => get_categories($cat_id), "cat_name" => format_text($cat_cache[$cat_id]['cat_name'], 2), "cat_description" => format_text($cat_cache[$cat_id]['cat_description'], 1, 0, 1), "cat_hits" => $cat_cache[$cat_id]['cat_hits'], "upload_url" => $upload_url, "upload_button" => $upload_button, "random_cat_image" => $random_cat_image )); unset($random_cat_image); //----------------------------------------------------- //--- Show Images ------------------------------------- //----------------------------------------------------- $site_template->register_vars(array( "has_rss" => true, "rss_title" => "RSS Feed: ".format_text($cat_cache[$cat_id]['cat_name'], 2)." (".str_replace(':', '', $lang['new_images']).")", "rss_url" => $script_url."/rss.php?action=images&".URL_CAT_ID."=".$cat_id )); $num_rows_all = (isset($cat_cache[$cat_id]['num_images'])) ? $cat_cache[$cat_id]['num_images'] : 0; $link_arg = $site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$cat_id); include(ROOT_PATH.'includes/paging.php'); $getpaging = new Paging($page, $perpage, $num_rows_all, $link_arg); $offset = $getpaging->get_offset(); $site_template->register_vars(array( "paging" => $getpaging->get_paging(), "paging_stats" => $getpaging->get_paging_stats() )); $imgtable_width = ceil((intval($config['image_table_width'])) / $config['image_cells']); if ((substr($config['image_table_width'], -1)) == "%") { $imgtable_width .= "%"; } $additional_sql = ""; if (!empty($additional_image_fields)) { foreach ($additional_image_fields as $key => $val) { $additional_sql .= ", i.".$key; } } $sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name")." FROM (".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c) LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id) WHERE i.image_active = 1 AND i.cat_id = $cat_id AND c.cat_id = i.cat_id ORDER BY ".$config['image_order']." ".$config['image_sort'].", i.image_id ".$config['image_sort']." LIMIT $offset, $perpage"; $result = $site_db->query($sql); $num_rows = $site_db->get_numrows($result); if (!$num_rows) { $thumbnails = ""; $msg = $lang['no_images']; } else { $thumbnails = "\n"; $count = 0; $bgcounter = 0; while ($image_row = $site_db->fetch_array($result)){ if ($count == 0) { $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2; $thumbnails .= "\n"; } $thumbnails .= "\n"; $count++; if ($count == $config['image_cells']) { $thumbnails .= "\n"; $count = 0; } } // end while if ($count > 0) { $leftover = ($config['image_cells'] - $count); if ($leftover > 0) { for ($i = 0; $i < $leftover; $i++){ $thumbnails .= "\n"; } $thumbnails .= "\n"; } } $thumbnails .= "
\n"; show_image($image_row); $thumbnails .= $site_template->parse_template("thumbnail_bit"); $thumbnails .= "\n
\n \n
\n"; } //end else $site_template->register_vars("thumbnails", $thumbnails); unset($thumbnails); //----------------------------------------------------- //--- Clickstream ------------------------------------- //----------------------------------------------------- $clickstream = "url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."".$config['category_separator'].get_category_path($cat_id).""; //----------------------------------------------------- //--- Print Out --------------------------------------- //----------------------------------------------------- $site_template->register_vars(array( "msg" => $msg, "clickstream" => $clickstream )); $site_template->print_template($site_template->parse_template($main_template)); $content = ob_get_contents(); ob_end_clean(); if ($cache_page_categories) { // Reset session mode $site_sess->mode = $old_session_mode; save_cache_file($cache_id, $content); } } // end if get_cache_file() echo $content; //Update Category Hits if ($user_info['user_level'] != ADMIN && $page == 1) { $sql = "UPDATE ".CATEGORIES_TABLE." SET cat_hits = cat_hits + 1 WHERE cat_id = $cat_id"; $site_db->query($sql); } include(ROOT_PATH.'includes/page_footer.php'); ?>