getPublic('')===false) return false; $query = Database::prepare(Database::get(), "SELECT title, description, url, medium FROM ? WHERE id = '?'", array(LYCHEE_TABLE_PHOTOS, $photoID)); $result = Database::get()->query($query); if ($result===false) { Log::error(__METHOD__, __LINE__, Database::get()->error); return false; } $row = $result->fetch_object(); if ($row===null) { Log::error(__METHOD__, __LINE__, 'Could not find photo in database'); return false; } if ($row->medium==='1') $dir = 'medium'; else $dir = 'big'; $parseUrl = parse_url('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); $url = $parseUrl['scheme'] . '://' . $parseUrl['host'] . $parseUrl['path'] . '?' . $parseUrl['query']; $picture = $parseUrl['scheme'] . '://' . $parseUrl['host'] . $parseUrl['path'] . '/../uploads/' . $dir . '/' . $row->url; $url = htmlentities($url); $picture = htmlentities($picture); $row->title = htmlentities($row->title); $row->description = htmlentities($row->description); $return = ''; $return .= ''; $return .= ''; $return .= ''; $return .= ''; $return .= ''; $return .= ''; $return .= ''; $return .= ''; $return .= ''; $return .= ''; $return .= ''; $return .= ''; return $return; } ?>