Ljus Ljud & Musik HB RSS-feed http://www.ljusljudmusik.se Ljud & Ljus anläggningar se'; /***** ERBJUDANDEN ******/ $q = "SELECT * FROM product "; $q .= "WHERE product.product_publish='Y' AND "; $q .= "product.product_special='Y' "; $q .= "ORDER BY product.product_sku ASC"; $db->query($q); $dbp = new ps_DB; $db_item = new ps_DB; $db_sku = new ps_DB; while ($db->next_record()) { /*** Header ***/ $rssstring .= "\nErbjudanden\n"; $attr_name=""; $attr_value=""; if ($db->f("product_parent_id")) { $q = "SELECT * FROM product, product_category_xref "; $q .= "WHERE product.product_id='".$db->f("product_parent_id")."' "; $q .= "AND product_category_xref.product_id=product.product_id "; $dbp->query($q); $dbp->next_record(); $url = "?page=".$ps_product->get_flypage($db->f("product_parent_id")); $url .= "&product_id=" . $db->f("product_parent_id") . "&show=info"; $url .= "&category_id=".$dbp->f("category_id"); $q = "SELECT attribute_name FROM "; $q .= "product_attribute_sku "; $q .= "WHERE product_id='".$dbp->f("product_id")."' "; $q .= "ORDER BY attribute_list ASC"; $db_sku->query($q); while ($db_sku->next_record()) { $q = "SELECT attribute_name, "; $q .= "attribute_value, product_id "; $q .= "FROM product_attribute WHERE "; $q .= "product_id='" . $db->f("product_id") . "' AND "; $q .= "attribute_name='" . $db_sku->f("attribute_name") . "'"; $db_item->query($q); while ($db_item->next_record()) { $attr_name .= $db_item->f("attribute_name") . " "; $attr_value .= $db_item->f("attribute_value"); } } } else { $q = "SELECT * FROM product, product_category_xref "; $q .= "WHERE product.product_id='".$db->f("product_id")."' "; $q .= "AND product_category_xref.product_id=product.product_id "; $dbp->query($q); $dbp->next_record(); $url = "?page=".$ps_product->get_flypage($db->f("product_id")); $url .= "&product_id=" . $db->f("product_id"); $url .= "&category_id=".$dbp->f("category_id")."&show=info"; } $rssstring .= "" . gethtml($db->f("product_name")); if (strlen($attr_value)>0) { $rssstring .= " " . gethtml($attr_value); } $rssstring .= "\n".URL.gethtml($url)."\n"; /*** Text ***/ $textrad = $dbp->f("product_desc"); if (strlen($textrad)>200) { $textrad = substr($textrad,0,min(strlen($textrad),200))."...
"; } /*** Prisuppgift ***/ $price = $ps_product->get_price($db->f("product_id")); if ($vatinc) { $moms=" inklusive moms"; } else { $moms=" exklusive moms"; } if ($price) { $textrad .= "Just nu: "; $textrad .= round($price["product_price"]) . " " . $price["product_currency"] . $moms; if ($price["product_rabatt"]>0) { $textrad .= "
(ordinarie ".round($price["product_price_ejrabatt"])." ".$price["product_currency"].$moms.")"; } $textrad .= "
Lagerstatus: ".$db->f("product_sku")." ".gethtml($dbp->f("product_name")); if (strlen($attr_value)>0) { $textrad .= " ".$attr_name." ".$attr_value; } if ($db->f("product_in_stock")>0) { $textrad .= " Finns i lager"; } else { $textrad .= "Ungefär ".$dbp->f("product_available_date")." dagar"; } } $rssstring .= "\n
\n"; } /***** NYHETSSPALTEN *****/ $q = "SELECT * FROM news "; $q .= "WHERE news_publish='Y' "; $q .= "ORDER BY news_cdate DESC"; $db->query($q); while ($db->next_record()) { $url = $db->f("news_descr"); $url = strstr($url,"0) { $url = substr($url,9,strpos($url,"\">")-9); } $title = gethtml($db->f("news_rubrik")); $descr = gethtml(strip_tags($db->f("news_descr"),'
')); $rssstring .= "\nNyhetsspalten\n"; $rssstring .= "" . $title; $rssstring .= "\n" . URL . gethtml($url) . "\n"; $rssstring .= "\n\n"; } /***** NYA OCH UPPDATERADE ARTIKLAR *****/ /*** Avsluta Kanalen ***/ $rssstring .= "
\n
"; echo $rssstring; ?>