Example #1
0
function my_options_delete_revision() {
	$dr_ver = '1.3.1';
	$get_my_posts = get_my_posts();
	$del_revision_no = get_option('del_revision_no');
	echo <<<EOT
	<div class="wrap">
		<h2>Delete-revision Manager  <font size=1>ver $dr_ver</font></h2>
		<div class="widget"><p style="margin:10px;">
EOT;
		printf(__("Now You have <span style='color:red;font-weight:bolder;'> %s </span> posts ,Up to now Delete-Revision has deteted <span id='revs_no' style='color:red;font-weight:bolder;'> %s </span> post revision of dedundancy,it's easy . Wish happy ending !",'delete-revision'), $get_my_posts,$del_revision_no);
		echo '</p></div>';

	if (isset($_POST['del_act'])) {
		delete_revision_act();
		$del_no = $_POST['rev_no'];
		update_option("del_revision_no",get_option("del_revision_no") + $del_no);
		echo '<div class="updated" style="margin-top:50px;"><p><strong>';
		printf(__("Deleted <span style='color:red;font-weight:bolder;'> %s </span> redundancy posts !",'delete-revision'),$del_no);	
		echo "</strong></p></div></div><script>
		var del_no = document.getElementById('revs_no').innerHTML;
		document.getElementById('revs_no').innerHTML = Number(del_no)+ $del_no;
		</script>";
	}
	elseif (isset($_POST['get_rev'])) {
		get_my_revision();
		
	}
	elseif (isset($_POST['maintain_mysql'])) {
		if ($_POST['operation'] == 'OPTIMIZE' ) {echo maintain_mysql('OPTIMIZE');}
		else echo maintain_mysql('CHECK');
	}
	else {
		echo '<form method="post" action="">';
		echo '<input class="button" type="submit" name="get_rev" value="';
		_e('Check Redundant Revision','delete-revision');
		echo '" />  <input class="button" type="submit" name="maintain_mysql" value="';
		_e('Database Optimization','delete-revision');
		echo '" /></form></div>';

	}
	
	echo '<br /><div class="widget"><div style="margin:12px;line-height: 1.5em;">';
	_e('Revision Post is in the 2.6 version of WordPress after the automatic accession to the revised edition of the journal preservation cause, you modify a log of each, will add a revision, if you modify many times, log on the few speeches, it will be a very frightening number!','delete-revision');
	_e('If you have 100 on the log, your revisiong redundancy may be as many as 1,000 articles!','delete-revision');
	echo '<br />';
	_e('Revision Manager is the end came, to delete a large number of redundant revision to increase the speed of implementation of the SQL statement, WordPress upgrade the speed there is a lot of benefits!','delete-revision');
	echo '<br />';
	_e('Thank you for your useing. I hope this will give you convenient plug-ins!','delete-revision');
	_e('Author','delete-revision');
	echo ':<a href="http://www.gohsy.com" target="_blank">http://www.gohsy.com</a></div></div>';
	
}
function my_options_bdelete_revision()
{
    $bdr_version = get_bdr_version();
    $bdel_revision_no = get_option('bdel_revision_no');
    echo <<<EOT
\t<div class="wrap">
\t\t<h2>Better Delete Revision Manager <font size=1>Version {$bdr_version}</font></h2>
\t\t<div class="widget"><p style="margin:10px;">
EOT;
    echo get_count_notice();
    echo '</p></div>';
    if (isset($_POST['del_act'])) {
        bdelete_revision_act();
        $del_no = $_POST['rev_no'];
        update_option("bdel_revision_no", get_option("bdel_revision_no") + $del_no);
        echo '<div class="updated" style="margin-top:50px;"><p><strong>';
        printf(__("Deleted <span style='color:red;font-weight:bolder;'> %s </span> revisions!", 'bdelete-revision'), $del_no);
        echo "</strong></p></div></div><script>\r\n\t\tvar del_no = document.getElementById('revs_no').innerHTML;\r\n\t\tdocument.getElementById('revs_no').innerHTML = Number(del_no)+ {$del_no};\r\n\t\t</script>";
    } else {
        if (isset($_POST['get_rev'])) {
            get_my_revision();
        } else {
            if (isset($_POST['maintain_mysql'])) {
                if ($_POST['operation'] == 'OPTIMIZE') {
                    echo maintain_mysql('OPTIMIZE');
                } else {
                    echo maintain_mysql('CHECK');
                }
            } else {
                echo '<form method="post" action="">';
                echo '<input class="button" type="submit" name="get_rev" value="';
                _e('Check Revision Posts', 'bdelete-revision');
                echo '" />  <input class="button" type="submit" name="maintain_mysql" value="';
                _e('Optimize Your Database', 'bdelete-revision');
                echo '" /></form></div>';
            }
        }
    }
    echo get_bdr_footer();
}