/** * adds a new file to our db */ public function addFileToDB() { DA_DatabaseHandler::insertMySQL(array(FILES_TABLE => array("filename" => $this->filename, "metaname" => $this->metaname, "filepath" => $this->path, "type" => $this->type, "level" => $this->level, "parent_id" => $this->parentid))) or die("<br/>could not insert into db"); $this->id = mysql_insert_id(); }
/** * adds a new folder to db and fs */ public function addNewFolder() { $this->currentfile["filename"] = strip_tags($_POST["create-folder"]); $this->currentfile["metaname"] = strip_tags($_POST["metaname"]); $this->checkForUploadDir(); if (is_dir(DA_WP_PATH . $this->currentfile["filename"])) { die("directory " . DA_WP_PATH . $this->currentfile["filename"] . " already exists!"); } mkdir(DA_WP_PATH . $this->currentfile["filename"]) or die("could not create directory."); DA_DatabaseHandler::insertMySQL(array(FOLDERS_TABLE => array("filepath" => $this->currentfile["filename"], "filename" => $this->currentfile["metaname"], "metaname" => $this->currentfile["metaname"], "type" => "folder", "level" => 0))); }