Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
webprofile-jwg2024
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Siti Aisah
webprofile-jwg2024
Commits
d7cf1a29
Commit
d7cf1a29
authored
Jan 31, 2023
by
Bagus Pambudi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://git.unesa.ac.id/bagus/webprofile-singlesite-5bahasa
parents
e5b1b302
e77b160c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
6 deletions
+33
-6
app/Http/Controllers/RssFeedNewController.php
+4
-6
resources/views/rss/feednew.blade.php
+28
-0
routes/web.php
+1
-0
No files found.
app/Http/Controllers/RssFeedNewController.php
View file @
d7cf1a29
...
...
@@ -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'
);
}
}
resources/views/rss/feednew.blade.php
0 → 100644
View file @
d7cf1a29
<?=
'<?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>
routes/web.php
View file @
d7cf1a29
...
...
@@ -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');
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment