get_var("SELECT COUNT(*) AS `count` FROM `".WPSC_TABLE_PRODUCT_LIST."` WHERE `donation` IN ('1') AND `active` IN ('1')"); if($donation_count > 0) { echo $before_widget; $full_title = $before_title . $title . $after_title; echo $full_title; nzshpcrt_donations(); echo $after_widget; } } function nzshpcrt_donations($input = null) { global $wpdb; $siteurl = get_option('siteurl'); $sql = "SELECT * FROM `".WPSC_TABLE_PRODUCT_LIST."` WHERE `donation` IN ('1') AND `active` IN ('1')"; $products = $wpdb->get_results($sql,ARRAY_A); // exit('
'.print_r($products,true).''); if($products != null) { $output = "
'.print_r($image,true).''); $output .= "".$product['name']."
\n\r"; echo " \n\r"; echo "
\n\r"; } function widget_donations_init() { if(function_exists('register_sidebar_widget')) { register_sidebar_widget(__('Product Donations', 'wpsc'), 'widget_donations'); register_widget_control(__('Product Donations', 'wpsc'), 'widget_donations_control'); } return; } add_action('plugins_loaded', 'widget_donations_init'); ?>