Prechádzať zdrojové kódy

Merge branch 'master' of http://git.dever.cc/project/cms

qinjie 4 rokov pred
rodič
commit
2013081ff5

+ 29 - 3
app/content/database/news.php

@@ -138,11 +138,11 @@ return array
         'video'     => array
         (
             'type'      => 'varchar-800',
-            'name'      => '上传视频-视频格式mp4,上传大小不能超过4G,如果上传了视频,上述封面图将作为视频封面',
+            'name'      => '上传视频-视频格式mp4,上传大小不能超过4G,上述封面图将作为视频封面',
             'default'   => '',
             'desc'      => '上传推荐视频',
-            'match'     => 'option',
-            'update'    => 'upload',
+            'match'     => $type_value == 3 ? 'is_string' : 'option',
+            'update'    => $type_value == 3 ? 'upload' : 'hidden',
             'key'       => '3',
             'place'     => '150',
             'upload'    => 'yun',
@@ -219,6 +219,32 @@ return array
             'key'       => '1',
         ),
 
+        'content_video'     => array
+        (
+            'type'      => 'varchar-800',
+            'name'      => '上传内容视频-视频格式mp4,上传大小不能超过4G,如果上传了视频',
+            'default'   => '',
+            'desc'      => '上传推荐视频',
+            'match'     => $type_value != 3 ? 'option' : 'option',
+            'update'    => $type_value != 3 ? 'upload' : 'hidden',
+            'key'       => '3',
+            'place'     => '150',
+            'upload'    => 'yun',
+            'large'     => true,
+        ),
+
+        'content_video_pic'       => array
+        (
+            'type'      => 'varchar-150',
+            'name'      => '内容视频封面图-图片尺寸1200*500px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
+            'default'   => '',
+            'desc'      => '封面图',
+            'match'     => $type_value != 3 ? 'option' : 'option',
+            'update'    => $type_value != 3 ? 'image' : 'hidden',
+            'key'       => '1',
+            'place'     => '1200*500',
+        ),
+
         'beizhu'      => array
         (
             'type'      => 'varchar-500',

+ 10 - 0
main/database/config.php

@@ -75,6 +75,16 @@ return array
 			'place'		=> '150',
 		),
 
+		'beian'		=> array
+		(
+			'type' 		=> 'varchar-100',
+			'name' 		=> '备案介绍',
+			'default' 	=> '',
+			'desc' 		=> '备案介绍',
+			'match' 	=> 'is_string',
+			'update'	=> 'textarea',
+		),
+
 		'xnr_pic'       => array
         (
             'type'      => 'varchar-150',

+ 22 - 6
main/src/Content.php

@@ -227,6 +227,17 @@ class Content
         return $data;
     }
 
+    # 获取底层页封面图
+    public function view_pic()
+    {
+        $data = Dever::load('main/content.view_video_1');
+        if ($data) {
+            return false;
+        }
+
+        return true;
+    }
+
     # 获取底层页视频
     public function view_video()
     {
@@ -256,7 +267,7 @@ class Content
     {
         $data = Dever::load('main/content.view');
         $result = array();
-        if ($data['type'] != 3 && $data['video']) {
+        if ($data['type'] != 3 && $data['content_video']) {
             return true;
         }
 
@@ -503,11 +514,16 @@ class Content
 
         $data = Dever::db('content/news')->one($id);
 
-        if ($data && isset($data['video']) && $data['video']) {
-            $info['video'] = $data['video'];
-            if (strstr($data['video'], '.qq.com')) {
-                $video_info = Dever::qqvideo($data['video']);
-                $info['video'] = isset($video_info[0]) ? $video_info[0] : '';
+        $video = '';
+        if ($data && $data['type'] == 3) {
+            $video = $data['video'];
+        } elseif ($data && $data['type'] != 3) {
+            $video = $data['content_video'];
+        }
+        if ($data && $video) {
+            $info['video'] = $video;
+            if (strstr($info['video'], '.qq.com')) {
+                $info['video'] = Dever::qqvideo($info['video']);
             }
 
             return $info;

+ 5 - 3
main/template/xuniren/article.php

@@ -13,19 +13,21 @@ $view
 ->fetch('.common-tit em', 'main/content.view#pdate_string')
 
 ->fetch(array('.article-wrapper img@src', 2), 'main/content.view#pic')
-->fetch(array('.article-wrapper img@style', 2), '<{!Dever::load("main/content.view_video")}>', 'none')
+->fetch(array('.article-wrapper img@style', 2), 'main/content.view_pic', 'none')
 
 ->fetch(array('.article-content .article', 0), 'main/content.view#content')
 
+# 页面上部视频 仅限视频模板
 ->fetch(array('.video-module@style', 0), 'main/content.view_video_1', 'none')
 ->fetch(array('.article-wrapper img@src', 0), 'main/content.view#pic')
 ->fetch(array('.article-wrapper img@src', 1), 'main/content.view#pic')
 ->fetch(array('.icon-play@data-url', 0), 'main/content.view#video_link')
 
 
+# 页面下部视频 仅限除视频之外的模板
 ->fetch(array('.article-video@style', 0), 'main/content.view_video_2', 'none')
-->fetch(array('.article-wrapper img@src', 0), 'main/content.view#pic')
-->fetch(array('.article-wrapper img@src', 1), 'main/content.view#pic')
+->fetch(array('.article-video img@src', 0), 'main/content.view#content_video_pic')
+->fetch(array('.article-video img@src', 1), 'main/content.view#content_video_pic')
 ->fetch(array('.icon-play@data-url', 1), 'main/content.view#video_link')
 
 

+ 3 - 0
main/template/xuniren/inc/head.php

@@ -5,6 +5,9 @@ $view
 ->fetch('meta[name="Keywords"]@content',                    '<{isset($keywords) ? Dever::load("main/content.config#keywords") . "," . $keywords : Dever::load("main/content.config#keywords")}>')
 ->fetch('meta[name="Description"]@content',                    '<{isset($info) ? Dever::load("main/content.config#info") . "," . $info : Dever::load("main/content.config#info")}>')
 ->fetch('.logo img@src',                    'main/content.config#logo')
+->fetch('.blogo img@src',                    'main/content.config#logo')
+->fetch('.copyright img@src',                    'main/content.config#weixin_qrcode')
+->fetch('footer span',                    'main/content.config#beian')
 //->fetch('.logo img@style',                    'width:100px')
 
 # 登录

+ 2 - 2
main/template/xuniren/video.php

@@ -24,7 +24,7 @@ $view
     (
         'a|0' => array
         (
-            'href' => 'javascript:;',
+            'href' => '$v.link',
             'title' => '$v.name',
 
             'img' => array
@@ -60,7 +60,7 @@ $view
     (
         'a|1' => array
         (
-            'href' => 'javascript:;',
+            'href' => '$v.link',
             'title' => '$v.name',
 
             'img' => array