prefix .'art_images'; $row = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM ".$table_name." where galerie_name = %s $rand LIMIT %d ", $galerie, $anzahl )); $out_head ='
'; $out_foot ='
'.$template_footer.apg_bluemGallery_select(); if(!empty($head)){ echo ' '.$head.'
'; } $galerie_name = substr($row[0]->galerie_name,0,15).$gn; echo '
'; foreach($row as $tmp) { if(empty($settings['wp_settings_img_details'])){ $out_body .= '
'; }else{ $out_body .= '
'; } } $out = $out_head . $out_body . $out_foot; $out = preg_replace(array('//Uis',"/[[:blank:]]+/"),array('',' '),str_replace(array("\n","\r","\t"),'',$out)); echo $out; }else{ global $wpdb; $table_name = $wpdb->prefix .'art_images'; $row = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM ".$table_name." ORDER BY rand() LIMIT %d ", $anzahl )); $out_head ='
'; $out_foot ='
'.$template_footer.apg_bluemGallery_select(); if(!empty($head)){ echo ' '.$head.'
'; } $galerie_name = substr($row[0]->galerie_name,0,15).$gn; echo '
'; foreach($row as $tmp) { if(empty($settings['wp_settings_img_details'])){ $out_body .= '
'; }else{ $out_body .= '
'; } } $out = $out_head . $out_body . $out_foot; $out = preg_replace(array('//Uis',"/[[:blank:]]+/"),array('',' '),str_replace(array("\n","\r","\t"),'',$out)); echo $out; } /////////////////////////////////////////////////////////////////// echo '
'; // After widget code, if any echo (isset($after_widget)?$after_widget:''); } public function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = $new_instance['title']; $instance['header'] = $new_instance['header']; $instance['head'] = $new_instance['head']; $instance['galerie'] = $new_instance['galerie']; $instance['anzahl'] = $new_instance['anzahl']; $instance['random'] = $new_instance['random']; $instance['alle'] = $new_instance['alle']; return $instance; } public function form( $instance ) { $instance = wp_parse_args( (array) $instance, array( 'title' => 'Art-Picture Galerie', 'header'=>'Übeschrift', 'head' => 'Titel' ) ); $title = ( isset( $instance['title'] ) && is_string( $instance['title'] ) ) ? esc_attr($instance['title']) : ''; $header = ( isset( $instance['header'] ) && is_string( $instance['header'] ) ) ? esc_attr($instance['header']) : 'Art-Picture Galerie'; $head = ( isset( $instance['head'] ) && is_string( $instance['head'] ) ) ? esc_attr($instance['head']) : 'Example Gallery'; $galerie = ( isset( $instance['galerie'] ) && is_string( $instance['galerie'] ) )? esc_attr($instance['galerie']) : ''; $anzahl = ( isset( $instance['anzahl'] ) && is_numeric( $instance['anzahl'] ) )? (int) $instance['anzahl'] : ''; $random = ( isset( $instance['random'] ) && is_numeric( $instance['random'] ) )? (int) $instance['random'] : ''; $alle = ( isset( $instance['alle'] ) && is_numeric( $instance['alle'] ) )? (int) $instance['alle'] : ''; ?>

/>

/>