Exemplo n.º 1
0
	function seteditaccess($value){
		$this->editaccess = saveaccess($value);
	}
Exemplo n.º 2
0
 function store()
 {
     $myts =& MyTextSanitizer::getInstance();
     $fileRealName = $myts->makeTboxData4Save($this->filerealname);
     $fileShowName = $myts->censorString($this->fileshowname);
     $fileShowName = $myts->makeTboxData4Save($fileShowName);
     $filetext = $myts->makeTboxData4Save($this->filetext);
     $filedescript = $myts->makeTboxData4Save($this->filedescript);
     $downloadname = $myts->makeTboxData4Save($this->downloadname);
     $groupid = saveaccess($this->groupid);
     $date = time();
     $ext = $myts->makeTboxData4Save($this->ext);
     $minetype = $myts->makeTboxData4Save($this->minetype);
     $counter = intval($this->counter);
     $articleid = intval($this->articleid);
     if (!isset($this->fileid)) {
         $newid = $this->db->genId($this->table . "_fileid_seq");
         $sql = "INSERT INTO " . $this->table . " (fileid, articleid, filerealname, fileshowname, filetext, filedescript, date, ext, minetype, downloadname, counter, groupid) " . "VALUES (" . $newid . "," . $articleid . ",'" . $fileRealName . "','" . $fileShowName . "','" . $filetext . "','" . $filedescript . "'," . $date . ",'" . $ext . "','" . $minetype . "','" . $downloadname . "'," . $counter . ",'" . $groupid . "')";
     } else {
         $sql = "UPDATE " . $this->table . " SET articleid=" . $articleid . ",filerealname='" . $this->filerealname . "',fileshowname='" . $fileShowName . "',filetext='" . $filetext . "', filedescript='" . $filedescript . "',date=" . $date . ",ext='" . $ext . "',minetype='" . $minetype . "',downloadname='" . $downloadname . "', groupid='" . $groupid . "',counter=" . $counter . " WHERE fileid=" . $this->fileid . "";
     }
     if (!($result = $this->db->query($sql))) {
         return false;
     }
     return true;
 }