..und wenn Du cat_id = 1 AND cat_id = 5 in die Where-Klausel einfügst... des funktioniert nich ?
Ansonsten schreib ma dem Autoren ´ne Mail, der is eigentlich ganz in Ordnung und wird dir weiterhelfen, wenn er kann.
Nur bestimmte Kategorien anzeigen
Forumsregeln
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.1, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.1, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
Code: Alles auswählen
..und wenn Du cat_id = 1 AND cat_id = 5 in die Where-Klausel einfügst... des funktioniert nich ? Aber einen hab ich noch. Ich werde mal versuchen in der content.php die Funktionen in ein foreach zu packen, so dass die Funktion für jedes Element im Array einmal ausgeführt wird. (<-- Strohhalm
by[t]e,
Chaze
!!!--> Kein Support per PN oder Mail <--!!!
Chaze
!!!--> Kein Support per PN oder Mail <--!!!
* Chaze klopft sich selber auf die Schulter und freut sich, dass er doch nicht so doof ist...
Der Schlüssel lag in der Funktion get_cat:
Der Schlüssel lag in der Funktion get_cat:
Mit OR anstatt mit AND funktioniert es.function get_cat($cat_id)
{
global $db;
// vérifier la catégorie
if ($cat_id <= 0) $cat_id = -1;
if ($cat_id > 0)
{
$sql = "SELECT * FROM " . CATEGORIES_TABLE . " WHERE cat_id = 1 OR cat_id = 3";
if ( !($result = $db->sql_query($sql)) ) message_die(GENERAL_ERROR, 'Could not query this categories A', '', __LINE__, __FILE__, $sql);
if ( !($row = $db->sql_fetchrow($result)) ) $cat_id = -1;
}
//
// no cat selected : get all
if ($cat_id <= 0)
{
//-- v 1.0.5
$sql = "SELECT * FROM " . CATEGORIES_TABLE . " WHERE cat_id = 1 OR cat_id = 3 ORDER BY cat_order";
//--
if ( !($result = $db->sql_query($sql)) ) message_die(GENERAL_ERROR, 'Could not query categories list B', '', __LINE__, __FILE__, $sql);
while ( $row = $db->sql_fetchrow($result) ) $category_rows[] = $row;
}
//
// a cat selected : get it and its sub-cats
if ($cat_id > 0)
{
// add the current one
$catrow[] = $row;
// get sub-cats
$catrow = get_sub_cat($cat_id,$catrow);
// get cats
//-- v 1.0.5
$sql = "SELECT * FROM " . CATEGORIES_TABLE . " ORDER BY cat_order";
//--
if( !($result = $db->sql_query($sql)) ) message_die(GENERAL_ERROR, 'Could not query categories list C', '', __LINE__, __FILE__, $sql);
while ($row = $db->sql_fetchrow($result) )
{
$found = false;
for ($i=0;( $i<count($catrow) && (!$found) );$i++) $found = ($row['cat_id'] == $catrow[$i]['cat_id']);
if ($found) $category_rows[] = $row;
}
}
return $category_rows;
}
by[t]e,
Chaze
!!!--> Kein Support per PN oder Mail <--!!!
Chaze
!!!--> Kein Support per PN oder Mail <--!!!