示例#1
0
文件: comment.php 项目: 4otaku/4otaku
 public function __construct($data = array())
 {
     parent::__construct($data);
     $this->set('comment_rights', sets::user('rights') || $this->get('cookie') == query::$cookie);
     $this->set('text', Transform_Text::cut_long_words($this->get('text')));
     $this->set('delete_rights', sets::user('rights'));
     $this->set('avatar', md5(strtolower($this->get('email'))));
 }
示例#2
0
文件: comment.php 项目: 4otaku/draw
	public function get_short_text () {
		$text = $this->data['text'];
		
		$text = Transform_Text::cut_long_text(strip_tags($text,'<br><em><strong><s>'),100);
		$text = preg_replace('/(<br(\s[^>]*)?>\n*)+/si','<br />',$text);

		return Transform_Text::cut_long_words($text);
	}