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/
Upload File :
Current Directory [ Writeable ] Root Directory [ Writeable ]


Current File : /www/wwwroot/www.jkmold.com/phpcms/modules/video/player.php
<?php 

defined('IN_PHPCMS') or exit('No permission resources.');



pc_base::load_app_class('admin', 'admin', 0);

pc_base::load_app_func('global', 'video');



class player extends admin {

	public function __construct() {

		parent::__construct();

		$this->userid = $_SESSION['userid'];

		pc_base::load_app_class('ku6api', 'video', 0);



		$this->setting = getcache('video');

		if(empty($this->setting['sn']) || empty($this->setting['skey'])) {

			header("Location: ".APP_PATH."index.php?m=video&c=video&a=open&meunid=".$_GET['meunid'].'&pc_hash='.$_GET['pc_hash']);

		}

		$this->ku6api = new ku6api($this->setting['sn'], $this->setting['skey']);

		if(!$this->ku6api->testapi()) {

			header("Location: ".APP_PATH."index.php?m=video&c=video&a=open&meunid=".$_GET['meunid'].'&pc_hash='.$_GET['pc_hash']);

		}

	}

	

	/**

	 * 

	 * 视频列表

	 */

	public function init() {

		$infos = $this->player_list(1);

		include $this->admin_tpl('player_list');		

	}

	

	/**

	 * function edit

	 * 修改播放器属性

	 */

	public function edit() {

		if (isset($_POST['dosubmit'])) {

			if(in_array($_POST['field'],array('default','auto','replay','share','show_elite','ssv'))) {

				if(preg_match('/([a-z0-9_\-\.])/i',$_POST['style'])) {

					if ($return = $this->ku6api->player_edit($_POST['field'],$_POST['style'])) {

						echo $return['data'][$_POST['field']];

						$this->player_list();

					}

				}

			}		

		}

	}



	private function player_list($return_data = 0) {

		$infos = $this->ku6api->player_list();

		$infos = $infos['data'];

		

		$player_caches = array();

		foreach($infos as $info) {

			if($info['default']==1) {

				$player_caches[$info['channelid']]['default'] = $info['style'];

			}

			$player_caches[$info['channelid']]['STY-'.$info['style']] = $info;

		}

		setcache('player',$player_caches,'video');

		if($return_data) return $infos;

		/*

		1=>array(

			'default'=> 'idZwHK_aOJ7E-oGT',

			'STY-idZwHK_aOJ7E-oGT'=> array('auto'=>1),

			'STY-7i8TjPi7A3o.'=> array(),

		  ),

		 */

	}

}



?>