public function displayHtmlContent($content)
 {
     $content = parse_popup($content);
     $content = parse_at_users($content);
     hook('parseContent', array('content' => &$content));
     return $content;
 }
Exemple #2
0
function parse_weibo_content($content)
{
    $content = shorten_white_space($content);
    $content = op_t($content, false);
    $content = parse_url_link($content);
    $content = parse_expression($content);
    $content = parse_at_users($content);
    $content = parseWeiboContent($content);
    return $content;
}
 public function getComment($id)
 {
     $comment = S('weibo_comment_' . $id);
     if (!$comment) {
         $comment = $this->find($id);
         $comment['content'] = $this->parseComment($comment['content']);
         S('weibo_comment_' . $id, $comment);
     }
     $comment['content'] = parse_at_users($comment['content'], true);
     $comment['can_delete'] = check_auth('Weibo/Index/doDelComment', $comment['uid']);
     $comment['user'] = query_user(array('uid', 'nickname', 'avatar32', 'avatar64', 'avatar128', 'avatar256', 'avatar512', 'space_url', 'rank_link', 'score', 'title', 'weibocount', 'fans', 'following'), $comment['uid']);
     return $comment;
 }
 public function getWeiboDetail($id)
 {
     $weibo = S('weibo_' . $id);
     $check_empty = empty($weibo);
     if ($check_empty) {
         $weibo = $this->where(array('status' => 1, 'id' => $id))->find();
         if (!$weibo) {
             return null;
         }
         $weibo_data = unserialize($weibo['data']);
         $class_exists = true;
         $type = array('repost', 'feed', 'image', 'share');
         if (!in_array($weibo['type'], $type)) {
             $class_exists = class_exists('Addons\\Insert' . ucfirst($weibo['type']) . '\\Insert' . ucfirst($weibo['type']) . 'Addon');
         }
         $weibo['content'] = parse_topic(parse_weibo_content($weibo['content']));
         if ($weibo['type'] === 'feed' || $weibo['type'] == '' || !$class_exists) {
             $fetchContent = "<p class='word-wrap'>" . $weibo['content'] . "</p>";
         } elseif ($weibo['type'] === 'repost') {
             $fetchContent = A('Weibo/Type')->fetchRepost($weibo);
         } elseif ($weibo['type'] === 'image') {
             $fetchContent = A('Weibo/Type')->fetchImage($weibo);
         } elseif ($weibo['type'] === 'share') {
             $fetchContent = R('Weibo/Share/getFetchHtml', array('param' => unserialize($weibo['data']), 'weibo' => $weibo), 'Widget');
         } else {
             $fetchContent = Hook::exec('Addons\\Insert' . ucfirst($weibo['type']) . '\\Insert' . ucfirst($weibo['type']) . 'Addon', 'fetch' . ucfirst($weibo['type']), $weibo);
         }
         $weibo = array('id' => intval($weibo['id']), 'content' => strval($weibo['content']), 'create_time' => intval($weibo['create_time']), 'type' => $weibo['type'], 'data' => unserialize($weibo['data']), 'weibo_data' => $weibo_data, 'comment_count' => intval($weibo['comment_count']), 'repost_count' => intval($weibo['repost_count']), 'can_delete' => 0, 'is_top' => $weibo['is_top'], 'uid' => $weibo['uid'], 'fetchContent' => $fetchContent, 'from' => $weibo['from']);
         S('weibo_' . $id, $weibo, 60 * 60);
     }
     $weibo['fetchContent'] = parse_at_users($weibo['fetchContent']);
     $weibo['user'] = query_user(array('uid', 'nickname', 'avatar64', 'space_url', 'rank_link', 'title'), $weibo['uid']);
     $weibo['can_delete'] = $this->canDeleteWeibo($weibo);
     // 判断转发的原微博是否已经删除
     if ($weibo['type'] == 'repost') {
         $source_weibo = $this->getWeiboDetail($weibo['weibo_data']['sourceId']);
         if (!$source_weibo['uid']) {
             if (!$check_empty) {
                 S('weibo_' . $id, null);
                 $weibo = $this->getWeiboDetail($id);
             }
         }
     }
     return $weibo;
 }
 public function displayHtmlContent($content)
 {
     $content = parse_popup($content);
     $content = parse_at_users($content);
     return $content;
 }
			<p>
				<a href="<?php 
            echo $vo["userInfo"]["space_url"];
            ?>
" ucard="<?php 
            echo $vo["userInfo"]["uid"];
            ?>
">
					<?php 
            echo $vo["userInfo"]["username"];
            ?>
</a>
			</p>

			<p><?php 
            echo parse_at_users($vo["content"]);
            ?>
</p>

			<p style="color: #ccc;">
				<?php 
            echo time_format($vo["ctime"]);
            ?>
  

				<?php 
            if (CheckPermission(array($vo['uid']))) {
                ?>
<a href="javascript:"
					class="del_lzl_reply pull-right"
					args="lzl_reply_id=<?php 
                        }
                    }
                }
            } else {
                echo "";
            }
            ?>
										</p>
									</div>
									<div class="col-xs-10">
										<div
											style="min-height: 10em; overflow: hidden; word-break: break-all"
											class="post_content">
											<div style="padding: 15px"></div>
											<?php 
            echo parse_at_users(parse_popup($reply["content"]));
            ?>
 <br />
										</div>
										<p class="pull-right text-muted">
											<?php 
            echo getLou($limit * ($page - 1) + $k + 1);
            ?>
 发表于
											<?php 
            echo time_format($reply["create_time"]);
            ?>
											<?php 
            if (CheckPermission(array($reply['uid']))) {
                ?>
<a