I write RSS feed for my Evil_Blog. Last version you can find in SVN. I never use RSS before and don't know how that must working correctly, but I already have problems with links to posts.
include_once(PHPWG_ROOT_PATH.'include/feedcreator.class.php'); $rss = new UniversalFeedCreator(); $rss->encoding=get_pwg_charset(); $rss->title = $conf['gallery_title']; $rss->link = get_root_url().'?/blog'; $rss->description = $page['evil_blog']['blog_description']; $result = pwg_query(" SELECT id, UNIX_TIMESTAMP(date) AS date, header, text FROM `".Evil_Blog_Table."` WHERE 1 ORDER BY `date` DESC "); while ($row = pwg_db_fetch_assoc($result)) { $item = new FeedItem(); $item->title = $row['header'].' '.date($page['evil_blog']['date_format'], $row['date']); $item->link = get_gallery_home_url().'?/blog/id/'.$row['id']; $item->description = $row['text']; $item->date = $row['date']; $item->descriptionHtmlSyndicated = true; $item->guid= sprintf('%s', $row['date']); $rss->addItem($item); } $fileName= PHPWG_ROOT_PATH.$conf['data_location'].'tmp'; mkgetdir($fileName); // just in case $fileName.='/evil_blog_feed.xml'; // send XML feed echo $rss->saveFeed('RSS2.0', $fileName, true);
My firefox can see each post, but can't get link to each post, it send me only to main rss link ($rss->link = get_root_url().'?/blog';). And on rss page titles don't have links. I do all like in your piwigo's code, but I don't understand what I do wrong. All looks like line $item->link = get_gallery_home_url().'?/blog/id/'.$row['id']; doing nothing.
PS. Released versions of Evil_Blog don't have different pages for each post. I download in SNV new version where each post has its own page.
Last edited by EvilKant (2012-11-20 10:33:01)
Offline
unfortunately the whole feedcreator class is quite old.
In your rss, there is no <link>?
Offline
Lol... I don't know what was that, but now all working. I think I was must restart firefox.
Offline