Hallo,
das Glossar wird leider nicht bei der Suche berücksichtigt. Hat jemand eine Lösung dafür? Ich könnte mir zwei Möglichkeiten vorstellen:
1. Die gesamte Kategorie die auf Offline steht soll durchsucht werden.
Mit 'protected' => false); im Search_Output Modul werden leider alle Kategorien die auf Offline stehen durchsucht, was ich nicht für sinnvoll halte.
2. Die einzelnen Artikel werden in derselben Kategorie angelegt wie das Glossar selbst.
Da ich mich zu wenig mit php auskenne kann ich das leider nicht umsetzen! Kann mir bitte jemand helfen?
Hier noch das Modul dass ich abgeändert habe. Contenido 4.8.12, AMR.
Modul-Output:
Code: Alles auswählen
<?php
$parentcatid = 12;
$cmstypeid = 1;
$numberofcmstype = 1;
echo "<!-- Modul: Glossarliste -->\n";
function klein($text) {
$text = urldecode($text);
$text = strip_tags($text, "");
// $text = str_replace(" ", "_", $text);
$text = str_replace(":", "_", $text);
$text = str_replace("(", "_", $text);
$text = str_replace(")", "_", $text);
$text = str_replace("[", "_", $text);
$text = str_replace("]", "_", $text);
$text = str_replace("'", "_", $text);
$text = str_replace('"', '_', $text);
$text = strtolower($text);
$text = str_replace("ä", "ae", $text);
$text = str_replace("ö", "oe", $text);
$text = str_replace("ü", "ue", $text);
$text = str_replace("ß", "ss", $text);
return $text;
}
function unterkategorien($kategorie) {
global $cfg, $unterkat;
$unterkat[] = $kategorie;
$db = new DB_Contenido;
$sql = "SELECT idcat FROM {$cfg['tab']['cat']} WHERE parentid = '".$kategorie."' ORDER BY idcat ASC;";
$db->query($sql);
while ($db->next_record()) {
unterkategorien($db->f("idcat"));
}
}
$db = new DB_Contenido;
$db2 = new DB_Contenido;
$liste = array("0-9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "@");
foreach ($liste as $buchstabe) {
$gesamt[$buchstabe] = "";
}
$unterkat = array();
unterkategorien($parentcatid);
// liest die anzahl betroffener artikel aus der datenbank
$sql = "SELECT count(*) AS anzahl FROM ".$cfg['tab']['cat']." AS a LEFT JOIN ".$cfg['tab']['cat_art']." AS b ON a.idcat = b.idcat LEFT JOIN ".$cfg['tab']['art_lang']." AS c ON b.idart = c.idart LEFT JOIN ".$cfg['tab']['content']." AS d ON c.idartlang = d.idartlang LEFT JOIN ".$cfg['tab']['cat_lang']." AS e ON a.idcat = e.idcat WHERE a.parentid IN (".implode(", ", $unterkat).") AND d.idtype = '".$cmstypeid."' AND d.typeid = '".$numberofcmstype."' AND d.value != '';";
$db->query($sql);
$db->next_record();
$anzahl_artikel = $db->f("anzahl");
if ($anzahl_artikel > 0) {
$sql = "SELECT d.value, b.idart, b.idcat, e.name FROM ".$cfg['tab']['cat']." AS a LEFT JOIN ".$cfg['tab']['cat_art']." AS b ON a.idcat = b.idcat LEFT JOIN ".$cfg['tab']['art_lang']." AS c ON b.idart = c.idart LEFT JOIN ".$cfg['tab']['content']." AS d ON c.idartlang = d.idartlang LEFT JOIN ".$cfg['tab']['cat_lang']." AS e ON a.idcat = e.idcat WHERE a.parentid IN (".implode(", ", $unterkat).") AND d.idtype = '".$cmstypeid."' AND d.typeid = '".$numberofcmstype."' AND d.value != '';";
$db->query($sql);
while ($db->next_record()) {
$suche = klein($db->f("value"));
$suchindex = substr($suche, 0, 1);
$titel = urldecode($db->f("value"));
$artikel = $db->f("idart");
$kategorie = $db->f("idcat");
$abteilung = $db->f("name");
$gefunden = false;
foreach ($liste as $value) {
$wert = ord($suchindex);
if (($wert > 47) && ($wert < 57))
$suchindex = "0-9";
if ($value == $suchindex) {
$gefunden = true;
break;
}
}
if ($gefunden) {
$gesamt[$suchindex][] = array('suche' => $suche, 'titel' => $titel, 'kategorie' => $kategorie, 'artikel' => $artikel, 'abteilung' => $abteilung);
} else {
$gesamt['@'][] = array('suche' => $suche, 'titel' => $titel, 'kategorie' => $kategorie, 'artikel' => $artikel, 'abteilung' => $abteilung);
}
}
echo '<div id="gl_abc">';
for ($i = 0; $i < 14; $i++) {
$text = strtoupper($liste[$i]);
if (is_array($gesamt[ $liste[$i] ])) {
$text = '<a href="front_content.php?idcat='.$parentcatid.'#'.$text.'">'.$text.'</a>';
}
echo $text.' ';
}
echo '</div>';
echo '<div id="gl_abc">';
for ($i = 14; $i < 28; $i++) {
$text = strtoupper($liste[$i]);
if (is_array($gesamt[ $liste[$i] ])) {
$text = '<a href="front_content.php?idcat='.$parentcatid.'#'.$text.'">'.$text.'</a>';
}
echo $text.' ';
}
echo '</div>';
echo '<div id="gl_text">Dieses Glossar enthält '.$anzahl_artikel.' Artikel.</div>';
foreach ($liste as $buchstabe) {
if (is_array($gesamt[$buchstabe])) {
sort($gesamt[$buchstabe]);
$text = strtoupper($buchstabe);
echo '<div id="gl_kat"><a name="'.$text.'"></a>'.$text.'</div>';
foreach ($gesamt[$buchstabe] as $eintrag) {
$link = $sess->url("front_content.php?idcat=".$eintrag['kategorie']."&idart=".$eintrag['artikel'].$sessionid);
echo '<div id="gl_headline"><h2><a href="'.$link.'">'.$eintrag['titel'].'</a></h2></div> ';
}
echo '';
}
}
} else {
echo '<div id="gl_text">Dieses Glossar enthält leider noch keine Artikel.</div>';
}
?>
CSS:
Code: Alles auswählen
/*Glossar*********************************************************/
#gl_abc {
margin-bottom: 5px;
font-size: 14px;
}
#gl_abc a {
margin-bottom: 5px;
font-size: 14px;
font-weight: bold;
}
#gl_headline h2 {
color: #fff;
font-size: 11px;
margin-bottom: 3px;
display:block;
font-weight: normal;
}
#gl_text {
border-top-width: 1px;
border-top-style: solid;
border-top-color: #ccc;
color: #000000;
margin-top: 16px;
margin-bottom: 6px;
padding-top: 6px;
}
#gl_kat {
color: #000000;
margin-top: 10px;
margin-bottom: 6px;
font-weight: bold;
border-top-width: 1px;
border-top-style: solid;
border-top-color: #ccc;
}
LG Benja