|
@@ -31,6 +31,8 @@ class Article
|
|
|
|
|
|
$content = $data['content'];
|
|
|
$replace = array();
|
|
|
+
|
|
|
+
|
|
|
if (strstr($data['content'], 'embed')) {
|
|
|
|
|
|
preg_match_all('/<embed src="(.*?)"(.*?)\/>/i', $data['content'], $matches);
|
|
@@ -47,8 +49,32 @@ class Article
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if (strstr($data['content'], 'data-file')) {
|
|
|
+
|
|
|
+ preg_match_all('/<img src="(.*?)" style="(.*?)" data-file="(.*?)" \/>/', $data['content'], $matches);
|
|
|
+ if (isset($matches[1])) {
|
|
|
+ foreach ($matches[1] as $k => $v) {
|
|
|
+ if (isset($matches[3][$k])) {
|
|
|
+ $content = str_replace($matches[0][$k], '{replace}'.count($replace).'{replace}', $content);
|
|
|
+
|
|
|
+ $file = $matches[3][$k];
|
|
|
+ $temp = explode('||', $file);
|
|
|
+ $file = $temp[0];
|
|
|
+ $name = $temp[1];
|
|
|
+ $cover = $v;
|
|
|
+
|
|
|
+ if (strstr($v, '.mp4') || strstr($v, '.mov') || strstr($v, '.m3u8')) {
|
|
|
+ $replace[] = array('type' => 6, 'content' => $file, 'cover' => $cover, 'name' => $name);
|
|
|
+ } else {
|
|
|
+ $replace[] = array('type' => 5, 'content' => $file, 'cover' => $cover, 'name' => $name);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if (strstr($data['content'], 'data-id')) {
|
|
|
-
|
|
|
+
|
|
|
preg_match_all('/<img(.*?)data-id="(.*?)" data-key="(.*?)" \/>/', $data['content'], $matches);
|
|
|
|
|
|
|