From: Evan Prodromou Date: Mon, 26 Apr 2010 06:37:41 +0000 (-0400) Subject: static method for getting best URL shortening service X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4d29ca0b91201f6df42940297ed5b64b070efe49;p=quix0rs-gnu-social.git static method for getting best URL shortening service --- diff --git a/classes/User_urlshortener_prefs.php b/classes/User_urlshortener_prefs.php index 3eb008a672..e0f85af012 100755 --- a/classes/User_urlshortener_prefs.php +++ b/classes/User_urlshortener_prefs.php @@ -75,6 +75,23 @@ class User_urlshortener_prefs extends Memcached_DataObject } } + static function urlShorteningService($user) + { + $def = common_config('url', 'shortener'); + + $prefs = self::getPrefs($user); + + if (empty($prefs)) { + if (!empty($user)) { + return $user->urlshorteningservice; + } else { + return $def; + } + } else { + return $prefs->urlshorteningservice; + } + } + static function getPrefs($user) { if (empty($user)) {