forked from GNUsocial/gnu-social
Section notices should not take up too much space.
No configuration options for the max amount of characters yet.
This commit is contained in:
parent
1349eb349a
commit
a987db2c55
@ -50,6 +50,8 @@ define('NOTICES_PER_SECTION', 6);
|
|||||||
|
|
||||||
class NoticeSection extends Section
|
class NoticeSection extends Section
|
||||||
{
|
{
|
||||||
|
protected $maxchars = 140;
|
||||||
|
|
||||||
function showContent()
|
function showContent()
|
||||||
{
|
{
|
||||||
$notices = $this->getNotices();
|
$notices = $this->getNotices();
|
||||||
@ -98,7 +100,9 @@ class NoticeSection extends Section
|
|||||||
$this->out->elementEnd('span');
|
$this->out->elementEnd('span');
|
||||||
|
|
||||||
$this->out->elementStart('p', 'entry-content');
|
$this->out->elementStart('p', 'entry-content');
|
||||||
$this->out->raw($notice->rendered);
|
$this->out->text(mb_strlen($notice->content) > $this->maxchars
|
||||||
|
? mb_substr($notice->content, 0, $this->maxchars) . '…'
|
||||||
|
: $notice->content);
|
||||||
$this->out->elementEnd('p');
|
$this->out->elementEnd('p');
|
||||||
|
|
||||||
$this->out->elementStart('div', 'entry_content');
|
$this->out->elementStart('div', 'entry_content');
|
||||||
|
Loading…
Reference in New Issue
Block a user