コミットを比較
4 コミット
f48049f5e4
...
72b9b3dc67
作成者 | SHA1 | 日付 |
---|---|---|
守矢諏訪子 | 72b9b3dc67 | |
テクニカル諏訪子 | 2358319b5d | |
守矢諏訪子 | 5d2bb989e1 | |
守矢諏訪子 | 2733098e66 |
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class RssFeedController extends Controller {
|
||||
public function feed () {
|
||||
$select = ['id', 'user_id', 'title', 'slug', 'publish_date', 'message'];
|
||||
$posts = DB::table('blg_content')->select($select)->where('isPost', true)->where('public_status', 0)->orderBy('id', 'desc')->limit(50)->get();
|
||||
|
||||
foreach ($posts as $k => $v) {
|
||||
$userd = DB::table('users')->where('id', $v->user_id)->first();
|
||||
$userd = DB::table('usr_profile')->where('user_id', $v->user_id)->first();
|
||||
$v->user = $userd->display_name;
|
||||
unset($posts[$k]->user_id);
|
||||
}
|
||||
|
||||
return response()->view('rss.feed', ['posts' => $posts])->header('Content-Type', 'application/xml');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
<?=
|
||||
'<?xml version="1.0" encoding="UTF-8"?>'.PHP_EOL
|
||||
?>
|
||||
<rss version="2.0">
|
||||
<channel>
|
||||
<title><![CDATA[{{ env('APP_NAME') }}]]></title>
|
||||
<link><![CDATA[{{ env('APP_URL') }}/feed ]]></link>
|
||||
<description><![CDATA[ テクニカル諏訪子のホームページです。ゲーム及びテクノロジー関係ブログですわ♡ ]]></description>
|
||||
<language>ja</language>
|
||||
<pubDate>{{ now() }}</pubDate>
|
||||
|
||||
@foreach($posts as $post)
|
||||
<item>
|
||||
<title><![CDATA[{{ $post->title }}]]></title>
|
||||
<link>{{ env('APP_URL') }}/blog/{{ $post->slug }}</link>
|
||||
<description><![CDATA[{!! $post->message !!}]]></description>
|
||||
<author><![CDATA[{{ $post->user }}]]></author>
|
||||
<pubDate>{{ date('Y-m-d H:i:s', $post->publish_date) }}</pubDate>
|
||||
</item>
|
||||
@endforeach
|
||||
</channel>
|
||||
</rss>
|
|
@ -4,6 +4,7 @@
|
|||
<ul class="navbar-nav mr-auto">
|
||||
<li class="nav-item"><a class="nav-link{{ (str_contains($_SERVER['REQUEST_URI'], '/blog') || $_SERVER['REQUEST_URI'] == '/' ? ' active' : '') }}" href="/">{{ __('site.top') }}</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="http://{{ env('ONION_HOST') }}">Tor</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="/feed">RSS</a></li>
|
||||
</ul>
|
||||
<ul class="navbar-nav ml-auto">
|
||||
@if ($user)
|
||||
|
|
|
@ -14,19 +14,6 @@
|
|||
<!-- Styles -->
|
||||
@include('theme.'.env('THEME').'.component.favicon')
|
||||
@include('theme.'.env('THEME').'.component.colors')
|
||||
<style>
|
||||
#page { background: green; }
|
||||
#post { background: deeppink; }
|
||||
#typepost:checked + #page { background: cyan; }
|
||||
#typepost:checked ~ #post { background: blue; }
|
||||
#typepost:checked + #post { background: purple; }
|
||||
#typepost:checked ~ #page { background: brown; }
|
||||
|
||||
#typepost:checked + #page { display: none; }
|
||||
#typepost:checked ~ #post { display: block; }
|
||||
#typepage:checked + #post { display: none; }
|
||||
#typepage:checked ~ #page { display: block; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@include('theme.'.env('THEME').'.component.navbar')
|
||||
|
|
|
@ -34,5 +34,6 @@ Route::get('/memberlist', 'User\MemberList@index');
|
|||
Route::get('/commentlist', 'Home\CommentList@index');
|
||||
Route::get('/contact/seiko', 'Home\Contact@seiko');
|
||||
Route::any('/contact', 'Home\Contact@index');
|
||||
Route::get('/feed', 'RssFeedController@feed');
|
||||
|
||||
Route::get('/{slug}', 'Home\Index@page');
|
||||
|
|
新しいイシューから参照