From 47c869edbd1dd9ca5ca2f711c2b77fddd395fd3c Mon Sep 17 00:00:00 2001 From: Ori Avtalion Date: Fri, 9 Jan 2009 23:33:54 +0200 Subject: Removed periods from strings ending with "!." --- lib/subs.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/subs.php') diff --git a/lib/subs.php b/lib/subs.php index 91fc8445d..a2699f7b9 100644 --- a/lib/subs.php +++ b/lib/subs.php @@ -44,7 +44,7 @@ function subs_subscribe_user($user, $other_nickname) { function subs_subscribe_to($user, $other) { if ($user->isSubscribed($other)) { - return _('Already subscribed!.'); + return _('Already subscribed!'); } if ($other->hasBlocked($user)) { @@ -114,7 +114,7 @@ function subs_unsubscribe_user($user, $other_nickname) { function subs_unsubscribe_to($user, $other) { if (!$user->isSubscribed($other)) - return _('Not subscribed!.'); + return _('Not subscribed!'); $sub = DB_DataObject::factory('subscription'); -- cgit v1.2.3-54-g00ecf From 235d458395248a04bc9e0ce94cef1c92beff9471 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 14 Jan 2009 13:37:21 -0500 Subject: Update code for subs to use common caching tools --- lib/subs.php | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) (limited to 'lib/subs.php') diff --git a/lib/subs.php b/lib/subs.php index a2699f7b9..483b2f78e 100644 --- a/lib/subs.php +++ b/lib/subs.php @@ -58,22 +58,20 @@ function subs_subscribe_to($user, $other) { subs_notify($other, $user); - if (common_config('memcached', 'enabled')) { - $cache = new Memcache(); - if ($cache->connect(common_config('memcached', 'server'), common_config('memcached', 'port'))) { - $cache->delete(common_cache_key('user:notices_with_friends:' . $user->id)); - } + $cache = common_memcache(); + + if ($cache) { + $cache->delete(common_cache_key('user:notices_with_friends:' . $user->id)); } if ($other->autosubscribe && !$other->isSubscribed($user) && !$user->hasBlocked($other)) { if (!$other->subscribeTo($user)) { return _('Could not subscribe other to you.'); } - if (common_config('memcached', 'enabled')) { - $cache = new Memcache(); - if ($cache->connect(common_config('memcached', 'server'), common_config('memcached', 'port'))) { - $cache->delete(common_cache_key('user:notices_with_friends:' . $other->id)); - } + $cache = common_memcache(); + + if ($cache) { + $cache->delete(common_cache_key('user:notices_with_friends:' . $other->id)); } subs_notify($user, $other); @@ -128,11 +126,10 @@ function subs_unsubscribe_to($user, $other) { if (!$sub->delete()) return _('Couldn\'t delete subscription.'); - if (common_config('memcached', 'enabled')) { - $cache = new Memcache(); - if ($cache->connect(common_config('memcached', 'server'), common_config('memcached', 'port'))) { - $cache->delete(common_cache_key('user:notices_with_friends:' . $user->id)); - } + $cache = common_memcache(); + + if ($cache) { + $cache->delete(common_cache_key('user:notices_with_friends:' . $user->id)); } return true; -- cgit v1.2.3-54-g00ecf