Hi nochmal.
Erweiterung des counterupdates. Es kam bei dem ein oder anderen zu Problemen, welche Dateien aus dem "BIG" Ordner darstellen. Mit dieser couterupdate.php ist es möglich, sowohl als auch den HIT Counter von 4images anzusteuern.
<?php
define('GET_CACHES', 1);
define('ROOT_PATH', './');
include(ROOT_PATH.'global.php');
require(ROOT_PATH.'includes/sessions.php');
include(ROOT_PATH.'includes/page_header.php');
$image_thumb_file = $HTTP_GET_VARS['image_name'];
$cat_id = preg_replace("/http(.*?)\/data\/media\/([0-9]+)\/(\w+).(\w+)/esi", "('\\2')", $image_thumb_file);
if(is_numeric($cat_id)) {
$image_thumb_file = preg_replace("/http(.*?)\/data\/media\/(\w+)\//si", "", $image_thumb_file);
}else {
$image_thumb_file = $HTTP_GET_VARS['image_name'];
$cat_id = preg_replace("/http(.*?)\/data\/media\/([0-9]+)\/big\/(\w+).(\w+)/esi", "('\\2')", $image_thumb_file);
$image_thumb_file = preg_replace("/http(.*?)\/data\/media\/(\w+)\//si", "", $image_thumb_file);
$image_thumb_file = preg_replace("/big\//si", "", $image_thumb_file);
}
// NUR AKTIVIEREN WENN der MOD TOP100 aktiviert ist
// http://www.4homepages.de/forum/index.php?topic=23055.0
/*$image_last_view_who = $user_info['user_id'];
$user_name_who = $user_info['user_name'];
if ($user_name_who == "") {
$user_name_who = $lang['userlevel_guest'];
}
else {
$user_name_who = $user_info['user_name'];
}
$sql = "UPDATE ".IMAGES_TABLE."
SET image_last_view = '".time()."', image_last_view_who = '$user_name_who', image_hits = image_hits + 1
WHERE image_thumb_file = '$image_thumb_file' AND cat_id = '$cat_id'";*/
// WENN TOP100 MOD aktiv ist, dann die SQL Abfrage rausnehmen
$sql = "UPDATE ".IMAGES_TABLE."
SET image_hits = image_hits + 1
WHERE image_thumb_file = '$image_thumb_file' AND cat_id = '$cat_id'";
$site_db->query($sql);
?>
LG