Exemple #1
0
 function readresvirtual($where, $drive)
 {
     $paths = array();
     if (strlen($where) == 0) {
         $sql = 'SELECT DISTINCT fpath FROM ' . TBL_SEARCH . ' WHERE LENGTH(fpath) > 0 AND drive = ' . $drive;
     } else {
         $lenwhere = strlen($where) + 1;
         $sql = 'SELECT DISTINCT SUBSTR(fpath, ' . $lenwhere . ') FROM ' . TBL_SEARCH . ' WHERE drive = ' . $drive . ' AND SUBSTR(fpath, 1, ' . strlen($where) . ') = "' . myescstr($where) . '" AND LENGTH(fpath) > ' . strlen($where);
     }
     $res = db_execquery($sql, true);
     while ($row = db_fetch_row($res)) {
         $pathx = explode('/', $row[0]);
         $paths[$pathx[0]] = true;
     }
     foreach ($paths as $name => $val) {
         $this->dirlist[] = array($name, array($drive));
     }
 }
Exemple #2
0
 function addarchivetbl($dest)
 {
     global $valuser;
     $sql = 'INSERT INTO ' . TBL_ARCHIVE . ' SET uid = ' . $valuser->getid() . ', utime = ' . time() . ', fpath = "' . myescstr($dest) . '"';
     $res = db_execquery($sql);
     if ($res) {
         return mysql_insert_id();
     }
     return 0;
 }