-
Notifications
You must be signed in to change notification settings - Fork 45
/
zoom.php
36 lines (31 loc) · 1.17 KB
/
zoom.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
include(dirname(__FILE__).'/config/config.inc.php');
if (isset($_GET['id_image']) AND is_numeric($_GET['id_image']))
{
$cookie = new Cookie('ps');
Tools::setCookieLanguage();
$id_image = intval($_GET['id_image']);
$image = new Image(intval($id_image), intval($cookie->id_lang));
$product = new Product(intval($image->id_product), false, intval($cookie->id_lang));
if (Validate::isLoadedObject($image) AND Validate::isLoadedObject($product))
{
if (file_exists(_PS_PROD_IMG_DIR_.intval($image->id_product).'-'.intval($id_image).'.jpg'))
{
$smarty->assign(array(
'css_dir' => _THEME_CSS_DIR_,
'img_dir' => _THEME_IMG_DIR_,
'product_name' => Tools::safeOutput($product->name),
'image_size' => getimagesize(_PS_PROD_IMG_DIR_.intval($image->id_product).'-'.intval($id_image).'.jpg'),
'image' => _THEME_PROD_DIR_.intval($image->id_product).'-'.intval($id_image).'.jpg',
'legend' => Tools::safeOutput($image->legend)));
}
else
$smarty->assign('error', 'this image cannot be found');
}
else
$smarty->assign('error', 'this image cannot be found');
}
else
$smarty->assign('error', 'missing parameter');
$smarty->display(_PS_THEME_DIR_.'zoom.tpl');
?>