This commit is contained in:
merdan 2021-05-21 15:50:04 +05:00
parent 59deb3c2a4
commit bd89d906b9
2 changed files with 4 additions and 3 deletions

View File

@ -38,7 +38,7 @@ class postsController extends Controller
public function show($locale,$id){ public function show($locale,$id){
$post = $this->Post::find($id,['id','content_html']); $post = $this->Post::find($id,['id','content_html','author']);
if(!is_null($post)) { if(!is_null($post)) {
$obj = Db::table('vdomah_blogviews_views') $obj = Db::table('vdomah_blogviews_views')

View File

@ -86,9 +86,9 @@ class Plugin extends PluginBase
$fileContents .= "\t\t<item>\n" . $fileContents .= "\t\t<item>\n" .
"\t\t\t<title>" . htmlspecialchars($post->title, ENT_QUOTES, 'UTF-8') . "</title>\n" . "\t\t\t<title>" . htmlspecialchars($post->title, ENT_QUOTES, 'UTF-8') . "</title>\n" .
"\t\t\t<link>" . Settings::get('link') . Settings::get('postPage') . "/" . $post->slug . "</link>\n" . "\t\t\t<link>" . Settings::get('link') . Settings::get('postPage') . "/" . $post->slug . "</link>\n" .
"\t\t\t<guid>" . Settings::get('link') . Settings::get('postPage') . "/" . $post->slug . "</guid>\n" . "\t\t\t<guid isPermaLink='true''>" . Settings::get('link') . Settings::get('postPage') . "/" . $post->slug . "</guid>\n" .
"\t\t\t<pubDate>" . $published->format(DateTime::RFC2822) . "</pubDate>\n" . "\t\t\t<pubDate>" . $published->format(DateTime::RFC2822) . "</pubDate>\n" .
"\t\t\t<description>" . htmlspecialchars($description, ENT_QUOTES, 'UTF-8') . "</description>\n" . "\t\t\t<description><![CDATA[ " . htmlspecialchars($description, ENT_QUOTES, 'UTF-8') . " ]]></description>\n" .
"\t\t</item>\n"; "\t\t</item>\n";
} }
@ -104,6 +104,7 @@ class Plugin extends PluginBase
protected function loadPosts() protected function loadPosts()
{ {
$posts = Db::table('rainlab_blog_posts') $posts = Db::table('rainlab_blog_posts')
->select('id','title','slug','published_at','content','excerpt','featured_image')
->orderBy('published_at', 'desc') ->orderBy('published_at', 'desc')
->where('published', '=', '1') ->where('published', '=', '1')
->get(); ->get();