Server : nginx/1.22.1 System : Linux iZwz9daxib3w3i063fw434Z 3.10.0-1127.19.1.el7.x86_64 #1 SMP Tue Aug 25 17:23:54 UTC 2020 x86_64 User : www ( 1000) PHP Version : 5.6.40 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv Directory : /www/wwwroot/www.jkmold.com/phpcms/modules/video/classes/ |
<?php /** * * ---------------------------- * v class * ---------------------------- * * An open source application development framework for PHP 5.0 or newer * * 这个类,主要负责视频模型数据处理 * @package PHPCMS V9.1.16 * @author chenxuewang * @copyright CopyRight (c) 2006-2012 上海盛大网络发展有限公司 * */ class v { private $db; public function __construct(&$db) { $this->db = & $db; } /** * * add 添加视频方法,将视频入库到视频库中 * @param array $data 视频信息数据 */ public function add($data = array()) { if (is_array($data) && !empty($data)) { $data['status'] = 1; $data['userid'] = defined('IN_ADMIN') ? 0 : intval(param::get_cookie('_userid')); $data['vid'] = safe_replace($data['vid']); $vid = $this->db->insert($data, true); return $vid ? $vid : false; } else { return false; } } /** * function edit * 编辑视频方法,用户重新编辑已上传的视频 * @param array $data 视频视频信息数组 包括title description tag vid 等信息 * @param int $vid 视频库中视频的主键 */ public function edit($data = array(), $vid = 0) { if (is_array($data) && !empty($data)) { $vid = intval($vid); if (!$vid) return false; unset($data['vid']); $this->db->update($data, "`videoid` = '$vid'"); return true; } else { return false; } } /** * function del_video * 删除视频库中的视频 * @param int $vid 视频ID */ public function del_video($vid = 0) { $vid = intval($vid); if (!$vid) return false; //删除视频关联的内容,并更新内容页 $this->db->delete(array('videoid'=>$vid)); return true; } } ?>