From fa6b49ab38ab8588c1505f6f0ac7c96d49295e68 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 20 Aug 2009 17:09:04 -0400 Subject: data classes allow >140 bios in profiles --- classes/Profile.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'classes/Profile.php') diff --git a/classes/Profile.php b/classes/Profile.php index f926b2cef..a34f4cf4b 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -35,14 +35,13 @@ class Profile extends Memcached_DataObject public $fullname; // varchar(255) multiple_key public $profileurl; // varchar(255) public $homepage; // varchar(255) multiple_key - public $bio; // varchar(140) multiple_key + public $bio; // text() multiple_key public $location; // varchar(255) multiple_key public $created; // datetime() not_null public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP /* Static get */ - function staticGet($k,$v=null) - { return Memcached_DataObject::staticGet('Profile',$k,$v); } + function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Profile',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE -- cgit v1.2.3-54-g00ecf From d2d3418b8ae6986c14e8eda25779d621443e9e0a Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 21 Aug 2009 07:40:46 -0400 Subject: Profile class has methods to check bio length --- classes/Profile.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'classes/Profile.php') diff --git a/classes/Profile.php b/classes/Profile.php index a34f4cf4b..ff233666a 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -460,4 +460,20 @@ class Profile extends Memcached_DataObject $c->delete(common_cache_key('profile:notice_count:'.$this->id)); } } + + static function maxBio() + { + $biolimit = common_config('message', 'biolimit'); + // null => use global limit (distinct from 0!) + if (is_null($biolimit)) { + $biolimit = common_config('site', 'textlimit'); + } + return $biolimit; + } + + static function bioTooLong($bio) + { + $biolimit = self::maxBio(); + return ($biolimit > 0 && !empty($bio) && (mb_strlen($bio) > $biolimit)); + } } -- cgit v1.2.3-54-g00ecf From 4d3e2daf536c32d46fffb4defac7cbe89bdf3a1c Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 21 Aug 2009 07:48:14 -0400 Subject: check correct setting in Profile bio length --- classes/Profile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'classes/Profile.php') diff --git a/classes/Profile.php b/classes/Profile.php index ff233666a..8f92b386e 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -463,7 +463,7 @@ class Profile extends Memcached_DataObject static function maxBio() { - $biolimit = common_config('message', 'biolimit'); + $biolimit = common_config('profile', 'biolimit'); // null => use global limit (distinct from 0!) if (is_null($biolimit)) { $biolimit = common_config('site', 'textlimit'); -- cgit v1.2.3-54-g00ecf