<?php
/*
###################################################################################
  Bigware Shop 2.3
  Release Datum: 23.08.2015
  
  Bigware Shop
  http://www.bigware.de

  Copyright (c) 2015 Bigware LTD
  (c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
  (c) 2015	Bigware LTD

  Copyrightvermerke duerfen nicht entfernt werden.
  ------------------------------------------------------------------------
  Dieses Programm ist freie Software. Sie koennen es unter den Bedingungen
  der GNU General Public License, wie von der Free Software Foundation
  veroeffentlicht, weitergeben und/oder modifizieren, entweder gemaess Version 2 
  der Lizenz oder (nach Ihrer Option) jeder spaeteren Version.
  Die Veroeffentlichung dieses Programms erfolgt in der Hoffnung, dass es Ihnen
  von Nutzen sein wird, aber OHNE IRGENDEINE GARANTIE, sogar ohne die
  implizite Garantie der MARKTREIFE oder der VERWENDBARKEIT FUER EINEN
  BESTIMMTEN ZWECK. Details finden Sie in der GNU General Public License.
  
  Sie sollten eine Kopie der GNU General Public License zusammen mit diesem
  Programm erhalten haben. Falls nicht, schreiben Sie an die Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.

  Infos:
  ------------------------------------------------------------------------
  Der Bigware Shop wurde vor vielen Jahren bereits aus dem bekannten Shopsystem osCommerce
  weiter- und neuentwickelt.
  Der Bigware Shop legt im hohen Masse Wert auf Bedienerfreundlichkeit, beinhaltet eine leichte
  Installation, viele neue professionelle Werkzeuge und zeichnet sich aus durch eine grosse 
  Community, die bei Problemen weiterhelfen kann.
  
  Der Bigware Shop ist auf jedem System lauffaehig, welches eine PHP Umgebung
  (ab PHP 4.1.3) und mySQL zur Verfuegung stellt und auf Linux basiert.
 
  Hilfe erhalten Sie im Forum auf www.bigware.de 
  
  -----------------------------------------------------------------------
  
 ##################################################################################




*/
$date_availability = 'AND (to_days(items_date_available_end) IS NULL OR (to_days(items_date_available_end) IS NOT NULL AND to_days(now()) <= to_days(items_date_available_end)))';
$sql=go_db_query('SELECT * FROM erw_einstellungen where id=1');
$row2=go_db_fetch_array($sql); 
$mt_extra_keywords = $row2['keywords']; 
$allg_metas = $row2['allg_metas'];     
define('PRIMARY_SECTION', ' : '); 
define('SECONDARY_SECTION', ' - '); 
define('TERTIARY_SECTION', ', '); 
define('WEB_SITE_KEYWORDS', $mt_extra_keywords); 

switch ($content) {
	case $GLOBALS['CONFIG_SHOW_FILE']['main_bigware_2']:
		define('META_TAG_TITLE', NAVBAR_TITLE_1 . PRIMARY_SECTION . TITLE . $web_site_tagline);
		define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . NAVBAR_TITLE_1 . SECONDARY_SECTION . WEB_SITE_KEYWORDS);
		define('META_TAG_KEYWORDS', WEB_SITE_KEYWORDS . NAVBAR_TITLE_1);
		break;
	case $GLOBALS['CONFIG_SHOW_FILE']['main_bigware_3']:
		define('META_TAG_TITLE', NAVBAR_TITLE_2 . PRIMARY_SECTION . TITLE . $web_site_tagline);
		define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . NAVBAR_TITLE_2 . SECONDARY_SECTION . WEB_SITE_KEYWORDS);
		define('META_TAG_KEYWORDS', WEB_SITE_KEYWORDS . NAVBAR_TITLE_2);
		break; 
	case $GLOBALS['CONFIG_SHOW_FILE']['main_bigware_43']:
		define('META_TAG_TITLE', ABOVE_TITLE . PRIMARY_SECTION . TITLE . $web_site_tagline);
		define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . NAVBAR_TITLE_1 . SECONDARY_SECTION . WEB_SITE_KEYWORDS);
		define('META_TAG_KEYWORDS', WEB_SITE_KEYWORDS . NAVBAR_TITLE_1);
		break;
	case $GLOBALS['CONFIG_SHOW_FILE']['main_bigware_44']:
		define('META_TAG_TITLE', ABOVE_TITLE . PRIMARY_SECTION . TITLE . $web_site_tagline);
		define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . NAVBAR_TITLE_1 . SECONDARY_SECTION . WEB_SITE_KEYWORDS);
		define('META_TAG_KEYWORDS', WEB_SITE_KEYWORDS . NAVBAR_TITLE_1);
		break;
	case $GLOBALS['CONFIG_SHOW_FILE']['member_history_more']:
		define('META_TAG_TITLE', ABOVE_TITLE . PRIMARY_SECTION . TITLE . $web_site_tagline);
		define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . NAVBAR_TITLE_1 . SECONDARY_SECTION . WEB_SITE_KEYWORDS);
		define('META_TAG_KEYWORDS', WEB_SITE_KEYWORDS . NAVBAR_TITLE_1);
		break;
	case $GLOBALS['CONFIG_SHOW_FILE']['main_bigware_47']:
		define('META_TAG_TITLE', ABOVE_TITLE . PRIMARY_SECTION . TITLE . $web_site_tagline);
		define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . NAVBAR_TITLE_1 . SECONDARY_SECTION . WEB_SITE_KEYWORDS);
		define('META_TAG_KEYWORDS', WEB_SITE_KEYWORDS . NAVBAR_TITLE_1);
		break;
	case $GLOBALS['CONFIG_SHOW_FILE']['main_bigware_45']:
		define('META_TAG_TITLE', ABOVE_TITLE . PRIMARY_SECTION . TITLE . $web_site_tagline);
		define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . NAVBAR_TITLE_1 . SECONDARY_SECTION . WEB_SITE_KEYWORDS);
		define('META_TAG_KEYWORDS', WEB_SITE_KEYWORDS . NAVBAR_TITLE_1);
		break;
	case $GLOBALS['CONFIG_SHOW_FILE']['main_bigware_48']:
		define('META_TAG_TITLE', ABOVE_TITLE . PRIMARY_SECTION . TITLE . $web_site_tagline);
		define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . NAVBAR_TITLE_1 . SECONDARY_SECTION . WEB_SITE_KEYWORDS);
		define('META_TAG_KEYWORDS', WEB_SITE_KEYWORDS . NAVBAR_TITLE_1);
		break;
	case $GLOBALS['CONFIG_SHOW_FILE']['main_bigware_15']:
		define('META_TAG_TITLE', ABOVE_TITLE . PRIMARY_SECTION . TITLE . $web_site_tagline);
		define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . NAVBAR_TITLE_1 . SECONDARY_SECTION . WEB_SITE_KEYWORDS);
		define('META_TAG_KEYWORDS', WEB_SITE_KEYWORDS . NAVBAR_TITLE_1);
		break;
	case $GLOBALS['CONFIG_SHOW_FILE']['main_bigware_16']:
		define('META_TAG_TITLE', ABOVE_TITLE . PRIMARY_SECTION . TITLE . $web_site_tagline);
		define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . NAVBAR_TITLE_1 . SECONDARY_SECTION . WEB_SITE_KEYWORDS);
		define('META_TAG_KEYWORDS', WEB_SITE_KEYWORDS . NAVBAR_TITLE_1);
		break;
	case $GLOBALS['CONFIG_SHOW_FILE']['main_bigware_16']:
		define('META_TAG_TITLE', ABOVE_TITLE . PRIMARY_SECTION . TITLE . $web_site_tagline);
		define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . NAVBAR_TITLE_1 . SECONDARY_SECTION . WEB_SITE_KEYWORDS);
		define('META_TAG_KEYWORDS', WEB_SITE_KEYWORDS . NAVBAR_TITLE_1);
		break; 
	case $GLOBALS['CONFIG_SHOW_FILE']['main_bigware_7']:
		define('META_TAG_TITLE', ABOVE_TITLE . PRIMARY_SECTION . TITLE . $web_site_tagline);
		define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . ABOVE_TITLE . SECONDARY_SECTION . WEB_SITE_KEYWORDS);
		define('META_TAG_KEYWORDS', WEB_SITE_KEYWORDS . ABOVE_TITLE);
		break;
	case $GLOBALS['CONFIG_SHOW_FILE']['main_bigware_51']:
		define('META_TAG_TITLE', ABOVE_TITLE . PRIMARY_SECTION . TITLE . $web_site_tagline);
		define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . ABOVE_TITLE . SECONDARY_SECTION . WEB_SITE_KEYWORDS);
		define('META_TAG_KEYWORDS', WEB_SITE_KEYWORDS . ABOVE_TITLE);
		break;
	case $GLOBALS['CONFIG_SHOW_FILE']['main_bigware_50']:
		define('META_TAG_TITLE', ABOVE_TITLE . PRIMARY_SECTION . TITLE . $web_site_tagline);
		define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . ABOVE_TITLE . SECONDARY_SECTION . WEB_SITE_KEYWORDS);
		define('META_TAG_KEYWORDS', WEB_SITE_KEYWORDS . ABOVE_TITLE);
		break;
	case $GLOBALS['CONFIG_SHOW_FILE']['main_bigware_66']:
		define('META_TAG_TITLE', ABOVE_TITLE . PRIMARY_SECTION . TITLE . $web_site_tagline);
		define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . ABOVE_TITLE . SECONDARY_SECTION . WEB_SITE_KEYWORDS);
		define('META_TAG_KEYWORDS', WEB_SITE_KEYWORDS . ABOVE_TITLE);
		break;
	case $GLOBALS['CONFIG_SHOW_FILE']['main_bigware_20']:
		define('META_TAG_TITLE', ABOVE_TITLE . PRIMARY_SECTION . TITLE . $web_site_tagline);
		define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . ABOVE_TITLE . SECONDARY_SECTION . WEB_SITE_KEYWORDS);
		define('META_TAG_KEYWORDS', WEB_SITE_KEYWORDS . ABOVE_TITLE);
		break;
	case $GLOBALS['CONFIG_SHOW_FILE']['main_bigware_39']:
		define('META_TAG_TITLE', ABOVE_TITLE . PRIMARY_SECTION . TITLE . $web_site_tagline);
		define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . ABOVE_TITLE . SECONDARY_SECTION . WEB_SITE_KEYWORDS);
		define('META_TAG_KEYWORDS', WEB_SITE_KEYWORDS . ABOVE_TITLE);
		break;
	case $GLOBALS['CONFIG_SHOW_FILE']['main_bigware_12']:
		define('META_TAG_TITLE', ABOVE_TITLE . PRIMARY_SECTION . TITLE . $web_site_tagline);
		define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . ABOVE_TITLE . SECONDARY_SECTION . WEB_SITE_KEYWORDS);
		define('META_TAG_KEYWORDS', WEB_SITE_KEYWORDS . ABOVE_TITLE);
		break;
	case $GLOBALS['CONFIG_SHOW_FILE']['main_bigware_29_d']:
		if ( (!isset($new_items_category_id)) || ($new_items_category_id == '0') ) { 
			$new_items_query = go_db_query("select distinct max(p.items_id), p.items_id, p.items_picture, p.items_tax_class_id, p.items_model, items_price from ((" . DB_TBL_ITEMS . " p) left join " . DB_TBL_SPECIALS . " s on p.items_id = s.items_id, " . DB_TBL_ITEMS_TO_CATEGORIES . " p2c, " . DB_TBL_CATEGORIES . " c) where c.categories_status='1' and p.items_id = p2c.items_id and p2c.categories_id = c.categories_id and items_status = '1' $date_availability GROUP BY p.items_id order by p.items_date_added desc limit " . MAX_SHOW_NEW_ITEMS);
		} else { 
			$new_items_query = go_db_query("select distinct p.items_id, p.items_picture, p.items_tax_class_id, p.items_model, if(s.status, s.specials_new_items_price, p.items_price) as items_price from ((" . DB_TBL_ITEMS . " p) left join " . DB_TBL_SPECIALS . " s on p.items_id = s.items_id, " . DB_TBL_ITEMS_TO_CATEGORIES . " p2c, " . DB_TBL_CATEGORIES . " c) where c.categories_status='1' and p.items_id = p2c.items_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_items_category_id . "' and p.items_status = '1' $date_availability order by rand() desc limit " . MAX_SHOW_NEW_ITEMS);
		}
		$dl = 1;
		while ($new_items = go_db_fetch_array($new_items_query)) {	
			if (go_get_items_name($new_items['items_id']) != ''){
				if ($dl == 1){
					$new_items1 .= go_get_items_name($new_items['items_id']);
				}else{
					$new_items1 .= ' - ' . go_get_items_name($new_items['items_id']);
				}
				$dl++;
			}
		}
		if ($new_items1 != ''){
			$keyword_desc = $new_items1;
			$descritions= substr(str_replace('"',' ', $new_items1 . ' ' . WEB_SITE_KEYWORDS), 0, 195);
			$titles= substr(str_replace('"',' ',$descritions . ' ' . PRIMARY_SECTION . ' ' . $web_site_tagline), 0, 100);
			$keyword_desc = html_entity_decode($keyword_desc);
			$keyword_desc = strip_tags(preg_replace("/\,|\?|\!|\"|\�|\$|\%|\&|\/|\(|\)|\=|\`|\*|\'|\:|\;|\,|\.|\#|\+|\r\n|\r|\n|\]|\[|\-/", '', $keyword_desc)); 
			$keyword_desc = preg_replace('/\s\s+/', ' ', $keyword_desc);
			$keywords_meta = explode (" ", $keyword_desc); 
			$keywords_meta = array_unique ($keywords_meta);
			$comma_separated = implode(", ", $keywords_meta);
			$comma_separated = substr($comma_separated . ', ' . WEB_SITE_KEYWORDS, 0, 1000); 
		} 
		$sqltitle=go_db_query('SELECT * FROM erw_einstellungen where id=2');
		$rowtitle=go_db_fetch_array($sqltitle); 
		$allg_metas_title = $rowtitle['allg_metas'];
		preg_match("/content=\".*\"/", $allg_metas_title, $metatitle);
		$metatitlenew = preg_split("/=/",$metatitle[0]);
		$metatitlenew[1] = trim($metatitlenew[1],"\x22\x27");

		define('META_TAG_TITLE', TITLE);  
		define('META_TAG_DESCRIPTION', $descritions);
		define('META_TAG_KEYWORDS', $comma_separated);
		break;
	case $GLOBALS[CONFIG_SHOW_FILE][main_bigware_49]:
		define('META_TAG_TITLE', ABOVE_TITLE . PRIMARY_SECTION . TITLE . $web_site_tagline);
		define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . ABOVE_TITLE . SECONDARY_SECTION . WEB_SITE_KEYWORDS);
		define('META_TAG_KEYWORDS', WEB_SITE_KEYWORDS . ABOVE_TITLE);
		break;
	case $GLOBALS[CONFIG_SHOW_FILE][main_bigware_29_n]:
		$mt_category_query = go_db_query("select categories_name from " . DB_TBL_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$current_category_id . "' and language_id = '" . (int)$languages_id . "'");
		$mt_category = go_db_fetch_array($mt_category_query);
		if ( (!isset($new_items_category_id)) || ($new_items_category_id == '0') ) {
			$new_items_query = go_db_query("select max(p.items_id), p.items_id, p.items_picture, p.items_tax_class_id, if(s.status, s.specials_new_items_price, p.items_price) as items_price from ((" . DB_TBL_ITEMS . " p) left join " . DB_TBL_SPECIALS . " s on p.items_id = s.items_id, " . DB_TBL_ITEMS_TO_CATEGORIES . " p2c, " . DB_TBL_CATEGORIES . " c) where c.categories_status='1' and p.items_id = p2c.items_id and p2c.categories_id = c.categories_id and items_status = '1' $date_availability GROUP BY p.items_id order by p.items_date_added desc limit " . MAX_SHOW_NEW_ITEMS);
		} else {
			$new_items_query = go_db_query("select distinct p.items_id, p.items_picture, p.items_tax_class_id, if(s.status, s.specials_new_items_price, p.items_price) as items_price from ((" . DB_TBL_ITEMS . " p) left join " . DB_TBL_SPECIALS . " s on p.items_id = s.items_id, " . DB_TBL_ITEMS_TO_CATEGORIES . " p2c, " . DB_TBL_CATEGORIES . " c) where c.categories_status='1' and p.items_id = p2c.items_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_items_category_id . "' and p.items_status = '1' $date_availability order by rand() desc limit " . MAX_SHOW_NEW_ITEMS);
		}
		$dl = 1;
		while ($new_items = go_db_fetch_array($new_items_query)) {	
			if ($dl == 1){
				$new_items1 .= go_get_items_name($new_items['items_id']);
			}else{
				$new_items1 .= ' - ' . go_get_items_name($new_items['items_id']);
			}
			$dl++;
		}
		if ($new_items1 != ""){
			$keyword_desc = $mt_category['categories_name'] . ' ' . $new_items1;
			$descritions= substr(str_replace('"',' ', $mt_category['categories_name'] . ' ' . PRIMARY_SECTION . ' ' . $new_items1 . ' ' . WEB_SITE_KEYWORDS), 0, 200);
			$titles= substr(str_replace('"',' ', $mt_category['categories_name'] . PRIMARY_SECTION . $new_items1 . ' ' . $web_site_tagline), 0, 100); 
			$keyword_desc = strip_tags(preg_replace("/\,|\?|\!|\"|\�|\$|\%|\&|\/|\(|\)|\=|\`|\*|\'|\:|\;|\,|\.|\#|\+|\r\n|\r|\n|\]|\[/", '', $keyword_desc)); 
			$keyword_desc = preg_replace('/\s\s+/', ' ', $keyword_desc);
			$keywords_meta = explode (" ", $keyword_desc); 
			$keywords_meta = array_unique ($keywords_meta);
			$comma_separated = implode(", ", $keywords_meta);
			$comma_separated = substr($comma_separated . WEB_SITE_KEYWORDS, 0, 1000); 
		}
		define('META_TAG_TITLE',  TITLE);
		define('META_TAG_DESCRIPTION', $descritions);
		define('META_TAG_KEYWORDS', $comma_separated);
		break;
	case $GLOBALS[CONFIG_SHOW_FILE][main_bigware_24]:


		$new_galerie_query = go_db_query("select * from " . DB_TBL_GALERIE_CAT_DESCRIPTION . " a, " . DB_TBL_GALERIE . " b, " . DB_TBL_GALERIE_DESCRIPTION . " c, " . DB_TBL_GALERIE_TO_CATEGORIES . " d  where a.categories_id = '" . $current_category_id . "' AND a.categories_id = d.categories_id AND d.galeries_id = b.galeries_id AND b.galeries_id = c.galeries_id AND a.language_id = '" . $languages_id . "' AND c.language_id = '" . $languages_id . "'");
		$mt_category_query = go_db_query("select categories_name from " . DB_TBL_GALERIE_CAT_DESCRIPTION . " where categories_id = '" . (int)$current_category_id . "' and language_id = '" . (int)$languages_id . "'");
		$mt_category = go_db_fetch_array($mt_category_query);   
		$new_catecories = $mt_category['categories_name'] . ' ';   
		$dl = 1;
		while ($galeries_name = go_db_fetch_array($new_galerie_query)) {	

			$new_galeries .= $galeries_name['galeries_name'] . ' ';

			$dl++;
		}
		$keyword_desc = $new_galeries;
		$descritions= substr(str_replace('"',' ', $new_catecories . ' ' . PRIMARY_SECTION . ' ' . $new_galeries . ' ' . WEB_SITE_KEYWORDS), 0, 200);
		$titles= substr(str_replace('"',' ', $new_catecories . PRIMARY_SECTION . $new_galeries . ' ' . $web_site_tagline), 0, 100);               
		$keyword_desc = strip_tags(preg_replace("/\,|\?|\!|\"|\�|\$|\%|\&|\/|\(|\)|\=|\`|\*|\'|\:|\;|\,|\.|\#|\+|\r\n|\r|\n|\]|\[/", '', $keyword_desc)); 
		$keyword_desc = preg_replace('/\s\s+/', ' ', $keyword_desc);
		$keywords_meta = explode (" ", $keyword_desc); 
		$keywords_meta = array_unique ($keywords_meta);
		$comma_separated = implode(", ", $keywords_meta);
		$comma_separated = substr($comma_separated . WEB_SITE_KEYWORDS, 0, 1000);               

		define('META_TAG_TITLE',  TITLE . ': ' . $titles);
		define('META_TAG_DESCRIPTION', $descritions);
		define('META_TAG_KEYWORDS', $comma_separated);
		break;
	case $GLOBALS[CONFIG_SHOW_FILE][main_bigware_23]:
		$mt_item_info_query = go_db_query("select p.galeries_id, pd.galeries_name, pd.galeries_description from " . DB_TBL_GALERIE . " p, " . DB_TBL_GALERIE_DESCRIPTION . " pd where p.galeries_id = '" . (int)$_GET['galeries_id'] . "' and pd.galeries_id = p.galeries_id and pd.language_id = '" . (int)$languages_id . "'");
		$mt_item_info = go_db_fetch_array($mt_item_info_query);
		$mt_items_description = $mt_item_info['galeries_description'];

		$mt_items_name = $mt_item_info['galeries_name'];
		$mt_items_name= substr(str_replace('"',' ',$mt_items_name), 0, 200); 
		$mt_items_description = substr(strip_tags(stripslashes($mt_item_info['galeries_description'])), 0, 200);


		$keyword_name = $mt_items_name;
		$keyword_name = html_entity_decode($keyword_name);
		$keyword_name = strip_tags(preg_replace("/\,|\?|\!|\"|\�|\$|\%|\&|\/|\(|\)|\=|\`|\*|\'|\:|\;|\,|\.|\#|\+|\r\n|\r|\n|\]|\[/", '', $keyword_name));
		$keyword_desc = $mt_item_info['items_description'];
		$keyword_desc = html_entity_decode($keyword_desc);
		$keyword_desc = strip_tags(preg_replace("/\,|\?|\!|\"|\�|\$|\%|\&|\/|\(|\)|\=|\`|\*|\'|\:|\;|\,|\.|\#|\+|\r\n|\r|\n|\]|\[/", '', $keyword_desc)); 
		$keyword_desc = preg_replace('/\s\s+/', ' ', $keyword_desc);
		$keywords_meta = explode (" ", $keyword_name . $keyword_desc); 
		$keywords_meta = array_unique ($keywords_meta);
		$comma_separated = implode(", ", $keywords_meta);
		$comma_separated = substr($comma_separated .  WEB_SITE_KEYWORDS, 0, 1000);
		$descriptions = substr($mt_items_name . PRIMARY_SECTION . $mt_items_description . SECONDARY_SECTION, 0, 200);
		$titles = substr(TITLE . PRIMARY_SECTION . $mt_items_name . SECONDARY_SECTION . ' ' . $web_site_tagline, 0, 100);
		define('META_TAG_TITLE', $titles);
		define('META_TAG_DESCRIPTION', $descriptions);
		define('META_TAG_KEYWORDS', $comma_separated);
		break;
	case $GLOBALS[CONFIG_SHOW_FILE][main_bigware_29_i]:
		if (isset($_GET['producers_id'])) {
			$mt_producer_query = go_db_query("select producers_name from " . DB_TBL_PRODUCERS . " where producers_id = '" . (int)$_GET['producers_id'] . "'");
			$mt_producer = go_db_fetch_array($mt_producer_query);
			define('META_TAG_TITLE', $mt_producer['producers_name'] . PRIMARY_SECTION . TITLE . $web_site_tagline);
			define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . $mt_producer['producers_name']) . SECONDARY_SECTION . WEB_SITE_KEYWORDS;
			define('META_TAG_KEYWORDS', WEB_SITE_KEYWORDS . $mt_producer['producers_name']);
		} else {
			$mt_category_query = go_db_query("select categories_name from " . DB_TBL_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$current_category_id . "' and language_id = '" . (int)$languages_id . "'");
			$mt_category = go_db_fetch_array($mt_category_query);

			$listing_split = new
				splitPageResults($listing_sql, MAX_SHOW_SEARCH_RESULTS, 'p.items_id');
			if ($listing_split->number_of_rows > 0) {
				$rows = 0;
				$listing_query = go_db_query($listing_split->sql_query);
				while ($listing = go_db_fetch_array($listing_query)) {
					$rows++;
					for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
						$test = $listing['items_name'] . ' ';
					}
					$test2 .= $test;
				}
			}    
			$titles= substr(str_replace('"',' ', TITLE . PRIMARY_SECTION . $mt_category['categories_name'] . ' - ' . $test2 . ' ' . $web_site_tagline), 0, 100);
			$descritions= substr(str_replace('"',' ', $mt_category['categories_name'] . PRIMARY_SECTION . $test2 . SECONDARY_SECTION . WEB_SITE_KEYWORDS), 0, 200);
			$keyword_desc = $mt_category['categories_name'] . ' ' . $test2;
			$keyword_desc = html_entity_decode($keyword_desc);
			$keyword_desc = strip_tags(preg_replace("/\,|\?|\!|\"|\�|\$|\%|\&|\/|\(|\)|\=|\`|\*|\'|\:|\;|\,|\.|\#|\+|\r\n|\r|\n|\]|\[/", '', $keyword_desc)); 
			$keyword_desc = preg_replace('/\s\s+/', ' ', $keyword_desc);
			$keywords_meta = explode (" ", $keyword_desc); 
			$keywords_meta = array_unique ($keywords_meta);
			$comma_separated = implode(", ", $keywords_meta);
			$comma_separated = substr($comma_separated . WEB_SITE_KEYWORDS, 0, 1000); 

			define('META_TAG_TITLE', TITLE);
			define('META_TAG_DESCRIPTION', $descritions);
			define('META_TAG_KEYWORDS', $comma_separated);
		}
		break;
	case $GLOBALS[CONFIG_SHOW_FILE][popup_picture]:
		define('META_TAG_TITLE', $items['items_name'] . PRIMARY_SECTION . TITLE . $web_site_tagline);
		define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . $items['items_name'] . SECONDARY_SECTION . WEB_SITE_KEYWORDS);
		define('META_TAG_KEYWORDS', WEB_SITE_KEYWORDS . $items['items_name']);
		break;
	case $GLOBALS[CONFIG_SHOW_FILE][main_bigware_58]:
		define('META_TAG_TITLE', ABOVE_SEARCH_HELP . PRIMARY_SECTION . TITLE . $web_site_tagline);
		define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . ABOVE_SEARCH_HELP . SECONDARY_SECTION . WEB_SITE_KEYWORDS);
		define('META_TAG_KEYWORDS', WEB_SITE_KEYWORDS . ABOVE_SEARCH_HELP);
		break;
	case $GLOBALS[CONFIG_SHOW_FILE][main_bigware_34]:
		$mt_item_info_query = go_db_query("select p.items_id, pd.items_name, pd.items_description, p.items_model, p.items_price, p.items_tax_class_id from " . DB_TBL_ITEMS . " p, " . DB_TBL_ITEMS_DESCRIPTION . " pd where p.items_status = '1' and p.items_id = '" . (int)$_GET['items_id'] . "' and pd.items_id = p.items_id and pd.language_id = '" . (int)$languages_id . "' $date_availability");
		$mt_item_info = go_db_fetch_array($mt_item_info_query);
		$mt_items_description = $mt_item_info['items_description'];

		if ($mt_new_price = go_get_items_special_price($mt_item_info['items_id'])) {
			$mt_items_price = $currencies->display_price($mt_item_info['items_price'], go_get_tax_rate($mt_item_info['items_tax_class_id'])) . $currencies->display_price($mt_new_price, go_get_tax_rate($mt_item_info['items_tax_class_id']));
		} else {
			$mt_items_price = $currencies->display_price($mt_item_info['items_price'], go_get_tax_rate($mt_item_info['items_tax_class_id']));
		}
		$mt_items_name = $mt_item_info['items_name'];
		$mt_items_name= substr(str_replace('"',' ',$mt_items_name), 0, 200); 
		$mt_items_description = substr(strip_tags(stripslashes($mt_item_info['items_description'])), 0, 200);


		$keyword_name = $mt_items_name;
		$keyword_name = html_entity_decode($keyword_name);
		$keyword_name = strip_tags(preg_replace("/\,|\?|\!|\"|\�|\$|\%|\&|\/|\(|\)|\=|\`|\*|\'|\:|\;|\,|\.|\#|\+|\r\n|\r|\n|\]|\[/", '', $keyword_name));
		$keyword_desc = $mt_item_info['items_description'];
		$keyword_desc = html_entity_decode($keyword_desc);
		$keyword_desc = strip_tags(preg_replace("/\,|\?|\!|\"|\�|\$|\%|\&|\/|\(|\)|\=|\`|\*|\'|\:|\;|\,|\.|\#|\+|\r\n|\r|\n|\]|\[/", '', $keyword_desc)); 
		$keyword_desc = preg_replace('/\s\s+/', ' ', $keyword_desc);
		$keywords_meta = explode (" ", $keyword_name . $keyword_desc); 
		$keywords_meta = array_unique ($keywords_meta);
		$comma_separated = implode(", ", $keywords_meta);
		$comma_separated = substr($comma_separated .  WEB_SITE_KEYWORDS, 0, 1000);
		$descriptions = substr($mt_items_name . PRIMARY_SECTION . $mt_items_description . SECONDARY_SECTION, 0, 200);
		$titles = substr(TITLE . PRIMARY_SECTION . $mt_items_name . ' ' . $web_site_tagline, 0, 100);
		define('META_TAG_TITLE', $titles);
		define('META_TAG_DESCRIPTION', $descriptions);
		define('META_TAG_KEYWORDS', $comma_separated);
		break;
	case $GLOBALS[CONFIG_SHOW_FILE][main_bigware_35]:
		$mt_review_query = go_db_query("select p.items_id, pd.items_name, p.items_model, p.items_price, p.items_tax_class_id from " . DB_TBL_ITEMS . " p, " . DB_TBL_ITEMS_DESCRIPTION . " pd where p.items_status = '1' and p.items_id = '" . (int)$_GET['items_id'] . "' and pd.items_id = p.items_id and pd.language_id = '" . (int)$languages_id . "' $date_availability");
		$mt_review = go_db_fetch_array($mt_review_query);
		if ($mt_new_price = go_get_items_special_price($mt_review['items_id'])) {
			$mt_items_price = $currencies->display_price($mt_review['items_price'], go_get_tax_rate($mt_review['items_tax_class_id'])) . $currencies->display_price($mt_new_price, go_get_tax_rate($mt_review['items_tax_class_id']));
		} else {
			$mt_items_price = $currencies->display_price($mt_review['items_price'], go_get_tax_rate($mt_review['items_tax_class_id']));
		}
		$mt_items_name = $mt_review['items_name']; 
		define('META_TAG_TITLE', $mt_items_name . PRIMARY_SECTION . TITLE . TERTIARY_SECTION . NAVBAR_TITLE);
		define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . NAVBAR_TITLE . SECONDARY_SECTION . $mt_items_name);
		define('META_TAG_KEYWORDS', WEB_SITE_KEYWORDS . $mt_items_name);
		break;
	case $GLOBALS[CONFIG_SHOW_FILE][main_bigware_36]:
		$mt_review_query = go_db_query("select rd.reviews_text, r.reviews_rating, r.reviews_id, r.attendees_name, p.items_id, p.items_price, p.items_tax_class_id, p.items_model, pd.items_name from " . DB_TBL_REVIEWS . " r, " . DB_TBL_REVIERELATIV_DESCRIPTION . " rd, " . DB_TBL_ITEMS . " p, " . DB_TBL_ITEMS_DESCRIPTION . " pd where r.reviews_id = '" . (int)$_GET['reviews_id'] . "' and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$languages_id . "' and r.items_id = p.items_id and p.items_status = '1' and p.items_id = pd.items_id and pd.language_id = '". (int)$languages_id . "' $date_availability");
		$mt_review = go_db_fetch_array($mt_review_query);
		if ($mt_new_price = go_get_items_special_price($mt_review['items_id'])) {
			$mt_items_price = $currencies->display_price($mt_review['items_price'], go_get_tax_rate($mt_review['items_tax_class_id'])) . $currencies->display_price($mt_new_price, go_get_tax_rate($mt_review['items_tax_class_id']));
		} else {
			$mt_items_price = $currencies->display_price($mt_review['items_price'], go_get_tax_rate($mt_review['items_tax_class_id']));
		}
		$mt_items_name = $mt_review['items_name']; 
		$mt_review_text = substr(strip_tags(stripslashes($mt_review['reviews_text'])), 0, 60);
		$mt_reviews_rating = SUB_TITLE_RATING . ' ' . sprintf(TEXT_OF_5_STARS, $mt_review['reviews_rating']);
		define('META_TAG_TITLE', $mt_items_name . SECONDARY_SECTION . TITLE . TERTIARY_SECTION . NAVBAR_TITLE);
		define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . NAVBAR_TITLE . SECONDARY_SECTION . $mt_items_name . SECONDARY_SECTION . $mt_review['attendees_name'] . SECONDARY_SECTION . $mt_review_text . '...' . SECONDARY_SECTION . $mt_reviews_rating);
		define('META_TAG_KEYWORDS', WEB_SITE_KEYWORDS . ' ' . $mt_items_price . ' ' . $mt_review['attendees_name'] . ' ' . $mt_reviews_rating);
		break;
	default:

		define('META_TAG_TITLE', NAVBAR_TITLE . PRIMARY_SECTION . TITLE . $web_site_tagline);
		define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . NAVBAR_TITLE . SECONDARY_SECTION . WEB_SITE_KEYWORDS);
		define('META_TAG_KEYWORDS', WEB_SITE_KEYWORDS . NAVBAR_TITLE);
}

echo $allg_metas; 

if (($_SERVER['SCRIPT_NAME']=="/".$GLOBALS['CONFIG_NAME_FILE']['main_bigware_29'])&&(sizeof($_GET)==0)) {
	$metaTagTitleQuery = go_db_query("select allg_metas from erw_einstellungen where id=2");
	$metaTagTitleQuery = go_db_fetch_array($metaTagTitleQuery);
	$metaTagTitle = $metaTagTitleQuery['allg_metas'];
	echo $metaTagTitle;
}
echo '<link rel="stylesheet" type="text/css" href="' . FOLDER_RELATIV_TEMPLATES . 'system.css">' . "\n";
?>
