getOne($data); } if (!$data) { Dever::alert('错误的文章信息'); } //embed $data['content_array'] = array(); if (strstr($data['content'], 'font-family:" gb","microsoft="" sans="" hiragino="" yahei","simsun";')) { $data['content'] = str_replace('font-family:" gb","microsoft="" sans="" hiragino="" yahei","simsun";', '', $data['content']); } if (strstr($data['content'], 'font-family:" yahei","simsun";')) { $data['content'] = str_replace('font-family:" yahei","simsun";', '', $data['content']); } if (strstr($data['content'], '"="" gb","microsoft="" sans="" hiragino="')) { $data['content'] = str_replace('"="" gb","microsoft="" sans="" hiragino="', '', $data['content']); } if (strstr($data['content'], 'font-family:" microsoft="" yahei","黑体",sans-serif')) { $data['content'] = str_replace('font-family:" microsoft="" yahei","黑体",sans-serif', '', $data['content']); } if (strstr($data['content'], '"="')) { $data['content'] = str_replace('"="', '', $data['content']); } if (strstr($data['content'], 'embed')) { //print_r($data['content']);die; # 音频 preg_match_all('//i', $data['content'], $matches); if (isset($matches[1])) { foreach ($matches[1] as $k => $v) { } } } if (strstr($data['content'], 'data-id')) { # 视频 preg_match_all('/
(\s[^>]*)(\s[^>]*)<\/p>/is', $data['content'], $matches);
$replace = array();
$content = $data['content'];
if (isset($matches[4][0]) && isset($matches[5][0])) {
foreach ($matches[4] as $k => $v) {
$content = str_replace($matches[0][$k], '{replace}'.$k.'{replace}', $content);
if ($matches[5][$k] == 'video/lib/core.vod') {
$method = 'video/lib/vod';
$type = 2;
} else {
$type = 3;
$method = 'video/lib/live';
}
$info = Dever::load($method)->get($v);
if (isset($info['content'])) {
unset($info['content']);
}
$replace[$k] = array('id' => $v, 'type' => $type, 'content' => $info);
}
}
//$data['content'] = preg_replace('/