示例#1
0
/**
 * nggallery_start_upgrade() - Proceed the upgrade routine
 * 
 * @param mixed $filepath
 * @return void
 */
function nggallery_start_upgrade($filepath)
{
    global $wpdb;
    ?>
<div class="wrap">
	<h2><?php 
    _e('Upgrade NextGEN Gallery', 'nggallery');
    ?>
</h2>
	<p><?php 
    ngg_upgrade();
    ?>
</p>
	<p><?php 
    _e('Upgrade sucessfull', 'nggallery');
    ?>
</p>
	<h3><a href="<?php 
    echo $filepath;
    ?>
"><?php 
    _e('Continue', 'nggallery');
    ?>
...</a></h3>
</div>
<?php 
}
示例#2
0
 function multisite_upgrade($blog_id)
 {
     global $wpdb;
     include_once dirname(__FILE__) . '/admin/upgrade.php';
     $current_blog = $wpdb->blogid;
     switch_to_blog($blog_id);
     ngg_upgrade();
     switch_to_blog($current_blog);
     return;
 }
示例#3
0
/**
 * nggallery_start_upgrade() - Proceed the upgrade routine
 *
 * @param mixed $filepath
 * @return void
 */
function nggallery_start_upgrade($filepath)
{
    ?>
<div class="wrap">
	<h2><?php 
    _e('Upgrade NextGEN Gallery', 'nggallery');
    ?>
</h2>
	<p><?php 
    ngg_upgrade();
    ?>
</p>
	<p class="finished"><?php 
    _e('Upgrade finished...', 'nggallery');
    ?>
</p>
	<h3><a class="finished" href="<?php 
    echo $filepath;
    ?>
"><?php 
    _e('Continue', 'nggallery');
    ?>
...</a></h3>
</div>
<?php 
}
示例#4
0
 /**
  * Main start invoked after all plugins are loaded.
  */
 function start_plugin()
 {
     // Load the language file
     load_plugin_textdomain('nggallery', false, NGGFOLDER . '/lang');
     // All credits to the translator
     $this->translator = '<p class="hint">' . __('<strong>Translation by : </strong><a target="_blank" href="http://alexrabe.de/wordpress-plugins/nextgen-gallery/languages/">See here</a>', 'nggallery') . '</p>';
     $this->translator .= '<p class="hint">' . __('<strong>This translation is not yet updated for Version 1.9.0</strong>. If you would like to help with translation, download the current po from the plugin folder and read <a href="http://alexrabe.de/wordpress-plugins/wordtube/translation-of-plugins/">here</a> how you can translate the plugin.', 'nggallery') . '</p>';
     // Content Filters
     add_filter('ngg_gallery_name', 'sanitize_title');
     // Check if we are in the admin area
     if (is_admin()) {
         // Pass the init check or show a message
         if (get_option('ngg_init_check') != false) {
             add_action('admin_notices', create_function('', 'echo \'<div id="message" class="error"><p><strong>' . get_option("ngg_init_check") . '</strong></p></div>\';'));
         }
     } else {
         // Add MRSS to wp_head
         if ($this->options['useMediaRSS']) {
             add_action('wp_head', array('nggMediaRss', 'add_mrss_alternate_link'));
         }
         // Look for XML request, before page is render
         add_action('parse_request', array(&$this, 'check_request'));
         // Add the script and style files
         add_action('wp_enqueue_scripts', array(&$this, 'load_scripts'));
         add_action('wp_enqueue_scripts', array(&$this, 'load_styles'));
     }
     if (get_option('ngg_db_version') != NGG_DBVERSION && isset($_GET['page']) != "nextcellent") {
         global $ngg;
         include_once dirname(__FILE__) . '/admin/functions.php';
         include_once dirname(__FILE__) . '/admin/upgrade.php';
         if (!empty($ngg->options['silentUpgrade'])) {
             try {
                 ngg_upgrade();
             } catch (Exception $e) {
                 add_action('admin_notices', create_function('', 'echo \'<div id="message" class="error"><p><strong>' . __('Something went wrong while upgrading NextCellent Gallery.', "nggallery") . '</strong></p></div>\';'));
             }
         } else {
             add_action('admin_notices', create_function('', 'echo \'<div id="message" class="update-nag"><p><strong>' . __('NextCellent Gallery requires a database upgrade.', "nggallery") . ' <a href="' . admin_url() . 'admin.php?page=nextcellent-gallery-nextgen-legacy" >' . __('Upgrade now', 'nggallery') . '</a></strong></p></div>\';'));
         }
     }
 }
示例#5
0
/**
 * Actually update the database, with a UI.
 *
 * @param $filepath string The URL to the overview page.
 */
function doing_update_output($filepath)
{
    ?>
	<div class="wrap">
		<h2><?php 
    _e('Upgrade NextCellent Gallery', 'nggallery');
    ?>
</h2>

		<p><?php 
    try {
        echo __('Upgrading database…', 'nggallery');
        ngg_upgrade();
        echo '<span class="dashicons dashicons-yes"></span><br />';
    } catch (ErrorException $e) {
        echo __("Oh no! Something went wrong while updating the database", 'nggallery') . ": " . $e;
    }
    ?>
</p>

		<p class="finished"><?php 
    _e('Upgrade complete.', 'nggallery');
    ?>
</p>
		<br/><a class="finished button button-primary"
		        href="<?php 
    echo $filepath;
    ?>
"><?php 
    _e('Continue to NextCellent', 'nggallery');
    ?>
</a>
	</div>
<?php 
}