mirror of
https://github.com/openvk/openvk
synced 2024-11-15 03:31:18 +03:00
слегка проебался
This commit is contained in:
parent
3aafae1af3
commit
9c92fe4901
8 changed files with 20 additions and 40 deletions
|
@ -587,20 +587,7 @@ final class Audio extends VKAPIRequestHandler
|
||||||
|
|
||||||
$playlists = [];
|
$playlists = [];
|
||||||
$params = [];
|
$params = [];
|
||||||
$order_str = 'id';
|
$order_str = (['id', 'length', 'listens'][$order] ?? 'id');
|
||||||
switch($order) {
|
|
||||||
default:
|
|
||||||
case 0:
|
|
||||||
$order_str = 'id';
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
$order_str = 'length';
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
$order_str = 'listens';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if($from_me === 1)
|
if($from_me === 1)
|
||||||
$params['from_me'] = $this->getUser()->getId();
|
$params['from_me'] = $this->getUser()->getId();
|
||||||
|
|
||||||
|
|
|
@ -251,19 +251,7 @@ class Audios
|
||||||
"unlisted" => 0,
|
"unlisted" => 0,
|
||||||
"deleted" => 0,
|
"deleted" => 0,
|
||||||
]);
|
]);
|
||||||
$order_str = 'id';
|
$order_str = (in_array($order['type'], ['id', 'length', 'listens']) ? $order['type'] : 'id') . ' ' . ($order['invert'] ? 'ASC' : 'DESC');;
|
||||||
|
|
||||||
switch($order['type']) {
|
|
||||||
case 'id':
|
|
||||||
$order_str = 'id ' . ($order['invert'] ? 'ASC' : 'DESC');
|
|
||||||
break;
|
|
||||||
case 'length':
|
|
||||||
$order_str = 'length ' . ($order['invert'] ? 'ASC' : 'DESC');
|
|
||||||
break;
|
|
||||||
case 'listens':
|
|
||||||
$order_str = 'listens ' . ($order['invert'] ? 'ASC' : 'DESC');
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if($params["only_performers"] == "1") {
|
if($params["only_performers"] == "1") {
|
||||||
$result->where("performer LIKE ?", $query);
|
$result->where("performer LIKE ?", $query);
|
||||||
|
@ -304,7 +292,7 @@ class Audios
|
||||||
$result = $this->playlists->where([
|
$result = $this->playlists->where([
|
||||||
"deleted" => 0,
|
"deleted" => 0,
|
||||||
])->where("CONCAT_WS(' ', name, description) LIKE ?", $query);
|
])->where("CONCAT_WS(' ', name, description) LIKE ?", $query);
|
||||||
$order_str = (['id', 'length', 'listens'][$order['type']] ?? 'id') . ' ' . ($order['invert'] ? 'ASC' : 'DESC');
|
$order_str = (in_array($order['type'], ['id', 'length', 'listens']) ? $order['type'] : 'id') . ' ' . ($order['invert'] ? 'ASC' : 'DESC');
|
||||||
|
|
||||||
if(is_null($params['from_me']) || empty($params['from_me']))
|
if(is_null($params['from_me']) || empty($params['from_me']))
|
||||||
$result->where(["unlisted" => 0]);
|
$result->where(["unlisted" => 0]);
|
||||||
|
|
|
@ -109,8 +109,8 @@ final class AudioPresenter extends OpenVKPresenter
|
||||||
|
|
||||||
$this->template->mode = $mode;
|
$this->template->mode = $mode;
|
||||||
$this->template->page = $page;
|
$this->template->page = $page;
|
||||||
|
|
||||||
if(in_array($mode, ["list", "new", "popular"]) && $this->user->identity)
|
if(in_array($mode, ["list", "new", "popular"]) && $this->user->identity && $page < 2)
|
||||||
$this->template->friendsAudios = $this->user->identity->getBroadcastList("all", true);
|
$this->template->friendsAudios = $this->user->identity->getBroadcastList("all", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
<div class="trackPanel">
|
<div class="trackPanel">
|
||||||
<div class="trackInfo">
|
<div class="trackInfo">
|
||||||
<div class="trackName">
|
<div class="trackName">
|
||||||
<b>{_track_unknown}</b> —
|
<a>{_track_unknown}</a> —
|
||||||
<span>{_track_noname}</span>
|
<span>{_track_noname}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
<div class='verticalGrayTabsWrapper'>
|
<div class='verticalGrayTabsWrapper'>
|
||||||
<div class="verticalGrayTabs">
|
<div class="verticalGrayTabs">
|
||||||
<div class='with_padding'>
|
<div class='with_padding'>
|
||||||
<a n:attr="id => $mode === 'list' && $isMy ? 'used' : 'ki'" href="/audios{$thisUser->getId()}" n:if="isset($thisUser)">{_my_music}</a>
|
<a n:if="isset($thisUser)" n:attr="id => $mode === 'list' && $isMy ? 'used' : 'ki'" href="/audios{$thisUser->getId()}">{_my_music}</a>
|
||||||
<a href="/player/upload{if $isMyClub}?gid={abs($ownerId)}{/if}" n:if="isset($thisUser)">{_upload_audio}</a>
|
<a n:if="isset($thisUser)" href="/player/upload{if $isMyClub}?gid={abs($ownerId)}{/if}">{_upload_audio}</a>
|
||||||
<a n:attr="id => $mode === 'new' ? 'used' : 'ki'" href="/audios/new">{_audio_new}</a>
|
<a n:if="isset($thisUser)" n:attr="id => $mode === 'new' ? 'used' : 'ki'" href="/search?section=audios">{_audio_new}</a>
|
||||||
<a n:attr="id => $mode === 'popular' ? 'used' : 'ki'" href="/audios/popular">{_audio_popular}</a>
|
<a n:if="isset($thisUser)" n:attr="id => $mode === 'popular' ? 'used' : 'ki'" href="/search?section=audios&order=listens">{_audio_popular}</a>
|
||||||
<a href="/search?section=audios" n:if="isset($thisUser)">{_audio_search}</a>
|
|
||||||
|
|
||||||
<hr n:if="isset($thisUser)">
|
<hr n:if="isset($thisUser)">
|
||||||
|
|
||||||
|
|
|
@ -191,7 +191,12 @@
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bigPlayer .paddingLayer .trackInfo b:hover {
|
.bigPlayer .paddingLayer .trackInfo a {
|
||||||
|
font-weight: bold;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bigPlayer .paddingLayer .trackInfo a:hover {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
@ -346,7 +351,7 @@
|
||||||
.overflowedName {
|
.overflowedName {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 99;
|
z-index: 99;
|
||||||
width: 85% !important;
|
width: 80% !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.audioEntry .status strong {
|
.audioEntry .status strong {
|
||||||
|
|
|
@ -2700,7 +2700,7 @@ a.poll-retract-vote {
|
||||||
}
|
}
|
||||||
|
|
||||||
.verticalGrayTabsWrapper {
|
.verticalGrayTabsWrapper {
|
||||||
width: 25.5%;
|
width: 158px;
|
||||||
border-top: 1px solid #E5E7E6;
|
border-top: 1px solid #E5E7E6;
|
||||||
border-left: 1px solid #d8d8d8;
|
border-left: 1px solid #d8d8d8;
|
||||||
scrollbar-width: none;
|
scrollbar-width: none;
|
||||||
|
|
|
@ -544,7 +544,8 @@ class bigPlayer {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.nodes["thisPlayer"].querySelector(".trackInfo span").innerHTML = escapeHtml(obj.name)
|
this.nodes["thisPlayer"].querySelector(".trackInfo span").innerHTML = escapeHtml(obj.name)
|
||||||
this.nodes["thisPlayer"].querySelector(".trackInfo b").innerHTML = escapeHtml(obj.performer)
|
this.nodes["thisPlayer"].querySelector(".trackInfo a").innerHTML = escapeHtml(obj.performer)
|
||||||
|
this.nodes["thisPlayer"].querySelector(".trackInfo a").href = `/search?query=§ion=audios&order=listens&only_performers=on&q=${encodeURIComponent(obj.performer.escapeHtml())}`
|
||||||
this.nodes["thisPlayer"].querySelector(".trackInfo .time").innerHTML = fmtTime(obj.length)
|
this.nodes["thisPlayer"].querySelector(".trackInfo .time").innerHTML = fmtTime(obj.length)
|
||||||
this.tracks["currentTrack"] = obj
|
this.tracks["currentTrack"] = obj
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue