Hallo,
ich möchte mit eine Abfrage den Title Tag für eine bestimmte Seite steuern, kriege es aber nicht genau hin, denn der gewünschte Titel wird zwar ausgegeben aber im Quellcode sind gleich zweimal Title Tags drin, was ich natürlich vermeiden möchte. Hat einer eine Idee wo die Abfrage richtig platziert werden sollte bzw. geändert werden?
<?php
if($_SERVER['REQUEST_URI'] == '/index.php/cat/c3_Elefanten.html')
{
?>
<title><?php echo "Der blauer Elefant"; ?></title>
<?php
}
?>
<?php
if (strstr($PHP_SELF, FILENAME_PRODUCT_INFO)) {
if ($product->isProduct()) {
?>
<meta name="description" content="<?php echo $product->data['products_meta_description']; ?>" />
<meta name="keywords" content="<?php echo $product->data['products_meta_keywords']; ?>" />
<title><?php echo TITLE.' - '.$product->data['products_meta_title'].' '.$product->data['products_name'].' '.$product->data['products_model']; ?></title>
<?php
} else {
?>
<meta name="description" content="<?php echo META_DESCRIPTION; ?>" />
<meta name="keywords" content="<?php echo META_KEYWORDS; ?>" />
<title><?php echo TITLE; ?></title>
<?php
}
} else {
if ($_GET['cPath']) {
if (strpos($_GET['cPath'],'_')=='1') {
$arr=explode('_',xtc_input_validation($_GET['cPath'],'cPath',''));
$_cPath=$arr[1];
} else {
//$_cPath=(int)$_GET['cPath'];
if (isset($_GET['cat'])) {
$site=explode('_',$_GET['cat']);
$cID=$site[0];
$_cPath=str_replace('c','',$cID);
}
}
$categories_meta_query=xtDBquery("SELECT categories_meta_keywords,
categories_meta_description,
categories_meta_title,
categories_name
FROM ".TABLE_CATEGORIES_DESCRIPTION."
WHERE categories_id='".$_cPath."' and
language_id='".$_SESSION['languages_id']."'");
$categories_meta = xtc_db_fetch_array($categories_meta_query,true);
if ($categories_meta['categories_meta_keywords']=='') {
$categories_meta['categories_meta_keywords']=META_KEYWORDS;
}
if ($categories_meta['categories_meta_description']=='') {
$categories_meta['categories_meta_description']=META_DESCRIPTION;
}
if ($categories_meta['categories_meta_title']=='') {
$categories_meta['categories_meta_title']=$categories_meta['categories_name'];
}
?>
<meta name="description" content="<?php echo $categories_meta['categories_meta_description']; ?>" />
<meta name="keywords" content="<?php echo $categories_meta['categories_meta_keywords']; ?>" />
<title><?php echo TITLE.' - '.$categories_meta['categories_meta_title']; ?></title>
<?php
} else {
if ($_GET['coID']){
$contents_meta_query=xtDBquery("SELECT content_heading
FROM ".TABLE_CONTENT_MANAGER."
WHERE content_group='".$_GET['coID']."' and
languages_id='".$_SESSION['languages_id']."'");
$contents_meta = xtc_db_fetch_array($contents_meta_query,true);
?>
<meta name="description" content="<?php echo META_DESCRIPTION; ?>" />
<meta name="keywords" content="<?php echo META_KEYWORDS; ?>" />
<title><?php echo TITLE.' - '.$contents_meta['content_heading']; ?></title>
<?php
}else{
}
?>
<meta name="description" content="<?php echo META_DESCRIPTION; ?>" />
<meta name="keywords" content="<?php echo META_KEYWORDS; ?>" />
<title><?php echo TITLE; ?></title>
<?php
}
}
?>
Vielen Dank im Voraus
ich möchte mit eine Abfrage den Title Tag für eine bestimmte Seite steuern, kriege es aber nicht genau hin, denn der gewünschte Titel wird zwar ausgegeben aber im Quellcode sind gleich zweimal Title Tags drin, was ich natürlich vermeiden möchte. Hat einer eine Idee wo die Abfrage richtig platziert werden sollte bzw. geändert werden?
<?php
if($_SERVER['REQUEST_URI'] == '/index.php/cat/c3_Elefanten.html')
{
?>
<title><?php echo "Der blauer Elefant"; ?></title>
<?php
}
?>
<?php
if (strstr($PHP_SELF, FILENAME_PRODUCT_INFO)) {
if ($product->isProduct()) {
?>
<meta name="description" content="<?php echo $product->data['products_meta_description']; ?>" />
<meta name="keywords" content="<?php echo $product->data['products_meta_keywords']; ?>" />
<title><?php echo TITLE.' - '.$product->data['products_meta_title'].' '.$product->data['products_name'].' '.$product->data['products_model']; ?></title>
<?php
} else {
?>
<meta name="description" content="<?php echo META_DESCRIPTION; ?>" />
<meta name="keywords" content="<?php echo META_KEYWORDS; ?>" />
<title><?php echo TITLE; ?></title>
<?php
}
} else {
if ($_GET['cPath']) {
if (strpos($_GET['cPath'],'_')=='1') {
$arr=explode('_',xtc_input_validation($_GET['cPath'],'cPath',''));
$_cPath=$arr[1];
} else {
//$_cPath=(int)$_GET['cPath'];
if (isset($_GET['cat'])) {
$site=explode('_',$_GET['cat']);
$cID=$site[0];
$_cPath=str_replace('c','',$cID);
}
}
$categories_meta_query=xtDBquery("SELECT categories_meta_keywords,
categories_meta_description,
categories_meta_title,
categories_name
FROM ".TABLE_CATEGORIES_DESCRIPTION."
WHERE categories_id='".$_cPath."' and
language_id='".$_SESSION['languages_id']."'");
$categories_meta = xtc_db_fetch_array($categories_meta_query,true);
if ($categories_meta['categories_meta_keywords']=='') {
$categories_meta['categories_meta_keywords']=META_KEYWORDS;
}
if ($categories_meta['categories_meta_description']=='') {
$categories_meta['categories_meta_description']=META_DESCRIPTION;
}
if ($categories_meta['categories_meta_title']=='') {
$categories_meta['categories_meta_title']=$categories_meta['categories_name'];
}
?>
<meta name="description" content="<?php echo $categories_meta['categories_meta_description']; ?>" />
<meta name="keywords" content="<?php echo $categories_meta['categories_meta_keywords']; ?>" />
<title><?php echo TITLE.' - '.$categories_meta['categories_meta_title']; ?></title>
<?php
} else {
if ($_GET['coID']){
$contents_meta_query=xtDBquery("SELECT content_heading
FROM ".TABLE_CONTENT_MANAGER."
WHERE content_group='".$_GET['coID']."' and
languages_id='".$_SESSION['languages_id']."'");
$contents_meta = xtc_db_fetch_array($contents_meta_query,true);
?>
<meta name="description" content="<?php echo META_DESCRIPTION; ?>" />
<meta name="keywords" content="<?php echo META_KEYWORDS; ?>" />
<title><?php echo TITLE.' - '.$contents_meta['content_heading']; ?></title>
<?php
}else{
}
?>
<meta name="description" content="<?php echo META_DESCRIPTION; ?>" />
<meta name="keywords" content="<?php echo META_KEYWORDS; ?>" />
<title><?php echo TITLE; ?></title>
<?php
}
}
?>
Vielen Dank im Voraus


Kommentar