dever 6 rokov pred
rodič
commit
cfd312340c

+ 5 - 5
content/database/article.php

@@ -170,7 +170,7 @@ return array
   		'pic_cover'		=> array
 		(
 			'type' 		=> 'varchar-150',
-			'name' 		=> '4:3封面图-请上传4:3比例的封面图',
+			'name' 		=> '4:3封面图-图片尺寸750*564px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
 			'default' 	=> '',
 			'desc' 		=> '封面图',
 			'match' 	=> 'option',
@@ -186,7 +186,7 @@ return array
 		'pic_cover_169'		=> array
 		(
 			'type' 		=> 'varchar-150',
-			'name' 		=> '16:9封面图-请上传16:9比例的封面图',
+			'name' 		=> '16:9封面图-图片尺寸750*422px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
 			'default' 	=> '',
 			'desc' 		=> '封面图',
 			'match' 	=> 'option',
@@ -364,7 +364,7 @@ return array
 		'share_pic'		=> array
 		(
 			'type' 		=> 'varchar-150',
-			'name' 		=> '分享图片-请上传570X300px或等比大小的图片',
+			'name' 		=> '分享图片-图片尺寸570*570px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
 			'default' 	=> '',
 			'desc' 		=> '分享图片',
 			'match' 	=> 'option',
@@ -372,8 +372,8 @@ return array
 			'key' 		=> '1',
 			'place'		=> '150',
 			'show'		=> 'share_yes=1',
-			'upload'	=> 'qiniu',
-			'large' 	=> true,
+			//'upload'	=> 'qiniu',
+			//'large' 	=> true,
 		),
 
 		'share_content'		=> array

+ 1 - 1
content/lib/Article.php

@@ -38,7 +38,7 @@ class Article
                 foreach ($matches[1] as $k => $v) {
                     $content = str_replace($matches[0][$k], '{replace}'.count($replace).'{replace}', $content);
 
-                    if (strstr($v, '.mp4')) {
+                    if (strstr($v, '.mp4') || strstr($v, '.mov') || strstr($v, '.m3u8')) {
                         $replace[] = array('type' => 6, 'content' => $v);
                     } else {
                         $replace[] = array('type' => 5, 'content' => $v);

+ 1 - 0
doc/apidoc.php

@@ -728,6 +728,7 @@
  * @apiSuccess {String}   content.is_button 全屏图上的保存按钮,1显示2不显示,type=1时有效
  * @apiSuccess {String}   content.button_name 全屏图上的保存按钮的文字,type=1时有效
  * @apiSuccess {String}   content.button_color 全屏图上的保存按钮的文字颜色,type=1时有效
+ * @apiSuccess {String}   content.note 是否预约提醒1为已预约,2为未预约
  * @apiSuccess {Object[]}   content.text 全屏图上的九个文字位置,type=1时有效
  * @apiSuccess {String}   content.text.text 文字位置,1上左2上中3上右4中左5正中6中右7下左8下中9下右
  * @apiSuccess {String}   content.text.name 文字内容 换行用\n隔开

+ 2 - 2
journal/database/content.php

@@ -115,7 +115,7 @@ return array
         'focus'     => array
         (
             'type'      => 'text-255',
-            'name'      => '4:3焦点图-请上传4:3比例的图片',
+            'name'      => '焦点图',
             'default'   => '',
             'desc'      => '焦点图',
             'match'     => 'option',
@@ -185,7 +185,7 @@ return array
         'pic'     => array
         (
             'type'      => 'varchar-150',
-            'name'      => '图片',
+            'name'      => '图片-全屏图图片尺寸750*1386px或等比尺寸,长图图片尺寸750*高度不限 或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
             'default'   => '',
             'desc'      => '图片',
             'match'     => 'option',

+ 6 - 6
journal/database/info.php

@@ -128,7 +128,7 @@ return array
 		'pic_view_cover'		=> array
 		(
 			'type' 		=> 'varchar-150',
-			'name' 		=> '封面图-1:1比例的图片',
+			'name' 		=> '封面图-图片尺寸660*660px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
 			'default' 	=> '',
 			'desc' 		=> '封面图',
 			'match' 	=> 'option',
@@ -140,7 +140,7 @@ return array
 		'pic_view_bg'		=> array
 		(
 			'type' 		=> 'text-255',
-			'name' 		=> '全屏背景图-进入小刊阅读页之前的全屏背景图,可以多张切换,尽量保持在5张之内',
+			'name' 		=> '全屏背景图-图片尺寸750*1386px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
 			'default' 	=> '',
 			'desc' 		=> '全屏背景图',
 			'match' 	=> 'option',
@@ -152,7 +152,7 @@ return array
 		'pic_gd'		=> array
 		(
 			'type' 		=> 'varchar-150',
-			'name' 		=> '小刊推广图-上传图片比例为750X1128px',
+			'name' 		=> '小刊推广图-图片尺寸750*1128px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
 			'default' 	=> '',
 			'desc' 		=> '小刊推广图',
 			'match' 	=> 'option',
@@ -377,7 +377,7 @@ return array
 		'share_pic'		=> array
 		(
 			'type' 		=> 'varchar-150',
-			'name' 		=> '分享图片',
+			'name' 		=> '分享图片-图片尺寸570*570px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
 			'default' 	=> '',
 			'desc' 		=> '分享图片',
 			'match' 	=> 'option',
@@ -385,8 +385,8 @@ return array
 			'key' 		=> '1',
 			'place'		=> '150',
 			'show'		=> 'share_yes=1',
-			'upload'	=> 'qiniu',
-			'large' 	=> true,
+			//'upload'	=> 'qiniu',
+			//'large' 	=> true,
 		),
 
 		'share_content'		=> array

+ 29 - 0
main/lib/Core.php

@@ -25,6 +25,35 @@ class Core
         $this->data['config'] = Dever::db('main/config')->one();
     }
 
+    # 图片处理
+    protected function pic($data, $type = 't1')
+    {
+        //?imageView2/1/w/100/h/100/q/75
+        $config = array
+        (
+            'pic', 'content', 'contact', 'logo', 'top', 'img', 'link', 'background', 'audio_pic'
+        );
+
+        foreach ($config as $k => $v) {
+            if (isset($data[$v]) && $data[$v]) {
+                $data[$v] = $this->replacePic($data[$v], $type);
+            }
+        }
+
+        return $data;
+    }
+
+    protected function replacePic($pic, $type = 't1')
+    {
+        $pic = Dever::pic($pic, $type);
+
+        if (strstr($pic, 'http://')) {
+            $pic = str_replace('http://', 'https://', $pic);
+        }
+
+        return $pic;
+    }
+
     # 列表页里的数据 根据类型,解析内容
     protected function content($data, $content = false)
     {

+ 7 - 0
main/src/Journal.php

@@ -388,6 +388,13 @@ class Journal extends Core
             $info['info'] = Dever::load('video/lib/vod')->get($info['vod_id']);
         } elseif ($info['type'] == 13) {
             $info['info'] = Dever::load('video/lib/live')->get($info['live_id']);
+
+            if ($this->data['uid'] > 0) {
+                $info['note'] = Dever::load('act/lib/note')->get($this->data['uid'], $info['id'], 3);
+                
+            } else {
+                $info['note'] = 2;
+            }
         }
 
         if (isset($info['info']['author_id']) && $info['info']['author_id']) {

+ 1 - 1
push/database/data.php

@@ -207,7 +207,7 @@ return array
         'pic'       => array
         (
             'type'      => 'varchar-200',
-            'name'      => '图片或图标-手动干扰项,请上传,' . $info['col_pic'] . '大小的图片',
+            'name'      => '图片或图标-手动干扰项,请上传' . $info['col_pic'] . '大小的图片',
             'default'   => '',
             'desc'      => '请选择图片',
             'match'     => $pic_state ? 'option' : 'option',

+ 5 - 3
video/database/live.php

@@ -145,7 +145,7 @@ return array
   		'pic_cover'		=> array
 		(
 			'type' 		=> 'varchar-150',
-			'name' 		=> '4:3封面图-请上传4:3比例的封面图',
+			'name' 		=> '4:3封面图-图片尺寸750*564px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
 			'default' 	=> '',
 			'desc' 		=> '封面图',
 			'match' 	=> 'option',
@@ -161,7 +161,7 @@ return array
 		'pic_cover_169'		=> array
 		(
 			'type' 		=> 'varchar-150',
-			'name' 		=> '16:9封面图-请上传16:9比例的封面图',
+			'name' 		=> '16:9封面图-图片尺寸750*422px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
 			'default' 	=> '',
 			'desc' 		=> '封面图',
 			'match' 	=> 'option',
@@ -417,7 +417,7 @@ return array
 		'share_pic'		=> array
 		(
 			'type' 		=> 'varchar-150',
-			'name' 		=> '分享图片-请上传570X300px或等比大小的图片',
+			'name' 		=> '分享图片-图片尺寸570*570px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
 			'default' 	=> '',
 			'desc' 		=> '分享图片',
 			'match' 	=> 'option',
@@ -425,6 +425,8 @@ return array
 			'key' 		=> '1',
 			'place'		=> '150',
 			'show'		=> 'share_yes=1',
+			//'upload'	=> 'qiniu',
+			//'large' 	=> true,
 		),
 
 		'share_content'		=> array

+ 8 - 4
video/database/vod.php

@@ -106,7 +106,7 @@ return array
 		'video'		=> array
 		(
 			'type' 		=> 'varchar-800',
-			'name' 		=> '上传视频',
+			'name' 		=> '上传视频-视频格式mp4,mov,上传大小不能超过4G',
 			'default' 	=> '',
 			'desc' 		=> '上传点播视频',
 			'match' 	=> 'is_string',
@@ -115,6 +115,8 @@ return array
 			'place'		=> '150',
 			'upload'	=> 'qiniu',
 			'large' 	=> true,
+			//不覆盖原文件,生成新文件
+			'cover'		=> 2,
 		),
 		
 		'cate_id'		=> array
@@ -157,7 +159,7 @@ return array
   		'pic_cover'		=> array
 		(
 			'type' 		=> 'varchar-150',
-			'name' 		=> '4:3封面图-请上传4:3比例的封面图',
+			'name' 		=> '4:3封面图-图片尺寸750*564px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
 			'default' 	=> '',
 			'desc' 		=> '封面图',
 			'match' 	=> 'option',
@@ -173,7 +175,7 @@ return array
 		'pic_cover_169'		=> array
 		(
 			'type' 		=> 'varchar-150',
-			'name' 		=> '16:9封面图-请上传16:9比例的封面图',
+			'name' 		=> '16:9封面图-图片尺寸750*422px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
 			'default' 	=> '',
 			'desc' 		=> '封面图',
 			'match' 	=> 'option',
@@ -351,7 +353,7 @@ return array
 		'share_pic'		=> array
 		(
 			'type' 		=> 'varchar-150',
-			'name' 		=> '分享图片-请上传570X300px或等比大小的图片',
+			'name' 		=> '分享图片-图片尺寸570*570px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
 			'default' 	=> '',
 			'desc' 		=> '分享图片',
 			'match' 	=> 'option',
@@ -359,6 +361,8 @@ return array
 			'key' 		=> '1',
 			'place'		=> '150',
 			'show'		=> 'share_yes=1',
+			//'upload'	=> 'qiniu',
+			//'large' 	=> true,
 		),
 
 		'share_content'		=> array

+ 18 - 1
video/lib/Vod.php

@@ -18,10 +18,27 @@ class Vod
     
         $data['content'] = Dever::filter($data['content']);
 
-        
+        $data['video'] = $this->convert($data['video'], 'mp4', 'video/vod', $data['id'], 'video');
+
         return $data;
     }
 
+    public function convert($url, $ext = 'mp4', $table = false, $id = false, $col = '')
+    {
+        if ($url && !strstr($url, '_c.' . $ext)) {
+            $file = $url . '_c.' . $ext;
+            if (Dever::is_file($file)) {
+                $url = $file;
+
+                if ($table) {
+                    Dever::db($table)->update(array('where_id' => $id, $col => $file));
+                }
+            }
+        }
+
+        return $url;
+    }
+
 
     # 获取相关推荐
     public function getRelation($info)