?> <p> <img src="<?php echo YOURLS_SITE; ?> /images/yourls-logo.png" alt="YOURLS" title="YOURLS" /> </p> <?php // Print errors, warnings and success messages foreach (array('error', 'warning', 'success') as $info) { if (count(${$info}) > 0) { echo "<ul class='{$info}'>"; foreach (${$info} as $msg) { echo '<li>' . $msg . "</li>\n"; } echo '</ul>'; } } // Display install button or link to admin area if applicable if (!yourls_is_installed() && !isset($_REQUEST['install'])) { echo '<p> </p><p style="text-align: center;"><input type="submit" name="install" value="Install YOURLS" class="button" /></p>'; } else { if (count($error) == 0) { echo '<p> </p><p style="text-align: center;">» <a href="' . yourls_admin_url() . '" title="YOURLS Administration Page">YOURLS Administration Page</a></p>'; } } ?> </form> </div> <?php yourls_html_footer();
require_once YOURLS_INC . '/class-mysql.php'; yourls_db_connect(); } // Allow early inclusion of a cache layer if (file_exists(YOURLS_USERDIR . '/cache.php')) { require_once YOURLS_USERDIR . '/cache.php'; } // Read options right from start yourls_get_all_options(); // Register shutdown function register_shutdown_function('yourls_shutdown'); // Core now loaded yourls_do_action('init'); // plugins can't see this, not loaded yet // Check if need to redirect to install procedure if (!yourls_is_installed() && !yourls_is_installing()) { yourls_redirect(yourls_admin_url('install.php'), 302); } // Check if upgrade is needed (bypassed if upgrading or installing) if (!yourls_is_upgrading() && !yourls_is_installing()) { if (yourls_upgrade_is_needed()) { yourls_redirect(YOURLS_SITE . '/admin/upgrade.php', 302); } } // Init all plugins yourls_load_plugins(); yourls_do_action('plugins_loaded'); // Is there a new version of YOURLS ? yourls_new_core_version_notice(); if (yourls_is_admin()) { yourls_do_action('admin_init');
// Allow early inclusion of a cache layer if (file_exists(YOURLS_USERDIR . '/cache.php')) { require_once YOURLS_USERDIR . '/cache.php'; } // Read options right from start yourls_get_all_options(); // Register shutdown function register_shutdown_function('yourls_shutdown'); // Core now loaded yourls_do_action('init'); // plugins can't see this, not loaded yet // Check if need to redirect to install procedure if (!yourls_is_installed() && !yourls_is_installing()) { yourls_redirect(yourls_admin_url('install.php'), 302); } // Check if upgrade is needed (bypassed if upgrading or installing) if (!yourls_is_upgrading() && !yourls_is_installing()) { if (yourls_upgrade_is_needed()) { yourls_redirect(YOURLS_SITE . '/admin/upgrade.php', 302); } } // Init all plugins yourls_load_plugins(); yourls_do_action('plugins_loaded'); // Is there a new version of YOURLS ? if (yourls_is_installed() && !yourls_is_upgrading()) { yourls_new_core_version_notice(); } if (yourls_is_admin()) { yourls_do_action('admin_init'); }
yourls_redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); exit; } } // Create the YOURLS object $ydb that will contain everything we globally need global $ydb; yourls_db_connect(); // Read options right from start yourls_get_all_options(); // Core now loaded yourls_do_action('init'); // plugins can't see this, not loaded yet // Check if we are in maintenance mode yourls_check_maintenance_mode(); // Check if need to redirect to install procedure if (!yourls_is_installed() && (!defined('YOURLS_INSTALLING') || YOURLS_INSTALLING != true)) { yourls_redirect(yourls_admin_url('install.php'), 302); } // Check if upgrade is needed. // Note: this is bypassable with define('YOURLS_NO_UPGRADE_CHECK', true) // This is also bypassed if YOURLS_INSTALLING if ((!defined('YOURLS_NO_UPGRADE_CHECK') || YOURLS_NO_UPGRADE_CHECK != true) && (!defined('YOURLS_INSTALLING') || YOURLS_INSTALLING != true)) { if (yourls_upgrade_is_needed()) { yourls_redirect(YOURLS_SITE . '/admin/upgrade.php', 302); } } // Init all plugins yourls_load_plugins(); yourls_do_action('plugins_loaded'); if (yourls_is_admin()) { yourls_do_action('admin_init');
// Allow early inclusion of a cache layer if (file_exists(YOURLS_USERDIR . '/cache.php')) { require_once YOURLS_USERDIR . '/cache.php'; } // Read options right from start yourls_get_all_options(); // Register shutdown function register_shutdown_function('yourls_shutdown'); // Core now loaded yourls_do_action('init'); // plugins can't see this, not loaded yet // Check if need to redirect to install procedure if (!yourls_is_installed() && !yourls_is_installing()) { yourls_redirect(yourls_admin_url('install.php'), 302); } // Check if upgrade is needed (bypassed if upgrading or installing) if (!yourls_is_upgrading() && !yourls_is_installing()) { if (yourls_upgrade_is_needed()) { yourls_redirect(YOURLS_SITE . '/admin/upgrade.php', 302); } } // Init all plugins yourls_load_plugins(); yourls_do_action('plugins_loaded'); // Is there a new version of YOURLS ? if (yourls_is_installed() && !yourls_is_upgrading() && yourls_maybe_check_core_version()) { yourls_new_core_version_notice(); } if (yourls_is_admin()) { yourls_do_action('admin_init'); }