Пример #1
0
                $returnval .= __('(Access to administration denied by administrator)', $this->g_info['ShortName']);
            } else {
                $returnval .= '<a rel="nofollow" href="' . $adminurl . '">' . __('Administration', $this->g_info['ShortName']) . '</a>';
            }
            $returnval .= ' | <a rel="nofollow" href="' . $logouturl . '">' . __('Log Out', $this->g_info['ShortName']) . '</a>';
        } else {
            $returnval .= '<a rel="nofollow" href="' . $loginurl . '">' . __('Log In', $this->g_info['ShortName']) . '</a>';
        }
        return $returnval;
    }
}
// class
if (!isset($myMaMo)) {
    // Create a new instance of your plugin that utilizes the WordpressPluginFramework and initialize the instance.
    $myMaMo = new MaintenanceMode();
    $myMaMo->Initialize(array('Name' => 'Modo Mantenimiento', 'Author' => 'acidc00l & Michael W&ouml;hrer', 'AuthorURI' => 'http://www.acidc00l.com/', 'PluginURI' => 'http://www.acidc00l.com/', 'SupportURI' => 'http://www.acidc00l.com/contacto/', 'OptionName' => 'plugin_maintenance-mode', 'DeleteOldOpt' => array('plugin_maintenancemode', 'plugin_maintenancemode2', 'plugin_maintenance-mode_5'), 'Version' => '8.0', 'UseOldOpt' => '1.0', 'CopyrightYear' => '2011', 'MinWP' => '3.1', 'PluginFile' => __FILE__, 'ShortName' => 'modo-mantenimiento'), array('mamo_activate' => 'off', 'mamo_excludedpaths' => '', 'mamo_include_feeds' => '', 'mamo_include_trackbacks' => '', 'mamo_include_xmlrpc' => '', 'mamo_backtime_days' => '0', 'mamo_backtime_hours' => '1', 'mamo_backtime_mins' => '0', 'mamo_pagetitle' => 'Modo Mantenimiento', 'mamo_pagemsg' => '<h1>Modo Mantenimiento: </h1>' . "\n\n" . '<p><a title="[blogtitle]" href="[blogurl]">[blogtitle]</a> se encuentra actualmente en mantenimiento programado.<br />' . "\n<br />\n" . 'Por favor, inténtelo de nuevo en [until].</p>' . "\n\n" . '<p>Disculpa las molestias.</p>', 'mamo_placeholder_until' => 'Vuelve <strong>en [days] días, [hours] horas, y [minutes] minutos</strong><br />(en [date] a las [time])', 'mamo_placeholder_until_exc' => 'de nuevo pronto', 'mamo_503_splashpage' => '', 'mamo_theme' => 'WP', 'mamo_role_frontend' => 'manage_options', 'mamo_role_backend' => 'read'));
    add_action('plugins_loaded', array($myMaMo, 'ApplyMaintenanceMode'));
    ############################################################################
    # Template Tags for using in themes
    ############################################################################
    /**
     * You can display a warning message in the front-end if you are logged in and the Maintenance Mode is activated
     * to remember you to deactivate the Maintenance Mode.
     */
    function is_maintenance()
    {
        global $myMaMo;
        if (substr($myMaMo->g_opt['mamo_activate'], 0, 2) == 'on') {
            return true;
        } else {
            return false;
Пример #2
0
                $returnval .= __('(Access to administration denied by administrator)', $this->g_info['ShortName']);
            } else {
                $returnval .= '<a rel="nofollow" href="' . $adminurl . '">' . __('Administration', $this->g_info['ShortName']) . '</a>';
            }
            $returnval .= ' | <a rel="nofollow" href="' . $logouturl . '">' . __('Log Out', $this->g_info['ShortName']) . '</a>';
        } else {
            $returnval .= '<a rel="nofollow" href="' . $loginurl . '">' . __('Log In', $this->g_info['ShortName']) . '</a>';
        }
        return $returnval;
    }
}
// class
if (!isset($myMaMo)) {
    // Create a new instance of your plugin that utilizes the WordpressPluginFramework and initialize the instance.
    $myMaMo = new MaintenanceMode();
    $myMaMo->Initialize(array('Name' => 'Maintenance Mode', 'Author' => 'Michael W&ouml;hrer', 'AuthorURI' => 'http://sw-guide.de/', 'PluginURI' => 'http://sw-guide.de/wordpress/plugins/maintenance-mode/', 'SupportURI' => 'http://wordpress.org/tags/maintenance-mode', 'OptionName' => 'plugin_maintenance-mode', 'DeleteOldOpt' => array('plugin_maintenancemode', 'plugin_maintenancemode2', 'plugin_maintenance-mode_5'), 'Version' => '5.4', 'UseOldOpt' => '5.0', 'CopyrightYear' => '2006-2010', 'MinWP' => '2.7', 'PluginFile' => __FILE__, 'ShortName' => 'maintenance-mode'), array('mamo_activate' => 'off', 'mamo_excludedpaths' => '', 'mamo_include_feeds' => '', 'mamo_include_trackbacks' => '', 'mamo_include_xmlrpc' => '', 'mamo_backtime_days' => '0', 'mamo_backtime_hours' => '1', 'mamo_backtime_mins' => '0', 'mamo_pagetitle' => 'Maintenance Mode', 'mamo_pagemsg' => '<h1>Maintenance Mode</h1>' . "\n\n" . '<p><a title="[blogtitle]" href="[blogurl]">[blogtitle]</a> is currently undergoing scheduled maintenance.<br />' . "\n<br />\n" . 'Please try back [until].</p>' . "\n\n" . '<p>Sorry for the inconvenience.</p>', 'mamo_placeholder_until' => '<strong>in [days] days, [hours] hours, and [minutes] minutes</strong><br />(on [date] at [time])', 'mamo_placeholder_until_exc' => 'again soon', 'mamo_503_splashpage' => '', 'mamo_theme' => 'default', 'mamo_role_frontend' => 'manage_options', 'mamo_role_backend' => 'read'));
    #	$myMaMo->ApplyMaintenanceMode();	// commented out and added the line below since plugin version 5.3 -- http://radiok.info/blog/the-case-of-maintenance-mode/
    add_action('plugins_loaded', array($myMaMo, 'ApplyMaintenanceMode'));
    ############################################################################
    # Template Tags for using in themes
    ############################################################################
    /**
     * You can display a warning message in the front-end if you are logged in and the Maintenance Mode is activated
     * to remember you to deactivate the Maintenance Mode.
     */
    function is_maintenance()
    {
        global $myMaMo;
        if (substr($myMaMo->g_opt['mamo_activate'], 0, 2) == 'on') {
            return true;
        } else {