Seite 1 von 1

Hilfe, System schmeisst mich raus

Verfasst: So 31. Okt 2004, 02:19
von Emile
Hallo

Alles lief bisher noch wunderbar, bis mich das System rausschmies, als eine bestimmte Seite editieren möchte.

Auf dieser Seite ist lediglich ein Suchmodul integriert, welches wunderbar funktioniert. Nur jedesmal wenn ich die Seite im Backend bearbeiten möchte, loggt mich das System aus.

Was habe ich falsch gemacht ? Alle anderen Seiten lassen sich problemlos bearbeiten.

please, help !

Verfasst: So 31. Okt 2004, 09:42
von timo
poste mal den Quellcode des Suchmoduls - vermutlich überschreibt der Entwickler dort eine Contenido-Variable...

mache ich gerne

Verfasst: So 31. Okt 2004, 12:50
von Emile
mache ich gerne

INPUT:
----------------------------------------------------------
$linktarget = "CMS_VALUE[1]";
$extratext = "CMS_VALUE[2]";

if($linktarget == "") {
$linktarget = "_self";
}
if($extratext == "") {
$extratext = 0;
}
?>
<table>
<tr>
<td>Linktarget</td>
<td>
<select name="CMS_VAR[1]">
<option value="_self"<? if(strcmp("_self", $linktarget) == 0) echo " selected"; ?>>gleiches Fenster (_self)</option>
<option value="_new"<? if(strcmp("_new", $linktarget) == 0) echo " selected"; ?>>neues Fenster (_new)</option>
</select>
</td>
</tr>
<tr>
<td>Zusätzlicher Text zum Artikellink</td>
<td>
<select name="CMS_VAR[2]">
<option value="0"<? if($extratext == 0) echo " selected"; ?>>kein zusätzlicher Text</option>
<option value="1"<? if($extratext == 1) echo " selected"; ?>>Artikelkommentar</option>
<option value="2"<? if($extratext == 2) echo " selected"; ?>>Anfang des Artikeltextes</option>
</select>
</td>
</tr>
</table>
<?
OUTPUT:
----------------------------------------------------------
<?php
//$linkziel = "front_content.php?idcat=15";
$linkziel = $auth->url();

$ignore_konj = array("und","oder","als","wenn","auch","wo","wie");
$ignore_art = array("der","die","das","ein","eine");
$ignore = array("ich","du","er","sie","es","wir","ihr","sie");

$extratextLength = 200;


$suchtext = $_POST["suchtext"];
?>

<form name="suche" action="<?= $linkziel ?>" method="post">
<table>
<tr>
<td><span style="font-size: 15px">Suche&nbsp;</span></td>
<td><input name="suchtext" type="text" size="20" value="<?= $suchtext ?>"></td>
<td><input name="submit" type="submit" value="Go"></td>
</tr>
</table>
</form>

<?php
$linktarget = "CMS_VALUE[1]";
$extratext = "CMS_VALUE[2]";

/* DB Instances */
$db = new DB_Contenido;
$db2 = new DB_Contenido;

/* Template Instance */
$tpl = new Template;


if($suchtext != "") {
while(ereg(' ', $suchtext)) {
$suchtext = ereg_replace(' ', ' ', $suchtext);
}
$suchliste = explode(" ", strtolower($suchtext));
$suchliste = array_diff($suchliste, $ignore_konj, $ignore_art, $ignore);
$suchtext = trim(implode(" ", $suchliste));

if($verknuepfung == "oder") {
$suchregexp = "(" . str_replace(" ", ")|(", $suchtext) . ")";
$s = ereg_replace("ü", "%FC", strtolower($suchtext));
$s = ereg_replace("ä", "%E4", $s);
$s = ereg_replace("ö", "%F6", $s);
$suchregexp .= "|$s";
$sql = "SELECT " .
"A.title AS title, " .
"A.idart AS idart, " .
"A.summary AS comment, " .
"B.idcat AS idcat, " .
"D.value AS content, " .
"A.idartlang AS sideid " .
"FROM " .
$cfg["tab"]["art_lang"] . " AS A, " .
$cfg["tab"]["cat_art"] . " AS B, " .
$cfg["tab"]["cat"] . " AS C, " .
$cfg["tab"]["content"] . " AS D " .
"WHERE " .
"A.idart = B.idart " .
"AND A.idartlang = D.idartlang " .
"AND B.idcat = C.idcat " .
"AND C.idclient = '$client' " .
"AND idlang = '$lang' " .
"AND online='1' " .
"AND (D.value REGEXP '" . $suchregexp . "' " .
"OR A.title REGEXP '" . $suchregexp . "' " .
"OR A.summary REGEXP '" . $suchregexp . "')";
} // end if($verkuepfung)
else {
$sql = "SELECT " .
"A.title AS title, " .
"A.idart AS idart, " .
"A.summary AS comment, " .
"B.idcat AS idcat, " .
"D.value AS content, " .
"A.idartlang AS sideid " .
"FROM " .
$cfg["tab"]["art_lang"] . " AS A, " .
$cfg["tab"]["cat_art"] . " AS B, " .
$cfg["tab"]["cat"] . " AS C, " .
$cfg["tab"]["content"]." AS D " .
"WHERE " .
"A.idart = B.idart " .
"AND A.idartlang = D.idartlang " .
"AND B.idcat = C.idcat " .
"AND C.idclient = '$client' " .
"AND idlang = '$lang' " .
"AND online = '1'";

while(list($key, $val) = each($suchliste)) {
$suchregexp = "(" . str_replace(" ", ")|(", $val) . ")";
$s = ereg_replace("ü", "%FC", strtolower($val));
$s = ereg_replace("ä", "%E4", $s);
$s = ereg_replace("ö", "%F6", $s);
$suchregexp .= "|$s";
$sql .= " AND (D.value REGEXP '" . $suchregexp . "' " .
"OR A.title REGEXP '" . $suchregexp . "' " .
"OR A.summary REGEXP '" . $suchregexp . "')";
} // end while
reset($suchliste);
} // end else($verknuepfung)

$db->query($sql);

if($db->num_rows() != 0){
while($db->next_record()) {
if ($auth->auth["uid"] == "nobody"){
$sql2 = "SELECT " .
"public " .
"FROM " .
$cfg["tab"]["cat_lang"] . " " .
"WHERE " .
"idcat = '" . $db->f("idcat") . "'";
$db2->query($sql2);

if($db2->next_record()) {
if($db2->f("public") == 0) {
continue;
} // end if(public)
} // end if(next_record)
} // end if(auth nobody)

$num = 0 + $db->f("sideid");
$results[$num][link] = "front_content.php?" .
"client=" . $client .
"&lang=" . $lang .
"&idcat=" . $db->f("idcat") .
"&idart=" . $db->f("idart");
$results[$num][title] = $db->f("title");

//anzuzeigenden Text ermitteln
switch($extratext) {
case 0:
$results[$num][text] = "";
break;
case 1:
$results[$num][text] = $db->f("comment");
break;
case 2:
$results[$num][text] = capiStrTrimSentence(strip_tags(urldecode($db->f("content"))), $extratextLength) . "...";
break;
} // end switch

while(list($key, $val) = each($suchliste)) {
$hits[$num] += substr_count(strtolower(strip_tags(urldecode($db->f("title")))), $val) +
substr_count(strtolower(strip_tags(urldecode($db->f("comment")))), $val) +
substr_count(strtolower(strip_tags(urldecode($db->f("content")))), $val);
} // end while

reset($suchliste);
} // end while(next_record)

if(count($hits) > 0) {
//anzahl hits speichern
$anzahlhits = count($hits);

$hits = array_values($hits);
$results = array_values($results);
array_multisort ($results, SORT_DESC, SORT_NUMERIC, $hits, SORT_DESC, SORT_NUMERIC);

} // end if(count hits)
} // end if(num_rows)


//Ausgabe-----------------

/* Start Output buffer */
ob_start();

if(count($hits) > 0) {
$tpl->reset();
$tpl->set('s', 'SUCHTEXT', $suchtext);
$tpl->set('s', 'TREFFER', $anzahlhits);

for($i = 0; $i < count($hits); $i++) {
$tpl->set('d', 'ARTIKELNAME', $results[$i][title]);
$tpl->set('d', 'TARGET', $linktarget);
$tpl->set('d', 'HREF', $results[$i][link]);
$tpl->set('d', 'TEXT', $results[$i][text]);
$tpl->next();
}
$tpl->generate('templates/search_found.html');
} // end if(count hits)
else {
$tpl->reset();
$tpl->set('s', 'SUCHTEXT', $suchtext);
$tpl->generate('templates/search_notfound.html');
} // end else (count hits)
} // end if(suchtext)

/* Read out buffer */
$html = ob_get_contents();

/* Clean buffer */
ob_end_clean();

/* Output buffer-contents */
echo $html;
?>

Ergänzendes

Verfasst: So 31. Okt 2004, 13:12
von Emile
Nun sehe ich mir ein anderes CMS an, den DEDI.

2 Tage

Verfasst: Mo 1. Nov 2004, 20:12
von Emile
2 Tage und noch keine Antwort ?
Was für ein Forum :cry:

Lieber Emergence vielen Dank.. Ciao

Verfasst: Di 2. Nov 2004, 13:56
von emergence
ich hab das gerade bei mir versucht...

das modul geht bei mir ohne das es mich rauswirft...

kein Zurück mehr

Verfasst: So 7. Nov 2004, 03:38
von Emile
Ich habe DEDI ( http://www.der-dirigent.de ) entdeckt, dort habe ich diese Probleme nicht mehr.. :P

In der Zwischenzeit habe ich das gesamte Projekt auf DEDI portiert, kann ich nur empfehlen.. Das mit Durchnummerieren von Variablen ist leider eine Zumutung. :|

Ihr werdet mich in diesem Forum wahrscheinlich nicht mehr sehen..
Astala vista .. :cry:

Re: kein Zurück mehr

Verfasst: So 7. Nov 2004, 12:25
von Halchteranerin
Emile hat geschrieben:Ihr werdet mich in diesem Forum wahrscheinlich nicht mehr sehen..
Astala vista .. :cry:
Reisende soll man nicht aufhalten ...

Re: 2 Tage

Verfasst: So 7. Nov 2004, 13:36
von emergence
Emile hat geschrieben:Lieber Emergence vielen Dank.. Ciao
bitte schön... viel erfolg mit dedi...