動画
このコミットが含まれているのは:
コミット
520511b175
|
@ -79,6 +79,38 @@ class HomeController extends Controller {
|
|||
return view('pages.site.video.videotable', ['res' => $res, 'menu' => $this->menu, 'user' => $this->user]);
|
||||
}
|
||||
|
||||
public function videoPlay ($vid) {
|
||||
$res = DB::table('vid_video')->where('vid', $vid)->first();
|
||||
$game = DB::table('vid_game')->where('id', $res->game_id)->first();
|
||||
|
||||
$res->gametitle = explode('】', $res->title);
|
||||
$res->title = $res->gametitle[1];
|
||||
$res->gametitle = $res->gametitle[0];
|
||||
$res->gametitle = str_replace('【'.$game->name, '', $res->gametitle);
|
||||
$res->mgametitle = $game->name;
|
||||
$res->slug = $game->slug;
|
||||
|
||||
if ($res->gametitle == '') $res->gametitle = '初代';
|
||||
|
||||
$comments = DB::table('blg_comments')->where('video_id', $res->slug)->orderBy('id', 'asc')->get()->toArray();
|
||||
|
||||
foreach ($comments as $k => $c) {
|
||||
if ($c->isShadow == 0) {
|
||||
if ($this->objSite->getIp() != $c->ipaddress) unset($comments[$k]);
|
||||
}
|
||||
else {
|
||||
unset($c->email);
|
||||
unset($c->ipaddress);
|
||||
unset($c->isShadow);
|
||||
$c->created = date('Y年m月d日 H:i:s', $c->created);
|
||||
}
|
||||
}
|
||||
|
||||
$res->comments = $comments;
|
||||
|
||||
return view('pages.site.video.prayer', ['res' => $res, 'menu' => $this->menu, 'user' => $this->user]);
|
||||
}
|
||||
|
||||
public function addContent (Request $r) {
|
||||
if ($this->user && ($this->user['blg_addpost'] || $this->user['blg_addpage'])) {
|
||||
$bdl = array();
|
||||
|
|
|
@ -152,7 +152,7 @@ class SiteController extends Controller {
|
|||
|
||||
public function newComment (Request $r) {
|
||||
$com = $r->comment;
|
||||
$id = DB::table('blg_content')->select('id')->where('slug', $r->slug)->first()->id;
|
||||
if ($r->isvideo == 'f') $id = DB::table('blg_content')->select('id')->where('slug', $r->slug)->first()->id;
|
||||
$shadow = DB::table('blg_blacklist')->where('ipaddress', $this->getIp())->first();
|
||||
|
||||
if ($shadow && !$shadow->isShadow) return array('status' => '0101FF', 'message' => '失礼しますが、あなたはBANされていましたので、コメントを保存できません。');
|
||||
|
@ -160,7 +160,8 @@ class SiteController extends Controller {
|
|||
|
||||
$add = DB::table('blg_comments')
|
||||
->insertGetId([
|
||||
'post_id' => $id,
|
||||
'post_id' => ($r->isvideo == 'f' ? $id : 0),
|
||||
'video_id' => ($r->isvideo == 't' ? $r->slug : ''),
|
||||
'name' => $com['name'],
|
||||
'email' => $com['mail'],
|
||||
'message' => $com['text'],
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
|
||||
<script>
|
||||
export default {
|
||||
props: { slug: '', comments: Array },
|
||||
props: { slug: '', isvideo: '', comments: Array },
|
||||
data: function () { return { comment: this.comments, newComment: {}, err: '', loading: true, sending: false } },
|
||||
computed: {
|
||||
total: function () {
|
||||
|
@ -68,6 +68,7 @@
|
|||
|
||||
axios.post('/api/comment/new', {
|
||||
comment: this.newComment,
|
||||
isvideo: this.isvideo,
|
||||
slug: this.slug
|
||||
}).then(res => {
|
||||
this.sending = false;
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
<a href="#" class="navbar-brand"><img src="/img/favicon.webp" style="border-radius: 4px;" width="30" height="30" alt="favicon" /></a>
|
||||
<ul class="navbar-nav mr-auto">
|
||||
<li class="nav-item"><a class="nav-link{{ (strpos($_SERVER['REQUEST_URI'], '/blog') !== false || $_SERVER['REQUEST_URI'] == '/' ? ' active' : '') }}" href="/">トップ</a></li>
|
||||
<li class="nav-item"><a class="nav-link{{ ($_SERVER['REQUEST_URI'] == '/passman' ? ' active' : '') }}" href="#">パスマン</a></li>
|
||||
<li class="nav-item"><a class="nav-link{{ (strpos($_SERVER['REQUEST_URI'], '/video') !== false || $_SERVER['REQUEST_URI'] == '/video' ? ' active' : '') }}" href="/video">動画</a></li>
|
||||
</ul>
|
||||
<ul class="navbar-nav ml-auto">
|
||||
<li class="nav-item dropdown">
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<comments slug="{{$res[0]['slug']}}" :comments="{{json_encode($res[0]['comments'])}}" />
|
||||
<comments slug="{{$res[0]['slug']}}" isvideo="f" :comments="{{json_encode($res[0]['comments'])}}" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
@extends('layouts.site')
|
||||
|
||||
@section('content')
|
||||
<div class="within">
|
||||
<div class="bar">【<a href="/video/{{ $res->slug }}">{{ $res->mgametitle }}</a>{{ $res->gametitle }}】{{ $res->title }}</div>
|
||||
<div class="back">
|
||||
<video style="max-width: 821px; width: 100%;" src="{{ $res->url }}" controls></video>
|
||||
</div>
|
||||
<div class="comment">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<comments slug="{{$res->slug}}" isvideo="t" :comments="{{json_encode($res->comments)}}" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
|
@ -21,7 +21,7 @@
|
|||
<tr>
|
||||
<td scope="row">{{ $r->gametitle }}</td>
|
||||
<td scope="row">{{ $r->title }}</td>
|
||||
<td scope="row">@if ($r->url) <a href="{{ $r->url }}"><img src="/img/play-box.webp" class="logo-play" alt="【{{ $r->gametitle }}】$r->title"></a> @endif</td>
|
||||
<td scope="row">@if ($r->url) <a href="/video/play/{{ $r->vid }}"><img src="/img/play-box.webp" class="logo-play" alt="【{{ $r->gametitle }}】$r->title"></a> @endif</td>
|
||||
<td scope="row">@if ($r->youtube) <a href="{{ $r->youtube }}"><img src="/img/play-box.webp" class="logo-play" alt="【{{ $r->gametitle }}】$r->title"></a> @endif</td>
|
||||
<td scope="row">@if ($r->twitter) <a href="{{ $r->twitter }}"><img src="/img/play-box.webp" class="logo-play" alt="【{{ $r->gametitle }}】$r->title"></a> @endif</td>
|
||||
<td scope="row">@if ($r->nicovideo) <a href="{{ $r->nicovideo }}"><img src="/img/play-box.webp" class="logo-play" alt="【{{ $r->gametitle }}】$r->title"></a> @endif</td>
|
||||
|
|
|
@ -15,5 +15,6 @@ Route::get('/profile/{id}', 'HomeController@profile');
|
|||
|
||||
Route::get('/video', 'HomeController@videoGame');
|
||||
Route::get('/video/{slug}', 'HomeController@videoTable');
|
||||
Route::get('/video/play/{vid}', 'HomeController@videoPlay');
|
||||
|
||||
Route::get('/{slug}', 'HomeController@page');
|
||||
|
|
新しいイシューから参照