Seite 1 von 1

Artikellist mit Dropdown Menü

Verfasst: So 13. Feb 2005, 13:17
von elcono
Hallo,
wie bekomme ich die Artikelliste alphabetisch sortiert ?

Hier der Code:

Code: Alles auswählen

<?php
/***********************************************
* CONTENIDO MODUL - OUTPUT
*
* Modulname	:	Artikellink Dropdown-Menue
* Author		:	Mathias Berkenkamp, Jose Rodriguez, Ekkehard Dörre
* Copyright	:	Mathias Berkenkamp, Jose Rodriguez, Ekkehard Dörre
* Created		:	24-09-2002
* Modified	:	09-03-2003
* Letzte Änderung	:	24-05-2004
* geändert durch	:	Christa Tabara
* Contenido-Version	:	4.4.4
************************************************/

if ("CMS_VALUE[1]" == "0") {

echo "<TABLE cellspacing=\"0\" border=\"0\"><FORM name=\"quicklink\"><TR><TD NOWRAP><SELECT NAME=\"jump\" onChange=\"if (this.options[this.selectedIndex].value.length!=0) location=this.options[this.selectedIndex].value\">";
echo"<OPTION VALUE=link>Bitte w&auml;hlen Sie</OPTION>";
// selected category
$selcat = "CMS_VALUE[0]";

// select all articles in category without start article

if ("CMS_VALUE[2]" == "0") {
$query = "SELECT ARTLANG.title,ARTLANG.idart, ARTLANG.idartlang FROM ".$cfg["tab"]["cat_art"]." AS CATART, ".$cfg["tab"]["art_lang"]." AS ARTLANG ".
         "WHERE CATART.idcat = '$selcat' AND ARTLANG.idart = CATART.idart AND ARTLANG.idlang = '$lang' AND ".
         "ARTLANG.online = '1' ORDER BY CATART.idart ";

// select all articles in category with start article

} else {
$query = "SELECT ARTLANG.title,ARTLANG.idart, ARTLANG.idartlang FROM ".$cfg["tab"]["cat_art"]." AS CATART, ".$cfg["tab"]["art_lang"]." AS ARTLANG ".
         "WHERE CATART.idcat = '$selcat' AND ARTLANG.idart = CATART.idart AND ARTLANG.idlang = '$lang' AND ".
         "ARTLANG.online = '1'AND CATART.is_start = '0' ORDER BY CATART.idart ";

}

// execute query
$db->query($query);

unset($articleID);
unset($linkID);


// get articles
$is_empty=1;
while ($db->next_record()) {
	
  $articleID = $db->f("idartlang");
  $linkID = $db->f("idart");  
  $link = $sess->url("front_content.php?client=$client&lang=$lang&idcat=$selcat&idart=$linkID");  
  $headline = $db->f("title");
  
  
  // HTML template for one element
   echo"<OPTION VALUE=$link>$headline</OPTION>";

  unset($headline);
  $is_empty=0;
} // end while
if ($is_empty == 1) {
        echo "<OPTION>Keine Artikel</OPTION>";
}

echo"</SELECT></FORM>
<SCRIPT LANGUAGE=\"Javascript 1.1\"><!--
document.quicklink.jump.selectedIndex=0;
//--></SCRIPT></TD</TR></table>";

} else {}
?>
Habe es versucht statt

Code: Alles auswählen

"ARTLANG.online = '1' ORDER BY CATART.idart ";

Code: Alles auswählen

"ARTLANG.online = '1' ORDER BY ARTLANG.title ";
aber es funzt nicht :cry:

Re: Artikellist mit Dropdown Menü

Verfasst: So 13. Feb 2005, 13:46
von Halchteranerin
Hi,
elcono hat geschrieben: Habe es versucht statt

Code: Alles auswählen

"ARTLANG.online = '1' ORDER BY CATART.idart ";

Code: Alles auswählen

"ARTLANG.online = '1' ORDER BY ARTLANG.title ";
aber es funzt nicht :cry:
das ist im Prinzip richtig, aber hast du das auch in beiden queries geaendert?

Gruss
Christa

Verfasst: So 13. Feb 2005, 13:47
von pit
hab das mal ausprobiert, bei mir funzt das soweit...

siehst du denn die auswahlliste?

Verfasst: So 13. Feb 2005, 14:01
von elcono
Da was der Fehler, habe es nur im "mit Startartikel" geändert ....

Funzt !

Mod Rewrite mit diesem Modul?

Verfasst: Do 19. Jul 2007, 11:49
von JochBec
Hallo!

ich verwende (noch immer) dieses Modul, es verwendet aber kein Mod_Rewrite. Kann man das mit ein- zwei Zeilen Code dem guten Stück beibringen?

Danke schonmal,


Jochen