get_row("SELECT * FROM publisher"); $wi = explode('/media/', $publisher->feed); $wi = explode('/', $wi[1]); echo ' '; $results = $wpdb->get_results("SELECT programs.name, programs.more, programs.image, programs.url, categories.rename FROM programs INNER JOIN categories ON programs.category = categories.name WHERE programs.visible = '1' AND categories.visible = '1' ORDER BY programs.date DESC ".$limit.""); foreach($results as $aPrograms){ $subid = $wpdb->get_row("SELECT subid FROM publisher"); if($subid != NULL){ $links = $aPrograms->url . $subid->subid; } $result .= '
'.$aPrograms->name.'
'.$aPrograms->name.'
'.$aPrograms->more.'
'; } $result .= '
'; return($result); } //Take top 3 from programs (ecpc) public function topPrograms($array){ global $post,$wpdb; if($array['amount'] < 1){ $limit = ''; }else{ $limit = 'LIMIT '.$array['amount']; } $publisher = $wpdb->get_row("SELECT * FROM publisher"); $wi = explode('/media/', $publisher->feed); $wi = explode('/', $wi[1]); echo ' '; $results = $wpdb->get_results("SELECT programs.name, programs.more, programs.image, programs.url, categories.rename FROM programs INNER JOIN categories ON programs.category = categories.name WHERE programs.visible = '1' AND categories.visible = '1' ORDER BY programs.ecpc DESC ".$limit.""); foreach($results as $aPrograms){ $subid = $wpdb->get_row("SELECT subid FROM publisher"); if($subid != NULL){ $links = $aPrograms->url . $subid->subid; } $result .= '
'.$aPrograms->name.'
'.$aPrograms->name.'
'.$aPrograms->more.'
'; } return($result); } //Show all programmas in that category public function category($array){ global $post,$wpdb; $rename = $wpdb->get_row("SELECT categories.rename FROM categories WHERE categories.category_id = '".$array['id']."'"); if($array['amount'] == ""){ $amount = $wpdb->get_results("SELECT * FROM programs INNER JOIN categories ON programs.category = categories.name WHERE categories.visible = '1' AND programs.visible = '1' AND categories.rename = '".$rename->rename."' ORDER BY programs.ecpc DESC"); $amount = count($amount); }else{ $amount = $array['amount']; } $publisher = $wpdb->get_row("SELECT * FROM publisher"); $wi = explode('/media/', $publisher->feed); $wi = explode('/', $wi[1]); echo ' '; if ($array['id'] != ""){ $rPrograms = $wpdb->get_results("SELECT programs.name, programs.image, programs.description, programs.url, programs.more, programs.more FROM programs INNER JOIN categories ON programs.category = categories.name WHERE categories.visible = '1' AND programs.visible = '1' AND categories.rename='".$rename->rename."' ORDER BY programs.ECPC DESC LIMIT ".$amount.""); } $result = ''; if($rPrograms){ foreach($rPrograms as $aPrograms){ $subid = $wpdb->get_row("SELECT subid FROM publisher"); if($subid != NULL){ $links = $aPrograms->url . $subid->subid; } if (strlen($aPrograms->more) > 0){$link = $aPrograms->more;}else{$link = $aPrograms->url;} $result .= '
'.$aPrograms->name.'
'.$aPrograms->name.'

'.$aPrograms->description.'
'; } } $result .= '
'; return($result); } //los program aanroepen public function program($array){ global $wpdb; $program = $wpdb->get_row("SELECT * FROM programs WHERE program_id = '".$array['id']."' AND programs.visible = '1'"); if(count($program) > 0){ $subid = $wpdb->get_row("SELECT subid FROM publisher"); if($subid != NULL){ $links = $program->url . $subid->subid; } $publisher = $wpdb->get_row("SELECT * FROM publisher"); $wi = explode('/media/', $publisher->feed); $wi = explode('/', $wi[1]); echo ' '; $result = '
'.$program->name.'
'.$program->name.'
'.$program->description.'
'; }else{ $result = ' '; } return($result); } //los program aanroepen public function moreProgram($array){ global $wpdb; $aProgram = $wpdb->get_row("SELECT programs.url, programs.image, programs.name, programs.more FROM programs WHERE programs.program_id = '".$array['id']."' AND programs.visible = '1'"); if(count($aProgram) > 0){ $subid = $wpdb->get_row("SELECT subid FROM publisher"); if($subid != NULL){ $links = $aProgram->url . $subid->subid; } $publisher = $wpdb->get_row("SELECT * FROM publisher"); $wi = explode('/media/', $publisher->feed); $wi = explode('/', $wi[1]); echo ' '; $result = '
'.$aProgram->name.'
'.$aProgram->name.'
'.$aProgram->more.'
'; }else{ $result = ' '; } return($result); } public function products($array){ global $wpdb; $publisher = $wpdb->get_row("SELECT * FROM publisher"); $wi = explode('/media/', $publisher->feed); $wi = explode('/', $wi[1]); if($array['view'] == "auto"){ echo ' '; //Automatisch $result =' '; $stores = explode(',', $array['stores']); for($i=0; $i 1){ $tDatabase .= " AND (productfeed.title REGEXP '[[:<:]]".$breed[1]."[[:>:]]' OR productfeed.description REGEXP '[[:<:]]".$breed[1]."[[:>:]]')"; }else{ $tDatabase .= " AND (productfeed.title LIKE '%".$eSearch[$i]."%' OR productfeed.description LIKE '%".$eSearch[$i]."%')"; } }else{ if(count($breed) > 1){ $tDatabase = "(productfeed.title REGEXP '[[:<:]]".$breed[1]."[[:>:]]' OR productfeed.description REGEXP '[[:<:]]".$breed[1]."[[:>:]]')"; }else{ $tDatabase = "(productfeed.title LIKE '%".$eSearch[$i]."%' OR productfeed.description LIKE '%".$eSearch[$i]."%')"; } } } $products = $wpdb->get_results("SELECT productfeed.product_id FROM productfeed INNER JOIN programs ON productfeed.program_id = programs.program_id WHERE ".$tDatabase." AND (".$dStores.") ORDER BY ".$dOrder." LIMIT ".$array['amount'].""); foreach($products AS $product){ $explode[] = $product->product_id; } }else{ //Handmatig $explode = explode(',', $array['products']); echo ' '; } if(count($explode) > 0){ $style = $wpdb->get_row("SELECT * FROM stylesheets WHERE stylesheet_id = '".$array['stylesheet']."' "); $result .='
'; for($i=0; $i < count($explode); $i++){ //Selected products $product = $wpdb->get_results("SELECT productfeed.image, productfeed.title, productfeed.price, programs.name, programs.image AS program_image, productfeed.link FROM productfeed INNER JOIN programs ON productfeed.program_id = programs.program_id WHERE productfeed.product_id = '".$explode[$i]."' ORDER BY RAND()"); if(count($product) > 0){ if($product->price == "0.00"){ $price = "Gratis!"; }else{ $price = $product->price; } if($style->float == 1){ $float = "left"; }else{ $float = "none"; } //View 1 is voor de tegelweergave if($style->view == 1){ $programwidth = $style->width / 4; if($style->store == 1){ $programimage = '
'; }else{ $programimage = ''; } if($style->button_store == 1 || $style->store_button_program != "disabled"){ if($style->store_button_program == "disabled"){ $storetext = $style->store_before; } else if($style->store_button_program == "after"){ $storetext = $style->store_before.' '.$product[0]->name; }else{ $storetext = $product[0]->name.' '.$style->store_before; } if($style->button_store == 1){ $buttonstyle= 'padding:5px; padding-top:2px; padding-bottom:2px; color:#'.$style->buttontextcolor.'; border:#'.$style->buttonbordercolor.' solid 1px; background:#'.$style->buttoncolor.';'; }else{ $buttonstyle= ""; } $store = '
'.$storetext.'
'; }else{ $store = ''; } if($style->price == 1){ if($style->price_button == 1){ $buttonstyle= 'padding:5px; padding-top:2px; padding-bottom:2px; color:#'.$style->buttontextcolor.'; border:#'.$style->buttonbordercolor.' solid 1px; background:#'.$style->buttoncolor.';'; }else{ $buttonstyle= ""; } $pricetext = $style->price_before.' '.$product[0]->price; $price ='
'.$pricetext.'
'; }else{ $price =''; } $result .='
'.$product[0]->title.'
'.$programimage.' '.$store.' '.$price.'
'; } elseif($style->view == 0){ $programwidth = $style->size / 2; if($style->store == 1){ $programimage = '
'; }else{ $programimage = ''; } if($style->price == 1){ if($style->price_button == 1){ $buttonstyle= 'color:#'.$style->buttontextcolor.'; border:#'.$style->buttonbordercolor.' solid 1px; background:#'.$style->buttoncolor.';'; }else{ $buttonstyle= ""; } $pricetext = $style->price_before.' '.$product[0]->price; $price ='
'.$pricetext.'
'; }else{ $price =''; } $result .='
'.$product[0]->title.'
'.$programimage.'
'.$price.'
'; $result .='
'; } }else{ $result = ''; } } $result .='
'; if($array['moreproducts'] == 1){ if($style->float == 1){ $dcmore_width = "98%"; }else{ $dcmore_width = $style->width.'px'; } $result .='
'.$style->moreproducts_text.'
'; } } return($result); } public function productlist($array){ global $wpdb; $publisher = $wpdb->get_row("SELECT * FROM publisher"); $wi = explode('/media/', $publisher->feed); $wi = explode('/', $wi[1]); echo ' '; $result = '
'; $explode = explode(" ", $array['product']); for($i=0; $i 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]."%')"; } } } $style = $wpdb->get_row("SELECT * FROM stylesheets WHERE stylesheet_id = '".$array['stylesheet']."' "); for($i=0; $i < count($explode); $i++){ $product = $wpdb->get_results("SELECT productfeed.image, productfeed.title, productfeed.price, programs.name, programs.image AS program_image, productfeed.link FROM productfeed INNER JOIN programs ON productfeed.program_id = programs.program_id ORDER BY RAND() LIMIT 5"); /*$product = $wpdb->get_results("SELECT * FROM productfeed WHERE ".$tDatabase." AND image != '' ORDER BY RAND() LIMIT 5 ");*/ //var_dump($product); if(count($product) > 0){ if($products->price == "0.00"){ $price = "Gratis!"; }else{ $price = $products->price; } if($style->float == 1){ $float = "left"; }else{ $float = "none"; } //View 1 is voor de tegelweergave if($style->view == 1){ $programwidth = $style->width / 4; if($style->store == 1){ $programimage = '
'; }else{ $programimage = ''; } if($style->button_store == 1 || $style->store_button_program != "disabled"){ if($style->store_button_program == "disabled"){ $storetext = $style->before_store; } else if($style->store_button_program == "after"){ $storetext = $style->store_before.' '.$product[0]->name; }else{ $storetext = $product[0]->name.' '.$style->store_before; } if($style->button_store == 1){ $buttonstyle= 'padding:5px; padding-top:2px; padding-bottom:2px; color:#'.$style->buttontextcolor.'; border:#'.$style->buttonbordercolor.' solid 1px; background:#'.$style->buttoncolor.';'; }else{ $buttonstyle= ""; } $store = '
'.$storetext.'
'; }else{ $store = ''; } if($style->price == 1){ if($style->price_button == 1){ $buttonstyle= 'padding:5px; padding-top:2px; padding-bottom:2px; color:#'.$style->buttontextcolor.'; border:#'.$style->buttonbordercolor.' solid 1px; background:#'.$style->buttoncolor.';'; }else{ $buttonstyle= ""; } $pricetext = $style->price_before.' '.$product[0]->price; $price ='
'.$pricetext.'
'; }else{ $price =''; } $result .='
'.$product[0]->title.'
'.$programimage.' '.$store.' '.$price.'
'; } elseif($style->view == 0){ $programwidth = $style->size / 2; if($style->store == 1){ $programimage = '
'; }else{ $programimage = ''; } if($style->price == 1){ if($style->price_button == 1){ $buttonstyle= 'color:#'.$style->buttontextcolor.'; border:#'.$style->buttonbordercolor.' solid 1px; background:#'.$style->buttoncolor.';'; }else{ $buttonstyle= ""; } $pricetext = $style->price_before.' '.$product[0]->price; $price ='
'.$pricetext.'
'; }else{ $price =''; } $result .='
'.$product[0]->title.'
'.$programimage.'
'.$price.'
'; } }else{ $result = ''; } } $result .='
'; return($result); } public function actioncodes(){ global $wpdb; $publisher = $wpdb->get_row("SELECT * FROM publisher"); $wi = explode('/media/', $publisher->feed); $wi = explode('/', $wi[1]); echo ' '; $aDaisycon = $wpdb->get_row("SELECT * FROM publisher"); if($aDaisycon->actioncode_status == "delete"){ $aActies = $wpdb->get_results("SELECT * FROM actioncodes INNER JOIN programs ON actioncodes.program_id = programs.program_id WHERE actioncodes.date_end > '".date('Y-m-d')."' OR actioncodes.date_end = 0000-00-00 ORDER BY date_end "); }else{ $aActies = $wpdb->get_results("SELECT * FROM actioncodes INNER JOIN programs ON actioncodes.program_id = programs.program_id ORDER BY date_end "); } foreach($aActies as $rActies){ if($rActies->date_end == '0000-00-00'){ $end = 'Onbekend'; }else{ $explode = explode('-', $rActies->date_end); $end = $explode[2].''.$explode[1].''.$explode[0]; } $result .= '
'.$rActies->actioncode_title.' ('.$rActies->name.')
Deze kortingscode is geldig t/m '.$end.'
'.$rActies->actioncode_description.'

Actiecode: '.$rActies->actioncode.' '; if($aDaisycon->actioncode_status == "alert"){ if($rActies->date_end < date('Y-m-d') && $rActies->date_end != "0000-00-00"){ $result .= '
LET OP DEZE ACTIECODE IS VERLOPEN!
'; } } $result.= '
'; } return($result); } public function actioncodesProgram($array){ global $wpdb; $publisher = $wpdb->get_row("SELECT * FROM publisher"); $wi = explode('/media/', $publisher->feed); $wi = explode('/', $wi[1]); echo ' '; $aDaisycon = $wpdb->get_row("SELECT * FROM publisher"); if($aDaisycon->actioncode_status == "delete"){ $aActies = $wpdb->get_results("SELECT * FROM actioncodes INNER JOIN programs ON actioncodes.program_id = programs.program_id WHERE (actioncodes.date_end > '".date('Y-m-d')."' OR actioncodes.date_end = '0000-00-00') AND actioncodes.program_id = '".$array['id']."' ORDER BY date_end"); }else{ $aActies = $wpdb->get_results("SELECT * FROM actioncodes INNER JOIN programs ON actioncodes.program_id = programs.program_id WHERE actioncodes.program_id = '".$array['id']."' ORDER BY date_end DESC"); } $result = ''; $i = 0; foreach($aActies as $rActies){ $result .= '
'.$rActies->actioncode_title.' ('.$rActies->name.')
Deze kortingscode is geldig t/m '; if($rActies->date_end == "0000-00-00"){ $result .= 'Onbekend'; }else{ $explode = explode('-', $rActies->date_end); $result .= $explode[2].'-'.$explode[1].'-'.$explode[0]; } $result .= '
'.$rActies->actioncode_description.'

Actiecode: '.$rActies->actioncode.' '; if($aDaisycon->actioncode_status == "alert"){ if($rActies->date_end < date('Y-m-d') && $rActies->date_end != "0000-00-00"){ $result .= '
LET OP DEZE ACTIECODE IS VERLOPEN!
'; } } $result.= '
'; } return($result); } public function actioncode($array){ global $wpdb; $publisher = $wpdb->get_row("SELECT * FROM publisher"); $wi = explode('/media/', $publisher->feed); $wi = explode('/', $wi[1]); echo ' '; $aDaisycon = $wpdb->get_row("SELECT * FROM publisher"); if($aDaisycon->actioncode_status == "delete"){ $aActies = $wpdb->get_results("SELECT * FROM actioncodes INNER JOIN programs ON actioncodes.program_id = programs.program_id WHERE actioncodes.date_end > '".date('Y-m-d')."' AND actioncodes.actioncode_id = '".$array['id']."' ORDER BY date_end "); }else{ $aActies = $wpdb->get_results("SELECT * FROM actioncodes INNER JOIN programs ON actioncodes.program_id = programs.program_id WHERE actioncodes.actioncode_id = '".$array['id']."' ORDER BY date_end "); } $i = 0; if($aActies){ foreach($aActies as $rActies){ $result .= '
'.$rActies->actioncode_title.' ('.$rActies->name.')
Deze kortingscode is geldig t/m '; if($rActies->date_end == "0000-00-00"){ $result .= 'Onbekend'; }else{ $result .= $rActies->date_end; } $result .= '
'.$rActies->actioncode_description.'

Actiecode: '.$rActies->actioncode.' '; if($aDaisycon->actioncode_status == "alert"){ if($rActies->date_end < date('Y-m-d') && $rActies->date_end != "0000-00-00"){ $result .= '
LET OP DEZE ACTIECODE IS VERLOPEN!
'; } } $result.= '
'; } } return($result); } public function searchProvider($array){ return('
Zoeken
'); } } ?>