| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 | 
							- <?php
 
- # return array(video, journal_buy) 1为可以、2为不可以
 
- function checkVersion()
 
- {
 
- 	$video = 1;
 
- 	$journal_buy = 1;
 
- 	$config = Dever::db('main/config')->one();
 
-     $source_type = Dever::input('source_type');
 
-     #小程序去掉视频
 
-     $app = false;
 
-     if ($source_type == 'ios' || $source_type == 'android') {
 
-         $app = true;
 
-     }
 
-     $app = true;
 
-     if ((isset($config['video']) && $config['video'] == 2) || !$app) {
 
-         $video = 2;
 
-     } elseif (isset($config['version']) && Dever::input('version') && $config['version'] == Dever::input('version')) {
 
-         $video = 2;
 
-         $journal_buy = 2;
 
-     }
 
-     return (object) array('video' => $video, 'journal_buy' => $journal_buy);
 
- }
 
- /**
 
-  * 音视频转换
 
-  */
 
- 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;
 
- }
 
 
  |