#569 content 위젯에서 닉네임 길이 제한 설정 추가

This commit is contained in:
akasima 2014-03-27 16:50:54 +09:00
parent be4fa48d65
commit 483ca47d13
6 changed files with 18 additions and 8 deletions

View file

@ -34,6 +34,8 @@ class content extends WidgetHandler
if(!$args->subject_cut_size) $args->subject_cut_size = 0;
// Cut the length of contents
if(!$args->content_cut_size) $args->content_cut_size = 100;
// Cut the length of nickname
if(!$args->nickname_cut_size) $args->nickname_cut_size = 0;
// Display time of the latest post
if(!$args->duration_new) $args->duration_new = 12;
// How to create thumbnails
@ -715,6 +717,7 @@ class content extends WidgetHandler
$widget_info->page_count = $args->page_count;
$widget_info->subject_cut_size = $args->subject_cut_size;
$widget_info->content_cut_size = $args->content_cut_size;
$widget_info->nickname_cut_size = $args->nickname_cut_size;
$widget_info->new_window = $args->new_window;
$widget_info->duration_new = $args->duration_new * 60*60;
@ -887,9 +890,12 @@ class contentItem extends Object
{
return $this->get('category');
}
function getNickName()
function getNickName($cut_size = 0, $tail='...')
{
return $this->get('nick_name');
if($cut_size) $nick_name = cut_str($this->get('nick_name'), $cut_size, $tail);
else $nick_name = $this->get('nick_name');
return $nick_name;
}
function getAuthorSite()
{