admin_url('admin-ajax.php'), 'images_path' => DBR_PLUGIN_DIR_PATH . "/images/", 'are_you_sure' => __('Are you sure to continue?', 'advanced-wp-reset'), 'warning_msg' => __('You are about to reset your database. Any content will be lost! This operation is irreversible!', 'advanced-wp-reset'), 'type_reset' => sprintf(__('Please type the word "%s" correctly in the text box','advanced-wp-reset'), "reset"), 'processing' => __('Processing...', 'advanced-wp-reset'), 'done' => __('Done!', 'advanced-wp-reset'), 'cancel' => __('Cancel', 'advanced-wp-reset'), 'Continue' => __('Continue', 'advanced-wp-reset'), 'ajax_nonce' => wp_create_nonce('DBR_nonce'), )); //wp_enqueue_script('jquery'); //wp_enqueue_script('jquery-ui-dialog'); //wp_enqueue_style('wp-jquery-ui-dialog'); } /******************************************************************** * Activation of the plugin ********************************************************************/ register_activation_hook(__FILE__, 'DBR_activate_plugin'); function DBR_activate_plugin(){ // Anything to do on activation? Maybe later... } /******************************************************************** * Add rating box to the top of wordpress admin panel ********************************************************************/ $aDBc_upload_dir = wp_upload_dir(); $aDBc_file_path = str_replace('\\' ,'/', $aDBc_upload_dir['basedir']) . "/DBR.txt"; if(isset($_GET['DBR_rate']) && $_GET['DBR_rate'] == "0"){ $handle = fopen($aDBc_file_path, "w"); if($handle){ fwrite($handle, "0"); } }else{ if(file_exists($aDBc_file_path)){ $content = file_get_contents($aDBc_file_path); if($content == "1"){ add_action('admin_notices', 'DBR_show_rate_box'); } } } function DBR_show_rate_box(){ $aDBc_new_URI = $_SERVER['REQUEST_URI']; $aDBc_new_URI = add_query_arg('DBR_rate', "0", $aDBc_new_URI); $style_botton = "background: #f0f5fa;padding: 4px !important;text-decoration: none;margin-right:10px;border-radius: 5px;-moz-border-radius: 5px;-webkit-border-radius: 5px; box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30,140,190,.8); "; ?>