예제 #1
0
/**
 * Load plugins
 *
 * Loads in the activated plugins data then loads the plugins.
 */
function lilina_plugins_init()
{
    $data = new DataHandler();
    $plugins = $data->load('plugins.data');
    if ($plugins === null) {
        return;
    }
    $plugins = unserialize($plugins);
    if (!is_array($plugins) || empty($plugins)) {
        return;
    }
    foreach ($plugins as $plugin) {
        if ('' !== $plugin && file_exists(LILINA_CONTENT_DIR . '/plugins/' . $plugin)) {
            include_once LILINA_CONTENT_DIR . '/plugins/' . $plugin;
        }
    }
    global $current_plugins;
    $current_plugins = $plugins;
}
예제 #2
0
/**
 * Load feeds into global $data
 *
 * @uses $data
 * @return array
 */
function load_feeds()
{
    global $data;
    $file = new DataHandler(LILINA_CONTENT_DIR . '/system/config/');
    $data = $file->load('feeds.data');
    if ($data !== null) {
        $data = unserialize(base64_decode($data));
    } else {
        $data = array();
    }
    return $data;
}
예제 #3
0
    //Settings that use other settings variables
    if (!defined('LILINA_CONTENT_DIR')) {
        define('LILINA_CONTENT_DIR', LILINA_PATH . '/content');
    }
    if (!defined('LILINA_CACHE_DIR')) {
        define('LILINA_CACHE_DIR', LILINA_CONTENT_DIR . '/system/cache/');
    }
    if (!defined('LILINA_DATA_DIR')) {
        define('LILINA_DATA_DIR', LILINA_CONTENT_DIR . '/system/data/');
    }
    if (!isset($settings['files'])) {
        $settings['files'] = array('feeds' => LILINA_CONTENT_DIR . '/system/config/feeds.data', 'options' => LILINA_CONTENT_DIR . '/system/config/options.data', 'settings' => LILINA_CONTENT_DIR . '/system/config/settings.php', 'plugins' => LILINA_CONTENT_DIR . '/system/config/plugins.data');
    }
    global $options;
    $data = new DataHandler(LILINA_CONTENT_DIR . '/system/config/');
    $options = $data->load('options.data');
    if ($options !== null) {
        $options = unserialize($options);
    } else {
        $options = array();
    }
    if (!isset($options['cachedir'])) {
        $options['cachedir'] = LILINA_CACHE_DIR;
    }
}
/**
 * Attempt to load the class before PHP fails with an error.
 *
 * This method is called automatically in case you are trying to use a class which hasn't been defined yet.
 * @param string $class_name Class called by the user
 */
예제 #4
0
 /**
  * Remove a feed
  *
  * @param string $id ID of the feed to remove
  * @return bool
  */
 public function delete($id)
 {
     if (empty($this->feeds[$id])) {
         throw new Exception(_r('Feed does not exist'), Errors::get_code('admin.feeds.invalid_id'));
     }
     //Make a copy for later.
     $removed = $this->feeds[$id];
     $removed = apply_filters('feed-delete', $removed);
     $cache = new DataHandler(get_option('cachedir'));
     if ($cache->load($id . '.ico') !== null) {
         $cache->delete($id . '.ico');
     }
     unset($this->feeds[$id]);
     $this->save();
     return sprintf(_r('Removed "%1$s" &mdash; <a href="%2$s">Undo</a>?'), $removed['name'], 'feeds.php?action=add&amp;add_name=' . urlencode($removed['name']) . '&amp;add_url=' . urlencode($removed['feed']) . '&amp;id=' . urlencode($removed['id']));
 }
예제 #5
0
/**
 * @todo Document
 * @author WordPress
 */
function update_nag()
{
    $data = new DataHandler();
    $cur = $data->load('core-update-check.data');
    if ($cur === null) {
        return false;
    }
    $cur = unserialize($cur);
    if (!isset($cur->response) || $cur->response != 'upgrade') {
        return false;
    }
    $msg = sprintf(_r('Lilina %1$s is available! <a href="%2$s">Please update now</a>.'), $cur->version, $cur->url);
    echo "<div id='update-nag' class='message'>{$msg}</div>";
}