prefix."product_list` WHERE `display_frontpage` IN('1') AND `active` IN('1')"; $product_list = $wpdb->get_results($sql,ARRAY_A); $output = "
\n\r"; foreach((array)$product_list as $product) { $output .= "
\n\r"; $output .= ""; if($product['image'] != '') { $output .= "".$product[\n\r"; $output .= "

\n\r"; $output .= stripslashes($product['name']); $output .= "\n\r"; if($product['special']==1) { $output .= "".nzshpcrt_currency_display($product['price'], $product['notax'])."
\n\r"; $output .= nzshpcrt_currency_display(($product['price'] - $product['special_price']), $product['notax'],false,$product['id']); } else { $output .= "".nzshpcrt_currency_display($product['price'], $product['notax']); } $output .= "
\n\r"; $output .= "

\n\r"; } $output .= "
"; $output .= "
\n\r"; } $output .= "
\n\r"; $output .= "
\n\r"; return preg_replace("/\[homepage_products\]/", $output, $content); } function nszhpcrt_category_tag($content = '') { //require_once('themes/iShop/iShop.php'); global $wpdb; if(preg_match_all("/\[wpsc_category=([\d]+),*(full)?\]/", $content, $matches)) { foreach($matches[1] as $key => $category_id) { $categories[$key]['id'] = $category_id; $categories[$key]['display'] = $matches[2][$key]; $categories[$key]['original_string'] = $matches[0][$key]; } //echo("
".print_r($categories,true)."
"); $siteurl = get_option('siteurl'); if(get_option('permalink_structure') != '') { $seperator ="?"; } else { $seperator ="&"; } foreach((array)$activated_widgets as $widget_container) { if(is_array($widget_container) && array_search(TXT_WPSC_DONATIONS, $widget_container)) { $no_donations_sql = "AND `".$wpdb->prefix."product_list`.`donation` != '1'"; break; } } foreach((array)$categories as $category) { $full_view = null; if($category['display'] == 'full') { $full_view = $category['display']; } $sql = "SELECT DISTINCT `".$wpdb->prefix."product_list`.*, `".$wpdb->prefix."item_category_associations`.`category_id`,`".$wpdb->prefix."product_order`.`order`, IF(ISNULL(`".$wpdb->prefix."product_order`.`order`), 0, 1) AS `order_state` FROM `".$wpdb->prefix."product_list` LEFT JOIN `".$wpdb->prefix."item_category_associations` ON `".$wpdb->prefix."product_list`.`id` = `".$wpdb->prefix."item_category_associations`.`product_id` LEFT JOIN `".$wpdb->prefix."product_order` ON ( ( `".$wpdb->prefix."product_list`.`id` = `".$wpdb->prefix."product_order`.`product_id` ) AND ( `".$wpdb->prefix."item_category_associations`.`category_id` = `".$wpdb->prefix."product_order`.`category_id` ) ) WHERE `".$wpdb->prefix."product_list`.`active` = '1' AND `".$wpdb->prefix."item_category_associations`.`category_id` IN ('".$category['id']."') $no_donations_sql ORDER BY `order_state` DESC,`".$wpdb->prefix."product_order`.`order` ASC"; $product_list = $wpdb->get_results($sql,ARRAY_A); $output = "
\n\r"; if ($full_view != null){ $output .= ""; } foreach((array)$product_list as $product) { $wpsc_theme = wpsc_theme_html($product); if ($full_view == null) { $output .= "
\n\r"; } else { /* product image is here */ $output .= "
"; $output .= ""; $output .=""; } else { $output .= "\n\r"; $output .= ""; } } if ($full_view != null) { $output .= "
"; } $output .=""; if($product['image'] != '') { $output .= "".$product[\n\r"; } $output .= ""; $output .= "" . stripslashes($product['name']) . ""; $output .= TXT_WPSC_PRICE.": " . nzshpcrt_currency_display($product['price'], $product['notax']) . "
"; if ($full_view != null) { $output .= "
"; } else { $output .= "
"; } if (get_option('hide_name_link')!=1) { if(($product['special']==1) && ($variations_output[1] === null)) { $output .= "$specialSpecial / Sale Price - " . stripslashes($product['name']) . ""; } else { //$output .= "$special" . stripslashes($product['name']) . ""; } } else { if(($product['special']==1) && ($variations_output[1] === null)) { $output .= "$specialSpecial / Sale Price - " . stripslashes($product['name']) . ""; } else { //$output .= "$special" . stripslashes($product['name']) . ""; } } if ($full_view !=null) { if($product['description'] != '') { $output .= "

".nl2br(stripslashes($product['description'])) . "

"; } if($product['additional_description'] != '') { $output .= ""; $output .= "".$product["; $output .= TXT_WPSC_MOREDETAILS.""; $output .= "
"; $output .= nl2br(stripslashes($product['additional_description'])) . ""; $output .= "

"; } } if ($full_view != null) { if(get_option('product_ratings') == 1) { $output .= ""; } $output .="
"; } $output .= "
\n\r"; $output .= "
\n\r"; $content = str_replace($category['original_string'], $output, $content); } } return $content; } ?>