From 7fbfbdae0700e68a465f70963521b9043fe5de30 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 20 Dec 2011 17:01:41 -0800 Subject: [PATCH 1/4] audio/video bb tags showing up on Diaspora --- boot.php | 2 +- include/bb2diaspora.php | 4 ++-- js/acl.js | 5 ++++- mod/acl.php | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/boot.php b/boot.php index 61f14d9bc0..742b6c6790 100644 --- a/boot.php +++ b/boot.php @@ -9,7 +9,7 @@ require_once('include/nav.php'); require_once('include/cache.php'); define ( 'FRIENDICA_PLATFORM', 'Friendica'); -define ( 'FRIENDICA_VERSION', '2.3.1200' ); +define ( 'FRIENDICA_VERSION', '2.3.1201' ); define ( 'DFRN_PROTOCOL_VERSION', '2.22' ); define ( 'DB_UPDATE_VERSION', 1112 ); diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index eb709e01dc..0e001df350 100644 --- a/include/bb2diaspora.php +++ b/include/bb2diaspora.php @@ -173,9 +173,9 @@ function bb2diaspora($Text,$preserve_nl = false) { // html5 video and audio -// $Text = preg_replace("/\[video\](.*?)\[\/video\]/", '', $Text); + $Text = preg_replace("/\[video\](.*?)\[\/video\]/", '$1', $Text); -// $Text = preg_replace("/\[audio\](.*?)\[\/audio\]/", '', $Text); + $Text = preg_replace("/\[audio\](.*?)\[\/audio\]/", '$1', $Text); // $Text = preg_replace("/\[iframe\](.*?)\[\/iframe\]/", '', $Text); diff --git a/js/acl.js b/js/acl.js index b270adb6e3..12045fe521 100644 --- a/js/acl.js +++ b/js/acl.js @@ -193,7 +193,8 @@ ACL.prototype.update_view = function(){ bthide.addClass("selected"); uclass="grouphide"; } - + + $(that.group_uids[id]).each(function(i,v){ $("#c"+v).removeClass("groupshow grouphide").addClass(uclass); }); @@ -208,6 +209,8 @@ ACL.prototype.update_view = function(){ btshow.removeClass("selected"); bthide.addClass("selected"); } + default: + break; } }); diff --git a/mod/acl.php b/mod/acl.php index 735c2c0b00..0fea6f7fc2 100644 --- a/mod/acl.php +++ b/mod/acl.php @@ -60,8 +60,8 @@ function acl_init(&$a){ intval($count) ); - foreach($r as $g){ +// logger('acl: group: ' . $g['name'] . ' members: ' . $g['uids']); $groups[] = array( "type" => "g", "photo" => "images/default-group-mm.png", From 2e088aad8daaceae83f9b824df9e9ae9791cc825 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 20 Dec 2011 19:11:46 -0800 Subject: [PATCH 2/4] bug #246 --- js/acl.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/js/acl.js b/js/acl.js index 12045fe521..bd9f71082e 100644 --- a/js/acl.js +++ b/js/acl.js @@ -171,6 +171,9 @@ ACL.prototype.update_view = function(){ $('.profile-jot-net input').attr('disabled', 'disabled'); $('#profile-jot-desc').html(' '); } + $("#acl-list-content .acl-list-item").each(function(){ + $(this).removeClass("groupshow grouphide"); + }); $("#acl-list-content .acl-list-item").each(function(){ itemid = $(this).attr('id'); @@ -193,10 +196,12 @@ ACL.prototype.update_view = function(){ bthide.addClass("selected"); uclass="grouphide"; } - - - $(that.group_uids[id]).each(function(i,v){ - $("#c"+v).removeClass("groupshow grouphide").addClass(uclass); + + $(that.group_uids[id]).each(function(i,v) { + if(uclass == "grouphide") + $("#c"+v).removeClass("groupshow"); + if(uclass != "") + $("#c"+v).addClass(uclass); }); break; @@ -209,8 +214,6 @@ ACL.prototype.update_view = function(){ btshow.removeClass("selected"); bthide.addClass("selected"); } - default: - break; } }); From d9ede7f7bd1f2a1ab1bacaf4a37a66fd79fd32e4 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 20 Dec 2011 20:12:29 -0800 Subject: [PATCH 3/4] implement max daily registrations --- mod/register.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/mod/register.php b/mod/register.php index 0115ec0d58..89f561642a 100644 --- a/mod/register.php +++ b/mod/register.php @@ -8,6 +8,15 @@ function register_post(&$a) { $verified = 0; $blocked = 1; + + $max_dailies = intval(get_config('system','max_daily_registrations')); + if($max_dailes) { + $r = q("select count(*) as total from user where register_date > UTC_TIMESTAMP - INTERVAL 1 day"); + if($r && $r[0]['total'] >= $max_dailies) { + return; + } + } + switch($a->config['register_policy']) { @@ -462,6 +471,16 @@ function register_content(&$a) { return; } + $max_dailies = intval(get_config('system','max_daily_registrations')); + if($max_dailes) { + $r = q("select count(*) as total from user where register_date > UTC_TIMESTAMP - INTERVAL 1 day"); + if($r && $r[0]['total'] >= $max_dailies) { + logger('max daily registrations exceeded.'); + notice( t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.') . EOL); + return; + } + } + if(x($_SESSION,'theme')) unset($_SESSION['theme']); From 048fcae40b260b04e7b2e1774c1c72b69f790212 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 21 Dec 2011 01:45:15 -0800 Subject: [PATCH 4/4] bug #247 --- mod/network.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mod/network.php b/mod/network.php index 8fa0b03e26..57e120e866 100644 --- a/mod/network.php +++ b/mod/network.php @@ -301,7 +301,8 @@ function network_content(&$a, $update = 0) { } - $sql_extra = " AND `item`.`parent` IN ( SELECT `parent` FROM `item` WHERE `id` = `parent` $star_sql AND ( `contact-id` IN ( $contact_str ) OR `allow_gid` REGEXP '<" . intval($group) . ">' )) "; +// $sql_extra = " AND `item`.`parent` IN ( SELECT `parent` FROM `item` WHERE `id` = `parent` $star_sql AND ( `contact-id` IN ( $contact_str ) OR `allow_gid` REGEXP '<" . intval($group) . ">' )) "; + $sql_extra = " AND `item`.`parent` IN ( SELECT DISTINCT(`parent`) FROM `item` WHERE 1 $star_sql AND ( `contact-id` IN ( $contact_str ) OR `allow_gid` REGEXP '<" . intval($group) . ">' )) "; $o = '

' . t('Group: ') . $r[0]['name'] . '

' . $o; } elseif($cid) {