|
|
|
@ -289,7 +289,7 @@ define ( 'GRAVITY_COMMENT', 6);
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
function startup() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
error_reporting(E_ERROR | E_WARNING | E_PARSE);
|
|
|
|
|
|
|
|
|
|
set_time_limit(0);
|
|
|
|
@ -389,7 +389,7 @@ if(! class_exists('App')) {
|
|
|
|
|
'stylesheet' => '',
|
|
|
|
|
'template_engine' => 'smarty3',
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// array of registered template engines ('name'=>'class name')
|
|
|
|
|
public $template_engines = array();
|
|
|
|
|
// array of instanced template engines ('name'=>'instance')
|
|
|
|
@ -420,6 +420,9 @@ if(! class_exists('App')) {
|
|
|
|
|
|
|
|
|
|
global $default_timezone, $argv, $argc;
|
|
|
|
|
|
|
|
|
|
if (file_exists(".htpreconfig.php"))
|
|
|
|
|
@include(".htpreconfig.php");
|
|
|
|
|
|
|
|
|
|
$this->timezone = ((x($default_timezone)) ? $default_timezone : 'UTC');
|
|
|
|
|
|
|
|
|
|
date_default_timezone_set($this->timezone);
|
|
|
|
@ -453,7 +456,7 @@ if(! class_exists('App')) {
|
|
|
|
|
if(x($_SERVER,'HTTPS') && $_SERVER['HTTPS'])
|
|
|
|
|
$this->scheme = 'https';
|
|
|
|
|
elseif(x($_SERVER,'SERVER_PORT') && (intval($_SERVER['SERVER_PORT']) == 443))
|
|
|
|
|
$this->scheme = 'https';
|
|
|
|
|
$this->scheme = 'https';
|
|
|
|
|
|
|
|
|
|
if(x($_SERVER,'SERVER_NAME')) {
|
|
|
|
|
$this->hostname = $_SERVER['SERVER_NAME'];
|
|
|
|
@ -478,13 +481,17 @@ if(! class_exists('App')) {
|
|
|
|
|
if(isset($path) && strlen($path) && ($path != $this->path))
|
|
|
|
|
$this->path = $path;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($hostname != "")
|
|
|
|
|
$this->hostname = $hostname;
|
|
|
|
|
|
|
|
|
|
if (is_array($argv) && $argc>1 && substr(end($argv), 0, 4)=="http" ) {
|
|
|
|
|
$this->set_baseurl(array_pop($argv) );
|
|
|
|
|
$argc --;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set_include_path("include/$this->hostname" . PATH_SEPARATOR . get_include_path());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if((x($_SERVER,'QUERY_STRING')) && substr($_SERVER['QUERY_STRING'],0,2) === "q=") {
|
|
|
|
|
$this->query_string = substr($_SERVER['QUERY_STRING'],2);
|
|
|
|
|
// removing trailing / - maybe a nginx problem
|
|
|
|
@ -550,7 +557,7 @@ if(! class_exists('App')) {
|
|
|
|
|
$mobile_detect = new Mobile_Detect();
|
|
|
|
|
$this->is_mobile = $mobile_detect->isMobile();
|
|
|
|
|
$this->is_tablet = $mobile_detect->isTablet();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* register template engines
|
|
|
|
|
*/
|
|
|
|
@ -560,7 +567,7 @@ if(! class_exists('App')) {
|
|
|
|
|
$this->register_template_engine($k);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function get_basepath() {
|
|
|
|
@ -640,7 +647,7 @@ if(! class_exists('App')) {
|
|
|
|
|
$this->pager['itemspage'] = ((intval($n) > 0) ? intval($n) : 0);
|
|
|
|
|
$this->pager['start'] = ($this->pager['page'] * $this->pager['itemspage']) - $this->pager['itemspage'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function set_pager_page($n) {
|
|
|
|
|
$this->pager['page'] = $n;
|
|
|
|
|
$this->pager['start'] = ($this->pager['page'] * $this->pager['itemspage']) - $this->pager['itemspage'];
|
|
|
|
@ -773,7 +780,7 @@ if(! class_exists('App')) {
|
|
|
|
|
$template_engine = $this->theme['template_engine'];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (isset($this->template_engines[$template_engine])){
|
|
|
|
|
if(isset($this->template_engine_instance[$template_engine])){
|
|
|
|
|
return $this->template_engine_instance[$template_engine];
|
|
|
|
@ -784,7 +791,7 @@ if(! class_exists('App')) {
|
|
|
|
|
return $obj;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo "template engine <tt>$template_engine</tt> is not registered!\n"; killme();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -827,6 +834,7 @@ if(! class_exists('App')) {
|
|
|
|
|
//$this->performance["markstart"] -= microtime(true) - $this->performance["marktime"];
|
|
|
|
|
$this->performance["markstart"] = microtime(true) - $this->performance["markstart"] - $this->performance["marktime"];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1008,7 +1016,7 @@ if(! function_exists('update_db')) {
|
|
|
|
|
));
|
|
|
|
|
$subject=sprintf(t('Update Error at %s'), $a->get_baseurl());
|
|
|
|
|
require_once('include/email.php');
|
|
|
|
|
$subject = email_header_encode($subject,'UTF-8');
|
|
|
|
|
$subject = email_header_encode($subject,'UTF-8');
|
|
|
|
|
mail($a->config['admin_email'], $subject, $email_msg,
|
|
|
|
|
'From: ' . 'Administrator' . '@' . $_SERVER['SERVER_NAME'] . "\n"
|
|
|
|
|
. 'Content-type: text/plain; charset=UTF-8' . "\n"
|
|
|
|
@ -1020,7 +1028,7 @@ if(! function_exists('update_db')) {
|
|
|
|
|
else {
|
|
|
|
|
set_config('database','update_' . $x, 'success');
|
|
|
|
|
set_config('system','build', $x + 1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1288,7 +1296,7 @@ if(! function_exists('profile_load')) {
|
|
|
|
|
$user = q("select uid from user where nickname = '%s' limit 1",
|
|
|
|
|
dbesc($nickname)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(! ($user && count($user))) {
|
|
|
|
|
logger('profile error: ' . $a->query_string, LOGGER_DEBUG);
|
|
|
|
|
notice( t('Requested account is not available.') . EOL );
|
|
|
|
@ -1310,7 +1318,7 @@ if(! function_exists('profile_load')) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$r = null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if($profile) {
|
|
|
|
|
$profile_int = intval($profile);
|
|
|
|
|
$r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `user`.* FROM `profile`
|
|
|
|
@ -1334,7 +1342,7 @@ if(! function_exists('profile_load')) {
|
|
|
|
|
$a->error = 404;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// fetch user tags if this isn't the default profile
|
|
|
|
|
|
|
|
|
|
if(! $r[0]['is-default']) {
|
|
|
|
|