public function photo_localurl($thumb = true)
{
if ($thumb) {
$ext = "";
} else {
$ext = "_big";
}
if (!is_dir($this->photodir)) {
$this->debug_scalar("<BR>***ERROR*** The configured image directory does not exist!<BR>");
return false;
}
$path = $this->photodir . $this->imdbid() . "{$ext}.jpg";
if (file_exists($path)) {
return $this->photoroot . $this->imdbid() . "{$ext}.jpg";
}
if (!is_writable($this->photodir)) {
$this->debug_scalar("<BR>***ERROR*** The configured image directory lacks write permission!<BR>");
return false;
}
if ($this->savephoto($path, $thumb)) {
return $this->photoroot . $this->imdbid() . "{$ext}.jpg";
}
return false;
}