Artikel wie ein Lexikon darstellen und darin Navigieren...
Nein, da der Code immer nur Kategorie A ausgeben sollte. Ich habe keine Ahnung, woher nur das A kommt...
Und wenn Du mehr Artikel anlegst, erhältst Du das Spielchen für jeden Artikel?
Gruß
HerrB
Und wenn Du mehr Artikel anlegst, erhältst Du das Spielchen für jeden Artikel?
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
Doppelte anzeige
JA bekomme es für jeden artikel
er schreibt mir immer die Kategori mit ? ohhman ich hoffe das ich mal weiter komm mit dem SQL hab ich immer noch nicht verstanden
Übrigens danke für die Schnelle antwort
kann es an abteilung liegen ?
er schreibt mir immer die Kategori mit ? ohhman ich hoffe das ich mal weiter komm mit dem SQL hab ich immer noch nicht verstanden
Übrigens danke für die Schnelle antwort
Code: Alles auswählen
if ($gefunden) {
$gesamt[$suchindex][] = array('suche' => $suche, 'titel' => $titel, 'kategorie' => $kategorie, 'artikel' => $artikel, '[b]abteilung[/b]' => [b]$abteilung); [/b]
} else {
$gesamt['@'][] = array('suche' => $suche, 'titel' => $titel, 'kategorie' => $kategorie, 'artikel' => $artikel, 'abteilung' => $abteilung);
}
}
echo ' <tr><td align="right" colspan="3" class="liste">';
for ($i = 0; $i < 14; $i++) {
$text = strtoupper($liste[$i]);
if (is_array($gesamt[ $liste[$i] ])) {
$text = '<a href="#'.$text.'" class="liste">'.$text.'</a>';
}
echo $text.' ';
}
echo '</td></tr>
<tr><td align="right" colspan="3" class="liste">';
for ($i = 14; $i < 28; $i++) {
$text = strtoupper($liste[$i]);
if (is_array($gesamt[ $liste[$i] ])) {
$text = '<a href="#'.$text.'" class="liste">'.$text.'</a>';
}
Ich sage ja, ich habe keine Ahnung. Die Daten werden hier gesammelt:
Man sieht, $abteilung ist Name der Kategorie. Die Ausgabe erfolgt hier:
Es werden ausgegeben: $text (ist der Buchstabe), $eintrag['titel'] (ist irgendein Inhalt aus dem Artikel) und $eintrag['abteilung'] (der Name der Kategorie) - und das einzige Element in Klammern.
Wie gesagt, ich habe keine Idee. Was ist "Kategorie A" vs. "A"? Wenn Kategorie A "hubbabubba" lautet, was ist dann A?
Kannst Du mal einen Screenshot der Kategorien liefern?
Gruß
HerrB
Code: Alles auswählen
$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");
Code: Alles auswählen
$text = strtoupper($buchstabe);
echo ' <tr><td colspan="3" width="'.$textspalteplus.'"><img src="images/dotclear.gif" width="'.$textspalteplus.'" height="20" alt=""></td></tr>
<tr>
<td valign="top" width="'.$breiterand.'"> </td>
<td valign="top" width="'.$breitekomplett.'" valign="top"><a name="'.$text.'"></a>'.$text.'</td>
<td valign="top" width="'.$breiterand.'"> </td>
</tr>
';
foreach ($gesamt[$buchstabe] as $eintrag) {
$link = $sess->url("front_content.php?idcat=".$eintrag['kategorie']."&idart=".$eintrag['artikel'].$sessionid);
echo ' <tr>
<td valign="top" width="'.$breiterand.'"> </td>
<td valign="top" width="'.$breitekomplett.'" valign="top"><a href="'.$link.'" class="liste_headlinelink">'.$eintrag['titel'].'</a> ('.$eintrag['abteilung'].')</td>
<td valign="top" width="'.$breiterand.'"> </td>
</tr>
Wie gesagt, ich habe keine Idee. Was ist "Kategorie A" vs. "A"? Wenn Kategorie A "hubbabubba" lautet, was ist dann A?
Kannst Du mal einen Screenshot der Kategorien liefern?
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
klap noch nicht
Hallo und Sorry das ich mich solange nicht gemeldet hab
an bei meine Kategorien
-Glossar Inhalt
Kategorie A
Kategorie B
und hir meine AUSGABE
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 @
Dieses Glossar enthält 4 Artikel.
A
A Test01 (A)
A Test01 (Kategorie A)
B
BBS (B)
BBS (Kategorie B)
jetz ist meine Frage wieso ich ein und den selben artikel 2fach angezeigt bekomme und ich es beheben kann die
[/code]
an bei meine Kategorien
-Glossar Inhalt
Kategorie A
Kategorie B
und hir meine AUSGABE
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 @
Dieses Glossar enthält 4 Artikel.
A
A Test01 (A)
A Test01 (Kategorie A)
B
BBS (B)
BBS (Kategorie B)
jetz ist meine Frage wieso ich ein und den selben artikel 2fach angezeigt bekomme und ich es beheben kann die
[/code]
Hilfe
KAnn nimat mir sagen was ich verkehrt mach
Nein, ehrlich gesagt, nicht. Tut mir leid.
Ich kann Dir z.Z. leider nicht helfen (V4.6...).
Gruß
HerrB
Ich kann Dir z.Z. leider nicht helfen (V4.6...).
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
kategorie nicht anzeigen
Danke für das tolle Modul. Funktioniert auch sehr gut.
Ich habe die Kategorie, in der sich die Artikel befinden, offline gesetzt.
Wenn nun aber über das Glossar ein entsprechender Artikel geöffnet wird, dann wird ein entsprechender Menüpunkt der geschützten Kategorie in der Navigation geöffnet. Zwar ohne Inhalt aber praktisch als Platzhalter.
Hat jemand eine Idee, wie dies zu verhindern ist?
Vielen Dank.
Mc
Ich habe die Kategorie, in der sich die Artikel befinden, offline gesetzt.
Wenn nun aber über das Glossar ein entsprechender Artikel geöffnet wird, dann wird ein entsprechender Menüpunkt der geschützten Kategorie in der Navigation geöffnet. Zwar ohne Inhalt aber praktisch als Platzhalter.
Hat jemand eine Idee, wie dies zu verhindern ist?
Vielen Dank.
Mc
Glossar unter 4.6.8
Hallo!
Das Modul läuft bei mir, soweit nur unter der neuen Version klappt es mit den Links aus dem ABC im Kopfbereich nicht mehr...
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 @
klickt man auf einen Buchstaben lande ich auf meiner Fehlerseite, anstelle auf den Textlink/Index der Seite, der Link der übergeben wird sieht so aus http://www.mein-foto-abc.de/cms/#A - müste es nicht ungefähr so lauten: http://www.mein-foto-abc.de/cms/front_c ... idcat=25#A ???
Da ich noch stets kein PHP etc. kann, welche Veränderung muss durchgeführt werden für die neue Contenido Version 4.6.8??
Das Modul läuft bei mir, soweit nur unter der neuen Version klappt es mit den Links aus dem ABC im Kopfbereich nicht mehr...
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 @
klickt man auf einen Buchstaben lande ich auf meiner Fehlerseite, anstelle auf den Textlink/Index der Seite, der Link der übergeben wird sieht so aus http://www.mein-foto-abc.de/cms/#A - müste es nicht ungefähr so lauten: http://www.mein-foto-abc.de/cms/front_c ... idcat=25#A ???
Da ich noch stets kein PHP etc. kann, welche Veränderung muss durchgeführt werden für die neue Contenido Version 4.6.8??
Code: Alles auswählen
Beschreibung
Für das Glossar muss eine Oberkategorie erzeugt werden.
Darunter legt man für jeden Anfangsbuchstaben eine Kategorie an.
$parentcatid ist die idcat der Oberkategorie.
$cmstypeid ist die interne ID des Content-Typs, 2 ist z.B. CMS_HTML.
$numberofcmstype ist die Nummer, die im Textmodul hinter dem Contenttyp steht, z.B. 1 bei CMS_HTML[1].
Code: Alles auswählen
Output
<?php
$parentcatid = 25;
$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;
}
$db = new DB_Contenido;
$db2 = new DB_Contenido;
$breiterand = 0;
$breitekomplett = 500 - 2 * $breiterand;
$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] = "";
}
// 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 = ".$parentcatid." 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 = ".$parentcatid." 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 '<table><tr><td align="right" colspan="3" class="liste">';
for ($i = 0; $i < 14; $i++) {
$text = strtoupper($liste[$i]);
if (is_array($gesamt[ $liste[$i] ])) {
$text = '<a href="#'.$text.'" class="liste">'.$text.'</a>';
}
echo $text.' ';
}
echo '</td></tr>
<tr><td align="right" colspan="3" class="liste">';
for ($i = 14; $i < 28; $i++) {
$text = strtoupper($liste[$i]);
if (is_array($gesamt[ $liste[$i] ])) {
$text = '<a href="#'.$text.'" class="liste">'.$text.'</a>';
}
echo $text.' ';
}
echo '</td></tr>
<tr><td colspan="3" class="text">Das ABC enthält zur Zeit '.$anzahl_artikel.' Artikel.</td></tr>
';
foreach ($liste as $buchstabe) {
if (is_array($gesamt[$buchstabe])) {
sort($gesamt[$buchstabe]);
$text = strtoupper($buchstabe);
echo '<tr><td colspan="3" width="'.$textspalteplus.'"><img src="upload/bilder/dotclear.gif" width="'.$textspalteplus.'" height="20" alt=""></td></tr>
<tr>
<td valign="top" width="'.$breiterand.'"> </td>
<td valign="top" width="'.$breitekomplett.'" valign="top"><a name="'.$text.'"></a>'.$text.'<hr width="100%" size="1" noshade></td>
<td valign="top" width="'.$breiterand.'"> </td>
</tr>
';
foreach ($gesamt[$buchstabe] as $eintrag) {
$link = $sess->url("front_content.php?idcat=".$eintrag['kategorie']."&idart=".$eintrag['artikel'].$sessionid);
echo '<tr>
<td valign="top" width="'.$breiterand.'"> </td>
<td valign="top" width="'.$breitekomplett.'" valign="top"><a href="'.$link.'" class="liste_headlinelink">'.$eintrag['titel'].'</a><font class="klein"> ('.$eintrag['abteilung'].')</font></td>
<td valign="top" width="'.$breiterand.'"> </td>
</tr>
';
}
echo '<tr>
<td valign="top" width="'.$breiterand.'"> </td>
<td valign="top" width="'.$breitekomplett.'"> </td>
<td valign="top" width="'.$breiterand.'"> </td>
</tr>
';
}
}
} else {
echo '<tr>
<td valign="top" width="'.$breiterand.'"> </td>
<td valign="top" align="center" width="'.$breitekomplett.'">Dieses Glossar enthält leider noch keine Artikel.</td>
<td valign="top" width="'.$breiterand.'"> </td>
</tr>
<tr>
<td valign="top" width="'.$breiterand.'"> </td>
<td valign="top" width="'.$breitekomplett.'"> </td>
<td valign="top" width="'.$breiterand.'"> </td>
</tr>
';
}
echo '</table>';
unset ($breiterand);
unset ($breitekomplett);
?>
Mit freundlichen Grüßen
Jörg Knörchen
Meine Hobby-Webseite:
www.mein-foto-abc.de : contenido 4.6.15 - I love it! : www.yogie.de : www.bastelstun.de
Jörg Knörchen
Meine Hobby-Webseite:
www.mein-foto-abc.de : contenido 4.6.15 - I love it! : www.yogie.de : www.bastelstun.de
-
- Beiträge: 86
- Registriert: Mi 20. Apr 2005, 16:16
- Kontaktdaten:
Ich benutze auch diese Modul "Glossarliste" unter Contenido Release: 4.6.15. Bei mir zeigt es im Kopfbereich zwar das ABC ... Z an, aber ich kann keins anklicken ...?
Könnt Ihr mir helfen???
[/quote]
Könnt Ihr mir helfen???
Code: Alles auswählen
<?php
$parentcatid = 57;
$cmstypeid = 2;
$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;
$breiterand = 5;
$breitekomplett = 200 - 2 * $breiterand;
$liste = array( "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 ' <tr><td colspan="3" class="glossliste">';
for ($i = 0; $i < 26; $i++) {
$text = strtoupper($liste[$i]);
if (is_array($gesamt[ $liste[$i] ])) {
$text = '<a href="#'.$text.'" class="liste">'.$text.'</a>';
}
echo $text.' ';
}
echo '</td></tr>
<tr><td colspan="3" class="text">Dieses Telefonbuch enthält '.$anzahl_artikel.' Artikel.</td></tr>
';
foreach ($liste as $buchstabe) {
if (is_array($gesamt[$buchstabe])) {
sort($gesamt[$buchstabe]);
$text = strtoupper($buchstabe);
echo ' <tr><td colspan="3" width="'.$textspalteplus.'"><img src="images/dotclear.gif" width="'.$textspalteplus.'" height="20" alt=""></td></tr>
<tr>
<td valign="top" width="'.$breiterand.'"> </td>
<td valign="top" width="'.$breitekomplett.'" valign="top"><a name="'.$text.'"></a>'.$text.'</td>
<td valign="top" width="'.$breiterand.'"> </td>
</tr>
';
foreach ($gesamt[$buchstabe] as $eintrag) {
$link = $sess->url("front_content.php?idcat=".$eintrag['kategorie']."&idart=".$eintrag['artikel'].$sessionid);
echo ' <tr>
<td valign="top" width="'.$breiterand.'"> </td>
<td valign="top" width="'.$breitekomplett.'" valign="top"><a href="'.$link.'" class="liste_headlinelink">'.$eintrag['titel'].'</a> ('.$eintrag['abteilung'].')</td>
<td valign="top" width="'.$breiterand.'"> </td>
</tr>
';
}
echo ' <tr>
<td valign="top" width="'.$breiterand.'"> </td>
<td valign="top" width="'.$breitekomplett.'"> </td>
<td valign="top" width="'.$breite.'"> </td>
</tr>
';
}
}
} else {
echo ' <tr>
<td valign="top" width="'.$breiterand.'"> </td>
<td valign="top" align="center" width="'.$breitekomplett.'">Dieses Glossar enthält leider noch keine Artikel.</td>
<td valign="top" width="'.$breiterand.'"> </td>
</tr>
<tr>
<td valign="top" width="'.$breiterand.'"> </td>
<td valign="top" width="'.$breitekomplett.'"> </td>
<td valign="top" width="'.$breiterand.'"> </td>
</tr>
';
}
unset ($breiterand);
unset ($breitekomplett);
?>
Hast du denn Artikel angelegt?
Unter 4.6.15 läuft es auch, habe aber mit der Zweisprachigkeit Probleme.
siehe http://www.webec.de
Gruß Mc
Unter 4.6.15 läuft es auch, habe aber mit der Zweisprachigkeit Probleme.
siehe http://www.webec.de
Gruß Mc
-
- Beiträge: 86
- Registriert: Mi 20. Apr 2005, 16:16
- Kontaktdaten:
Probier mal dieses Modul. Kann aber sein, dass es das gleiche ist.
Gruß Mc
Gruß Mc
Code: Alles auswählen
<?php
$parentcatid = 18;
$cmstypeid = 1;
$numberofcmstype = 1;
echo "<!-- Modul: Glossarliste -->\n";
echo "<table ...>\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;
$breiterand = 5;
$breitekomplett = 200 - 2 * $breiterand;
$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 ' <tr><td align="left" colspan="3" class="glossar">';
for ($i = 0; $i < 28; $i++) {
$text = strtoupper($liste[$i]);
if (is_array($gesamt[ $liste[$i] ])) {
$text = '<a href="front_content.php?idcat=17#'.$text.'" class="glossar">'.$text.'</a>';
}
echo $text.' ';
}
/* echo '</td></tr>
<tr><td align="left" colspan="3" class="glossar">';
for ($i = 14; $i < 28; $i++) {
$text = strtoupper($liste[$i]);
if (is_array($gesamt[ $liste[$i] ])) {
$text = '<a href="#'.$text.'" class="glossar">'.$text.'</a>';
}
echo $text.' ';
}
*/
echo '</td></tr>
<tr><td colspan="3" align="left" class="text">Dieses Glossar enthält '.$anzahl_artikel.' Artikel.</td></tr>
';
foreach ($liste as $buchstabe) {
if (is_array($gesamt[$buchstabe])) {
sort($gesamt[$buchstabe]);
$text = strtoupper($buchstabe);
echo ' <tr><td colspan="3" width="'.$textspalteplus.'"><img src="images/dotclear.gif" width="'.$textspalteplus.'" height="10" alt=""></td></tr>
<tr>
<td valign="top" width="'.$breiterand.'"> </td>
<td valign="top" width="'.$breitekomplett.'" valign="top" class="glossar_liste"><a name="'.$text.'"></a>'.$text.'</td>
<td valign="top" width="'.$breiterand.'"> </td>
</tr>
';
foreach ($gesamt[$buchstabe] as $eintrag) {
$link = $sess->url("front_content.php?idcat=".$eintrag['kategorie']."&idart=".$eintrag['artikel'].$sessionid);
echo ' <tr>
<td valign="top" width="'.$breiterand.'"> </td>
<!--<td valign="top" width="'.$breitekomplett.'" valign="top" class="glossar_liste"><a href="'.$link.'" class="glossar_headlinelink">'.$eintrag['titel'].'</a> ('.$eintrag['abteilung'].')</td> -->
<td valign="top" width="'.$breitekomplett.'" valign="top" class="glossar_liste"><a href="'.$link.'" class="glossar_headlinelink">'.$eintrag['titel'].'</a></td>
<td valign="top" width="'.$breiterand.'"> </td>
</tr>
';
}
/* Abstand verkleinern
echo ' <tr>
<td valign="top" width="'.$breiterand.'"> </td>
<td valign="top" width="'.$breitekomplett.'"> </td>
<td valign="top" width="'.$breiterand.'"> </td>
</tr>
';
*/
}
}
} else {
echo ' <tr>
<td valign="top" width=""> </td>
<td valign="top" align="left" width="">Dieses Glossar enthält leider noch keine Artikel.</td>
<td valign="top" width=""> </td>
</tr>
<tr>
<td valign="top" width=""> </td>
<td valign="top" width=""> </td>
<td valign="top" width=""> </td>
</tr>
';
}
unset ($breiterand);
unset ($breitekomplett);
echo "</table>\n";
?>
Ich habe das Modul etwas abgeändert. In Zeile 105 wurde die Variable $parentcatid für die Anker-Links nicht automatisch abgefragt, was dann zu Fehlern führte wenn die Links in der Kopfzeile angeklickt werden.
Bei mir läuft das Modul jetzt unter 4.6.15 problemlos.
Hier der Code:
Natürlich sind die Variablen am Anfang dementsprechend zu ändern.
Bei mir läuft das Modul jetzt unter 4.6.15 problemlos.
Hier der Code:
Code: Alles auswählen
<?php
$parentcatid = 36;
$cmstypeid = 1;
$numberofcmstype = 1;
echo "<!-- Modul: Glossarliste -->\n";
echo "<table ...>\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;
$breiterand = 5;
$breitekomplett = 200 - 2 * $breiterand;
$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 ' <tr><td align="left" colspan="3" class="glossar"><br>';
for ($i = 0; $i < 28; $i++) {
$text = strtoupper($liste[$i]);
if (is_array($gesamt[ $liste[$i] ])) {
$text = '<a href="front_content.php?idcat='.$parentcatid.'#'.$text.'" class="glossar">'.$text.'</a>';
}
echo $text.' ';
}
/* echo '</td></tr>
<tr><td align="left" colspan="3" class="glossar">';
for ($i = 14; $i < 28; $i++) {
$text = strtoupper($liste[$i]);
if (is_array($gesamt[ $liste[$i] ])) {
$text = '<a href="#'.$text.'" class="glossar">'.$text.'</a>';
}
echo $text.' ';
}
*/
echo '</td></tr>
<tr><td colspan="3" align="left" class="text">Dieses Glossar enthält '.$anzahl_artikel.' Artikel.</td></tr>
';
foreach ($liste as $buchstabe) {
if (is_array($gesamt[$buchstabe])) {
sort($gesamt[$buchstabe]);
$text = strtoupper($buchstabe);
echo ' <tr><td colspan="3" width="'.$textspalteplus.'"><img src="images/dotclear.gif" width="'.$textspalteplus.'" height="10" alt=""></td></tr>
<tr>
<td valign="top" width="'.$breiterand.'"> </td>
<td valign="top" width="'.$breitekomplett.'" valign="top" class="glossar_liste"><a name="'.$text.'"></a>'.$text.'</td>
<td valign="top" width="'.$breiterand.'"> </td>
</tr>
';
foreach ($gesamt[$buchstabe] as $eintrag) {
$link = $sess->url("front_content.php?idcat=".$eintrag['kategorie']."&idart=".$eintrag['artikel'].$sessionid);
echo ' <tr>
<td valign="top" width="'.$breiterand.'"> </td>
<!--<td valign="top" width="'.$breitekomplett.'" valign="top" class="glossar_liste"><a href="'.$link.'" class="glossar_headlinelink">'.$eintrag['titel'].'</a> ('.$eintrag['abteilung'].')</td> -->
<td valign="top" width="'.$breitekomplett.'" valign="top" class="glossar_liste"><a href="'.$link.'" class="glossar_headlinelink">'.$eintrag['titel'].'</a></td>
<td valign="top" width="'.$breiterand.'"> </td>
</tr>
';
}
/* Abstand verkleinern
echo ' <tr>
<td valign="top" width="'.$breiterand.'"> </td>
<td valign="top" width="'.$breitekomplett.'"> </td>
<td valign="top" width="'.$breiterand.'"> </td>
</tr>
';
*/
}
}
} else {
echo ' <tr>
<td valign="top" width=""> </td>
<td valign="top" align="left" width="">Dieses Glossar enthält leider noch keine Artikel.</td>
<td valign="top" width=""> </td>
</tr>
<tr>
<td valign="top" width=""> </td>
<td valign="top" width=""> </td>
<td valign="top" width=""> </td>
</tr>
';
}
unset ($breiterand);
unset ($breitekomplett);
echo "</table>\n";
?>
Ich habe mal den Code von Marxer etwas geändert.
Die Ausgabe erfolgt nun nichtmehr über eine Tabelle. Das Layout wird nun mit CSS bestimmt.
Code:
CSS
Die Ausgabe erfolgt nun nichtmehr über eine Tabelle. Das Layout wird nun mit CSS bestimmt.
Code:
Code: Alles auswählen
<?php
$parentcatid = 1;
$cmstypeid = 1;
$numberofcmstype = 1;
echo "<!-- Modul: Glossarliste -->\n";
echo "<div id='glossar'>";
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 = 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;
$breiterand = 5;
$breitekomplett = 200 - 2 * $breiterand;
$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);
}
}
$quickLinks = "";
for ($i = 0; $i < 28; $i++) {
$text = strtoupper($liste[$i]);
if (is_array($gesamt[ $liste[$i] ])) {
$quickLinks .= "<li><a href=\"front_content.php?idcat=".$parentcatid."#".$text."\" class=\"glossar\">".$text."</a></li>";
} else {
$quickLinks .= "<li>".$text."</li>";
}
}
echo "<ul id='glossarQuicklinks'>".$quickLinks."</ul>".
"<br /><p>Dieses Glossar enthält ".$anzahl_artikel." Artikel</p>";
/******
*** Einträge
******/
echo "<ul id='glossarEintraege'>";
foreach ($liste as $buchstabe) {
if (is_array($gesamt[$buchstabe])) {
sort($gesamt[$buchstabe]);
$text = strtoupper($buchstabe);
echo "<li id=".$text.">".$text."</li>";
foreach ($gesamt[$buchstabe] as $eintrag) {
$link = $sess->url("front_content.php?idcat=".$eintrag['kategorie']."&idart=".$eintrag['artikel'].$sessionid);
echo "<li><a href=".$link." class='glossar_headlinelink'>".$eintrag['titel']."</a></li>";
}
}
}
echo "</div>"; // close div glossarEinträge
} else {
echo "<div id=\"glossarEintraege\">Dieses Glossar enthält leider noch keine Artikel.</div>";
}
unset ($breiterand);
unset ($breitekomplett);
echo "</div>";
?>
Code: Alles auswählen
/* Glossar */
#glossar {
}
#glossarQuicklinks {
list-style: none;
}
#glossarQuicklinks li {
float: left;
margin-right: 10px;
}
#glossarEintraege {
list-style: none;
}
Modul: Glossarliste
Hallo,
kann mir jemand beschreiben was ich da ganz genau machen muss damit ich diesen Glossar zum laufen bringe?
Folgendes habe ich bisher verstanden und umgesetzt:
Muss ich da sonst noch etwas beachten? habe ich da etwas vergessen?
Welche nummern muss ich bei $parentcatid = ???; $cmstypeid = ???; $numberofcmstype = ???; Ich habe dort überall eine 1 stehen.
Momentan erscheint bei mir die Liste zwar aber mit der Kompletten Hauptnavigation und @ zeichen, es werden die Strukturen von der Hauptnavigation aufgelistet aber die Kategorien die ich im Verzeichniss glossar angelegt habe nicht.
Kann mir da jemand helfen.
Ein Danke schonmal im voraus.
[/list]
kann mir jemand beschreiben was ich da ganz genau machen muss damit ich diesen Glossar zum laufen bringe?
Folgendes habe ich bisher verstanden und umgesetzt:
- den Code von "Cym" als neues Module in die Ausgabe. Dann ein Template erstellen "glossar".
- Im Content Kategorie ein Verzeichniss anlegen z. B. "Glossar", dort das Template auswählen "glossar".
- Dann Hauptverzeichnisse z. B. "Kategorie 1", "Kategorie 2" ...
- Dann Artikel anlegen, die sich in der Jeweiligen Kategorien befinden. z. B. in Kategorie1 "Artikel 1", in Kategorie2 "Artikel 2"
Muss ich da sonst noch etwas beachten? habe ich da etwas vergessen?
Welche nummern muss ich bei $parentcatid = ???; $cmstypeid = ???; $numberofcmstype = ???; Ich habe dort überall eine 1 stehen.
Momentan erscheint bei mir die Liste zwar aber mit der Kompletten Hauptnavigation und @ zeichen, es werden die Strukturen von der Hauptnavigation aufgelistet aber die Kategorien die ich im Verzeichniss glossar angelegt habe nicht.
Kann mir da jemand helfen.
Ein Danke schonmal im voraus.
[/list]