2.在/e/class/userfun.php中添加接受emoji表情,解析emoji表情的函数,代码如下:
//接受emoji表情
function addEmoji($content){
$return= preg_replace_callback('/[\xf0-\xf7].{3}/', function ($r){return '@E' . base64_encode($r[0]);}, $content);
return $return;
}
//解析emoji表情
function getEmoji($content){
$return=preg_replace_callback('/@E(.{6}==)/',function ($r){return base64_decode($r[1]);},$content);
return $return;
}
3.在/e/class/functions.php中,找到返回自定义字段函数ReturnAddF 大概6179行 添加如下代码:
if($f=='newstime')//时间
{
$value=empty($value)?time():to_time($value);
}
elseif($f=='title'){
$value=addEmoji($value);
}
4.在内容模板中解析标题中的emoji表情,代码如下:
<?=getEmoji($navinfor['title'])?>
|