aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--boot.php18
-rw-r--r--include/bb2diaspora.php22
-rw-r--r--include/diaspora.php57
-rw-r--r--include/items.php4
-rw-r--r--include/nav.php4
-rw-r--r--index.php3
-rw-r--r--js/fk.autocomplete.js21
-rw-r--r--js/main.js4
-rw-r--r--library/HTML5/TreeBuilder.php4
-rw-r--r--mod/dfrn_confirm.php1
-rw-r--r--mod/profile_photo.php1
-rw-r--r--mod/tagger.php2
-rw-r--r--view/diaspora_vcard.tpl2
-rw-r--r--view/profile_vcard.tpl2
-rw-r--r--view/theme/duepuntozero/profile_vcard.tpl2
15 files changed, 110 insertions, 37 deletions
diff --git a/boot.php b/boot.php
index fb394c59a..3e18db065 100644
--- a/boot.php
+++ b/boot.php
@@ -9,7 +9,7 @@ require_once('include/nav.php');
require_once('include/cache.php');
define ( 'FRIENDIKA_PLATFORM', 'Friendica');
-define ( 'FRIENDIKA_VERSION', '2.3.1161' );
+define ( 'FRIENDIKA_VERSION', '2.3.1164' );
define ( 'DFRN_PROTOCOL_VERSION', '2.22' );
define ( 'DB_UPDATE_VERSION', 1103 );
@@ -796,17 +796,17 @@ function profile_load(&$a, $nickname, $profile = 0) {
if($profile) {
$profile_int = intval($profile);
- $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `user`.* FROM `profile`
- LEFT JOIN `user` ON `profile`.`uid` = `user`.`uid`
- WHERE `user`.`nickname` = '%s' AND `profile`.`id` = %d LIMIT 1",
+ $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `user`.* FROM `profile`
+ left join `contact` on `contact`.`uid` = `profile`.`uid` LEFT JOIN `user` ON `profile`.`uid` = `user`.`uid`
+ WHERE `user`.`nickname` = '%s' AND `profile`.`id` = %d and `contact`.`self` = 1 LIMIT 1",
dbesc($nickname),
intval($profile_int)
);
}
if(! count($r)) {
- $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `user`.* FROM `profile`
- LEFT JOIN `user` ON `profile`.`uid` = `user`.`uid`
- WHERE `user`.`nickname` = '%s' AND `profile`.`is-default` = 1 LIMIT 1",
+ $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `user`.* FROM `profile`
+ left join `contact` on `contact`.`uid` = `profile`.`uid` LEFT JOIN `user` ON `profile`.`uid` = `user`.`uid`
+ WHERE `user`.`nickname` = '%s' AND `profile`.`is-default` = 1 and `contact`.`self` = 1 LIMIT 1",
dbesc($nickname)
);
}
@@ -881,6 +881,8 @@ function profile_sidebar($profile, $block = 0) {
if((! is_array($profile)) && (! count($profile)))
return $o;
+ $profile['picdate'] = urlencode($profile['picdate']);
+
call_hooks('profile_sidebar_enter', $profile);
@@ -955,7 +957,7 @@ function profile_sidebar($profile, $block = 0) {
$diaspora = array(
'podloc' => $a->get_baseurl(),
'searchable' => (($profile['publish'] && $profile['net-publish']) ? 'true' : 'false' ),
- 'nickname ' => $profile['nickname'],
+ 'nickname' => $profile['nickname'],
'fullname' => $profile['name'],
'firstname' => $firstname,
'lastname' => $lastname,
diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php
index 6b0589c43..036e6cdb8 100644
--- a/include/bb2diaspora.php
+++ b/include/bb2diaspora.php
@@ -22,6 +22,8 @@ function diaspora2bb($s) {
$s = preg_replace("/\[url\=?(.*?)\]https?:\/\/vimeo.com\/([0-9]+)(.*?)\[\/url\]/ism",'[vimeo]$2[/vimeo]',$s);
$s = preg_replace("/\[url\=https?:\/\/vimeo.com\/([0-9]+)\](.*?)\[\/url\]/ism",'[vimeo]$1[/vimeo]',$s);
$s = preg_replace("/([^\]\=]|^)(https?\:\/\/)(vimeo|youtu|www\.youtube|soundcloud)([a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)/ism", '$1[url]$2$3$4[/url]',$s);
+ // remove duplicate adjacent code tags
+ $s = preg_replace("/(\[code\])+(.*?)(\[\/code\])+/ism","[code]$2[/code]", $s);
$s = scale_diaspora_images($s);
return $s;
}
@@ -178,17 +180,15 @@ function bb2diaspora($Text,$preserve_nl = false) {
// [img=widthxheight]image source[/img]
// $Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/", '<img src="$3" style="height:{$2}px; width:{$1}px;" >', $Text);
-// if (get_pconfig(local_user(), 'oembed', 'use_for_youtube' )==1){
-// // use oembed for youtube links
-// $Text = preg_replace("/\[youtube\]/",'[embed]',$Text);
-// $Text = preg_replace("/\[\/youtube\]/",'[/embed]',$Text);
-// } else {
-// // Youtube extensions
- // $Text = preg_replace("/\[youtube\]https?:\/\/www.youtube.com\/watch\?v\=(.*?)\[\/youtube\]/",'[youtube]$1[/youtube]',$Text);
- // $Text = preg_replace("/\[youtube\]https?:\/\/youtu.be\/(.*?)\[\/youtube\]/",'[youtube]$1[/youtube]',$Text);
-// $Text = preg_replace("/\[youtube\](.*?)\[\/youtube\]/", '<iframe width="425" height="349" src="http://www.youtube.com/embed/$1" frameborder="0" allowfullscreen></iframe>', $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\]https?:\/\/www.youtube.com\/watch\?v\=(.*?)\[\/youtube\]/ism",'http://www.youtube.com/watch?v=$1',$Text);
+ $Text = preg_replace("/\[youtube\]https?:\/\/www.youtube.com\/embed\/(.*?)\[\/youtube\]/ism",'http://www.youtube.com/watch?v=$1',$Text);
+ $Text = preg_replace("/\[youtube\]https?:\/\/youtu.be\/(.*?)\[\/youtube\]/ism",'http://www.youtube.com/watch?v=$1',$Text);
+ $Text = preg_replace("/\[youtube\]([A-Za-z0-9\-_=]+)(.*?)\[\/youtube\]/ism", 'http://www.youtube.com/watch?v=$1', $Text);
+
+ $Text = preg_replace("/\[vimeo\]https?:\/\/player.vimeo.com\/video\/([0-9]+)(.*?)\[\/vimeo\]/ism",'http://vimeo.com/$1',$Text);
+ $Text = preg_replace("/\[vimeo\]https?:\/\/vimeo.com\/([0-9]+)(.*?)\[\/vimeo\]/ism",'http://vimeo.com/$1',$Text);
+ $Text = preg_replace("/\[vimeo\]([0-9]+)(.*?)\[\/vimeo\]/ism", 'http://vimeo.com/$1',$Text);
+
diff --git a/include/diaspora.php b/include/diaspora.php
index 7e1e034d6..ff0c0c0d7 100644
--- a/include/diaspora.php
+++ b/include/diaspora.php
@@ -420,6 +420,8 @@ function diaspora_decode($importer,$xml) {
function diaspora_request($importer,$xml) {
+ $a = get_app();
+
$sender_handle = unxmlify($xml->sender_handle);
$recipient_handle = unxmlify($xml->recipient_handle);
@@ -440,7 +442,60 @@ function diaspora_request($importer,$xml) {
intval($importer['uid'])
);
}
- // send notification?
+ // send notification
+
+ $r = q("SELECT `hide-friends` FROM `profile` WHERE `uid` = %d AND `is-default` = 1 LIMIT 1",
+ intval($importer['uid'])
+ );
+
+ if((count($r)) && ($r[0]['hide-friends'] == 0)) {
+ require_once('include/items.php');
+
+ $self = q("SELECT * FROM `contact` WHERE `self` = 1 AND `uid` = %d LIMIT 1",
+ intval($importer['uid'])
+ );
+
+ if(count($self)) {
+
+ $arr = array();
+ $arr['uri'] = $arr['parent-uri'] = item_new_uri($a->get_hostname(), $importer['uid']);
+ $arr['uid'] = $importer['uid'];
+ $arr['contact-id'] = $self[0]['id'];
+ $arr['wall'] = 1;
+ $arr['type'] = 'wall';
+ $arr['gravity'] = 0;
+ $arr['origin'] = 1;
+ $arr['author-name'] = $arr['owner-name'] = $self[0]['name'];
+ $arr['author-link'] = $arr['owner-link'] = $self[0]['url'];
+ $arr['author-avatar'] = $arr['owner-avatar'] = $self[0]['thumb'];
+ $arr['verb'] = ACTIVITY_FRIEND;
+ $arr['object-type'] = ACTIVITY_OBJ_PERSON;
+
+ $A = '[url=' . $self[0]['url'] . ']' . $self[0]['name'] . '[/url]';
+ $B = '[url=' . $contact['url'] . ']' . $contact['name'] . '[/url]';
+ $BPhoto = '[url=' . $contact['url'] . ']' . '[img]' . $contact['thumb'] . '[/img][/url]';
+ $arr['body'] = sprintf( t('%1$s is now friends with %2$s'), $A, $B)."\n\n\n".$Bphoto;
+
+ $arr['object'] = '<object><type>' . ACTIVITY_OBJ_PERSON . '</type><title>' . $contact['name'] . '</title>'
+ . '<id>' . $contact['url'] . '/' . $contact['name'] . '</id>';
+ $arr['object'] .= '<link>' . xmlify('<link rel="alternate" type="text/html" href="' . $contact['url'] . '" />' . "\n");
+ $arr['object'] .= xmlify('<link rel="photo" type="image/jpeg" href="' . $contact['thumb'] . '" />' . "\n");
+ $arr['object'] .= '</link></object>' . "\n";
+ $arr['last-child'] = 1;
+
+ $arr['allow_cid'] = $user[0]['allow_cid'];
+ $arr['allow_gid'] = $user[0]['allow_gid'];
+ $arr['deny_cid'] = $user[0]['deny_cid'];
+ $arr['deny_gid'] = $user[0]['deny_gid'];
+
+ $i = item_store($arr);
+ if($i)
+ proc_run('php',"include/notifier.php","activity","$i");
+
+ }
+
+ }
+
return;
}
diff --git a/include/items.php b/include/items.php
index 35db71946..b8e258d3f 100644
--- a/include/items.php
+++ b/include/items.php
@@ -2666,7 +2666,7 @@ function item_getfeedtags($item) {
$matches = false;
$cnt = preg_match_all('|\#\[url\=(.*?)\](.*?)\[\/url\]|',$item['tag'],$matches);
if($cnt) {
- for($x = 0; $x < count($matches); $x ++) {
+ for($x = 0; $x < $cnt; $x ++) {
if($matches[1][$x])
$ret[] = array('#',$matches[1][$x], $matches[2][$x]);
}
@@ -2674,7 +2674,7 @@ function item_getfeedtags($item) {
$matches = false;
$cnt = preg_match_all('|\@\[url\=(.*?)\](.*?)\[\/url\]|',$item['tag'],$matches);
if($cnt) {
- for($x = 0; $x < count($matches); $x ++) {
+ for($x = 0; $x < $cnt; $x ++) {
if($matches[1][$x])
$ret[] = array('@',$matches[1][$x], $matches[2][$x]);
}
diff --git a/include/nav.php b/include/nav.php
index f7165fd0d..4c75a495b 100644
--- a/include/nav.php
+++ b/include/nav.php
@@ -180,9 +180,11 @@ function nav_set_selected($item){
'introductions' => null,
'notifications' => null,
'messages' => null,
- 'directory' => null,
+ 'directory' => null,
'settings' => null,
'contacts' => null,
+ 'manage' => null,
+ 'register' => null,
);
$a->nav_sel[$item] = 'selected';
}
diff --git a/index.php b/index.php
index 3d8648528..78ceb6d77 100644
--- a/index.php
+++ b/index.php
@@ -2,7 +2,7 @@
/**
*
- * Friendika
+ * Friendica
*
*/
@@ -133,6 +133,7 @@ if($install)
else
check_config($a);
+nav_set_selected('nothing');
$arr = array('app_menu' => $a->apps);
diff --git a/js/fk.autocomplete.js b/js/fk.autocomplete.js
index 3f73c6fbb..545fd1645 100644
--- a/js/fk.autocomplete.js
+++ b/js/fk.autocomplete.js
@@ -23,6 +23,13 @@ function ACPopup(elm,backend_url){
style = $(elm.container).offset();
w = elm.container.offsetWidth;
h = elm.container.offsetHeight;
+ // Quick fix for chrome until I get a tool to inspect the dom
+ // Chrome returns 0x0
+ if(! w)
+ w = 530;
+ if(! h)
+ h = 130;
+
}
style.top=style.top+h;
@@ -105,9 +112,13 @@ ACPopup.prototype._search = function(){
$(this.cont).append(elm);
}
ACPopup.prototype.onkey = function(event){
- if (event.keyCode == '13' && this.idsel>-1) {
- this.cont.children()[this.idsel].click();
- event.preventDefault();
+ if (event.keyCode == '13') {
+ if(this.idsel>-1) {
+ this.cont.children()[this.idsel].click();
+ event.preventDefault();
+ }
+ else
+ this.close();
}
if (event.keyCode == '38') { //cursor up
cmax = this.cont.children().size()-1;
@@ -115,14 +126,14 @@ ACPopup.prototype.onkey = function(event){
if (this.idsel<0) this.idsel=cmax;
event.preventDefault();
}
- if (event.keyCode == '40') { //cursor down
+ if (event.keyCode == '40' || event.keyCode == '9') { //cursor down
cmax = this.cont.children().size()-1;
this.idsel++;
if (this.idsel>cmax) this.idsel=0;
event.preventDefault();
}
- if (event.keyCode == '38' || event.keyCode == '40' ) {
+ if (event.keyCode == '38' || event.keyCode == '40' || event.keyCode == '9') {
this.cont.children().removeClass('selected');
$(this.cont.children()[this.idsel]).addClass('selected');
}
diff --git a/js/main.js b/js/main.js
index 9832b2cbc..74e58e0e3 100644
--- a/js/main.js
+++ b/js/main.js
@@ -42,7 +42,7 @@
if (e.hasClass("ttbottom")) pos="bottom";
if (e.hasClass("ttleft")) pos="left";
if (e.hasClass("ttright")) pos="right";
- e.tipTip({defaultPosition: pos});
+ e.tipTip({defaultPosition: pos, edgeOffset: 8});
});
@@ -133,7 +133,7 @@
});
eSysmsg.children("info").each(function(){
text = $(this).text();
- $.jGrowl(text, { sticky: false, theme: 'info' });
+ $.jGrowl(text, { sticky: false, theme: 'info', life: 10000 });
});
});
diff --git a/library/HTML5/TreeBuilder.php b/library/HTML5/TreeBuilder.php
index a64816f56..10d446d1e 100644
--- a/library/HTML5/TreeBuilder.php
+++ b/library/HTML5/TreeBuilder.php
@@ -3041,9 +3041,9 @@ class HTML5_TreeBuilder {
if (!empty($token['attr'])) {
foreach($token['attr'] as $attr) {
- // mike@macgirvin.com 2011-10-21, stray double quotes cause everything to abort
+ // mike@macgirvin.com 2011-10-21, stray double quotes and/or numeric tags cause everything to abort
$attr['name'] = str_replace('"','',$attr['name']);
- if(!$el->hasAttribute($attr['name'])) {
+ if($attr['name'] && (!$el->hasAttribute($attr['name'])) && (! is_numeric($attr['name']))) {
$el->setAttribute($attr['name'], $attr['value']);
}
}
diff --git a/mod/dfrn_confirm.php b/mod/dfrn_confirm.php
index 180e8ff31..ce6f4f95f 100644
--- a/mod/dfrn_confirm.php
+++ b/mod/dfrn_confirm.php
@@ -446,6 +446,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
$arr['wall'] = 1;
$arr['type'] = 'wall';
$arr['gravity'] = 0;
+ $arr['origin'] = 1;
$arr['author-name'] = $arr['owner-name'] = $self[0]['name'];
$arr['author-link'] = $arr['owner-link'] = $self[0]['url'];
$arr['author-avatar'] = $arr['owner-avatar'] = $self[0]['thumb'];
diff --git a/mod/profile_photo.php b/mod/profile_photo.php
index 47f0f8d8e..e3dbdaf39 100644
--- a/mod/profile_photo.php
+++ b/mod/profile_photo.php
@@ -86,6 +86,7 @@ function profile_photo_post(&$a) {
intval(local_user())
);
+ info( t('Shift-reload the page or clear browser cache if the new photo does not display immediately.') . EOL);
// Update global directory in background
$url = $a->get_baseurl() . '/profile/' . $a->user['nickname'];
if($url && strlen(get_config('system','directory_submit_url')))
diff --git a/mod/tagger.php b/mod/tagger.php
index 9e458a5b7..76ec3366c 100644
--- a/mod/tagger.php
+++ b/mod/tagger.php
@@ -105,7 +105,7 @@ EOT;
if(! isset($bodyverb))
return;
- $termlink = '&#x2317;[url=' . $a->get_baseurl() . '/search?search=' . urlencode($term) . ']'. $term . '[/url]';
+ $termlink = html_entity_decode('&#x2317;') . '[url=' . $a->get_baseurl() . '/search?search=' . urlencode($term) . ']'. $term . '[/url]';
$arr = array();
diff --git a/view/diaspora_vcard.tpl b/view/diaspora_vcard.tpl
index e71fc33ef..de3981a94 100644
--- a/view/diaspora_vcard.tpl
+++ b/view/diaspora_vcard.tpl
@@ -2,7 +2,7 @@
<dl class='entity_nickname'>
<dt>Nickname</dt>
<dd>
- <a class="nickname url uid" href="$podloc/" rel="me">$diaspora.nickname</a>
+ <a class="nickname url uid" href="$diaspora.podloc/" rel="me">$diaspora.nickname</a>
</dd>
</dl>
<dl class='entity_fn'>
diff --git a/view/profile_vcard.tpl b/view/profile_vcard.tpl
index c78eb9b7f..5bcbfd0b0 100644
--- a/view/profile_vcard.tpl
+++ b/view/profile_vcard.tpl
@@ -21,7 +21,7 @@
{{ if $pdesc }}<div class="title">$profile.pdesc</div>{{ endif }}
- <div id="profile-photo-wrapper"><img class="photo" width="175" height="175" src="$profile.photo" alt="$profile.name" /></div>
+ <div id="profile-photo-wrapper"><img class="photo" width="175" height="175" src="$profile.photo?rev=$profile.picdate" alt="$profile.name" /></div>
diff --git a/view/theme/duepuntozero/profile_vcard.tpl b/view/theme/duepuntozero/profile_vcard.tpl
index b3f5cc50d..154f22363 100644
--- a/view/theme/duepuntozero/profile_vcard.tpl
+++ b/view/theme/duepuntozero/profile_vcard.tpl
@@ -5,7 +5,7 @@
{{ if $pdesc }}<div class="title">$profile.pdesc</div>{{ endif }}
- <div id="profile-photo-wrapper"><img class="photo" width="175" height="175" src="$profile.photo" alt="$profile.name"></div>
+ <div id="profile-photo-wrapper"><img class="photo" width="175" height="175" src="$profile.photo?rev=$profile.picdate" alt="$profile.name"></div>