diff --git a/boot.php b/boot.php
index e1687030d..f357487b9 100644
--- a/boot.php
+++ b/boot.php
@@ -11,7 +11,7 @@ require_once('include/cache.php');
define ( 'FRIENDICA_PLATFORM', 'Friendica');
define ( 'FRIENDICA_VERSION', '2.3.1329' );
define ( 'DFRN_PROTOCOL_VERSION', '2.23' );
-define ( 'DB_UPDATE_VERSION', 1142 );
+define ( 'DB_UPDATE_VERSION', 1143 );
define ( 'EOL', "
\r\n" );
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
@@ -1520,9 +1520,12 @@ function get_my_url() {
}
function zrl_init(&$a) {
- proc_run('php','include/gprobe.php',bin2hex(get_my_url()));
- $arr = array('zrl' => get_my_url(), 'url' => $a->cmd);
- call_hooks('zrl_init',$arr);
+ $tmp_str = get_my_url();
+ if(validate_url($tmp_str)) {
+ proc_run('php','include/gprobe.php',bin2hex($tmp_str));
+ $arr = array('zrl' => $tmp_str, 'url' => $a->cmd);
+ call_hooks('zrl_init',$arr);
+ }
}
function zrl($s,$force = false) {
diff --git a/database.sql b/database.sql
index dc586bc2b..cf086796a 100644
--- a/database.sql
+++ b/database.sql
@@ -1027,6 +1027,7 @@ CREATE TABLE IF NOT EXISTS `user` (
`account_expired` tinyint(1) NOT NULL DEFAULT '0',
`account_expires_on` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`expire_notification_sent` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `service_class` char(32) NOT NULL,
`allow_cid` mediumtext NOT NULL,
`allow_gid` mediumtext NOT NULL,
`deny_cid` mediumtext NOT NULL,
@@ -1042,7 +1043,8 @@ CREATE TABLE IF NOT EXISTS `user` (
KEY `verified` (`verified`),
KEY `unkmail` (`unkmail`),
KEY `cntunkmail` (`cntunkmail`),
- KEY `account_removed` (`account_removed`)
+ KEY `account_removed` (`account_removed`),
+ KEY `service_class` (`service_class`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
diff --git a/include/contact_widgets.php b/include/contact_widgets.php
index cfe27c5c9..bf3a86958 100644
--- a/include/contact_widgets.php
+++ b/include/contact_widgets.php
@@ -146,11 +146,19 @@ function common_friends_visitor_widget($profile_uid) {
$cid = local_user();
else {
if(get_my_url()) {
- $r = q("select id from gcontact where nurl = '%s' limit 1",
- dbesc(normalise_link(get_my_url()))
+ $r = q("select id from contact where nurl = '%s' and uid = %d limit 1",
+ dbesc(normalise_link(get_my_url())),
+ intval($profile_uid)
);
if(count($r))
- $zcid = $r[0]['id'];
+ $cid = $r[0]['id'];
+ else {
+ $r = q("select id from gcontact where nurl = '%s' limit 1",
+ dbesc(normalise_link(get_my_url()))
+ );
+ if(count($r))
+ $zcid = $r[0]['id'];
+ }
}
}
@@ -162,14 +170,14 @@ function common_friends_visitor_widget($profile_uid) {
if($cid)
$t = count_common_friends($profile_uid,$cid);
else
- $t = count_common_friends($profile_uid,$cid);
+ $t = count_common_friends_zcid($profile_uid,$zcid);
if(! $t)
return;
if($cid)
- $r = common_friends($profile_uid,$cid,5);
+ $r = common_friends($profile_uid,$cid,5,true);
else
- $r = common_friends_zcid($profile_uid,$zcid);
+ $r = common_friends_zcid($profile_uid,$zcid,5,true);
return replace_macros(get_markup_template('remote_friends_common.tpl'), array(
'$desc' => sprintf( tt("%d friend in common", "%d friends in common", $t), $t),
diff --git a/include/socgraph.php b/include/socgraph.php
index a08d58074..35d754cad 100644
--- a/include/socgraph.php
+++ b/include/socgraph.php
@@ -182,13 +182,18 @@ function count_common_friends($uid,$cid) {
}
-function common_friends($uid,$cid,$limit=9999) {
+function common_friends($uid,$cid,$limit=9999,$shuffle = false) {
+
+ if($shuffle)
+ $sql_extra = " order by rand() ";
+ else
+ $sql_extra = " order by `gcontact`.`name` asc ";
$r = q("SELECT `gcontact`.*
FROM `glink` left join `gcontact` on `glink`.`gcid` = `gcontact`.`id`
where `glink`.`cid` = %d and `glink`.`uid` = %d
and `gcontact`.`nurl` in (select nurl from contact where uid = %d and self = 0 and id != %d )
- order by `gcontact`.`name` asc limit 0, %d",
+ sql_extra limit 0, %d",
intval($cid),
intval($uid),
intval($uid),
@@ -217,13 +222,18 @@ function count_common_friends_zcid($uid,$zcid) {
}
-function common_friends_zcid($uid,$zcid,$limit = 6) {
+function common_friends_zcid($uid,$zcid,$limit = 9999,$shuffle) {
+
+ if($shuffle)
+ $sql_extra = " order by rand() ";
+ else
+ $sql_extra = " order by `gcontact`.`name` asc ";
$r = q("SELECT `gcontact`.*
FROM `glink` left join `gcontact` on `glink`.`gcid` = `gcontact`.`id`
where `glink`.`zcid` = %d
and `gcontact`.`nurl` in (select nurl from contact where uid = %d and self = 0 )
- order by `gcontact`.`name` asc limit 0, %d",
+ $sql_extra limit 0, %d",
intval($zcid),
intval($uid),
intval($limit)
diff --git a/mod/profiles.php b/mod/profiles.php
index 3a52c8fa5..4de9057dc 100644
--- a/mod/profiles.php
+++ b/mod/profiles.php
@@ -328,7 +328,7 @@ function profile_activity($changed, $value) {
$prof = '[url=' . $self[0]['url'] . '?tab=profile' . ']' . t('public profile') . '[/url]';
if($t == 1 && strlen($value)) {
- $message = sprintf( t('%1$s changed %2$s to %3$s'), $A, $changes, $value);
+ $message = sprintf( t('%1$s changed %2$s to "%3$s"'), $A, $changes, $value);
$message .= "\n\n" . sprintf( t(' - Visit %1$s\'s %2$s'), $A, $prof);
}
else
diff --git a/update.php b/update.php
index cce942f27..e363aa942 100644
--- a/update.php
+++ b/update.php
@@ -1,6 +1,6 @@
+
diff --git a/view/theme/diabook/comment_item.tpl b/view/theme/diabook/comment_item.tpl
index e10b86845..fc3594fdc 100644
--- a/view/theme/diabook/comment_item.tpl
+++ b/view/theme/diabook/comment_item.tpl
@@ -13,13 +13,13 @@