mirror of
https://github.com/openvk/openvk
synced 2025-04-23 08:33:02 +03:00
Compare commits
4 commits
32a235ece1
...
4afcdc70c6
Author | SHA1 | Date | |
---|---|---|---|
|
4afcdc70c6 | ||
|
b7fc23bb52 | ||
|
3fec1b57a4 | ||
|
ca8b6a83fb |
7 changed files with 25 additions and 5 deletions
|
@ -187,7 +187,7 @@ class Photo extends Media
|
|||
foreach ($sizes as $id => $meta) {
|
||||
if (isset($meta[3]) && !$meta[3]) {
|
||||
$res[$id] = (object) [
|
||||
"url" => ovk_scheme(true) . $_SERVER["HTTP_HOST"] . "/photos/thumbnails/" . $this->getId() . "_$id.jpeg",
|
||||
"url" => ovk_scheme(true) . $_SERVER["HTTP_HOST"] . "/photos/thumbnails/" . $this->getRecord()->hash . "_$id.jpeg",
|
||||
"width" => null,
|
||||
"height" => null,
|
||||
"crop" => null,
|
||||
|
|
|
@ -28,6 +28,17 @@ class Photos
|
|||
return new Photo($photo);
|
||||
}
|
||||
|
||||
public function getByHash(string $hash): ?Photo
|
||||
{
|
||||
$photo = $this->photos->where("hash", $hash)->fetch();
|
||||
|
||||
if (!$photo) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new Photo($photo);
|
||||
}
|
||||
|
||||
public function getByOwnerAndVID(int $owner, int $vId): ?Photo
|
||||
{
|
||||
$photo = $this->photos->where([
|
||||
|
|
|
@ -371,7 +371,11 @@ abstract class OpenVKPresenter extends SimplePresenter
|
|||
$whichbrowser->isEngine('NetFront') || // PSP and other japanese portable systems
|
||||
$whichbrowser->isOs('Android') ||
|
||||
$whichbrowser->isOs('iOS') ||
|
||||
$whichbrowser->isBrowser('Internet Explorer', '<=', '8')) {
|
||||
$whichbrowser->isBrowser('BlackBerry Browser') ||
|
||||
$whichbrowser->isBrowser('Internet Explorer', '<=', '8') ||
|
||||
$whichbrowser->isBrowser('Firefox', '<=', '47') ||
|
||||
$whichbrowser->isBrowser('Safari', '<=', '7') ||
|
||||
$whichbrowser->isBrowser('Google Chrome', '<=', '35')) {
|
||||
// yeah, it's old, but ios and android are?
|
||||
if ($whichbrowser->isOs('iOS') && $whichbrowser->isOs('iOS', '<=', '9')) {
|
||||
return true;
|
||||
|
|
|
@ -229,9 +229,9 @@ final class PhotosPresenter extends OpenVKPresenter
|
|||
$this->renderPhoto($photo->getOwner(true)->getId(), $photo->getVirtualId());
|
||||
}
|
||||
|
||||
public function renderThumbnail($id, $size): void
|
||||
public function renderThumbnail($hash, $size): void
|
||||
{
|
||||
$photo = $this->photos->get($id);
|
||||
$photo = $this->photos->getByHash((string) $hash);
|
||||
if (!$photo || $photo->isDeleted()) {
|
||||
$this->notFound();
|
||||
}
|
||||
|
|
|
@ -173,8 +173,10 @@ routes:
|
|||
handler: "Photos->photo"
|
||||
- url: "/photo{num}_{num}/like"
|
||||
handler: "Photos->like"
|
||||
- url: "/photos/thumbnails/{num}_{text}.jpeg"
|
||||
- url: "/photos/thumbnails/{?hash}_{text}.jpeg"
|
||||
handler: "Photos->thumbnail"
|
||||
placeholders:
|
||||
hash: "[A-z0-9\\-_\\/]{15,}"
|
||||
- url: "/photos/{text}"
|
||||
handler: "Photos->absolutePhoto"
|
||||
- url: "/photo{num}_{num}/edit"
|
||||
|
|
|
@ -2235,6 +2235,7 @@
|
|||
"mobile_like" = "Like";
|
||||
"mobile_user_info_hide" = "Hide";
|
||||
"mobile_user_info_show_details" = "Show details";
|
||||
"mobile_attachment_only_for_pc" = "This attachments is not implemented for PDA version. Please, view it on PC.";
|
||||
|
||||
/* Fullscreen player */
|
||||
|
||||
|
|
|
@ -2130,6 +2130,7 @@
|
|||
"mobile_like" = "Нравится";
|
||||
"mobile_user_info_hide" = "Скрыть";
|
||||
"mobile_user_info_show_details" = "Показать подробнее";
|
||||
"mobile_attachment_only_for_pc" = "Вложение недоступно в PDA версии, его просмотр возможен только с другого устройства";
|
||||
|
||||
/* Fullscreen player */
|
||||
|
||||
|
@ -2306,3 +2307,4 @@
|
|||
"faves_few" = "$1 закладки";
|
||||
"faves_many" = "$1 закладок";
|
||||
"faves_other" = "$1 закладок";
|
||||
|
||||
|
|
Loading…
Reference in a new issue