123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- # return array(video, journal_buy) 1为可以、2为不可以
- function checkVersion()
- {
- $video = 1;
- $journal_buy = 1;
- $config = Dever::db('main/config')->one();
- if (isset($config['video']) && $config['video'] == 2) {
- $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;
- }
|