*/
function startup() {
-
+
error_reporting(E_ERROR | E_WARNING | E_PARSE);
set_time_limit(0);
'stylesheet' => '',
'template_engine' => 'smarty3',
);
-
+
// array of registered template engines ('name'=>'class name')
public $template_engines = array();
// array of instanced template engines ('name'=>'instance')
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);
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'];
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
$mobile_detect = new Mobile_Detect();
$this->is_mobile = $mobile_detect->isMobile();
$this->is_tablet = $mobile_detect->isTablet();
-
+
/**
* register template engines
*/
$this->register_template_engine($k);
}
}
-
+
}
function get_basepath() {
$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'];
$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];
return $obj;
}
}
-
+
echo "template engine <tt>$template_engine</tt> is not registered!\n"; killme();
}
//$this->performance["markstart"] -= microtime(true) - $this->performance["marktime"];
$this->performance["markstart"] = microtime(true) - $this->performance["markstart"] - $this->performance["marktime"];
}
+
}
}
));
$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"
else {
set_config('database','update_' . $x, 'success');
set_config('system','build', $x + 1);
- }
+ }
}
}
}
$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 );
}
$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`
$a->error = 404;
return;
}
-
+
// fetch user tags if this isn't the default profile
if(! $r[0]['is-default']) {
function api_status_show(&$a, $type){
$user_info = api_get_user($a);
// get last public wall message
- $lastwall = q("SELECT `item`.*, `i`.`contact-id` as `reply_uid`, `i`.`nick` as `reply_author`
- FROM `item`, `contact`,
- (SELECT `item`.`id`, `item`.`contact-id`, `contact`.`nick` FROM `item`,`contact` WHERE `contact`.`id`=`item`.`contact-id`) as `i`
+
+ $lastwall = q("SELECT `item`.*, `i`.`contact-id` as `reply_uid`, `c`.`nick` as `reply_author`
+ FROM `item`, `contact`, `item` as `i`, `contact` as `c`
WHERE `item`.`contact-id` = %d
AND `i`.`id` = `item`.`parent`
- AND `contact`.`id`=`item`.`contact-id` AND `contact`.`self`=1
- AND `type`!='activity'
+ AND `contact`.`id`=`item`.`contact-id` AND `c`.`id`=`i`.`contact-id` AND `contact`.`self`=1
+ AND `item`.`type`!='activity'
AND `item`.`allow_cid`='' AND `item`.`allow_gid`='' AND `item`.`deny_cid`='' AND `item`.`deny_gid`=''
- ORDER BY `created` DESC
+ ORDER BY `item`.`created` DESC
LIMIT 1",
intval($user_info['id'])
);
+// $lastwall = q("SELECT `item`.*, `i`.`contact-id` as `reply_uid`, `i`.`nick` as `reply_author`
+// FROM `item`, `contact`,
+// (SELECT `item`.`id`, `item`.`contact-id`, `contact`.`nick` FROM `item`,`contact` WHERE `contact`.`id`=`item`.`contact-id`) as `i`
+// WHERE `item`.`contact-id` = %d
+// AND `i`.`id` = `item`.`parent`
+// AND `contact`.`id`=`item`.`contact-id` AND `contact`.`self`=1
+// AND `type`!='activity'
+// AND `item`.`allow_cid`='' AND `item`.`allow_gid`='' AND `item`.`deny_cid`='' AND `item`.`deny_gid`=''
+// ORDER BY `created` DESC
+// LIMIT 1",
+// intval($user_info['id'])
+// );
+
if (count($lastwall)>0){
$lastwall = $lastwall[0];
$url = ((count($match)==2)?$match[1]:$match[2]);
// Always embed the SSL version
- $url = str_replace("http://www.youtube.com/", "https://www.youtube.com/", $url);
+ $url = str_replace(array("http://www.youtube.com/", "http://player.vimeo.com/"),
+ array("https://www.youtube.com/", "https://player.vimeo.com/"), $url);
//logger("tryoembed: $url");
$Text = preg_replace("/\[vimeo\]https?:\/\/vimeo.com\/([0-9]+)(.*?)\[\/vimeo\]/ism",'[vimeo]$1[/vimeo]',$Text);
if ($tryoembed)
- $Text = preg_replace("/\[vimeo\]([0-9]+)(.*?)\[\/vimeo\]/ism", '<iframe width="' . $a->videowidth . '" height="' . $a->videoheight . '" src="http://player.vimeo.com/video/$1" frameborder="0" ></iframe>', $Text);
+ $Text = preg_replace("/\[vimeo\]([0-9]+)(.*?)\[\/vimeo\]/ism", '<iframe width="' . $a->videowidth . '" height="' . $a->videoheight . '" src="https://player.vimeo.com/video/$1" frameborder="0" ></iframe>', $Text);
else
- $Text = preg_replace("/\[vimeo\]([0-9]+)(.*?)\[\/vimeo\]/ism", "http://vimeo.com/$1", $Text);
+ $Text = preg_replace("/\[vimeo\]([0-9]+)(.*?)\[\/vimeo\]/ism", "https://vimeo.com/$1", $Text);
// $Text = preg_replace("/\[youtube\](.*?)\[\/youtube\]/", '<object width="425" height="350" type="application/x-shockwave-flash" data="http://www.youtube.com/v/$1" ><param name="movie" value="http://www.youtube.com/v/$1"></param><!--[if IE]><embed src="http://www.youtube.com/v/$1" type="application/x-shockwave-flash" width="425" height="350" /><![endif]--></object>', $Text);
$alike = array();
$dlike = array();
-
// array with html for each thread (parent+comments)
$threads = array();
$threadsid = -1;
if($blocked)
continue;
}
-
+
$threadsid++;
$threads[$threadsid]['items'] = array($arr['output']);
}
-
}
else
{
if($arr_blocked) {
$blocked = false;
foreach($arr_blocked as $b) {
-
+
if($b && link_compare($item['author-link'],$b)) {
$blocked = true;
break;
if($blocked)
continue;
}
-
+
// Can we put this after the visibility check?
}
$threads = $conv->get_template_data($alike, $dlike);
+
if(!$threads) {
logger('[ERROR] conversation : Failed to get template data.', LOGGER_DEBUG);
$threads = array();
$stamp2 = microtime(true);
$duration = (float)($stamp2-$stamp1);
+ $a->save_timestamp($stamp1, "database");
+
if(x($a->config,'system') && x($a->config['system'],'db_log')) {
if (($duration > $a->config["system"]["db_loglimit"])) {
$duration = round($duration, 3);
}
}
- $a->save_timestamp($stamp1, "database");
+ //$a->save_timestamp($stamp1, "database");
if($this->debug)
logger('dba: ' . printable(print_r($r, true)));
$return_code = 0;
}
else {
- if(! intval(get_config('system','diaspora_test'))) {
+ if (!intval(get_config('system','diaspora_test'))) {
post_url($dest_url . '/', $slap);
$return_code = $a->get_curl_code();
- }
- else {
+ } else {
logger('diaspora_transmit: test_mode');
return 200;
}
}
-
+
logger('diaspora_transmit: ' . $logid . ' returns: ' . $return_code);
if((! $return_code) || (($return_code == 503) && (stristr($a->get_curl_headers(),'retry-after')))) {
// if contact's ssl policy changed, which we just determined
// is on our own server, update our contact links
-
+
$ssl_policy = get_config('system','ssl_policy');
fix_contact_ssl_policy($x[0],$ssl_policy);
require_once('library/simplepie/simplepie.inc');
logger('mod-delivery: local delivery');
local_delivery($x[0],$atom);
- break;
+ break;
}
}
-
-
logger('notifier: dfrndelivery: ' . $contact['name']);
$deliver_status = dfrn_deliver($owner,$contact,$atom);
logger('notifier: dfrn_delivery returns ' . $deliver_status);
-
+
if($deliver_status == (-1)) {
logger('notifier: delivery failed: queuing message');
// queue message for redelivery
* For Mozilla auth manager - still needs sorting, and this might conflict with LRDD header.
* Apache/PHP lumps the Link: headers into one - and other services might not be able to parse it
* this way. There's a PHP flag to link the headers because by default this will over-write any other
- * link header.
+ * link header.
*
* What we really need to do is output the raw headers ourselves so we can keep them separate.
*
*/
-
+
// header('Link: <' . $a->get_baseurl() . '/amcd>; rel="acct-mgmt";');
if((x($_SESSION,'authenticated')) || (x($_POST,'auth-params')) || ($a->module === 'login'))
* any plugins have been added or removed and reacts accordingly.
*/
-
if($install)
$a->module = 'install';
elseif($maintenance)
// Compatibility with the Android Diaspora client
if ($a->module == "stream")
$a->module = "network";
-
+
$privateapps = get_config('config','private_addons');
if(is_array($a->plugins) && in_array($a->module,$a->plugins) && file_exists("addon/{$a->module}/{$a->module}.php")) {
$func = str_replace('-','_',current_theme()) . '_content_loaded';
$func($a);
}
-
}
-
/*
* Create the page head after setting the language
* and getting any auth credentials
if(x($_SESSION,'submanage') && intval($_SESSION['submanage']))
return "";
+ if (function_exists("apc_delete")) {
+ $toDelete = new APCIterator('user', APC_ITER_VALUE);
+ apc_delete($toDelete);
+ }
+
/**
* Side bar links
*/
`contact`.`network`, `contact`.`thumb`, `contact`.`self`, `contact`.`writable`,
`contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`,
`user`.`nickname`, `user`.`hidewall`
- FROM `item` FORCE INDEX (`received`) LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
+ FROM `item` FORCE INDEX (`received`, `wall`) LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
LEFT JOIN `user` ON `user`.`uid` = `item`.`uid`
WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0
AND `item`.`allow_cid` = '' AND `item`.`allow_gid` = ''
if($update) {
$r = q("SELECT id FROM item WHERE item.uid = %d
- AND `item`.`parent` = ( SELECT `parent` FROM `item` WHERE ( `id` = '%s' OR `uri` = '%s' ))
+ AND `item`.`parent` = ( SELECT `parent` FROM `item` FORCE INDEX (PRIMARY, `uri`) WHERE ( `id` = '%s' OR `uri` = '%s' ))
$sql_extra AND unseen = 1",
intval($a->profile['uid']),
dbesc($item_id),
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
and `item`.`moderated` = 0
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
- AND `item`.`parent` = ( SELECT `parent` FROM `item` WHERE ( `id` = '%s' OR `uri` = '%s' )
+ AND `item`.`parent` = ( SELECT `parent` FROM `item` FORCE INDEX (PRIMARY, `uri`) WHERE ( `id` = '%s' OR `uri` = '%s' )
AND uid = %d )
$sql_extra
ORDER BY `parent` DESC, `gravity` ASC, `id` ASC ",
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
and `item`.`moderated` = 0
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
- AND `item`.`parent` = ( SELECT `parent` FROM `item` WHERE `uri` = '%s' AND uid = %d )
+ AND `item`.`parent` = ( SELECT `parent` FROM `item` FORCE INDEX (PRIMARY, `uri`) WHERE `uri` = '%s' AND uid = %d )
ORDER BY `parent` DESC, `gravity` ASC, `id` ASC ",
intval(local_user()),
dbesc($item_uri),
}
}
-
$o = '';
// item filter tabs
// --- end item filter tabs
-
-
-
-
$contact_id = $a->cid;
require_once('include/acl_selectors.php');
}
-
// We don't have to deal with ACLs on this page. You're looking at everything
// that belongs to you, hence you can see all of it. We will filter by group if
// desired.
$update_unseen = ' WHERE uid = ' . intval(local_user()) . ' AND unseen = 1 AND parent IN ( ' . dbesc($parents_str) . ' )';
}
-
// We aren't going to try and figure out at the item, group, and page
// level which items you've seen and which you haven't. If you're looking
// at the top level network page just mark everything seen.
// on they just get buried deeper. It has happened to me a couple of times also.
if((! $group) && (! $cid) && (! $star)) {
- $r = q("UPDATE `item` SET `unseen` = 0
+ $r = q("UPDATE `item` SET `unseen` = 0
WHERE `unseen` = 1 AND `uid` = %d",
intval(local_user())
);
$pager_sql = sprintf(" LIMIT %d, %d ",intval($a->pager['start']), intval($a->pager['itemspage']));
$r = q("SELECT `item`.`id` AS `item_id`, `contact`.`uid` AS `contact-uid`
- FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
+ FROM `item` FORCE INDEX (created, uid) LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
and `item`.`moderated` = 0 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
AND `item`.`id` = `item`.`parent` AND `item`.`wall` = 1
function settings_init(&$a) {
+ if (function_exists("apc_delete")) {
+ $toDelete = new APCIterator('user', APC_ITER_VALUE);
+ apc_delete($toDelete);
+ }
+
// These lines provide the javascript needed by the acl selector
$tpl = get_markup_template("settings-head.tpl");
global $a;
$result = array();
+ $i = 0;
+
foreach($this->threads as $item) {
if($item->get_data_value('network') === NETWORK_MAIL && local_user() != $item->get_data_value('uid'))
continue;
+
$item_data = $item->get_template_data($alike, $dlike);
+
if(!$item_data) {
logger('[ERROR] Conversation::get_template_data : Failed to get item template data ('. $item->get_id() .').', LOGGER_DEBUG);
return false;
background-repeat: no-repeat;\r
opacity: 0.5;\r
}\r
-.icon.link { display: none; background-position: -144px 0px;}\r
+\r
+.icon.link {\r
+ display: block; width: 22px; height: 24px;\r
+ background-size: 100% 100%;\r
+ background-image: url('images/link.png');\r
+ background-repeat: no-repeat;\r
+\r
+}\r
\r
/*.globe { background-position: 0px -16px;}*/\r
.icon.globe {\r
<div id="profile-upload-wrapper" style="display: {{$visitor}};" >
<div id="wall-image-upload-div" ><a href="#" onclick="return false;" id="wall-image-upload" class="icon camera" title="{{$upload}}"></a></div>
</div>
- <div id="profile-attach-wrapper" style="display: {{$visitor}};" >
+ {{*<!--<div id="profile-attach-wrapper" style="display: {{$visitor}};" >
<div id="wall-file-upload-div" ><a href="#" onclick="return false;" id="wall-file-upload" class="icon attach" title="{{$attach}}"></a></div>
- </div>
-
- {{*<!--<div id="profile-link-wrapper" style="display: {{$visitor}};" ondragenter="linkdropper(event);" ondragover="linkdropper(event);" ondrop="linkdrop(event);" >
- <a id="profile-link" class="icon link" title="{{$weblink}}" ondragenter="return linkdropper(event);" ondragover="return linkdropper(event);" ondrop="linkdrop(event);" onclick="jotGetLink(); return false;"></a>-->*}}
+ </div> -->*}}
+ {{*<!--<div id="profile-link-wrapper" style="display: {{$visitor}};" ondragenter="linkdropper(event);" ondragover="linkdropper(event);" ondrop="linkdrop(event);" >-->*}}
<div id="profile-link-wrapper" style="display: {{$visitor}};" >
- <a id="profile-link" class="icon link" title="{{$weblink}}" onclick="jotGetLink(); return false;"></a>
- </div>
+ <a id="profile-link" class="icon link" title="{{$weblink}}" ondragenter="return linkdropper(event);" ondragover="return linkdropper(event);" ondrop="linkdrop(event);" onclick="jotGetLink(); return false;"></a>
+ </div>
<div id="profile-video-wrapper" style="display: {{$visitor}};" >
<a id="profile-video" class="icon video" title="{{$video}}" onclick="jotVideoURL();return false;"></a>
</div>
/* display: table-cell; */
vertical-align: top;
width: 185px;
- padding: 32px 10px 10px 20px;
+ /* padding: 32px 10px 10px 20px; */
+ padding: 10px 10px 0px 20px;
/* border-right: 1px solid #D2D2D2; */
/* background-color: #ECECF2; */
background-color: #F2F2F2;
font-size: 13px;
/* background: #F1F1F1; */
- top: 0px;
+ /* top: 0px; */
+ top: 32px;
overflow-y: auto;
z-index: 2;
position: fixed;
/* overflow: auto; */
- height: 100%;
+ height: calc(100% - 42px);
/* overflow: scroll; */
}
aside .vcard .fn {