public function getShortDescription() { $Str = new StringHelper(); return $Str->substr($this->description, 0, 65); }
public function getShortName() { $str = new StringHelper(); return $str->substr($this->name, 0, 50); }
public function getTinyNotes() { $str = new StringHelper(); return $str->substr($this->notes, 0, 15); }
<?php /* @var $this SiteController */ $this->pageTitle = $model->title; $sh = new StringHelper(); FbUtils::AddMetaTags('DE-PTI - ' . $model->title, Yii::app()->params["domain"] . 'de-pti', $sh->substr($model->contents, 0, 60)); $FacebookUrl = Yii::app()->params['domain'] . Yii::App()->createUrl("site/showNews", array("id" => $data->news_id)); ?> <div class="container"> <div class="row"> <div class="col-xs-12 text-align-justify"> <p><?php print nl2br($model->contents); ?> </p> </div> </div> <div class="row"> <div class="col-xs-12"> <h3>Várjuk a véleményedet!</h3> <div class="text-align-center"> <div class="fb-comments" data-width="690" data-href="<?php print $FacebookUrl; ?> " data-numposts="5" data-colorscheme="light"></div> </div> </div> </div> </div>
<h4 class="timeline-title"> <?php print CHtml::link($data->title, array('site/showNews', 'id' => $data->news_id)); ?> </h4> <p> <small class="text-muted"> <i class="fa fa-clock-o"></i> <?php $str = new StringHelper(); print date('Y. m. d. H:i', strtotime($data->date_created)); if ($data->date_created != $data->date_updated) { print " (módosítva: " . date('Y. m. d. H:i', strtotime($data->date_updated)) . ")"; } if ($data->subject_id != null) { $SubjName = $str->substr($data->subject->name, 0, 50); print ' - ' . CHtml::link($SubjName, array('subject/details', 'id' => $data->subject->subject_id)); } print ' - <b>' . $data->user->username . '</b>'; ?> </small> </p> <?php if (Yii::app()->user->getId() && Yii::app()->user->level >= 1) { print '<p><div class="btn-group">'; print CHtml::link('<i class="fa fa-edit"></i> Módosítás', Yii::app()->createUrl("site/editnews", array('id' => $data->news_id)), array('class' => 'btn btn-sm btn-primary')); print sprintf('<a onclick="DeleteNews(\'%s\')" class="btn btn-sm btn-danger"> <i class="fa fa-trash-o"></i> Törlés </a>', Yii::app()->createUrl("site/deletenews", array('id' => $data->news_id))); print '</div></p>';