content; $content = _parseReply($content); /* 已测试 √ */ if (strpos($content, '{x}') !== false || strpos($content, '{ }') !== false) { $content = strtr($content, array( "{x}" => '', "{ }" => '' )); } /* 过滤网易云音乐 - √ */ if (strpos($content, '{music') !== false) { $content = preg_replace('/{music-list([^\/})]*)\/}/SU', '', $content); $content = preg_replace('/{music([^\/})]*)\/}/SU', '', $content); } /* 过滤默认卡片 */ if (strpos($content, '{card-default') !== false) { $content = preg_replace('/{card-default(.*)}/SU', '', $content); $content = preg_replace('/{\/card-default}/SU', '', $content); } /* 过滤回复可见 */ if (strpos($content, '{hide') !== false) { $db = Typecho_Db::get(); $hasComment = $db->fetchAll($db->select()->from('table.comments')->where('cid = ?', $post->cid)->where('mail = ?', $post->remember('mail', true))->limit(1)); if ($hasComment || $login) { $content = strtr($content, array("{hide}" => "", "{/hide}" => "")); } else { $content = strtr($content, array("{hide}" => "", "{/hide}" => "")); } } /* 过滤dplayer播放器 */ if (strpos($content, '{dplayer') !== false) { $player = Helper::options()->JCustomPlayer ? Helper::options()->JCustomPlayer : '/usr/themes/Joe/library/player.php?url='; $content = preg_replace('/{dplayer(.*)\/}/SU', '', $content); } /* 过滤bilibili播放器 */ if (strpos($content, '{bilibili') !== false) { $content = preg_replace('/{bilibili(.*)\/}/SU', '', $content); } /* 过滤复制粘贴功能 */ if (strpos($content, '{copy') !== false) { $content = preg_replace('/{copy(.*)}/SU', '', $content); $content = preg_replace('/{\/copy}/SU', '', $content); } /* 过滤居中标题 */ if (strpos($content, '{mtitle') !== false) { $content = strtr($content, array("{mtitle}" => '', "{/mtitle}" => '')); } /* 过滤消息提示 */ if (strpos($content, '{message') !== false) { $content = preg_replace('/{message(.*)}/SU', '', $content); $content = preg_replace('/{\/message}/SU', '', $content); } /* 标签按钮 */ if (strpos($content, '{anote') !== false) { $content = preg_replace('/{anote(.*)}/SU', '', $content); $content = preg_replace('/{\/anote}/SU', '', $content); } /* 多彩按钮 */ if (strpos($content, '{abtn') !== false) { $content = preg_replace('/{abtn(.*)}/SU', '', $content); $content = preg_replace('/{\/abtn}/SU', '', $content); } /* 多彩按钮 */ if (strpos($content, '{timeline') !== false) { $content = strtr($content, array("{timeline}" => '', "{/timeline}" => '')); $content = strtr($content, array("{timeline-item}" => '', "{/timeline-item}" => '')); } echo $content; }