base_prefix; $table_name_ad_google = $base_prefix . "author_advertising_ad_google"; extract($args); $options = get_option('kd_aa_widget'); $title = $options[$number]['title']; $google_values = get_option('kd_author_advertising'); $selected_id = get_option("kd_aa_widget_id"); if($selected_id >= 1 ){ $widget_content = kd_template_ad($selected_id); } echo $before_widget . $before_title . $title . $after_title . $widget_content . $after_widget; } function kd_aa_widget_control($number) { $options = $newoptions = get_option('kd_aa_widget'); if ( !is_array($options) ) $options = $newoptions = array(); if ( $_POST["kd_aa_widget-$number"] ) { $newoptions[$number]['title'] = strip_tags(stripslashes($_POST["kd_aa_widget-$number"])); } if ( $options != $newoptions ) { $options = $newoptions; update_option('kd_aa_widget', $options); } $title = attribute_escape($options[$number]['title']); ?>

" name="kd_aa_widget-submit-" value="1" /> 3 ) $number = 3; if ( $number < 1 ) $number = 1; $newoptions['number'] = $number; } if ( $options != $newoptions ) { $options = $newoptions; update_option('kd_aa_widget', $options); kd_aa_widget_register($options['number']); } kd_aa_widget_register(); } } function kd_aa_widget_page() { $options = $newoptions = get_option('kd_aa_widget'); ?>

3 ) $number = 3; $class = array('classname' => 'kd_aa_widget'); for ($i = 1; $i <= 3; $i++) { $name = sprintf(__('Author Advertising Pro %d'), $i); $id = "advertising-$i"; // Never never never translate an id wp_register_sidebar_widget($id, $name, $i <= $number ? 'kd_aa_widget' : /* unregister */ '', $class, $i); wp_register_widget_control($id, $name, $i <= $number ? 'kd_aa_widget_control' : /* unregister */ '', $dims, $i); } add_action('sidebar_admin_setup', 'kd_aa_widget_setup'); add_action('sidebar_admin_page', 'kd_aa_widget_page'); } function kd_aa_widget_admin() { //GET VALUES global $wpdb; $base_prefix = $wpdb->base_prefix; $table_name_ad_google = $base_prefix . "author_advertising_ad_google"; //check if Plugin need to install his db table. $kd_need_install = kd_check_install(); //check if Plugin need to update db table column for a new version. $kd_need_update = kd_check_update(); if ($kd_need_install) { kd_installer(); } elseif ($kd_need_update) { kd_updater(); } else { if (isset($_POST['ads_id'])) { update_option("kd_aa_widget_id", $_POST['ads_id']); } echo kd_G_icon(); echo "

", _e('Author Advertising Pro - Widget', 'author-advertising-pro'), "


"; echo "

"; echo "
", kd_help_icon(), "
"; echo "

", _e('In questa sezione potrai selezionare l\'id dell\'annuncio Adsense che desideri utilizzare come widget.', 'author-advertising-pro'), "

"; echo "

", _e('Nelle prossime versioni del plugin tale funzione otterrà notevoli miglioramenti.', 'author-advertising-pro'), "

"; echo "

"; echo "
"; echo "
"; echo "
"; echo "

", _e('Scegli l\'ID dell\'annuncio Adsense che vuoi usare come Widget:', 'author-advertising-pro'), "

"; echo _e('ID Annuncio:', 'author-advertising-pro'), " "; echo ""; echo "
"; echo "
"; //FINE BLOCCO SELECT ID } } ?>