本文整理匯總了PHP中JComments::maskEmail方法的典型用法代碼示例。如果您正苦於以下問題:PHP JComments::maskEmail方法的具體用法?PHP JComments::maskEmail怎麽用?PHP JComments::maskEmail使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類JComments
的用法示例。
在下文中一共展示了JComments::maskEmail方法的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: prepareComment
function prepareComment(&$comment)
{
if (isset($comment->_skip_prepare) && $comment->_skip_prepare == 1) {
return;
}
$config =& JCommentsFactory::getConfig();
$bbcode =& JCommentsFactory::getBBCode();
$acl =& JCommentsFactory::getACL();
// convert to datetime if variable contains string value
if (is_string($comment->datetime)) {
$comment->datetime = strtotime($comment->datetime);
}
// run autocensor
if ($acl->check('enable_autocensor')) {
$comment->comment = JCommentsText::censor($comment->comment);
}
// replace BBCode tags
$comment->comment = $bbcode->replace($comment->comment);
if ($config->getInt('enable_custom_bbcode')) {
$customBBCode =& JCommentsFactory::getCustomBBCode();
$comment->comment = $customBBCode->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 smile codes with images
if ($config->get('enable_smiles') == '1') {
$smiles =& JCommentsFactory::getSmiles();
$comment->comment = $smiles->replace($comment->comment);
}
// Gravatar support
$comment->gravatar = md5(strtolower($comment->email));
if (empty($comment->avatar)) {
$comment->avatar = '<img src="http://www.gravatar.com/avatar.php?gravatar_id=' . $comment->gravatar . '&default=' . urlencode(JCommentsFactory::getLink('noavatar')) . '" alt="" />';
}
$comment->author = JComments::getCommentAuthorName($comment);
if ($config->getInt('enable_mambots') == 1) {
JCommentsPluginHelper::trigger('onAfterPrepareComment', array(&$comment));
}
}