Merge branch 'master' of git://github.com/friendica/friendica

This commit is contained in:
Tobias Diekershoff 2013-10-07 07:46:39 +02:00
commit 8bd6858bfa
19 changed files with 99 additions and 68 deletions

View file

@ -420,6 +420,9 @@ if(! class_exists('App')) {
global $default_timezone, $argv, $argc; global $default_timezone, $argv, $argc;
if (file_exists(".htpreconfig.php"))
@include(".htpreconfig.php");
$this->timezone = ((x($default_timezone)) ? $default_timezone : 'UTC'); $this->timezone = ((x($default_timezone)) ? $default_timezone : 'UTC');
date_default_timezone_set($this->timezone); date_default_timezone_set($this->timezone);
@ -453,7 +456,7 @@ if(! class_exists('App')) {
if(x($_SERVER,'HTTPS') && $_SERVER['HTTPS']) if(x($_SERVER,'HTTPS') && $_SERVER['HTTPS'])
$this->scheme = 'https'; $this->scheme = 'https';
elseif(x($_SERVER,'SERVER_PORT') && (intval($_SERVER['SERVER_PORT']) == 443)) elseif(x($_SERVER,'SERVER_PORT') && (intval($_SERVER['SERVER_PORT']) == 443))
$this->scheme = 'https'; $this->scheme = 'https';
if(x($_SERVER,'SERVER_NAME')) { if(x($_SERVER,'SERVER_NAME')) {
$this->hostname = $_SERVER['SERVER_NAME']; $this->hostname = $_SERVER['SERVER_NAME'];
@ -478,6 +481,10 @@ if(! class_exists('App')) {
if(isset($path) && strlen($path) && ($path != $this->path)) if(isset($path) && strlen($path) && ($path != $this->path))
$this->path = $path; $this->path = $path;
} }
if ($hostname != "")
$this->hostname = $hostname;
if (is_array($argv) && $argc>1 && substr(end($argv), 0, 4)=="http" ) { if (is_array($argv) && $argc>1 && substr(end($argv), 0, 4)=="http" ) {
$this->set_baseurl(array_pop($argv) ); $this->set_baseurl(array_pop($argv) );
$argc --; $argc --;
@ -827,6 +834,7 @@ if(! class_exists('App')) {
//$this->performance["markstart"] -= microtime(true) - $this->performance["marktime"]; //$this->performance["markstart"] -= microtime(true) - $this->performance["marktime"];
$this->performance["markstart"] = microtime(true) - $this->performance["markstart"] - $this->performance["marktime"]; $this->performance["markstart"] = microtime(true) - $this->performance["markstart"] - $this->performance["marktime"];
} }
} }
} }

View file

@ -619,19 +619,32 @@
function api_status_show(&$a, $type){ function api_status_show(&$a, $type){
$user_info = api_get_user($a); $user_info = api_get_user($a);
// get last public wall message // get last public wall message
$lastwall = q("SELECT `item`.*, `i`.`contact-id` as `reply_uid`, `i`.`nick` as `reply_author`
FROM `item`, `contact`, $lastwall = q("SELECT `item`.*, `i`.`contact-id` as `reply_uid`, `c`.`nick` as `reply_author`
(SELECT `item`.`id`, `item`.`contact-id`, `contact`.`nick` FROM `item`,`contact` WHERE `contact`.`id`=`item`.`contact-id`) as `i` FROM `item`, `contact`, `item` as `i`, `contact` as `c`
WHERE `item`.`contact-id` = %d WHERE `item`.`contact-id` = %d
AND `i`.`id` = `item`.`parent` AND `i`.`id` = `item`.`parent`
AND `contact`.`id`=`item`.`contact-id` AND `contact`.`self`=1 AND `contact`.`id`=`item`.`contact-id` AND `c`.`id`=`i`.`contact-id` AND `contact`.`self`=1
AND `type`!='activity' AND `item`.`type`!='activity'
AND `item`.`allow_cid`='' AND `item`.`allow_gid`='' AND `item`.`deny_cid`='' AND `item`.`deny_gid`='' 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", LIMIT 1",
intval($user_info['id']) 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){ if (count($lastwall)>0){
$lastwall = $lastwall[0]; $lastwall = $lastwall[0];

View file

@ -38,7 +38,8 @@ function tryoembed($match){
$url = ((count($match)==2)?$match[1]:$match[2]); $url = ((count($match)==2)?$match[1]:$match[2]);
// Always embed the SSL version // 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"); //logger("tryoembed: $url");
@ -666,9 +667,9 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true, $simplehtml = fal
$Text = preg_replace("/\[vimeo\]https?:\/\/vimeo.com\/([0-9]+)(.*?)\[\/vimeo\]/ism",'[vimeo]$1[/vimeo]',$Text); $Text = preg_replace("/\[vimeo\]https?:\/\/vimeo.com\/([0-9]+)(.*?)\[\/vimeo\]/ism",'[vimeo]$1[/vimeo]',$Text);
if ($tryoembed) 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 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); // $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);

View file

@ -487,7 +487,6 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
$alike = array(); $alike = array();
$dlike = array(); $dlike = array();
// array with html for each thread (parent+comments) // array with html for each thread (parent+comments)
$threads = array(); $threads = array();
$threadsid = -1; $threadsid = -1;
@ -697,7 +696,6 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
$threads[$threadsid]['items'] = array($arr['output']); $threads[$threadsid]['items'] = array($arr['output']);
} }
} }
else else
{ {
@ -754,6 +752,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
} }
$threads = $conv->get_template_data($alike, $dlike); $threads = $conv->get_template_data($alike, $dlike);
if(!$threads) { if(!$threads) {
logger('[ERROR] conversation : Failed to get template data.', LOGGER_DEBUG); logger('[ERROR] conversation : Failed to get template data.', LOGGER_DEBUG);
$threads = array(); $threads = array();

View file

@ -93,6 +93,8 @@ class dba {
$stamp2 = microtime(true); $stamp2 = microtime(true);
$duration = (float)($stamp2-$stamp1); $duration = (float)($stamp2-$stamp1);
$a->save_timestamp($stamp1, "database");
if(x($a->config,'system') && x($a->config['system'],'db_log')) { if(x($a->config,'system') && x($a->config['system'],'db_log')) {
if (($duration > $a->config["system"]["db_loglimit"])) { if (($duration > $a->config["system"]["db_loglimit"])) {
$duration = round($duration, 3); $duration = round($duration, 3);
@ -168,7 +170,7 @@ class dba {
} }
} }
$a->save_timestamp($stamp1, "database"); //$a->save_timestamp($stamp1, "database");
if($this->debug) if($this->debug)
logger('dba: ' . printable(print_r($r, true))); logger('dba: ' . printable(print_r($r, true)));

View file

@ -2667,11 +2667,10 @@ function diaspora_transmit($owner,$contact,$slap,$public_batch,$queue_run=false)
$return_code = 0; $return_code = 0;
} }
else { else {
if(! intval(get_config('system','diaspora_test'))) { if (!intval(get_config('system','diaspora_test'))) {
post_url($dest_url . '/', $slap); post_url($dest_url . '/', $slap);
$return_code = $a->get_curl_code(); $return_code = $a->get_curl_code();
} } else {
else {
logger('diaspora_transmit: test_mode'); logger('diaspora_transmit: test_mode');
return 200; return 200;
} }

View file

@ -679,8 +679,6 @@ function notifier_run(&$argv, &$argc){
} }
} }
logger('notifier: dfrndelivery: ' . $contact['name']); logger('notifier: dfrndelivery: ' . $contact['name']);
$deliver_status = dfrn_deliver($owner,$contact,$atom); $deliver_status = dfrn_deliver($owner,$contact,$atom);

View file

@ -136,7 +136,6 @@ if(! x($_SESSION,'sysmsg_info'))
* any plugins have been added or removed and reacts accordingly. * any plugins have been added or removed and reacts accordingly.
*/ */
if($install) if($install)
$a->module = 'install'; $a->module = 'install';
elseif($maintenance) elseif($maintenance)
@ -320,10 +319,8 @@ if($a->module_loaded) {
$func = str_replace('-','_',current_theme()) . '_content_loaded'; $func = str_replace('-','_',current_theme()) . '_content_loaded';
$func($a); $func($a);
} }
} }
/* /*
* Create the page head after setting the language * Create the page head after setting the language
* and getting any auth credentials * and getting any auth credentials

View file

@ -87,6 +87,11 @@ function admin_content(&$a) {
if(x($_SESSION,'submanage') && intval($_SESSION['submanage'])) if(x($_SESSION,'submanage') && intval($_SESSION['submanage']))
return ""; return "";
if (function_exists("apc_delete")) {
$toDelete = new APCIterator('user', APC_ITER_VALUE);
apc_delete($toDelete);
}
/** /**
* Side bar links * Side bar links
*/ */

View file

@ -70,7 +70,7 @@ function community_content(&$a, $update = 0) {
`contact`.`network`, `contact`.`thumb`, `contact`.`self`, `contact`.`writable`, `contact`.`network`, `contact`.`thumb`, `contact`.`self`, `contact`.`writable`,
`contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`, `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`,
`user`.`nickname`, `user`.`hidewall` `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` LEFT JOIN `user` ON `user`.`uid` = `item`.`uid`
WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0 WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0
AND `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`allow_cid` = '' AND `item`.`allow_gid` = ''

View file

@ -123,7 +123,7 @@ function display_content(&$a, $update = 0) {
if($update) { if($update) {
$r = q("SELECT id FROM item WHERE item.uid = %d $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", $sql_extra AND unseen = 1",
intval($a->profile['uid']), intval($a->profile['uid']),
dbesc($item_id), dbesc($item_id),
@ -142,7 +142,7 @@ function display_content(&$a, $update = 0) {
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0 WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
and `item`.`moderated` = 0 and `item`.`moderated` = 0
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 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 ) AND uid = %d )
$sql_extra $sql_extra
ORDER BY `parent` DESC, `gravity` ASC, `id` ASC ", ORDER BY `parent` DESC, `gravity` ASC, `id` ASC ",
@ -171,7 +171,7 @@ function display_content(&$a, $update = 0) {
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0 WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
and `item`.`moderated` = 0 and `item`.`moderated` = 0
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 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 ", ORDER BY `parent` DESC, `gravity` ASC, `id` ASC ",
intval(local_user()), intval(local_user()),
dbesc($item_uri), dbesc($item_uri),

View file

@ -376,7 +376,6 @@ function network_content(&$a, $update = 0) {
} }
} }
$o = ''; $o = '';
// item filter tabs // item filter tabs
@ -498,10 +497,6 @@ function network_content(&$a, $update = 0) {
// --- end item filter tabs // --- end item filter tabs
$contact_id = $a->cid; $contact_id = $a->cid;
require_once('include/acl_selectors.php'); require_once('include/acl_selectors.php');
@ -572,7 +567,6 @@ function network_content(&$a, $update = 0) {
} }
// We don't have to deal with ACLs on this page. You're looking at everything // 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 // that belongs to you, hence you can see all of it. We will filter by group if
// desired. // desired.
@ -849,7 +843,6 @@ function network_content(&$a, $update = 0) {
$update_unseen = ' WHERE uid = ' . intval(local_user()) . ' AND unseen = 1 AND parent IN ( ' . dbesc($parents_str) . ' )'; $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 // 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 // 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. // at the top level network page just mark everything seen.

View file

@ -277,7 +277,7 @@ function profile_content(&$a, $update = 0) {
$pager_sql = sprintf(" LIMIT %d, %d ",intval($a->pager['start']), intval($a->pager['itemspage'])); $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` $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 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`.`moderated` = 0 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
AND `item`.`id` = `item`.`parent` AND `item`.`wall` = 1 AND `item`.`id` = `item`.`parent` AND `item`.`wall` = 1

View file

@ -16,6 +16,11 @@ function get_theme_config_file($theme){
function settings_init(&$a) { 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 // These lines provide the javascript needed by the acl selector
$tpl = get_markup_template("settings-head.tpl"); $tpl = get_markup_template("settings-head.tpl");

View file

@ -130,10 +130,14 @@ class Conversation extends BaseObject {
global $a; global $a;
$result = array(); $result = array();
$i = 0;
foreach($this->threads as $item) { foreach($this->threads as $item) {
if($item->get_data_value('network') === NETWORK_MAIL && local_user() != $item->get_data_value('uid')) if($item->get_data_value('network') === NETWORK_MAIL && local_user() != $item->get_data_value('uid'))
continue; continue;
$item_data = $item->get_template_data($alike, $dlike); $item_data = $item->get_template_data($alike, $dlike);
if(!$item_data) { if(!$item_data) {
logger('[ERROR] Conversation::get_template_data : Failed to get item template data ('. $item->get_id() .').', LOGGER_DEBUG); logger('[ERROR] Conversation::get_template_data : Failed to get item template data ('. $item->get_id() .').', LOGGER_DEBUG);
return false; return false;

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 B

View file

@ -3790,7 +3790,14 @@ aside input[type='text'] {
background-repeat: no-repeat; background-repeat: no-repeat;
opacity: 0.5; opacity: 0.5;
} }
.icon.link { display: none; background-position: -144px 0px;}
.icon.link {
display: block; width: 22px; height: 24px;
background-size: 100% 100%;
background-image: url('images/link.png');
background-repeat: no-repeat;
}
/*.globe { background-position: 0px -16px;}*/ /*.globe { background-position: 0px -16px;}*/
.icon.globe { .icon.globe {

View file

@ -40,14 +40,12 @@
<div id="profile-upload-wrapper" style="display: {{$visitor}};" > <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 id="wall-image-upload-div" ><a href="#" onclick="return false;" id="wall-image-upload" class="icon camera" title="{{$upload}}"></a></div>
</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 id="wall-file-upload-div" ><a href="#" onclick="return false;" id="wall-file-upload" class="icon attach" title="{{$attach}}"></a></div>
</div> </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}};" 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 id="profile-link-wrapper" style="display: {{$visitor}};" > <div id="profile-link-wrapper" style="display: {{$visitor}};" >
<a id="profile-link" class="icon link" title="{{$weblink}}" onclick="jotGetLink(); return false;"></a> <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>
<div id="profile-video-wrapper" style="display: {{$visitor}};" > <div id="profile-video-wrapper" style="display: {{$visitor}};" >
<a id="profile-video" class="icon video" title="{{$video}}" onclick="jotVideoURL();return false;"></a> <a id="profile-video" class="icon video" title="{{$video}}" onclick="jotVideoURL();return false;"></a>

View file

@ -863,19 +863,21 @@ aside {
/* display: table-cell; */ /* display: table-cell; */
vertical-align: top; vertical-align: top;
width: 185px; width: 185px;
padding: 32px 10px 10px 20px; /* padding: 32px 10px 10px 20px; */
padding: 10px 10px 0px 20px;
/* border-right: 1px solid #D2D2D2; */ /* border-right: 1px solid #D2D2D2; */
/* background-color: #ECECF2; */ /* background-color: #ECECF2; */
background-color: #F2F2F2; background-color: #F2F2F2;
font-size: 13px; font-size: 13px;
/* background: #F1F1F1; */ /* background: #F1F1F1; */
top: 0px; /* top: 0px; */
top: 32px;
overflow-y: auto; overflow-y: auto;
z-index: 2; z-index: 2;
position: fixed; position: fixed;
/* overflow: auto; */ /* overflow: auto; */
height: 100%; height: calc(100% - 42px);
/* overflow: scroll; */ /* overflow: scroll; */
} }
aside .vcard .fn { aside .vcard .fn {