本文整理汇总了PHP中JCommentsFactory::getSmilies方法的典型用法代码示例。如果您正苦于以下问题:PHP JCommentsFactory::getSmilies方法的具体用法?PHP JCommentsFactory::getSmilies怎么用?PHP JCommentsFactory::getSmilies使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JCommentsFactory
的用法示例。
在下文中一共展示了JCommentsFactory::getSmilies方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepareComment
public static function prepareComment(&$comment)
{
if (isset($comment->_skip_prepare) && $comment->_skip_prepare == 1) {
return;
}
JCommentsEventHelper::trigger('onJCommentsCommentBeforePrepare', array(&$comment));
$config = JCommentsFactory::getConfig();
$acl = JCommentsFactory::getACL();
// run autocensor
if ($acl->check('enable_autocensor')) {
$comment->comment = JCommentsText::censor($comment->comment);
if ($comment->title != '') {
$comment->title = JCommentsText::censor($comment->title);
}
}
// replace deleted comment text with predefined message
if ($comment->deleted == 1) {
$comment->comment = JText::_('COMMENT_TEXT_COMMENT_HAS_BEEN_DELETED');
$comment->username = '';
$comment->name = '';
$comment->email = '';
$comment->homepage = '';
$comment->userid = 0;
$comment->isgood = 0;
$comment->ispoor = 0;
}
// replace BBCode tags
$comment->comment = JCommentsFactory::getBBCode()->replace($comment->comment);
if ($config->getInt('enable_custom_bbcode')) {
$comment->comment = JCommentsFactory::getCustomBBCode()->replace($comment->comment);
}
// fix long words problem
$word_maxlength = $config->getInt('word_maxlength');
if ($word_maxlength > 0) {
$comment->comment = JCommentsText::fixLongWords($comment->comment, $word_maxlength);
if ($comment->title != '') {
$comment->title = JCommentsText::fixLongWords($comment->title, $word_maxlength);
}
}
if ($acl->check('emailprotection')) {
$comment->comment = JComments::maskEmail($comment->id, $comment->comment);
}
// autolink urls
if ($acl->check('autolinkurls')) {
$comment->comment = preg_replace_callback(_JC_REGEXP_LINK, array('JComments', 'urlProcessor'), $comment->comment);
if ($acl->check('emailprotection') != 1) {
$comment->comment = preg_replace(_JC_REGEXP_EMAIL, '<a href="mailto:\\1@\\2">\\1@\\2</a>', $comment->comment);
}
}
// replace smilies' codes with images
if ($config->get('enable_smilies') == '1') {
$comment->comment = JCommentsFactory::getSmilies()->replace($comment->comment);
}
$comment->author = JComments::getCommentAuthorName($comment);
// Gravatar support
$comment->gravatar = md5(strtolower($comment->email));
if (empty($comment->avatar)) {
$comment->avatar = '<img src="http://www.gravatar.com/avatar/' . $comment->gravatar . '?d=' . urlencode(JCommentsFactory::getLink('noavatar')) . '" alt="' . htmlspecialchars($comment->author) . '" />';
}
JCommentsEventHelper::trigger('onJCommentsCommentAfterPrepare', array(&$comment));
}
示例2: getSmiles
/**
* Returns a reference to the global {@link JCommentsSmiles} object, only creating it if it does not already exist.
*
* @deprecated 3.0 Use JCommentsFactory::getSmilies instead
* @return JCommentsSmilies
*/
public static function getSmiles()
{
return JCommentsFactory::getSmilies();
}