'Products', 'description' => __('Deze widget toont producten aan de hand van de opgegeven zoekterm. Je kan zelf bepalen hoeveel producten je toont.','DaisyconPlugin') ); $this->WP_Widget('Products', __('Daisycon producten','DaisyconPlugin'), $widget_ops); } function form($instance) { $instance = wp_parse_args( (array) $instance, array( 'product' => '', 'aantal' => '5', 'chars' => '10', 'size' => '50') ); $title = $instance['title']; ?>

1){ $tDatabase .= " AND (title REGEXP '[[:<:]]".$breed[1]."[[:>:]]' OR description REGEXP '[[:<:]]".$breed[1]."[[:>:]]')"; }else{ $tDatabase .= " AND (title LIKE '%".$explode[$i]."%' OR description LIKE '%".$explode[$i]."%')"; } }else{ if(count($breed) > 1){ $tDatabase = "(title REGEXP '[[:<:]]".$breed[1]."[[:>:]]' OR description REGEXP '[[:<:]]".$breed[1]."[[:>:]]')"; }else{ $tDatabase = "(title LIKE '%".$explode[$i]."%' OR description LIKE '%".$explode[$i]."%')"; } } } $products = $wpdb->get_results("SELECT * FROM productfeed WHERE ".$tDatabase." AND image != '' ORDER BY RAND() LIMIT ".$instance['aantal']." "); $publisher = $wpdb->get_row("SELECT * FROM publisher"); $wi = explode('/media/', $publisher->feed); $wi = explode('/', $wi[1]); echo ' '; if(count($products) > 0){ foreach ($products AS $product){ echo'
'; echo ''; echo' '; echo '
'; if($instance['text'] == 1){ echo '
'.substr($product->title, 0, $instance['chars']).'
'; } if($instance['price'] == 1){ echo '
€ '.$product->price.'
'; } echo '
'; } } } } ?>