Ejemplo n.º 1
0
function ozh_ta_do_page_manual()
{
    ?>
	<fieldset class="ozh_ta_fs">
	<h3>Manual archiving</h3>
	<?php 
    if (!ozh_ta_is_manually_archiving()) {
        ?>
		<p>Manually archive your tweets as posts into WordPress. Once this is done, the import will be set to <strong>automatic</strong>, as per the refresh interval defined.</p>
		<p>If this is the first time you do it and you have lots of tweets to import, this will be longish. Don't close this page till it says "all done"! If the script timeouts or goes moo in the middle of an import, just refresh the page</p>
		<?php 
        $url = wp_nonce_url(admin_url('options-general.php?page=ozh_ta&action=import_all&time=' . time()), 'ozh_ta-import_all');
        ?>
		<p><a href="<?php 
        echo $url;
        ?>
" class="button">Manually archive now</a></p>

	<?php 
    } else {
        check_admin_referer('ozh_ta-import_all');
        // Import the goodness
        ozh_ta_require('import.php');
        ozh_ta_schedule_next(0);
        // clear any scheduling : it'll be rescheduled after all tweets have been imported
        ozh_ta_get_tweets(true);
    }
    echo '</fieldset>';
}
Ejemplo n.º 2
0
function ozh_ta_load_admin()
{
    global $ozh_ta;
    ozh_ta_require('settings.php');
    ozh_ta_require('option-page.php');
    ozh_ta_init_settings();
    if (!ozh_ta_is_configured()) {
        add_action('admin_notices', 'ozh_ta_notice_config');
    }
    add_filter('plugin_row_meta', 'ozh_ta_plugin_row_meta', 10, 2);
    add_filter('plugin_action_links_' . plugin_basename(__FILE__), 'ozh_ta_plugin_actions');
}