Browse Source

Fix blog RSS list page

leosw 7 months ago
parent
commit
2aa41e692d
2 changed files with 10 additions and 9 deletions
  1. 1
    0
      includes/config.example.php
  2. 9
    9
      views/d.blog.list.rss

+ 1
- 0
includes/config.example.php View File

@@ -15,6 +15,7 @@ $config['include_folder']=basename(__DIR__);
15 15
 $config['abs_root_folder']=str_replace($config['include_folder'],"",__DIR__);
16 16
 // This is the relative folder to the root of the website from the DocumentRoot (can also be called subfolder)
17 17
 $config['rel_root_folder']=str_replace($_SERVER['DOCUMENT_ROOT'],"",$config['abs_root_folder']);
18
+$config['web_root_folder']="kabano.test";
18 19
 if($config['rel_root_folder']=="") $config['rel_root_folder']="/";
19 20
 
20 21
 // Here all the absolute paths to specific folders

+ 9
- 9
views/d.blog.list.rss View File

@@ -14,25 +14,25 @@ echo ('<?xml version="1.0" encoding="UTF-8"?>'); ?>
14 14
 <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
15 15
 <channel>
16 16
 	<title>Kabano</title>
17
-	<link><?=$config['rel_root_folder']?></link>
18
-	<atom:link href="<?=$config['rel_root_folder']?>blog/rss" rel="self" type="application/rss+xml" />
17
+	<link><?=$config['web_root_folder']?></link>
18
+	<atom:link href="<?=$config['web_root_folder']?>blog/rss" rel="self" type="application/rss+xml" />
19 19
 	<description>L'actualité du blog officiel de Kabano : Plateforme collaborative de recensement de cabanes et refuges.</description>
20 20
 	<language>fr</language>
21 21
 	<image>
22
-		<url><?=$config['views_url']?>img/header_rss.svg</url>
22
+		<url><?=$config['web_root_folder']?>views/img/header_rss.svg</url>
23 23
 		<title>Kabano</title>
24
-		<link><?=$config['rel_root_folder']?></link>
24
+		<link><?=$config['web_root_folder']?></link>
25 25
 		<height>44</height>
26 26
 		<width>154</width>
27 27
 	</image>
28 28
 
29
-	<? foreach ($blogArticles_list as $row) { ?>
29
+	<? foreach ($blogArticles->objs as $row) { ?>
30 30
 
31 31
 		<item>
32
-			<title><?=$row->title?></title>
33
-			<link><?=$config['rel_root_folder']?>blog/<?=$row->url?></link>
34
-			<guid><?=$config['rel_root_folder']?>blog/<?=$row->url?></guid>
35
-			<pubDate><?=$row->lastedit?></pubDate>
32
+			<title><?=$row->name?></title>
33
+			<link><?=$config['web_root_folder']?>blog/<?=$row->permalink?></link>
34
+			<guid><?=$config['web_root_folder']?>blog/<?=$row->permalink?></guid>
35
+			<pubDate><?=gmdate(DATE_RFC822, strtotime($row->update_date))?></pubDate>
36 36
 			<description><![CDATA[
37 37
 				<?=$row->content_html?>
38 38
 				]]></description>

Loading…
Cancel
Save