find($data);
}
if (!$data) {
Dever::alert('错误的专题信息');
}
//$data = $this->getContent($data, $uid);
return $data;
}
public function getContent($data, $uid = false)
{
//embed
$data['content_array'] = array();
$data['content'] = Dever::filter($data['content']);
$content = $data['content'];
$replace = array();
if (strstr($data['content'], 'jpg')) {
# gif
preg_match_all('//', $content, $matches);
if (isset($matches[2])) {
foreach ($matches[2] as $k => $v) {
$content = str_replace($matches[0][$k], '{replace}'.count($replace).'{replace}', $content);
$pic = $v;
$replace[] = array('type' => 2, 'pic' => $pic . '.jpg');
}
}
}
elseif (strstr($data['content'], 'gif')) {
# gif
preg_match_all('/
/', $content, $matches);
if (isset($matches[2])) {
foreach ($matches[2] as $k => $v) {
$content = str_replace($matches[0][$k], '{replace}'.count($replace).'{replace}', $content);
$pic = $v;
$replace[] = array('type' => 2, 'pic' => $pic . '.gif');
}
}
}
elseif (strstr($data['content'], 'png')) {
# gif
preg_match_all('/
/', $content, $matches);
if (isset($matches[2])) {
foreach ($matches[2] as $k => $v) {
$content = str_replace($matches[0][$k], '{replace}'.count($replace).'{replace}', $content);
$pic = $v;
$replace[] = array('type' => 2, 'pic' => $pic . '.png');
}
}
}
//$data['content'] = preg_replace('/