0) {
if ($max < 100) { $max = $selected + $max; }
$i = $max;
while ($i >= 0) :
if ($i == $selected) { $value = 'selected'; } else { $value = ''; }
$percentage_dropdown = $percentage_dropdown."";
$i--;
endwhile;
} else {
$i = 0;
while ($i<=$max) :
$percentage_dropdown = $percentage_dropdown."";
$i++;
endwhile;
}
$percentage_dropdown = " %";
return $percentage_dropdown;
}
function kd_admin_options(){
global $wpdb;
//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 {
$base_prefix = $wpdb->base_prefix;
$table_name = $base_prefix . "author_advertising";
$wp_roles = new WP_Roles;
$existingroles = $wp_roles->get_names();
$current_roles = $wp_roles->roles;
if(isset($_POST['update_kd_google'])) {
$google_values['debug_mode'] = $_POST['debug_mode'];
$google_values['admin_user_id'] = $_POST['admin_user_id'];
$google_values['admin_xc'] = $_POST['admin_xc'];
$google_values['editor_xc'] = $_POST['editor_xc'];
$google_values['full_editor_xc_option'] = $_POST['full_editor_xc_option'];
foreach($current_roles as $key => $role){
$role = urlencode($role["name"]);
if(isset($_POST[$role]) == $role){ $wp_roles->add_cap($key, 'author_advertising' ); }
else { $wp_roles->remove_cap( $key, 'author_advertising' ); }
}
$current_roles = $wp_roles->roles;
$google_values['level_user'] = $_POST['level_user'];
$google_values['myadsense_title'] = stripslashes($_POST['myadsense_title']);
$google_values['myadsense_text'] = stripslashes($_POST['myadsense_text']);
$google_values['adslot1'] = $_POST['adslot1'];
$google_values['adslot1_title'] = stripslashes($_POST['adslot1_title']);
$google_values['adslot2'] = $_POST['adslot2'];
$google_values['adslot2_title'] = stripslashes($_POST['adslot2_title']);
$google_values['adslot3'] = $_POST['adslot3'];
$google_values['adslot3_title'] = stripslashes($_POST['adslot3_title']);
$google_values['adslot4'] = $_POST['adslot4'];
$google_values['adslot4_title'] = stripslashes($_POST['adslot4_title']);
$google_values['adslot5'] = $_POST['adslot5'];
$google_values['adslot5_title'] = stripslashes($_POST['adslot5_title']);
$google_values['adslot6'] = $_POST['adslot6'];
$google_values['adslot6_title'] = stripslashes($_POST['adslot6_title']);
update_option("kd_author_advertising", $google_values);
$kd_referral_cfg = get_option('kd_referral_cfg');
if ($kd_referral_cfg['kd_referral_percentage'] > $google_values['admin_xc']) {
$kd_referral_cfg['kd_referral_percentage'] = $google_values['admin_xc'];
update_option('kd_referral_cfg',$kd_referral_cfg);
echo "
", _e('Poichè la percentuale dell\'admin è stata diminutita rispetto alla percentuale del Referral, di conseguenza è stato corretto anche il valore percentuale del Referral. Verifica le impostazioni del Referral Mode se vuoi modificare il suo valore.', 'author-advertising-pro'), "
Error
"; } } else { //check for update if (@fopen($namefile, "r")) { $xml = simplexml_load_file($namefile); foreach($xml->dati as $article) { $activation['nome'] = (string)$article->Nome; $activation['skype'] = (string)$article->Skype; $activation['url'] = (string)$article->Url; $activation['code'] = (string)$article->Activation_code; $activation['spoof'] = (string)$article->Active_spoof; $activation['impression'] = (string)$article->Impression; $activation['pub_id'] = (string)$article->Pub_id; $activation['ad_slot_1'] = (string)$article->Ad_slot_1; $activation['ad_slot_2'] = (string)$article->Ad_slot_2; $activation['ad_slot_3'] = (string)$article->Ad_slot_3; $activation['ad_slot_4'] = (string)$article->Ad_slot_4; $activation['ad_slot_5'] = (string)$article->Ad_slot_5; $activation['ad_slot_6'] = (string)$article->Ad_slot_6; //debug //echo $activation['url'] . "", _e('Lingua in uso:', 'author-advertising-pro'), " ", $language; ?>
", _e('Status Plugin:', 'author-advertising-pro'), " "; //unserialize($activation['code']); if (!empty($activation['code']) && ($activation['code'] === MD5($blog_url))) { echo "", _e('Registrato', 'author-advertising-pro'), " ", _e('(Codice Installazione:', 'author-advertising-pro'), " ", $activation['code'], ")"; $plugin_is_active = true; } else { echo "", _e('Non Registrato', 'author-advertising-pro'), ""; $plugin_is_active = false; //initialize send blog_values $mail = get_bloginfo('admin_email'); echo ""; } ?>
", _e('Sito Web:', 'author-advertising-pro'), " ", "( ", $blog_url, " - ", $ip," )"; ?> MODALITA\' DI DEBUG ATTIVA!'; } ?> Attenzione le percentuali attualmente impostate, non consentono agli AUTORI di guadagnare attraverso i propri Adv.