sandra140681
Grünschnabel
Hallo Leute!
Ich arbeite seit kurzem mit Virtuemart auf Joomla 1.0.*. Leider komme ich nicht auf den Fehler:
Ich muss am Shop eines Bekannten einiges ändern u. hab dazu erstmal Virtuemart upgedatet. Da am bestehenden Shop einige verändert wurde, bin ich dabei, alles wieder so hinzubekommen, wie's vorher war.
Ein Punkt davon: Wenn man auf eine Hauptkategorie klickt, soll per Zufall versch. Bilder angezeigt werden, wobei die diese in folgenden Ordnern abgelegt werden /images/ID-HAUPTKATEGORIE/BILD-NR.jpg.
Die if-Abfrage funktioniert, nur das Bild wird nicht ausgegeben - woran könnte es liegen?!
Hier ein Auszug:
------------------------
function get_child_list($category_id) {
global $sess, $ps_product, $VM_LANG;
$ps_vendor_id = $_SESSION["ps_vendor_id"];
$db = new ps_DB;
$childs = array();
srand((double)microtime()*1000000);
//echo rand(1,20);
if($_GET[category_id]==58 or $_GET[parent_id]==58)
{$categoryid = 58;
$bildid = rand(1, 5);
}
else if ($_GET[category_id]==66 or $_GET[parent_id]==66)
{$categoryid = 66;
$bildid = rand(1, 7);
}
else if ($_GET[category_id]==68 or $_GET[parent_id]==68)
{$categoryid = 68;
$bildid = rand(1, 3);
}
else if ($_GET[category_id]==69 or $_GET[parent_id]==69)
{$categoryid = 69;
$bildid = rand(1, 9);
}
else if ($_GET[category_id]==70 or $_GET[parent_id]==70)
{$categoryid = 70;
$bildid = rand(1, 1);
}
else if ($_GET[category_id]==71 or $_GET[parent_id]==71)
{$categoryid = 71;
$bildid = rand(1, 8);
}
else {$categoryid = 0;}
$parentid = $categoryid;
$html = "";
$q = "SELECT category_id, category_thumb_image, category_child_id,category_name FROM #__{vm}_category,#__{vm}_category_xref ";
$q .= "WHERE #__{vm}_category_xref.category_parent_id='$category_id' ";
$q .= "AND #__{vm}_category.category_id=#__{vm}_category_xref.category_child_id ";
$q .= "AND #__{vm}_category.vendor_id='$ps_vendor_id' ";
$q .= "AND #__{vm}_category.category_publish='Y' ";
$q .= "ORDER BY #__{vm}_category.list_order, #__{vm}_category.category_name ASC";
$db->setQuery($q);
$db->query();
//Bei den Hauptkategorien soll das Produktbild angezeigt werden
if($_GET[category_id]==58 or $_GET[category_id]==71 or $_GET[category_id]==69 or $_GET[category_id]==66 or $_GET[category_id]==70 or $_GET[category_id]==68) {
$html .= "<img src='".$mosConfig_live_site."/templates/morelloo/images/".$_GET[category_id]."/".$bildid.".jpg' width='600'>";
echo ($bildid);
} else {
while( $db->next_record() ) {
$childs[] = array (
'category_name' => $db->f("category_name"),
'category_id' => $db->f("category_id"),
'category_thumb_image' => $db->f("category_thumb_image"),
'number_of_products' => ps_product_category:
roducts_in_category( $db->f("category_id")),
);
}
}
return $childs;
}
------------------------
Hoffe, ihr könnt' mir helfen?!
glg Sandra
Ich arbeite seit kurzem mit Virtuemart auf Joomla 1.0.*. Leider komme ich nicht auf den Fehler:
Ich muss am Shop eines Bekannten einiges ändern u. hab dazu erstmal Virtuemart upgedatet. Da am bestehenden Shop einige verändert wurde, bin ich dabei, alles wieder so hinzubekommen, wie's vorher war.
Ein Punkt davon: Wenn man auf eine Hauptkategorie klickt, soll per Zufall versch. Bilder angezeigt werden, wobei die diese in folgenden Ordnern abgelegt werden /images/ID-HAUPTKATEGORIE/BILD-NR.jpg.
Die if-Abfrage funktioniert, nur das Bild wird nicht ausgegeben - woran könnte es liegen?!
Hier ein Auszug:
------------------------
function get_child_list($category_id) {
global $sess, $ps_product, $VM_LANG;
$ps_vendor_id = $_SESSION["ps_vendor_id"];
$db = new ps_DB;
$childs = array();
srand((double)microtime()*1000000);
//echo rand(1,20);
if($_GET[category_id]==58 or $_GET[parent_id]==58)
{$categoryid = 58;
$bildid = rand(1, 5);
}
else if ($_GET[category_id]==66 or $_GET[parent_id]==66)
{$categoryid = 66;
$bildid = rand(1, 7);
}
else if ($_GET[category_id]==68 or $_GET[parent_id]==68)
{$categoryid = 68;
$bildid = rand(1, 3);
}
else if ($_GET[category_id]==69 or $_GET[parent_id]==69)
{$categoryid = 69;
$bildid = rand(1, 9);
}
else if ($_GET[category_id]==70 or $_GET[parent_id]==70)
{$categoryid = 70;
$bildid = rand(1, 1);
}
else if ($_GET[category_id]==71 or $_GET[parent_id]==71)
{$categoryid = 71;
$bildid = rand(1, 8);
}
else {$categoryid = 0;}
$parentid = $categoryid;
$html = "";
$q = "SELECT category_id, category_thumb_image, category_child_id,category_name FROM #__{vm}_category,#__{vm}_category_xref ";
$q .= "WHERE #__{vm}_category_xref.category_parent_id='$category_id' ";
$q .= "AND #__{vm}_category.category_id=#__{vm}_category_xref.category_child_id ";
$q .= "AND #__{vm}_category.vendor_id='$ps_vendor_id' ";
$q .= "AND #__{vm}_category.category_publish='Y' ";
$q .= "ORDER BY #__{vm}_category.list_order, #__{vm}_category.category_name ASC";
$db->setQuery($q);
$db->query();
//Bei den Hauptkategorien soll das Produktbild angezeigt werden
if($_GET[category_id]==58 or $_GET[category_id]==71 or $_GET[category_id]==69 or $_GET[category_id]==66 or $_GET[category_id]==70 or $_GET[category_id]==68) {
$html .= "<img src='".$mosConfig_live_site."/templates/morelloo/images/".$_GET[category_id]."/".$bildid.".jpg' width='600'>";
echo ($bildid);
} else {
while( $db->next_record() ) {
$childs[] = array (
'category_name' => $db->f("category_name"),
'category_id' => $db->f("category_id"),
'category_thumb_image' => $db->f("category_thumb_image"),
'number_of_products' => ps_product_category:

);
}
}
return $childs;
}
------------------------
Hoffe, ihr könnt' mir helfen?!
glg Sandra
Zuletzt bearbeitet: