public function __construct($dir) { $datadir = DATA_DIR . $dir; if (PPHP::os() == 'WIN') { $datadir = str_replace('/', '\\', $datadir); } if (!file_exists($datadir)) { @mkdir($datadir, 0700, true); } if (!file_exists($datadir)) { throw new PException('Data subdir "' . $datadir . '" does not exist!'); } if (!is_dir($datadir)) { throw new PException('Data subdir "' . $datadir . '" is not a directory!'); } if (!is_writable($datadir)) { throw new PException('Data subdir "' . $datadir . '" is not writable!'); } $this->dir = $datadir; }
public function getOldPicture($memberid) { $s = $this->dao->query(' SELECT `membersphotos`.`FilePath` as FilePath FROM `members` LEFT JOIN `membersphotos` on `membersphotos`.`IdMember`=`members`.`id` WHERE `members`.`id`=\'' . $memberid . '\' AND `members`.`Status`=\'Active\' ORDER BY membersphotos.SortOrder '); // look if any of the pics exists while ($row = $s->fetch(PDB::FETCH_OBJ)) { $path = str_replace("/bw", "", $row->FilePath); $full_path = getcwd() . '/bw' . $path; if (PPHP::os() == 'WIN') { $full_path = str_replace("/", "\\", $full_path); } if (is_file($full_path)) { return $full_path; } } return false; }