Commit c3db8b61 by Siti Aisah
parents e4824713 5bede281
......@@ -7,11 +7,9 @@ class RssFeedNewController extends Controller
public function feed()
{
$setting = webprofilesetting();
// $posts = Posts::where('post_status', 't')->
// orderBy('post_date', 'desc')->
// limit(10)->get();
$posts = Posts::orderBy('created_at')->get();
$data = response()->view('rss.feed', compact('posts','setting'))->header('Content-Type', 'application/xml');
return strip_tags($data);
$posts = Posts::where('post_status', 't')->
orderBy('post_date', 'desc')->
limit(30)->get();
return $data = response()->view('rss.feednew', compact('posts','setting'))->header('Content-Type', 'application/xml');
}
}
......@@ -88,7 +88,7 @@ class PostController extends Controller
*/
public function store(Request $request)
{
$request['content'] = strip_tags($request->content, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th']);
$request['content'] = strip_tags($request->content, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th', 'iframe','section']);
$request['title'] = strip_tags($request->title);
$request->validate([
'title' => 'required',
......@@ -223,7 +223,7 @@ class PostController extends Controller
$data['content'] = 'kosong';
}
$content = $trans->translate($this->SOURCE, $this->TARGET, strip_tags($data['content'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th']));
$content = $trans->translate($this->SOURCE, $this->TARGET, strip_tags($data['content'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th', 'iframe','section']));
$dataEn['post_id'] = $post->id;
$dataEn['title'] = $title;
......@@ -241,7 +241,7 @@ class PostController extends Controller
$data['content'] = 'kosong';
}
$content = $trans->translate($this->SOURCE, $this->TARGETDE, strip_tags($data['content'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th']));
$content = $trans->translate($this->SOURCE, $this->TARGETDE, strip_tags($data['content'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th', 'iframe','section']));
$dataDe['post_id'] = $post->id;
$dataDe['title'] = $title;
......@@ -259,7 +259,7 @@ class PostController extends Controller
$data['content'] = 'kosong';
}
$content = $trans->translate($this->SOURCE, $this->TARGETSA, strip_tags($data['content'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th']));
$content = $trans->translate($this->SOURCE, $this->TARGETSA, strip_tags($data['content'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th', 'iframe','section']));
$dataSa['post_id'] = $post->id;
$dataSa['title'] = $title;
......@@ -277,7 +277,7 @@ class PostController extends Controller
$data['content'] = 'kosong';
}
$content = $trans->translate($this->SOURCE, $this->TARGETZH, strip_tags($data['content'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th']));
$content = $trans->translate($this->SOURCE, $this->TARGETZH, strip_tags($data['content'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th', 'iframe','section']));
$dataZh['post_id'] = $post->id;
$dataZh['title'] = $title;
......@@ -346,11 +346,11 @@ class PostController extends Controller
*/
public function update(Request $request, $id)
{
$request['content'] = strip_tags($request->content, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th']);
$request['content_en'] = strip_tags($request->content_en, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th']);
$request['content_de'] = strip_tags($request->content_de, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th']);
$request['content_sa'] = strip_tags($request->content_sa, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th']);
$request['content_zh'] = strip_tags($request->content_zh, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th']);
$request['content'] = strip_tags($request->content, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th', 'iframe','section']);
$request['content_en'] = strip_tags($request->content_en, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th', 'iframe','section']);
$request['content_de'] = strip_tags($request->content_de, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th', 'iframe','section']);
$request['content_sa'] = strip_tags($request->content_sa, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th', 'iframe','section']);
$request['content_zh'] = strip_tags($request->content_zh, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th', 'iframe','section']);
$request['title'] = strip_tags($request->title);
$request['title_en'] = strip_tags($request->title_en);
$request['title_de'] = strip_tags($request->title_de);
......@@ -416,7 +416,7 @@ class PostController extends Controller
{
if($manual==1){
$dataEn['title'] = strip_tags($data['title_en']);
$dataEn['content'] = strip_tags($data['content_en'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th']);
$dataEn['content'] = strip_tags($data['content_en'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th', 'iframe','section']);
}
else{
......@@ -426,7 +426,7 @@ class PostController extends Controller
$trans = new GoogleTranslate();
$title = $trans->translate($this->SOURCE, $this->TARGET, strip_tags($data['title']));
$content = $trans->translate($this->SOURCE, $this->TARGET, strip_tags($data['content'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th']));
$content = $trans->translate($this->SOURCE, $this->TARGET, strip_tags($data['content'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th', 'iframe','section']));
$dataEn['title'] = $title;
$dataEn['content'] = $content;
......@@ -438,7 +438,7 @@ class PostController extends Controller
{
if($manual==1){
$dataDe['title'] = strip_tags($data['title_de']);
$dataDe['content'] = strip_tags($data['content_de'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th']);
$dataDe['content'] = strip_tags($data['content_de'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th', 'iframe','section']);
}
else{
......@@ -448,7 +448,7 @@ class PostController extends Controller
$trans = new GoogleTranslate();
$title = $trans->translate($this->SOURCE, $this->TARGETDE, strip_tags($data['title']));
$content = $trans->translate($this->SOURCE, $this->TARGETDE, strip_tags($data['content'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th']));
$content = $trans->translate($this->SOURCE, $this->TARGETDE, strip_tags($data['content'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th', 'iframe','section']));
$dataDe['title'] = $title;
$dataDe['content'] = $content;
}
......@@ -459,7 +459,7 @@ class PostController extends Controller
{
if($manual==1){
$dataSa['title'] = strip_tags($data['title_sa']);
$dataSa['content'] = strip_tags($data['content_sa'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th']);
$dataSa['content'] = strip_tags($data['content_sa'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th', 'iframe','section']);
}
else{
......@@ -469,7 +469,7 @@ class PostController extends Controller
$trans = new GoogleTranslate();
$title = $trans->translate($this->SOURCE, $this->TARGETSA, strip_tags($data['title']));
$content = $trans->translate($this->SOURCE, $this->TARGETSA, strip_tags($data['content'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th']));
$content = $trans->translate($this->SOURCE, $this->TARGETSA, strip_tags($data['content'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th', 'iframe','section']));
$dataSa['title'] = $title;
$dataSa['content'] = $content;
}
......@@ -480,7 +480,7 @@ class PostController extends Controller
{
if($manual==1){
$dataZh['title'] = strip_tags($data['title_zh']);
$dataZh['content'] = strip_tags($data['content_zh'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th']);
$dataZh['content'] = strip_tags($data['content_zh'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th', 'iframe','section']);
}
else{
if ($data['content'] == null) {
......@@ -489,7 +489,7 @@ class PostController extends Controller
$trans = new GoogleTranslate();
$title = $trans->translate($this->SOURCE, $this->TARGETZH, strip_tags($data['title']));
$content = $trans->translate($this->SOURCE, $this->TARGETZH, strip_tags($data['content'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th']));
$content = $trans->translate($this->SOURCE, $this->TARGETZH, strip_tags($data['content'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th', 'iframe','section']));
$dataZh['title'] = $title;
$dataZh['content'] = $content;
}
......
......@@ -104,11 +104,11 @@ class SliderController extends Controller
{
$request -> validate([
'title' => 'required',
'slider' => 'required|mimes:jpg,jpeg,png|max : 3072'
// 'slider' => 'required|mimes:jpg,jpeg,png|max : 3072'
], [
'title.required' => 'Nama slider wajib diisi',
// 'title.max' => 'Nama slider terlalu panjang',
'slider.required' => 'Gambar wajib diupload',
// 'slider.required' => 'Gambar wajib diupload',
'slider.mimes' => 'File yang diupload harus berupa JPG, JPEG, dan PNG',
'slider.max' => 'Ukuran gambar maksimal 3 MB'
]);
......
<?=
'<?xml version="1.0" encoding="UTF-8"?>'.PHP_EOL
?>
<rss version="2.0">
<channel>
<title>RSS {{$setting['web_title']}}</title>
<link>{{ url('') }}></link>
<description>RSS {{$setting['web_title']}}></description>
<language>{{ $setting['default_language'] }}</language>
<copyright>{{$setting['web_title']}}</copyright>
<lastBuildDate>{{ now() }}</lastBuildDate>
<generator>feed_domain ({{ $setting['email'] }})</generator>
@foreach($posts as $post)
<item>
<id>{{ $post->id }}</id>
<title>{{ $post->title }}</title>
<description>{{ strip_tags(($post->content)) }}</description>
<link>{{ url('post/'.$post['slug'])}}</link>
<pubDate>{{ $post->post_date }}</pubDate>
<image>{{ $setting['url_static'] . '/' . $setting['directory'] . '/thumbnail/' . $post->thumbnail }}</image>
<guid isPermaLink="false">{{ url('post/'.$post['slug']) }}</guid>
<kategori>{{ $post->rCategory->name }}</kategori>
<views>{{ $post->viewer }}</views>
</item>
@endforeach
</channel>
</rss>
......@@ -61,32 +61,32 @@
</ul>
</li>
@elseif($setting['layout_menu'] == 1)
<li class="dropdown"><a href="#" data-toggle="dropdown" class="dropdown-toggle">{!! $value->rDe->name !!} <div class="arrow-up"></div></a>
<li class="dropdown"><a href="#" data-toggle="dropdown" class="dropdown-toggle">@if ($value->rDe) {!! $value->rDe->name !!} @else {!! $value->name !!} @endif<div class="arrow-up"></div></a>
<ul class="dropdown-menu" role="menu">
@foreach ($menu as $valuec)
@if($valuec->parent == $value->id)
@if($valuec->url)
<li><a href="{!! url((string)$valuec->url) !!}">{!! $valuec->rDe->name !!}</a></li>
<li><a href="{!! url((string)$valuec->url) !!}">@if ($valuec->rDe) {!! $valuec->rDe->name !!} @else {!! $valuec->name !!} @endif</a></li>
@else
<li class="dropdown-submenu">
<b> <a href="#">{!! $valuec->name !!}</a> </b>
<b> <a href="#">@if ($valuec->rDe) {!! $valuec->rDe->name !!} @else {!! $valuec->name !!} @endif</a> </b>
<ul class="dropdown-menu">
@foreach ($menu as $valuec2)
@if($valuec2->parent == $valuec->id)
@if($valuec2->url)
<li><a href="{!! url((string)$valuec2->url) !!}">{!! $valuec2->rDe->name !!}</a></li>
<li><a href="{!! url((string)$valuec2->url) !!}">@if ($valuec2->rDe) {!! $valuec2->rDe->name !!} @else {!! $valuec2->name !!} @endif</a></li>
@else
<li class="dropdown-submenu">
<b> <a href="#">{!! $valuec2->rDe->name !!}</a></b>
<b> <a href="#">@if ($valuec2->rDe) {!! $valuec2->rDe->name !!} @else {!! $valuec2->name !!} @endif</a></b>
<ul class="dropdown-menu">
@foreach($menu as $valuec3)
@if($valuec3->parent == $valuec2->id)
<li><a href="{!! url((string)$valuec3->url) !!}" target="_blank">{!! $valuec3->rDe->name !!}</a></li>
<li><a href="{!! url((string)$valuec3->url) !!}" target="_blank">@if ($valuec3->rDe) {!! $valuec3->rDe->name !!} @else {!! $valuec3->name !!} @endif</a></li>
@endif
......
......@@ -61,12 +61,12 @@
</ul>
</li>
@elseif($setting['layout_menu'] == 1)
<li class="dropdown"><a href="#" data-toggle="dropdown" class="dropdown-toggle">{!! $value->rEn->name !!} <div class="arrow-up"></div></a>
<li class="dropdown"><a href="#" data-toggle="dropdown" class="dropdown-toggle">@if ($value->rEn) {!! $value->rEn->name !!} @else {!! $value->name !!} @endif<div class="arrow-up"></div></a>
<ul class="dropdown-menu" role="menu">
@foreach ($menu as $valuec)
@if($valuec->parent == $value->id)
@if($valuec->url)
<li><a href="{!! url((string)$valuec->url) !!}">{!! $valuec->rEn->name !!}</a></li>
<li><a href="{!! url((string)$valuec->url) !!}">@if ($valuec->rEn) {!! $valuec->rEn->name !!} @else {!! $valuec->name !!} @endif </a></li>
@else
<li class="dropdown-submenu">
<b> <a href="#">{!! $valuec->name !!}</a> </b>
......@@ -75,18 +75,18 @@
@if($valuec2->parent == $valuec->id)
@if($valuec2->url)
<li><a href="{!! url((string)$valuec2->url) !!}">{!! $valuec2->rEn->name !!}</a></li>
<li><a href="{!! url((string)$valuec2->url) !!}">@if ($valuec2->rEn) {!! $valuec2->rEn->name !!} @else {!! $valuec2->name !!} @endif </a></li>
@else
<li class="dropdown-submenu">
<b> <a href="#">{!! $valuec2->rEn->name !!}</a></b>
<b> <a href="#">@if ($valuec2->rEn) {!! $valuec2->rEn->name !!} @else {!! $valuec2->name !!} @endif</a></b>
<ul class="dropdown-menu">
@foreach($menu as $valuec3)
@if($valuec3->parent == $valuec2->id)
<li><a href="{!! url((string)$valuec3->url) !!}" target="_blank">{!! $valuec3->rEn->name !!}</a></li>
<li><a href="{!! url((string)$valuec3->url) !!}" target="_blank">@if ($valuec3->rEn) {!! $valuec3->rEn->name !!} @else {!! $valuec3->name !!} @endif</a></li>
@endif
......
......@@ -23,3 +23,4 @@ Route::post('/change-language', 'TranslateController@changeLocale')->name('langu
Route::get('/home', 'HomeController@index')->name('home');
Route::get('rss', 'RssFeedController@feed');
Route::get('rssnew', 'RssFeedNewController@feed');
// Route::get('cekrss', 'CekRssFeedController@cekRss');
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment