products = $wpdb->get_results($sql, ARRAY_A);
$wpsc_query->product_count = count($wpsc_query->products);
// get top selling in this month
if ($wpsc_query->product_count == 0)
{
$top_selling_at_time = 'This Month';
$sql = get_sql_top_selling(getMonthRange());
$wpsc_query->products = $wpdb->get_results($sql, ARRAY_A);
$wpsc_query->product_count = count($wpsc_query->products);
}
// get top selling in all time
if ($wpsc_query->product_count == 0)
{
$top_selling_at_time = 'All Time';
$sql = get_sql_top_selling(getMonthRange());
$wpsc_query->products = $wpdb->get_results($sql, ARRAY_A);
$wpsc_query->product_count = count($wpsc_query->products);
}
$n_download = count($wpsc_query->products);
$i_row_download = 1;
$i_slide_download = 1;
$max_per_row = 4;
$max_per_slide = 8;
$downloadRemain = bcmod($n_download, $max_per_slide);
$downloadRemain = ($downloadRemain == $n_download) ? $max_per_slide - $n_download : $downloadRemain;
?>
Top Selling
No Image Available
8) ? substr($p_title, 0, 8) . '...' : $p_title; ?>
', '');
?>