403Webshell
Server IP : 85.158.181.41  /  Your IP : 216.73.217.12
Web Server : Apache
System : Linux cloud9-vm129 6.1.178+1-ph #ph SMP PREEMPT_DYNAMIC Wed Jul 29 09:00:54 UTC 2026 x86_64
User : moncbefd ( 1024)
PHP Version : 7.3.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/moncbefd/www.moneta.at/templates/Honeygrid/smarty/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/moncbefd/www.moneta.at/templates/Honeygrid/smarty/function.product_images.php
<?php
/* --------------------------------------------------------------
   function.product_images.php 2018-04-25
   Gambio GmbH
   http://www.gambio.de
   Copyright (c) 2016 Gambio GmbH
   Released under the GNU General Public License (Version 2)
   [http://www.gnu.org/licenses/gpl-2.0.html]
   --------------------------------------------------------------
*/

function getImages($query, $name, $image, $product_id)
{
	$images = array();
	$result = xtc_db_query($query);
	
	while($row = xtc_db_fetch_array($result))
	{
		$images[] = array(
			'IMAGE'         => 'images/product_images/thumbnail_images/' . $row['image_name'],
			'IMAGE_ALT'     => !empty($row['gm_alt_text']) ? $row['gm_alt_text'] : $name,
			'PRODUCTS_NAME' => $name
		);
	}
	
	$query  = 'SELECT gm_show_image FROM ' . TABLE_PRODUCTS . ' WHERE products_id = ' . (int)$product_id;
	$result = xtc_db_query($query);
	$row    = xtc_db_fetch_array($result);
	
	if($row['gm_show_image'] === '1' && count($images) > 0)
	{
		array_unshift($images, [
			'IMAGE'         => $image,
			'IMAGE_ALT'     => $name,
			'PRODUCTS_NAME' => $name
		]);
	}
	
	return $images;
}

function smarty_function_product_images($params, &$smarty)
{
	$query = 'SELECT 
					i.image_id, 
					i.image_name,
					a.gm_alt_text
				FROM ' . TABLE_PRODUCTS_IMAGES . ' i
				LEFT JOIN gm_prd_img_alt a ON (i.image_id = a.image_id
					AND i.products_id = a.products_id
					AND a.language_id = ' . (int)$_SESSION['languages_id'] . ')
				WHERE i.products_id = ' . (int)$params['product_id'] . ' AND 
					  i.gm_show_image = 1
				ORDER BY i.image_nr';
	
	$images = getImages($query, $params['p_name'], $params['p_image'], $params['product_id']);
	$smarty->assign($params['out'], $images);
}

Youez - 2016 - github.com/yon3zu
LinuXploit