Sitemap mehrmals einsetzen
Sitemap mehrmals einsetzen
Hallo,
ich will bzw. muss eine Sitemap (Standard Sitemap) mehrmals auf einer Seite einsetzen.
Nur ich erhalte leider einer Fehler:
Fatal error: Cannot redeclare sitemap() (previously declared in
c:\contenido\htdocs\cms\front_content.php(770) : eval()'d code:51) in
c:\contenido\htdocs\cms\front_content.php(770) : eval()'d code on line 157
Kann mir einer helfen?
ich will bzw. muss eine Sitemap (Standard Sitemap) mehrmals auf einer Seite einsetzen.
Nur ich erhalte leider einer Fehler:
Fatal error: Cannot redeclare sitemap() (previously declared in
c:\contenido\htdocs\cms\front_content.php(770) : eval()'d code:51) in
c:\contenido\htdocs\cms\front_content.php(770) : eval()'d code on line 157
Kann mir einer helfen?
-
- Beiträge: 1536
- Registriert: Fr 20. Aug 2004, 10:07
- Kontaktdaten:
http://contenido.org/forum/viewtopic.php?t=11663
schau mal das 2te Post an das gilt auch für die Sitemap
schau mal das 2te Post an das gilt auch für die Sitemap
greets
-
- Beiträge: 3626
- Registriert: Di 12. Okt 2004, 20:00
- Wohnort: Voerde (Niederrhein)
- Kontaktdaten:
Nein, das ist so nicht richtig. "Cannot redeclare..." bedeutet, dass eine Funktion (in diesem Falle "sitemap") eben nicht zweimal deklariert werden darf.rezeptionist hat geschrieben:http://contenido.org/forum/viewtopic.php?t=11663
schau mal das 2te Post an das gilt auch für die Sitemap
Wenn man um den Code der Funktion eine Abfrage schaltet, ob diese bereits deklariert wurde, könnte man das evtl. mehrmals zum laufen bekommen. Etwa in der Form:
Code: Alles auswählen
if (!function_exists('sitemap')) {
function sitemap () {
// hier ist der Code der Funktion
}
}
So endlich Zeit gefunden, den Tipp zu testen.
Leider kommt jetzt der Fehler:
Fatal error: Call to undefined function: sitemap() in /.../cms/contenido/includes/include.con_editcontent.php(649) : eval()'d code on line 246
Hier ist der geänderte Code:
Leider kommt jetzt der Fehler:
Fatal error: Call to undefined function: sitemap() in /.../cms/contenido/includes/include.con_editcontent.php(649) : eval()'d code on line 246
Hier ist der geänderte Code:
Code: Alles auswählen
<?php
/***********************************************
* CONTENIDO MODUL - OUTPUT
*
* Modulname : Sitemap
* Author(s) : Jan Lengowski, Jose Rodriguez
* Copyright : Contenido - four for business
* Created : 15-08-2002
************************************************/
#System properties in use:
#Type: navigation, Name: idcat_homepage
#Contains idcat of tree to be displayed in sitemap
#Includes
cInclude("frontend", "includes/functions.navigation.php");
cInclude("classes", "class.frontend.permissions.php");
cInclude("classes", "class.frontend.groups.php");
cInclude("classes", "class.frontend.users.php");
cInclude("classes", "class.template.php");
#If no tree is selected, use client setting
$newcat = "CMS_VALUE[0]";
if ($newcat=='') {
$cApiClient = new cApiClient($client);
$newcat = $cApiClient->getProperty('navigation', 'idcat_homepage');
}
#Get cat tree
$sql = "SELECT level FROM ".$cfg["tab"]["cat_tree"]." WHERE idcat=$newcat";
$db->query($sql);
$db->next_record();
echo sitemap($newcat);
if (!function_exists('sitemap')) {
function sitemap($newcat) {
global $lang, $client, $cfg, $printing;
#Initialize database objects
$db = new DB_Contenido;
$db2 = new DB_Contenido;
$db3 = new DB_Contenido;
$tpl = new Template;
$tpl2 = new Template;
$tpl3 = new Template;
$sql = "SELECT * FROM ".$cfg["tab"]["cat_tree"]." AS A, ".$cfg["tab"]["cat"]." AS B, ".$cfg["tab"]["cat_lang"]." AS C "."WHERE A.idcat=B.idcat AND B.idcat=C.idcat AND "."C.idlang='$lang' AND B.idclient='$client' AND "."B.parentid =$newcat AND C.visible=1 "."ORDER by A.idtree";
$db->query($sql);
#Build level 1
$tpl->reset();
while ($db->next_record()) {
#Check permissions, determine visibility
$visible = checkCatPermission($db->f("idcatlang"),$db->f("public"));
if ($visible) {
$tpl->set("d","URL","front_content.php?idcat=".$db->f("idcat"));
$tpl->set("d","NAME",$db->f("name"));
$sql = "SELECT * FROM ".$cfg["tab"]["cat_tree"]." AS A, ".$cfg["tab"]["cat"]." AS B, ".$cfg["tab"]["cat_lang"]." AS C "."WHERE A.idcat=B.idcat AND B.idcat=C.idcat AND "."C.idlang='$lang' AND B.idclient='$client' AND "."B.parentid =".$db->f("idcat")." AND C.visible=1 "."ORDER by A.idtree";
$db2->query($sql);
#Build level 2
$tpl2->reset();
$level2 = '';
$j = 0;
while ($db2->next_record()) {
$visible = checkCatPermission($db2->f("idcatlang"),$db2->f("public"));
if ($visible) {
$tpl2->set("d", "URL", "front_content.php?idcat=".$db2->f("idcat"));
$tpl2->set("d", "NAME", $db2->f("name"));
$sql = "SELECT * FROM ".$cfg["tab"]["cat_tree"]." AS A, ".$cfg["tab"]["cat"]." AS B, ".$cfg["tab"]["cat_lang"]." AS C "."WHERE A.idcat=B.idcat AND B.idcat=C.idcat AND "."C.idlang='$lang' AND B.idclient='$client' AND "."B.parentid =".$db2->f("idcat")." AND C.visible=1 "."ORDER by A.idtree";
$db3->query($sql);
#Build level 3
$tpl3->reset();
$level3 = '';
$k = 0;
while ($db3->next_record()) {
$visible = checkCatPermission($db3->f("idcatlang"),$db3->f("public"));
if ($visible) {
$tpl3->set("d", "URL", "front_content.php?idcat=".$db3->f("idcat"));
$tpl3->set("d", "NAME", $db3->f("name"));
$tpl3->next();
$k ++;
}
}
$level3 = $tpl3->generate($cfgClient[$client]["path"]["frontend"]."templates/"."sitemap_level3.html",1,0);
$j++;
}
$tpl2->set("d", "LEVEL3", $level3);
$tpl2->next();
}
$level2 = $tpl2->generate($cfgClient[$client]["path"]["frontend"]."templates/"."sitemap_level2.html",1,0);
}
$tpl->set("d", "LEVEL2", $level2);
$tpl->next();
}
$tpl->generate($cfgClient[$client]["path"]["frontend"]."templates/"."sitemap_level1.html");
}
}
?>
Diesen Teil nach den if(!function _exist... }-Block verschieben:
Gruß
HerrB
Code: Alles auswählen
#If no tree is selected, use client setting
$newcat = "CMS_VALUE[0]";
if ($newcat=='') {
$cApiClient = new cApiClient($client);
$newcat = $cApiClient->getProperty('navigation', 'idcat_homepage');
}
#Get cat tree
$sql = "SELECT level FROM ".$cfg["tab"]["cat_tree"]." WHERE idcat=$newcat";
$db->query($sql);
$db->next_record();
echo sitemap($newcat);
HerrB
Bitte keine unaufgeforderten PMs oder E-Mails -> use da Forum!
Newsletter: V4.4.x | V4.6.0-15 (Module, Backend) | V4.6.22+
Standardartikelliste: V4.4.x | V4.6.x
http://www.contenido.org/forum/search.php | http://faq.contenido.org | http://www.communido.net
Newsletter: V4.4.x | V4.6.0-15 (Module, Backend) | V4.6.22+
Standardartikelliste: V4.4.x | V4.6.x
http://www.contenido.org/forum/search.php | http://faq.contenido.org | http://www.communido.net
Wenn Du magst, kannst Du mir mal Anmeldedaten per PM senden, komme aber erst morgen dazu.
Gruß
HerrB
Gruß
HerrB
Bitte keine unaufgeforderten PMs oder E-Mails -> use da Forum!
Newsletter: V4.4.x | V4.6.0-15 (Module, Backend) | V4.6.22+
Standardartikelliste: V4.4.x | V4.6.x
http://www.contenido.org/forum/search.php | http://faq.contenido.org | http://www.communido.net
Newsletter: V4.4.x | V4.6.0-15 (Module, Backend) | V4.6.22+
Standardartikelliste: V4.4.x | V4.6.x
http://www.contenido.org/forum/search.php | http://faq.contenido.org | http://www.communido.net
-
- Beiträge: 3626
- Registriert: Di 12. Okt 2004, 20:00
- Wohnort: Voerde (Niederrhein)
- Kontaktdaten:
Versuch es mal mit folgendem Moduloutput:Salech hat geschrieben:Also alles, außer den Includes!
gemacht...aber jetzt kommt dieser Fehler:
Fatal error: Call to undefined function: sitemap() in /.../cms/cms/front_content.php(914) : eval()'d code on line 73
Code: Alles auswählen
<?php
/***********************************************
* CONTENIDO MODUL - OUTPUT
*
* Modulname : Sitemap
* Author(s) : Jan Lengowski, Jose Rodriguez
* Copyright : Contenido - four for business
* Created : 15-08-2002
************************************************/
#System properties in use:
#Type: navigation, Name: idcat_homepage
#Contains idcat of tree to be displayed in sitemap
#Includes
cInclude("frontend", "includes/functions.navigation.php");
cInclude("classes", "class.frontend.permissions.php");
cInclude("classes", "class.frontend.groups.php");
cInclude("classes", "class.frontend.users.php");
cInclude("classes", "class.template.php");
if (!function_exists('sitemap')) {
function sitemap($newcat) {
global $lang, $client, $cfg, $printing;
#Initialize database objects
$db = new DB_Contenido;
$db2 = new DB_Contenido;
$db3 = new DB_Contenido;
$tpl = new Template;
$tpl2 = new Template;
$tpl3 = new Template;
$sql = "SELECT * FROM ".$cfg["tab"]["cat_tree"]." AS A, ".$cfg["tab"]["cat"]." AS B, ".$cfg["tab"]["cat_lang"]." AS C "."WHERE A.idcat=B.idcat AND B.idcat=C.idcat AND "."C.idlang='$lang' AND B.idclient='$client' AND "."B.parentid =$newcat AND C.visible=1 "."ORDER by A.idtree";
$db->query($sql);
#Build level 1
$tpl->reset();
while ($db->next_record()) {
#Check permissions, determine visibility
$visible = checkCatPermission($db->f("idcatlang"),$db->f("public"));
if ($visible) {
$tpl->set("d","URL","front_content.php?idcat=".$db->f("idcat"));
$tpl->set("d","NAME",$db->f("name"));
$sql = "SELECT * FROM ".$cfg["tab"]["cat_tree"]." AS A, ".$cfg["tab"]["cat"]." AS B, ".$cfg["tab"]["cat_lang"]." AS C "."WHERE A.idcat=B.idcat AND B.idcat=C.idcat AND "."C.idlang='$lang' AND B.idclient='$client' AND "."B.parentid =".$db->f("idcat")." AND C.visible=1 "."ORDER by A.idtree";
$db2->query($sql);
#Build level 2
$tpl2->reset();
$level2 = '';
$j = 0;
while ($db2->next_record()) {
$visible = checkCatPermission($db2->f("idcatlang"),$db2->f("public"));
if ($visible) {
$tpl2->set("d", "URL", "front_content.php?idcat=".$db2->f("idcat"));
$tpl2->set("d", "NAME", $db2->f("name"));
$sql = "SELECT * FROM ".$cfg["tab"]["cat_tree"]." AS A, ".$cfg["tab"]["cat"]." AS B, ".$cfg["tab"]["cat_lang"]." AS C "."WHERE A.idcat=B.idcat AND B.idcat=C.idcat AND "."C.idlang='$lang' AND B.idclient='$client' AND "."B.parentid =".$db2->f("idcat")." AND C.visible=1 "."ORDER by A.idtree";
$db3->query($sql);
#Build level 3
$tpl3->reset();
$level3 = '';
$k = 0;
while ($db3->next_record()) {
$visible = checkCatPermission($db3->f("idcatlang"),$db3->f("public"));
if ($visible) {
$tpl3->set("d", "URL", "front_content.php?idcat=".$db3->f("idcat"));
$tpl3->set("d", "NAME", $db3->f("name"));
$tpl3->next();
$k ++;
}
}
$level3 = $tpl3->generate($cfgClient[$client]["path"]["frontend"]."templates/"."sitemap_level3.html",1,0);
$j++;
}
$tpl2->set("d", "LEVEL3", $level3);
$tpl2->next();
}
$level2 = $tpl2->generate($cfgClient[$client]["path"]["frontend"]."templates/"."sitemap_level2.html",1,0);
}
$tpl->set("d", "LEVEL2", $level2);
$tpl->next();
}
$tpl->generate($cfgClient[$client]["path"]["frontend"]."templates/"."sitemap_level1.html");
}
}
#If no tree is selected, use client setting
$newcat = "CMS_VALUE[0]";
if ($newcat=='') {
$cApiClient = new cApiClient($client);
$newcat = $cApiClient->getProperty('navigation', 'idcat_homepage');
}
#Get cat tree
$sql = "SELECT level FROM ".$cfg["tab"]["cat_tree"]." WHERE idcat=$newcat";
$db->query($sql);
$db->next_record();
echo sitemap($newcat);
?>
Habe ich etwas anderes geschrieben ...?
Gruß
HerrB
Gruß
HerrB
Bitte keine unaufgeforderten PMs oder E-Mails -> use da Forum!
Newsletter: V4.4.x | V4.6.0-15 (Module, Backend) | V4.6.22+
Standardartikelliste: V4.4.x | V4.6.x
http://www.contenido.org/forum/search.php | http://faq.contenido.org | http://www.communido.net
Newsletter: V4.4.x | V4.6.0-15 (Module, Backend) | V4.6.22+
Standardartikelliste: V4.4.x | V4.6.x
http://www.contenido.org/forum/search.php | http://faq.contenido.org | http://www.communido.net
Bin ich ja beruhigt...
Gruß
HerrB

Gruß
HerrB
Bitte keine unaufgeforderten PMs oder E-Mails -> use da Forum!
Newsletter: V4.4.x | V4.6.0-15 (Module, Backend) | V4.6.22+
Standardartikelliste: V4.4.x | V4.6.x
http://www.contenido.org/forum/search.php | http://faq.contenido.org | http://www.communido.net
Newsletter: V4.4.x | V4.6.0-15 (Module, Backend) | V4.6.22+
Standardartikelliste: V4.4.x | V4.6.x
http://www.contenido.org/forum/search.php | http://faq.contenido.org | http://www.communido.net