",__('The following directories are not writable: :directory: You won't be able to upload any images or files here. You will need to change the permissions on these directories to make them writable.', 'wpsc'))."
";
}
// class='stuffbox'
?>
escape($search_input)."%";
$search_sql = "AND (`products`.`name` LIKE '".$search_string."' OR `products`.`description` LIKE '".$search_string."')";
} else {
$search_sql = '';
}
$search_sql = apply_filters('wpsc_admin_products_list_search_sql', $search_sql);
if($category_id > 0) { // if we are getting items from only one category, this is a monster SQL query to do this with the product order
$sql = "SELECT `products`.`id` , `products`.`name` , `products`.`price` , `products`.`image`,`products`.`weight` , `products`.`publish`, `categories`.`category_id`,`order`.`order`, IF(ISNULL(`order`.`order`), 0, 1) AS `order_state`
FROM `".WPSC_TABLE_PRODUCT_LIST."` AS `products`
LEFT JOIN `".WPSC_TABLE_ITEM_CATEGORY_ASSOC."` AS `categories` ON `products`.`id` = `categories`.`product_id`
LEFT JOIN `".WPSC_TABLE_PRODUCT_ORDER."` AS `order` ON (
( `products`.`id` = `order`.`product_id` )
AND
( `categories`.`category_id` = `order`.`category_id` )
)
WHERE `products`.`active` = '1' $search_sql
AND `categories`.`category_id`
IN (
'".$category_id."'
)
ORDER BY `order_state` DESC,`order`.`order` ASC, `products`.`date_added` DESC, `products`.`id` DESC";
// if we are selecting a category, set is_sortable to true
$is_sortable = true;
} else {
$itempp = 10;
if ($_GET['pageno']!='all') {
if($_GET['pageno'] > 0) {
$page = absint($_GET['pageno']);
} else {
$page = 1;
}
$start = (int)($page * $itempp) - $itempp;
$sql = "SELECT DISTINCT * FROM `".WPSC_TABLE_PRODUCT_LIST."` AS `products` WHERE `products`.`active`='1' $search_sql ORDER BY `products`.`date_added` DESC LIMIT $start,$itempp";
if(get_option('wpsc_sort_by') == 'dragndrop'){
$sql = "SELECT DISTINCT * FROM `".WPSC_TABLE_PRODUCT_LIST."` AS `products` LEFT JOIN `".WPSC_TABLE_PRODUCT_ORDER."` AS `order` ON `products`.`id`= `order`.`product_id` WHERE `products`.`active`='1' AND `order`.`category_id`='0' $search_sql ORDER BY `order`.`order`";
}
} else {
$sql = "SELECT DISTINCT * FROM `".WPSC_TABLE_PRODUCT_LIST."` AS `products` WHERE `products`.`active`='1' $search_sql ORDER BY `products`.`date_added`";
}
}
// exit($sql);
$product_list = $wpdb->get_results($sql,ARRAY_A);
//exit('