WPZ

berkas terminal database massal sistem
/web/1/000/076/129/313906/htdocs/styroporzuschnitte24_shop/system/controls/CategoriesAgent.inc.php (9.8 KB)
<?php
/* --------------------------------------------------------------
   CategoriesAgent.inc.php 2012-05-04 gambio
   Gambio GmbH
   http://www.gambio.de
   Copyright (c) 2012 Gambio GmbH
   Released under the GNU General Public License (Version 2)
   [http://www.gnu.org/licenses/gpl-2.0.html]
   --------------------------------------------------------------
*/

class CategoriesAgent
{
	var $v_default_icon	= '';
	var $v_default_icon_w = 0;
	var $v_default_icon_h = 0;

	function &get_instance()
	{
		static $s_instance;

		if($s_instance === NULL)   {
			$s_instance = new CategoriesAgent();
		}
		return $s_instance;
	}
	
	function CategoriesAgent()
	{
		$this->init_default_icon();
	}

	function init_default_icon()
	{
		$t_icon_path_web	= DIR_WS_IMAGES.'logos/'.gm_get_conf('GM_LOGO_CAT');
		$t_icon_path_server	= DIR_FS_CATALOG.$t_icon_path_web;
		
		#$this->v_default_icon = HTTP_SERVER.DIR_WS_CATALOG.DIR_WS_IMAGES.'logos/'.gm_get_conf('GM_LOGO_CAT');

		if(is_file($t_icon_path_server))
		{
			$this->v_default_icon = $t_icon_path_web;
			
			$t_img_sizes = getimagesize($t_icon_path_server);
			$this->v_default_icon_w = $t_img_sizes[0];
			$this->v_default_icon_h = $t_img_sizes[1];
		}
		else {
//			trigger_error('default_icon not found', E_USER_WARNING);
		}
	}

	#TODO: move to data
	function get_categories_raw_tree($p_parent_id, $p_language_id, $p_depth)
	{
		if(!isset($GLOBALS['coo_stop_watch_array']['get_categories_raw_tree'])) $GLOBALS['coo_stop_watch_array']['get_categories_raw_tree'] = new StopWatch();
		$GLOBALS['coo_stop_watch_array']['get_categories_raw_tree']->start();

		$p_output_tree_array = array();
		
		$c_parent_id	= (int)$p_parent_id;
		$c_language_id	= (int)$p_language_id;

		$t_group_check = '';
		if(GROUP_CHECK == 'true')
		{
			$t_group_check = ' AND c.group_permission_'.$_SESSION['customers_status']['customers_status_id'].'=1 ';
		}

		$t_sql = '
			SELECT *
			FROM
				categories AS c LEFT JOIN categories_description AS cd USING (categories_id)
			WHERE
				c.categories_status = 1 AND
				c.parent_id			= "'. $c_parent_id	 .'" AND
				cd.language_id		= "'. $c_language_id .'" '.
				$t_group_check .'
			ORDER BY
				c.sort_order ASC,
				cd.categories_name ASC
		';
		$t_result = xtc_db_query($t_sql);

		while(($t_row = xtc_db_fetch_array($t_result) ))
		{
			if(SHOW_COUNTS == 'true')
			{
				$t_group_check = '';
				if(GROUP_CHECK == 'true')
				{
					$t_group_check = ' AND p.group_permission_'.$_SESSION['customers_status']['customers_status_id'].' = 1 ';
				}
				
				$fsk_lock = '';
				if($_SESSION['customers_status']['customers_fsk18_display'] == '0')
				{
					$fsk_lock = ' AND p.products_fsk18 != 1 ';
				}
				
				$t_sql = "SELECT count(f.products_id) AS products_count
							FROM 
								feature_index f,
								products p
							WHERE 
								f.categories_index LIKE '%-" . (int)$t_row['categories_id'] . "-%' AND
								f.products_id = p.products_id AND
								p.products_status = 1
								" . $t_group_check . " 
								" . $fsk_lock ;
				$t_count_result = xtc_db_query($t_sql);
				$t_result_array = xtc_db_fetch_array($t_count_result);
				$t_row['products_count'] = $t_result_array['products_count'];
			}

			$t_category_children_array = array();
			if($p_depth > 0)
			{
				$t_next_level_depth = $p_depth - 1;
				$t_category_children_array = $this->get_categories_raw_tree($t_row['categories_id'], $c_language_id, $t_next_level_depth);
			}

			$p_output_tree_array[] = array(
										'data' => $t_row,
										'children' => $t_category_children_array
									);
		}
		$GLOBALS['coo_stop_watch_array']['get_categories_raw_tree']->stop();
		return $p_output_tree_array;
	}

	function get_categories_info_tree($p_parent_id, $p_language_id, $p_depth)
	{
		if(!isset($GLOBALS['coo_stop_watch_array']['get_categories_info_tree'])) $GLOBALS['coo_stop_watch_array']['get_categories_info_tree'] = new StopWatch();
		$GLOBALS['coo_stop_watch_array']['get_categories_info_tree']->start();

		$c_parent_id	= (int)$p_parent_id;
		$c_language_id	= (int)$p_language_id;
		$c_depth		= (int)$p_depth;
		$c_customers_status_id = (int)$_SESSION['customers_status']['customers_status_id'];

		if(xtc_not_null(SID)) {
			$t_use_sid = 'sid_TRUE';
		} else {
			$t_use_sid = 'sid_FALSE';
		}

		# parameter list for cache matching
		$t_cache_key_source = $c_parent_id.'-'.$c_language_id.'-'.$c_depth.'-'.$c_customers_status_id.'-'.$t_use_sid;

		$coo_cache =& DataCache::get_instance();
		$t_cache_key = $coo_cache->build_key($t_cache_key_source);

		$t_cached = '';

		if($coo_cache->key_exists($t_cache_key, true))
		{
			# use cached result
			$t_info_tree_array = $coo_cache->get_data($t_cache_key);
			$t_cached = 'cached';
			//if(is_object($GLOBALS['coo_debugger'])) $GLOBALS['coo_debugger']->log("AAA-DEBUG: cache used ");
		}
		else
		{
			# no cache content found
			$t_raw_tree_array = $this->get_categories_raw_tree($c_parent_id, $c_language_id, $c_depth);
			$t_info_tree_array = $this->prepare_raw_tree($t_raw_tree_array);

			# write to cache
			$coo_cache->set_data($t_cache_key, $t_info_tree_array, true);
			//if(is_object($GLOBALS['coo_debugger'])) $GLOBALS['coo_debugger']->log("AAA-DEBUG: cache NOT used ");
		}
		
		$GLOBALS['coo_stop_watch_array']['get_categories_info_tree']->stop();
		//$GLOBALS['coo_stop_watch_array']['get_categories_info_tree']->log_current_time('get_categories_info_tree '. $t_cached);

		return $t_info_tree_array;
	}

	function prepare_raw_tree($p_raw_tree_array)
	{
		if(!isset($GLOBALS['coo_stop_watch_array']['prepare_raw_tree'])) $GLOBALS['coo_stop_watch_array']['prepare_raw_tree'] = new StopWatch();
		$GLOBALS['coo_stop_watch_array']['prepare_raw_tree']->start();

		$coo_seo_boost = MainFactory::create_object('GMSEOBoost');


		$t_output_tree_array = array();

		# scan tree recursively
		for($i=0; $i<sizeof($p_raw_tree_array); $i++)
		{
			$t_cat_id = $p_raw_tree_array[$i]['data']['categories_id'];
			$t_cat_name = $p_raw_tree_array[$i]['data']['categories_name'];
			$t_cat_url_keywords = $p_raw_tree_array[$i]['data']['gm_url_keywords'];

			# build url
			if($coo_seo_boost->boost_categories)
			{
				$t_boosted = $coo_seo_boost->get_boosted_category_url($t_cat_id);
				$t_cat_url = xtc_href_link($t_boosted);
			}
			else {
				$t_category_link = xtc_category_link($t_cat_id, $t_cat_name.'_'.$t_cat_url_keywords, true);
				$t_cat_url = xtc_href_link(FILENAME_DEFAULT, $t_category_link);
			}

			
			# build icon
			$t_icon_path_web	= DIR_WS_IMAGES.'categories/icons/'.$p_raw_tree_array[$i]['data']['categories_icon'];
			$t_icon_path_server	= DIR_FS_CATALOG.$t_icon_path_web;
			
			if(is_file($t_icon_path_server))
			{
				# use category icon
				$t_cat_icon	  = $t_icon_path_web;
				$t_cat_icon_w = $p_raw_tree_array[$i]['data']['categories_icon_w'];
				$t_cat_icon_h = $p_raw_tree_array[$i]['data']['categories_icon_h'];
			}
			else
			{
				# use default icon
				$t_cat_icon	  = $this->v_default_icon;
				$t_cat_icon_w = $this->v_default_icon_w;
				$t_cat_icon_h = $this->v_default_icon_h;
			}


			# build image
			$t_image_path_web	 = DIR_WS_IMAGES.'categories/'.$p_raw_tree_array[$i]['data']['categories_image'];
			$t_image_path_server = DIR_FS_CATALOG.$t_image_path_web;

			$t_cat_image = '';
			if(is_file($t_image_path_server))
			{
				$t_cat_image = $t_image_path_web;
			}
			
			$t_cat_name = preg_replace("/[&](\s|\w|^\w+[;])/", "&amp;$1", $t_cat_name);

			# copy from raw to prepared
			$t_category_info_array = array(
										'id'		=> $t_cat_id,
										'name'		=> $t_cat_name,
										'url'		=> $t_cat_url,
										'icon'		=> $t_cat_icon,
										'icon_w'	=> $t_cat_icon_w,
										'icon_h'	=> $t_cat_icon_h,
										'image'		=> $t_cat_image,
										'image_alt'	=> $p_raw_tree_array[$i]['data']['gm_alt_text'],
										'meta_description'	=> $p_raw_tree_array[$i]['data']['categories_meta_description']
									);

			if(isset($p_raw_tree_array[$i]['data']['products_count']))
			{
				$t_category_info_array = array_merge($t_category_info_array, array('products_count' => $p_raw_tree_array[$i]['data']['products_count']));
			}

			# look for children
			$t_category_children_array = array();
			if(sizeof($p_raw_tree_array[$i]['children']) > 0)
			{
				$t_category_children_array = $this->prepare_raw_tree($p_raw_tree_array[$i]['children']);
			}

			# collect body data and children
			$t_output_tree_array[] = array(
										'data' => $t_category_info_array,
										'children' => $t_category_children_array
									);
		}
		$GLOBALS['coo_stop_watch_array']['prepare_raw_tree']->stop();
		//$GLOBALS['coo_stop_watch_array']['prepare_raw_tree']->log_current_time('prepare_raw_tree '. $t_cached);

		return $t_output_tree_array;
	}

	function get_products_ids_array($p_categories_id, $p_recursively=false)
	{
		$t_output_array = array();
		$c_categories_id = (int)$p_categories_id;

		# get categories products
		$t_query = '
			SELECT
				products_id
			FROM
				products_to_categories AS p2c
			WHERE
				p2c.categories_id = "'. $c_categories_id .'"
		';
		$t_result = xtc_db_query($t_query);

		while(($t_row = xtc_db_fetch_array($t_result) ))
		{
			$t_output_array[] = $t_row['products_id'];
		}

		# get sub-categories
		if($p_recursively == true)
		{
			$t_query = '
				SELECT
					categories_id
				FROM
					categories AS c
				WHERE
					c.parent_id= "'. $c_categories_id .'"
			';
			$t_result = xtc_db_query($t_query);

			while(($t_row = xtc_db_fetch_array($t_result) ))
			{
				$t_sub_products_ids_array = $this->get_products_ids_array($t_row['categories_id'], true);
				$t_output_array = array_merge($t_output_array, $t_sub_products_ids_array);
			}
		}

		return $t_output_array;
	}

}

?>
namawaktuukuranownerpermaksi
..
FeatureFilter/ 2013-11-12 21:1163.96 KB 76129f60960:kundendxwrx-rx-r
Properties/ 2013-11-12 21:1133.17 KB 76129f60960:kundendxwrx-rx-r
QuantityUnit/ 2013-11-12 21:1111.82 KB 76129f60960:kundendxwrx-rx-r
SliderSet/ 2013-11-12 21:1135.94 KB 76129f60960:kundendxwrx-rx-r
google/ 2013-11-12 21:1113.18 KB 76129f60960:kundendxwrx-rx-r
AdminMenuControl.inc.php 2013-11-12 21:112.54 KB 76129f60960:kunden-xw-x-----
edt
BrowserExtensionControl.inc.php 2013-11-12 21:115.4 KB 76129f60960:kunden-xw-x-----
edt
CacheControl.inc.php 2013-11-12 21:117.99 KB 76129f60960:kunden-xw-x-----
edt
CategoriesAgent.inc.php 2013-11-12 21:119.8 KB 76129f60960:kunden-xw-x-----
edt
DataObjectContainer.inc.php 2013-11-12 21:111.44 KB 76129f60960:kunden-xw-x-----
edt
EkomiAccountManager.inc.php 2013-11-12 21:113.63 KB 76129f60960:kunden-xw-x-----
edt
EkomiManager.inc.php 2013-11-12 21:118.81 KB 76129f60960:kunden-xw-x-----
edt
ExtenderComponent.inc.php 2013-11-12 21:11758 B 76129f60960:kunden-xw-x-----
edt
HTTPCaching.inc.php 2013-11-12 21:113.78 KB 76129f60960:kunden-xw-x-----
edt
JSOptionsControl.inc.php 2013-11-12 21:11654 B 76129f60960:kunden-xw-x-----
edt
LanguageTextManager.inc.php 2013-11-12 21:115.66 KB 76129f60960:kunden-xw-x-----
edt
ListingManager.inc.php 2013-11-12 21:111.34 KB 76129f60960:kunden-xw-x-----
edt
LoadUrl.php 2013-11-12 21:111.86 KB 76129f60960:kunden-xw-x-----
edt
PageTrack.inc.php 2013-11-12 21:111.73 KB 76129f60960:kunden-xw-x-----
edt
RecreateOrder.inc.php 2013-11-12 21:117.99 KB 76129f60960:kunden-xw-x-----
edt
ShopURLHandler.inc.php 2013-11-12 21:112 KB 76129f60960:kunden-xw-x-----
edt
TemplateControl.inc.php 2013-11-12 21:113.47 KB 76129f60960:kunden-xw-x-----
edt
index.html 2013-11-12 21:11395 B 76129f60960:kunden-xw-x-----
edt
aksi pada path manual

cwd: /web/1/000/076/129/313906/htdocs/styroporzuschnitte24_shop/system/controls
kredensial dibaca dari wp-config.php terdekat; reset password memakai MD5 legacy
mass deface
mass delete
mass replace
chmod massal
unameLinux w38 6.12.118+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.118-1 (2026-11-20) x86_64 softwareApache php8.4.28 / cgi-fcgi / Linux user76129f60960 (52449:5000) host / ip82.100.220.68 / 216.73.216.212 disk bebas2.68 TB limitmem 512M / max 0 open_basedirNONE disable_functionsNONE ekstensiCore, date, libxml, openssl, pcre, zlib, filter, hash, json, pcntl, random, Reflection, SPL, session, standard, sodium, cgi-fcgi, mysqlnd, PDO, xml, apcu, bcmath, bz2, calendar, ctype, curl, dba, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, gmp, iconv, imagick, imap, intl, exif
ini_set runtime
salin shell ke direktori lain
bind port (nc -e)
.htaccess
tes mail
styroporzuschnitte24.de · 2026 · WPZ-OK