I guess attachment is missing, so posting again. I m gonna be regular soon, :)
:( attachment giving errors, let me try and paste code.
backup thumbs.inc.php and paste this into it, removing earlier code.
...........................code..........................
<?php
$arr_item = explode(".",$page_name_pieces[1]);
$arr_item = explode(URL_TOKEN_SEPARATOR,$arr_item[0]);
$arr_item_temp = $arr_item;
$arr_item_thumb_id = array_pop($arr_item_temp);
$item_short_name = implode(URL_WORD_SEPARATOR, $arr_item_temp);
$item_short_name = htmlentities(urlencode($item_short_name));
$sql = "SELECT a.id, a.short_name FROM
.
a WHERE a.short_name='".$item_short_name."' ";
$wallpaper = $DB->get($sql);
if (count($wallpaper)==0)
{
redirect(WEB_PATH);
}
$ws_short_name = $wallpaper['short_name'];//WS::prepareName(
$filename = THUMBS_PATH.$ws_short_name.DEFAULT_URL_TOKEN_SEPARATOR.$arr_item_thumb_id.".jpg";
if (!file_exists($filename))
{
//generate thumbnail
WS::generate_thumbs($ws_short_name, (int)str_replace("t", "", $arr_item_thumb_id));
}
if (!file_exists($filename))
{
redirect(WEB_PATH);
}
else
{
$filesize = filesize($filename);
header("Content-Type: image/jpeg");
header("Content-Length: $filesize");
readfile($filename);
}
define("EXIT_NOW", "1");
?>