Thread: Newest Products
View Single Post
  #211  
Old 04-23-2008, 01:14 PM
 
flawfulfibers flawfulfibers is offline
 

Member
  
Join Date: Mar 2008
Posts: 10
 

Default Re: Newest Products

Anyone have any ideas? PLEASE???

here's one of the messages that I get:

[22-Apr-2008 23:46:20] (shop: 23-Apr-2008 00:46:20) SQL error:
Site :
http://www.flawfulfibers.com
Remote IP : 82.165.28.150
Logged as :
SQL query : SELECT xcart_products.productid, IF(xcart_products_lng.productid != '', xcart_products_lng.product, xcart_products.product) as product, xcart_products.productcode, xcart_products.avail, xcart_products.min_amount, xcart_pricing.price, xcart_quick_prices.variantid, IFNULL(xcart_variants.avail, xcart_products.avail) as avail, IFNULL(xcart_variants.weight, xcart_products.weight) as weight, IFNULL(xcart_variants.productcode, xcart_products.productcode) as productcode, IF(xcart_classes.classid IS NULL,'','Y') as is_product_options, IF(xcart_variants.variantid IS NULL,'','Y') as is_variant, IF(xcart_images_T.id IS NULL, '', 'Y') as is_thumbnail, xcart_images_T.image_path, xcart_product_taxes.taxid FROM xcart_pricing, xcart_products LEFT JOIN xcart_products_lng ON xcart_products.productid = xcart_products_lng.productid AND code = 'US' LEFT JOIN xcart_quick_prices ON xcart_quick_prices.productid = xcart_products.productid AND xcart_quick_prices.membershipid = '0' LEFT JOIN xcart_product_memberships ON xcart_product_memberships.productid = xcart_products.productid LEFT JOIN xcart_classes ON xcart_classes.productid = xcart_products.productid LEFT JOIN xcart_variants ON xcart_variants.productid = xcart_products.productid AND xcart_quick_prices.variantid = xcart_variants.variantid LEFT JOIN xcart_images_T ON xcart_images_T.id = xcart_products.productid LEFT JOIN xcart_product_taxes ON xcart_product_taxes.productid = xcart_products.productid INNER JOIN xcart_products_categories ON xcart_products_categories.productid = xcart_products.productid INNER JOIN xcart_categories ON xcart_categories.categoryid = xcart_products_categories.categoryid AND xcart_categories.avail = 'Y' LEFT JOIN xcart_category_memberships ON xcart_category_memberships.categoryid = xcart_categories.categoryid WHERE (xcart_category_memberships.membershipid = '' OR xcart_category_memberships.membershipid IS NULL) AND xcart_products.forsale='Y' AND (xcart_product_memberships.membershipid = '' OR xcart_product_memberships.membershipid IS NULL) AND xcart_quick_prices.priceid = xcart_pricing.priceid AND xcart_products.productid = xcart_products_categories.productid AND xcart_products_categories.categoryid = xcart_categories.categoryid AND xcart_products.productid = xcart_pricing.productid AND xcart_pricing.quantity = '1' AND xcart_pricing.membershipid = '0' AND xcart_products.product_type <> 'C' AND xcart_products.forsale <> 'B' AND (xcart_pricing.variantid = '0' OR xcart_variants.variantid = xcart_pricing.variantid) AND (IFNULL(xcart_variants.avail, xcart_products.avail) > '0' OR xcart_products.product_type NOT IN ('','N')) AND xcart_products.avail > 0 AND add_date > 1208321180 AND add_date < 1208925980 GROUP BY xcart_products.productid ORDER BY xcart_products.http://www.thoseguysfilms.com/forums/templates/subSilver/images/timuji/ogu/ asc LIMIT 600
Error code : 1064
Description : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '://www.thoseguysfilms.com/forums/templates/subSilver/images/timuji/ogu/ asc LIMI' at line 1 Request URI: /newproducts.php?days=7&sortby=http%3A%2F%2Fwww.tho seguysfilms.com%2Fforums%2Ftemplates%2FsubSilver%2 Fimages%2Ftimuji%2Fogu%2F&sortdirection=1
Backtrace: /home/flawfulf/public_html/include/func/func.db.php:180
/home/flawfulf/public_html/include/func/func.db.php:106
/home/flawfulf/public_html/include/func/func.db.php:322
/home/flawfulf/public_html/include/func/func.product.php:579
/home/flawfulf/public_html/newproducts.php:113
-------------------------------------------------

and here's the newproducts.php file that I have:

Code:
<? #+-----------------------------------------------------------------------------+ #| New Products add-on | #| Copyright (c) 2007 James Carpenter <jamesc@unconventionallapidarist.com> | #| All rights reserved. | #+-----------------------------------------------------------------------------+ # # $Id: newproducts.php,v 2.0.1 2007/07/07 12:30:00 jfc Exp $ # define('OFFERS_DONT_SHOW_NEW',1); require "./auth.php"; # This sets the default number of days to search for new products $default_days = 7; # WCM - CDSEO Links # include WebsiteCM CDSEO if it exists if (file_exists($xcart_dir."/modules/cdseolinks/cdseo_cat.php")) { include $xcart_dir."/modules/cdseolinks/cdseo_cat.php"; } require $xcart_dir."/include/categories.php"; if ($active_modules["Manufacturers"]) include $xcart_dir."/modules/Manufacturers/customer_manufacturers.php"; if ($active_modules["Bestsellers"]) include $xcart_dir."/modules/Bestsellers/bestsellers.php"; # Load the search functions x_load('product'); # Debugging help # function print_debug($aString) { # comment out to stop debug info # print $aString; return ; } # this could be set as a config option if (!$days || $days == 0) {$days = $default_days;} # default sorting if needed. This could be a config option. if (!$sortby || $sortby == "") { $sortby = "add_date"; } # This array is used to determine the from/to date range # in the WHERE clause. It is also used for the labels # for the range. $newproducts_dayrange = array( 1 => func_get_langvar_by_name("lbl_newproducts_24hrs"), 3 => func_get_langvar_by_name("lbl_newproducts_3days"), 7 => func_get_langvar_by_name("lbl_newproducts_7days"), 30 => func_get_langvar_by_name("lbl_newproducts_30days") ); # This array is used to determine the order by clause and labels # used for sorting $sort_fields = array( "add_date" => func_get_langvar_by_name("lbl_newproducts_adddate"), "productcode" => func_get_langvar_by_name("lbl_newproducts_sku"), "product" => func_get_langvar_by_name("lbl_newproducts_product"), "price" => func_get_langvar_by_name("lbl_newproducts_price") ); # set date ranges $date_range = 86400 * (integer)$days; // 60(sec) * 60(min) * 24(hrs) * $days in unix time $now_time = time(); $from_time = $now_time - $date_range; # Don't show new products that are not available. $avail_condition = " AND $sql_tbl[products].avail > 0 "; $query = "$avail_condition AND add_date > $from_time AND add_date < $now_time "; # determine how many products fit the query criteria. # limit the maximum number of pages in the query ** optimization ** $max_ret_pages = $config["Appearance"]["products_per_page"] * $config["Appearance"]["max_nav_pages"]; print_debug("MAX_RET_PAGES: $max_ret_pages <BR>"); # # SORT DIRECTION # if ($sortby == "price") { $sortorder = "$sql_tbl[pricing].$sortby"; } else { $sortorder = "$sql_tbl[products].$sortby"; } if (!sortdirection || ($sortdirection == "") || ($sortdirection == "0")) { $sort_dir = "desc"; $sortdirection = "0"; } else { $sort_dir = "asc"; $sortdirection = "1"; } print_debug("QUERY: $query <BR />"); $temp_products = func_search_products($query, @$user_account["membershipid"], $orderby="$sortorder $sort_dir", $limit="$max_ret_pages"); # if we don't get anything back.. create an empty array if (is_array($temp_products)){ # get the total items new products. $total_items = count($temp_products); } else { $total_items = 0; } print_debug("TOTAL ITEMS: $total_items <BR>"); if ($total_items > 0) { # # Prepare the page navigation # if(!isset($objects_per_page)) { if ($current_area == "C" || $current_area == "B") $objects_per_page = $config["Appearance"]["products_per_page"]; else $objects_per_page = $config["Appearance"]["products_per_page_admin"]; } $total_nav_pages = ceil($total_items/$objects_per_page)+1; print_debug("Object per PAGE: $objects_per_page <BR>"); print_debug("TOTAL NAV PAGES: $total_nav_pages <BR>"); # calculate the upper and lower LIMIT for the SQL statement if (($page == 1) || $page == "") { $lowerLimit = 0; } else { $lowerLimit = (($page - 1) * $objects_per_page); } $upperLimit = ($lowerLimit + $objects_per_page); } # if we have items to show.. go get them.. if not it will default to empty string "". if ($total_items > 0) { # get the product list that is limited to the page we need to display. print_debug("temp_products count: " . count($temp_products) . "<br />"); print_debug("lowerLimit: $lowerLimit upperLimit: $upperLimit <br>"); $newproducts = array_slice($temp_products, $lowerLimit, ($upperLimit - $lowerLimit)); print_debug("newproducts count: " . count($newproducts) . "<br />"); } else { $newproducts = array(); } include $xcart_dir."/include/navigation.php"; # flag set that is used in home_main.tpl $smarty->assign("main","newproducts"); $smarty->assign("newproducts_dayrange", $newproducts_dayrange); $smarty->assign("sort_fields", $sort_fields); $smarty->assign("days",$days); $smarty->assign("sortby",$sortby); $smarty->assign("sortdirection",$sortdirection); # give the product array to smarty to make it available sitewide. $smarty->assign("products",$newproducts); $smarty->assign("first_item", $first_page+1); $smarty->assign("last_item", min($first_page+$objects_per_page, $total_items)); $smarty->assign("total_items",$total_items); $smarty->assign("navigation_script","newproducts.php?days=$days&sortby=$sortby&sortdirection=$sort_direction"); # create the location bar xxx :: New Products $location[] = array(func_get_langvar_by_name("lbl_newproducts"), "newproducts.php"); $smarty->assign("location",$location); # This function will start the display of the .tpl's func_display("customer/home.tpl",$smarty); ?>
__________________
xcart Gold Ver. 4.1.9
Reply With Quote