Example #1
0
    public function __construct()
    {
        $sql = 'SELECT *
			FROM _config';
        $this->config = sql_rowset($sql, 'config_name', 'config_value');
        if ($this->v('site_disable')) {
            exit('not_running');
        }
        $address = $this->v('site_address');
        $host_addr = array_key(explode('/', array_key(explode('//', $address), 1)), 0);
        if ($host_addr != get_host()) {
            $allow_hosts = get_file(XFS . XCOR . 'store/domain_alias');
            foreach ($allow_hosts as $row) {
                if (substr($row, 0, 1) == '#') {
                    continue;
                }
                $remote = strpos($row, '*') === false;
                $row = !$remote ? str_replace('*', '', $row) : $row;
                $row = str_replace('www.', '', $row);
                if ($row == get_host()) {
                    $sub = str_replace($row, '', get_host());
                    $sub = f($sub) ? $sub . '.' : ($remote ? 'www.' : '');
                    $address = str_replace($host_addr, $sub . $row, $address);
                    $this->v('site_address', $address, true);
                    break;
                }
            }
        }
        if (strpos($address, 'www.') !== false && strpos(get_host(), 'www.') === false && strpos($address, get_host())) {
            $page_protocol = array_key(explode('//', _page()), 0);
            $a = $this->v('site_address') . str_replace(str_replace('www.', '', $page_protocol . $address), '', _page());
            redirect($a, false);
        }
        $this->cache_dir = XFS . XCOR . 'cache/';
        if (is_remote() && @file_exists($this->cache_dir) && @is_writable($this->cache_dir) && @is_readable($this->cache_dir)) {
            $this->cache_f = true;
        }
        //
        // Load additional objects.
        //
        $this->email = _import('emailer');
        $this->cache = _import('cache');
        return;
    }
Example #2
0
    public function _gallery_create()
    {
        global $bio, $core;
        if (_button()) {
            $upload = _import('upload');
            // Start
            $sql = 'SELECT MAX(image_id) AS total
				FROM _bio_images
				WHERE image_bio = ?';
            $image = sql_field(sql_filter($sql, $this->a('bio_id')), 'total', 0) + 1;
            $upload->chmod(array(_lib(LIB_BIO . ' ' . $this->a('bio_id'))), 0777);
            $f = $upload->process(LIB . 'tmp/', request_var('files:picture'), w('jpg'), $core->v('max_upload'));
            if ($f === false && count($upload->error)) {
                $warning->set($upload->error);
            }
            if (!$warning->exist) {
                $total = 0;
                foreach ($f as $row) {
                    //$row = $upload->_row($gallery, $image);
                    $f2 = $upload->resize($row, LIB . 'tmp', LIB . 'events/future/', $v['e_id'], array(600, 400), false, false, true);
                    if ($f2 === false) {
                        continue;
                    }
                    $f3 = $upload->resize($row, LIB . 'events/future/', LIB . 'events/preview/', $v['e_id'], array(210, 210), false, false);
                    $total++;
                    //
                    $sql_insert = array('bio' => $bio->v('bio_id'), 'image' => $image, 'width' => $i_data['width'], 'height' => $i_data['height'], 'views' => 0, 'downloads' => 0, 'allow_dl' => (int) $allow_dl);
                    sql_put('_bio_images', prefix('image', $sql_insert));
                    $image++;
                }
                $sql = 'UPDATE _bio_store SET store_value = store_value + ??
					WHERE store_bio = ?';
                _sql(sql_filter($sql, $total, $bio->v('bio_id')));
            }
            if (!$error) {
                redirect(_link_control('a', array('a' => $bio->v('bio_alias'), 'x1' => $this->x(1))));
            }
        }
        return v_style(array('U_CREATE' => _link_bio($bio->v('bio_alias'), array('x1' => $this->x(1), 'x2' => $this->x(2))), 'MAX_FILESIZE' => $core - v('max_upload')));
    }
Example #3
0
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
if (!defined('XFS')) {
    exit;
}
$starttime = explode(' ', microtime());
$starttime = $starttime[1] + $starttime[0];
error_reporting(E_ALL);
if (@ini_get('register_globals')) {
    foreach ($_REQUEST as $var_name => $void) {
        unset(${$var_name});
    }
}
if (!defined('REQC')) {
    define('REQC', strtolower(ini_get('request_order')) == 'gp');
}
require_once XFS . XCOR . 'constants.php';
require_once XFS . XCOR . 'functions.php';
$database = _import('db.mysql', 'database');
$style = _import('style');
$bio = _import('bio');
$core = _import('core');
$warning = _import('warning');
$file = _import('filesystem');
if (!defined('XRUN')) {
    $core->run();
}