source/index/upload.ctrl.php

(开头部分) 10KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php
class uploadControl extends skymvc{
	public $sitedir;
	private $oss=NULL;
	public $w1="160";
	public $w2="440";
	public $w3="750";
	public function __construct(){
		parent::__construct();	
	}
	 
	public function onInit(){
		//检验table是否合法
		$tablename=get_post("tablename","h");
		if(!empty($tablename)){
			if(preg_match("/[^\w]+/",$tablename)){
				exit("出错了");
			}
		}
		$this->loadClass("image");
		$this->loadClass("upload");

		$this->upload->uploaddir="attach/".$this->sitedir; 
	 
		if(empty($_SESSION['ssuser']) &&   empty($_SESSION['ssupload']) && empty($_SESSION['ssadmin']) && empty($_SESSION['ssshopadmin'])){
			$this->goall("die access",1);
		}
		session_write_close();
		set_time_limit(300);
		 
		include_once(ROOT_PATH."api/ossapi/ossapi.php");
		 
	}
	
	public function onDefault(){
		
	}
	
	public function upload_oss($files,$delFile=true){
		if(!UPLOAD_OSS) return false;
		if(empty($files)) return false;
		$arr=array("",".100x100.jpg",".small.jpg",".middle.jpg");
		foreach($arr as $a){		
			if(file_exists(ROOT_PATH.$files.$a)){
				$to=str_replace("//","/",$files.$a);
				$from=ROOT_PATH.$files.$a;
				 
				$response = oss_upload_file(array("bucket"=>OSS_BUCKET,"to"=>$to,"from"=>$from));
				 
				if(defined("UPLOAD_DEL") && UPLOAD_DEL && $delFile){
					@unlink($from);
				}
			}
		}
	}
	
	public function saveRemoteImg($url){
		$dir=isset($_GET['dir'])?get('dir','h')."/":"";
		$dir=str_replace(".","_",$dir);
		if(get('id','i')){
后面还有 315 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。