Пример #1
0
 function load_file($url)
 {
     if (($file = @file_get_contents_emulate($url)) !== false) {
         $this->data = new FeedData();
         if (preg_match('`<item>(.*)</item>`is', $file)) {
             $expParsed = explode('<item>', $file);
             $nbItems = count($expParsed) - 1 > $nbItems ? $nbItems : count($expParsed) - 1;
             $this->data->set_date(preg_match('`<!-- RSS generated by PHPBoost on (.*) -->`is', $expParsed[0], $var) ? $var[1] : '');
             $this->data->set_title(preg_match('`<title>(.*)</title>`is', $expParsed[0], $var) ? $var[1] : '');
             $this->data->set_link(preg_match('`<atom:link href="(.*)" rel="self" type="application/rss+xml" />`is', $expParsed[0], $var) ? $var[1] : '');
             $this->data->set_host(preg_match('`<link>(.*)</link>`is', $expParsed[0], $var) ? $var[1] : '');
             $this->data->set_desc(preg_match('`<description>(.*)</description>`is', $expParsed[0], $var) ? $var[1] : '');
             $this->data->set_lang(preg_match('`<language>(.*)</language>`is', $expParsed[0], $var) ? $var[1] : '');
             for ($i = 1; $i <= $nbItems; $i++) {
                 $item = new FeedItem();
                 $item->set_title(preg_match('`<title>(.*)</title>`is', $expParsed[$i], $title) ? $title[1] : '');
                 $item->set_link(preg_match('`<link>(.*)</link>`is', $expParsed[$i], $url) ? $url[1] : '');
                 $item->set_guid(preg_match('`<guid>(.*)</guid>`is', $expParsed[$i], $guid) ? $guid[1] : '');
                 $item->set_desc(preg_match('`<desc>(.*)</desc>`is', $expParsed[$i], $desc) ? $desc[1] : '');
                 $item->set_date_rfc822(preg_match('`<pubDate>(.*)</pubDate>`is', $expParsed[$i], $date) ? gmdate_format('date_format_tiny', strtotime($date[1])) : '');
                 $this->data->add_item($item);
             }
             return true;
         }
         return false;
     }
     return false;
 }
Пример #2
0
 function load_file($url)
 {
     if (($file = @file_get_contents_emulate($url)) !== false) {
         $this->data = new FeedData();
         if (preg_match('`<entry>(.*)</entry>`is', $file)) {
             $expParsed = explode('<entry>', $file);
             $nbItems = count($expParsed) - 1 > $nbItems ? $nbItems : count($expParsed) - 1;
             $this->data->set_date(preg_match('`<updated>(.*)</updated>`is', $expParsed[0], $var) ? $var[1] : '');
             $this->data->set_title(preg_match('`<title>(.*)</title>`is', $expParsed[0], $var) ? $var[1] : '');
             $this->data->set_link(preg_match('`<link href="(.*)"/>`is', $expParsed[0], $var) ? $var[1] : '');
             $this->data->set_host(preg_match('`<link href="(.*)"/>`is', $expParsed[0], $var) ? $var[1] : '');
             for ($i = 1; $i <= $nbItems; $i++) {
                 $item = new FeedItem();
                 $item->set_title(preg_match('`<title>(.*)</title>`is', $expParsed[$i], $title) ? $title[1] : '');
                 $item->set_link(preg_match('`<link href="(.*)"/>`is', $expParsed[$i], $url) ? $url[1] : '');
                 $item->set_guid(preg_match('`<id>(.*)</id>`is', $expParsed[$i], $guid) ? $guid[1] : '');
                 $item->set_desc(preg_match('`<summary>(.*)</summary>`is', $expParsed[$i], $desc) ? $desc[1] : '');
                 $item->set_date_rfc3339(preg_match('`<updated>(.*)</updated>`is', $expParsed[$i], $date) ? gmdate_format('date_format_tiny', strtotime($date[1])) : '');
                 $this->data->add_item($item);
             }
             return true;
         }
         return false;
     }
     return false;
 }
Пример #3
0
 function open()
 {
     if (!$this->is_open()) {
         parent::open();
         if (file_exists($this->path) && is_file($this->path)) {
             $this->fd = fopen($this->path, 'r+');
         } else {
             if (!file_exists($this->path)) {
                 $this->fd = fopen($this->path, 'x+');
             }
         }
         if ($this->mode & READ) {
             $this->contents = file_get_contents_emulate($this->path);
             $this->lines = explode("\n", $this->contents);
         }
     }
 }
Пример #4
0
$new_language = retrieve(POST, 'new_language', '');
if (!empty($new_language) && is_file('lang/' . $new_language . '/install_' . $new_language . '.php') && $new_language != $lang) {
    $lang = $new_language;
    redirect(HOST . FILE . add_lang('?step=' . $step, true));
}
switch ($step) {
    case STEP_INTRO:
        $template->assign_vars(array('C_INTRO' => true, 'L_INTRO_TITLE' => $LANG['intro_title'], 'L_INTRO_EXPLAIN' => $LANG['intro_explain'], 'DISTRIBUTION' => sprintf($LANG['intro_distribution'], DISTRIBUTION_NAME), 'L_DISTRIBUTION_EXPLAIN' => $LANG['intro_distribution_intro'], 'DISTRIBUTION_DESCRIPTION' => DISTRIBUTION_DESCRIPTION, 'L_NEXT_STEP' => add_lang('install.php?step=' . (STEP_INTRO + 1)), 'L_START_INSTALL' => $LANG['start_install']));
        break;
    case STEP_LICENSE:
        $submit = !empty($_POST['submit']) ? true : false;
        $license_agreement = !empty($_POST['license_agreement']) ? true : false;
        if ($submit && $license_agreement) {
            redirect(HOST . FILE . add_lang('?step=' . (STEP_LICENSE + 1), true));
        }
        $template->assign_vars(array('C_LICENSE' => true, 'TARGET' => add_lang('install.php?step=' . STEP_LICENSE), 'U_PREVIOUS_PAGE' => add_lang('install.php?step=' . (STEP_LICENSE - 1)), 'L_REQUIRE_LICENSE_AGREEMENT' => $submit && !$license_agreement ? '<div class="warning">' . $LANG['require_license_agreement'] . '</div>' : $LANG['require_license_agreement'], 'L_ALERT_PLEASE_AGREE_LICENSE' => $LANG['alert_agree_license'], 'L_QUERY_TERMS' => $LANG['license_terms'], 'L_REQUIRE_LICENSE' => $LANG['license_agreement'], 'L_PLEASE_AGREE' => $LANG['please_agree_license'], 'L_NEXT_STEP' => $LANG['next_step'], 'L_PREVIOUS_STEP' => $LANG['previous_step'], 'L_LICENSE_TERMS' => file_get_contents_emulate('license.txt')));
        break;
    case STEP_SERVER_CONFIG:
        if (function_exists('apache_get_modules')) {
            $get_rewrite = apache_get_modules();
            $check_rewrite = !empty($get_rewrite[5]) ? 1 : 0;
        } else {
            $check_rewrite = -1;
        }
        $template->assign_vars(array('C_SERVER_CONFIG' => true, 'C_PHP_VERSION_OK' => phpversion() >= '4.1.0', 'C_GD_LIBRAIRY_ENABLED' => @extension_loaded('gd'), 'C_URL_REWRITING_KNOWN' => $check_rewrite != -1, 'C_URL_REWRITING_ENABLED' => $check_rewrite == 1));
        @clearstatcache();
        $chmod_dir = array('../cache', '../cache/backup', '../cache/syndication', '../cache/tpl', '../images/avatars', '../images/group', '../images/maths', '../images/smileys', '../kernel/db', '../lang', '../menus', '../templates', '../upload');
        $all_dirs_ok = true;
        foreach ($chmod_dir as $dir) {
            $is_writable = $is_dir = true;
            if (file_exists($dir) && is_dir($dir)) {
Пример #5
0
 function _load($parse_name)
 {
     if (!isset($this->files[$parse_name])) {
         return false;
     }
     $this->template = @file_get_contents_emulate($this->files[$parse_name]);
     if ($this->template === false) {
         die('Template::_load(): The ' . $this->files[$parse_name] . ' file loading to parse ' . $parse_name . ' failed.');
     }
     if (empty($this->template)) {
         die('Template::_load(): The file ' . $this->files[$parse_name] . ' to parse ' . $parse_name . ' is empty.');
     }
     return true;
 }