diff options
Diffstat (limited to 'www/functions/class_files.php')
| -rw-r--r-- | www/functions/class_files.php | 174 |
1 files changed, 0 insertions, 174 deletions
diff --git a/www/functions/class_files.php b/www/functions/class_files.php deleted file mode 100644 index 10182a9..0000000 --- a/www/functions/class_files.php +++ /dev/null @@ -1,174 +0,0 @@ -<?php - -class file { - - public $file; - - function __construct($val = null){ - if($val == null){ - $this->file = collect_content($GLOBALS["db"], $_GET["name"], $_GET["folder"]); - } else { - $this->file = $val; - } - } - function NotFound(){ - if($this->file == FILE_NOT_FOUND){ - return true; - } else { - return false; - } - } - function isEmpty(){ - if($this->file == EMPTY_FOLDER){ - return true; - } else { - return false; - } - } - function isFile(){ - if(check_if_file($GLOBALS["db"], $_GET["name"], $_GET["folder"])){ - return true; - } else { - return false; - } - } - function initFile($val){ - if(!$val){ - return false; - } - $this->file=$val; - } - function getDim(){ - return count($this->file); - } - function getId($val = null){ - $ar = $this->file; - if($val != null){ - if(!preg_match("/^[0-9]+$/", $val)){ - return false; - } - return $ar[$val][0]; - } else { - $res; - for($i=0; $i<count($ar); $i++){ - $res[$i] = $ar[$i][0]; - } - return $res; - } - } - function getParent($val = null){ - $ar = $this->file; - if($val != null){ - if(!preg_match("/^[0-9]+$/", $val)){ - return false; - } - return $ar[$val][1]; - } else { - $res; - for($i=0; $i<count($ar); $i++){ - $res[$i] = $ar[$i][1]; - } - return $res; - } - } - function getOwnerId(){ - $id = user_id($GLOBALS["db"], $_GET["name"]); - return $id; - } - function getOwnerName(){ - return $_GET["name"]; - } - function getName($val = null){ - $ar = $this->file; - if($val != null){ - if(!preg_match("/^[0-9]+$/", $val)){ - return false; - } - return $ar[$val][3]; - } else { - $res; - for($i=0; $i<count($ar); $i++){ - $res[$i] = $ar[$i][3]; - } - return $res; - } - } - function getType($val = null){ - $ar = $this->file; - if($val != null){ - if(!preg_match("/^[0-9]+$/", $val)){ - return false; - } - return $ar[$val][4]; - } else { - $res; - for($i=0; $i<count($ar); $i++){ - $res[$i] = $ar[$i][4]; - } - return $res; - } - } - function getMime($val = null){ - $ar = $this->file; - if($val != null){ - if(!preg_match("/^[0-9]+$/", $val)){ - return false; - } - return $ar[$val][5]; - } else { - $res; - for($i=0; $i<count($ar); $i++){ - $res[$i] = $ar[$i][5]; - } - return $res; - } - } - function getSize($val = null){ - $ar = $this->file; - if($val != null){ - if(!preg_match("/^[0-9]+$/", $val)){ - return false; - } - return $ar[$val][6]; - } else { - $res; - for($i=0; $i<count($ar); $i++){ - $res[$i] = $ar[$i][6]; - } - return $res; - } - } - function getHash($val = null){ - $ar = $this->file; - if($val != null){ - if(!preg_match("/^[0-9]+$/", $val)){ - return false; - } - return $ar[$val][7]; - } else { - $res; - for($i=0; $i<count($ar); $i++){ - $res[$i] = $ar[$i][7]; - } - return $res; - } - } - function getDownLink($val = null){ - $ar = $this->file; - if($val != null){ - if(!preg_match("/^[0-9]+$/", $val)){ - return false; - } - return $ar[$val][8]; - } else { - $res; - for($i=0; $i<count($ar); $i++){ - $res[$i] = $ar[$i][8]; - } - return $res; - } - } - function getAll(){ - return $this->file; - } -} |
