ページネーション

このコミットが含まれているのは:
守矢諏訪子 2021-12-16 13:02:06 +09:00
コミット 4472773f4b
7個のファイルの変更30行の追加12行の削除

ファイルの表示

@ -20,10 +20,12 @@ class Channel extends Common {
'page' => 'channel',
'cat' => $cat,
'paginate' => $page,
'pagetotal' => 500,
'userinfo' => $this->common->user,
];
$res['channel'] = $this->getChannel($id);
$res['video'] = $this->getVideo($id, ($page*$this->count), $this->count);
$res['pagetotal'] = $res['video']->total;
return view('pages.peertube.c', ['res' => $res]);
}

ファイルの表示

@ -8,22 +8,26 @@ use App\Http\Controllers\Peertube\Common;
class Local extends Common {
private $common;
private $count;
public function __construct () {
$this->common = new Common;
$this->count = 50;
}
public function index () {
public function index ($page=0) {
$res = [
'page' => 'videoslist',
'paginate' => $page,
'pagetotal' => 500,
'userinfo' => $this->common->user,
];
$res['video'] = $this->getVideo();
$res['video'] = $this->getVideo(($page*$this->count), $this->count);
return view('pages.peertube.videos.local', ['res' => $res]);
}
function getVideo () {
$get = $this->ptapi_get('/api/v1/videos/?start=0&count=50&sort=-publishedAt&filter=local&skipCount=true&nsfw=both');
function getVideo ($start, $count) {
$get = $this->ptapi_get('/api/v1/videos/?start='.$start.'&count='.$count.'&sort=-publishedAt&filter=local&skipCount=true&nsfw=both');
return $this->vidlist($get);
}
}

ファイルの表示

@ -8,22 +8,26 @@ use App\Http\Controllers\Peertube\Common;
class Recentlyadded extends Common {
private $common;
private $count;
public function __construct () {
$this->common = new Common;
$this->count = 25;
}
public function index () {
public function index ($page=0) {
$res = [
'page' => 'videoslist',
'paginate' => $page,
'pagetotal' => 500,
'userinfo' => $this->common->user,
];
$res['video'] = $this->getVideo();
$res['video'] = $this->getVideo(($page*$this->count), $this->count);
return view('pages.peertube.videos.recentlyadded', ['res' => $res]);
}
function getVideo () {
$get = $this->ptapi_get('/api/v1/videos/?start=0&count=25&sort=-publishedAt&skipCount=true&nsfw=both');
function getVideo ($start, $count) {
$get = $this->ptapi_get('/api/v1/videos/?start='.$start.'&count='.$count.'&sort=-publishedAt&skipCount=true&nsfw=both');
return $this->vidlist($get);
}
}

ファイルの表示

@ -19,9 +19,9 @@
@include('theme.'.env('THEME').'.component.peertube.parts.common.videominature')
@endforeach
</div>
@include('theme.'.env('THEME').'.component.peertube.parts.common.paginate', [
'root' => '/peertube/c/'.$res['channel']->name.($res['channel']->host != 'video.076.ne.jp' ? '@'.$res['channel']->host : '').'/'.$res['cat']
])
</div>
</my-videos-list>
</my-video-channel-videos>
@if ($res['paginate'] != 0) <a href="/peertube/c/{{ $res['channel']->name }}{{ $res['channel']->host != 'video.076.ne.jp' ? '@'.$res['channel']->host : '' }}/{{ $res['cat'] }}/{{ $res['paginate']-1 }}" class="block-title">戻り</a> @endif
@if (($res['paginate']*25) < $res['video']->total) <a href="/peertube/c/{{ $res['channel']->name }}{{ $res['channel']->host != 'video.076.ne.jp' ? '@'.$res['channel']->host : '' }}/{{ $res['cat'] }}/{{ $res['paginate']+1 }}" class="block-title"></a> @endif
</my-video-channel-videos>

ファイルの表示

@ -0,0 +1,2 @@
@if ($res['paginate'] != 0) <a href="{{ $root }}/{{ $res['paginate']-1 }}" class="block-title">戻り</a> @endif
@if (($res['paginate']*25) < $res['pagetotal']) <a href="{{ $root }}/{{ $res['paginate']+1 }}" class="block-title"></a> @endif

ファイルの表示

@ -19,6 +19,9 @@
<div _ngcontent-jba-c163="" class="action-block"></div>
</div>
@include('theme.'.env('THEME').'.component.peertube.parts.common.videosbydate')
@include('theme.'.env('THEME').'.component.peertube.parts.common.paginate', [
'root' => '/peertube/videos/local'
])
</div>
</div>
</div>

ファイルの表示

@ -19,6 +19,9 @@
<div _ngcontent-jba-c163="" class="action-block"></div>
</div>
@include('theme.'.env('THEME').'.component.peertube.parts.common.videosbydate')
@include('theme.'.env('THEME').'.component.peertube.parts.common.paginate', [
'root' => '/peertube/videos/recently-added'
])
</div>
</div>
</div>