本文整理汇总了PHP中post::parse_text方法的典型用法代码示例。如果您正苦于以下问题:PHP post::parse_text方法的具体用法?PHP post::parse_text怎么用?PHP post::parse_text使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类post
的用法示例。
在下文中一共展示了post::parse_text方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: htmlspecialchars
if ($p->post_type == 'private') {
$title .= ' » ' . $p->post_to_user->username;
}
}
$title .= ': ' . $p->post_message;
$title = preg_replace('/\\s+/s', ' ', $title);
$content = '<div style="line-height:1.3; padding:5px;">';
if ($p->post_user->id == 0 && $p->post_group) {
$content .= '<img src="' . $C->IMG_URL . '/avatars/thumbs2/' . $p->post_group->avatar . '" width="16" height="16" alt="" border="0" /> <strong>' . $p->post_group->title . '</strong>';
} else {
$content .= '<img src="' . $C->IMG_URL . '/avatars/thumbs2/' . $p->post_user->avatar . '" width="16" height="16" alt="" border="0" /> <strong>' . $p->post_user->username . '</strong>';
}
if ($p->post_type == 'private') {
$content .= '<img src="' . $C->IMG_URL . '/avatars/thumbs2/' . $p->post_to_user->avatar . '" width="16" height="16" alt="" border="0" /> <strong>' . $p->post_to_user->username . '</strong>';
}
$content .= ':<br />' . $p->parse_text() . '<br />';
if (isset($p->post_attached['link'])) {
$content .= '<a href="' . htmlspecialchars($p->post_attached['link']->link) . '" target="_blank">' . htmlspecialchars($p->post_attached['link']->link) . '</a><br />';
}
if (isset($p->post_attached['file'])) {
$content .= '<a href="' . $C->SITE_URL . 'getfile/pid:' . $p->post_tmp_id . '/' . htmlspecialchars($p->post_attached['file']->title) . '" target="_blank">' . htmlspecialchars($p->post_attached['file']->title) . '</a><br />';
}
if (isset($p->post_attached['image'])) {
$content .= '<a href="' . $C->IMG_URL . 'attachments/' . $this->network->id . '/' . $p->post_attached['image']->file_preview . '" target="_blank"><img src="' . $C->IMG_URL . 'attachments/' . $this->network->id . '/' . $p->post_attached['image']->file_thumbnail . '" width="60" height="60" alt="' . htmlspecialchars($p->post_attached['image']->title) . '" border="0" /></a><br />';
}
if (isset($p->post_attached['videoembed'])) {
$content .= '<a href="' . $p->post_attached['videoembed']->orig_url . '" target="_blank"><img src="' . $C->IMG_URL . 'attachments/' . $this->network->id . '/' . $p->post_attached['videoembed']->file_thumbnail . '" width="60" height="60" alt="' . htmlspecialchars($p->post_attached['videoembed']->orig_url) . '" border="0" /></a><br />';
}
$content .= '</div>';
$content = preg_replace('/\\s+/s', ' ', $content);
echo "\t<entry>\n";