Post Reply 
Petition to improve the RSS feeds
May. 04, 2009, 06:50 PM (This post was last modified: Dec. 08, 2011 11:22 PM by Kye-U.)
Post: #16
RE: Petition to improve the RSS feeds
I realize that the MyBB author(s) have updated the select query in syndication.php. I'll be working on fixing it.

EDIT: Done (I believe). Please verify that the RSS feeds are functioning the way they were before the upgrade Smile!

Some notes for myself (and anyone who is interested in modifying MyBB):

In syndication.php:

After:
Code:
$unviewable = '';

Add:
Code:
$unviewable2 = '';

After:
Code:
$unviewable .= " AND fid NOT IN($unviewableforums)";

Add:
Code:
$unviewable2 .= " AND p.fid NOT IN($unviewableforums)";

After:
Code:
$unviewable .= " AND fid NOT IN($inactiveforums)";

Add:
Code:
$unviewable2 .= " AND p.fid NOT IN($inactiveforums)";

After:
Code:
$forumlist = "AND fid IN ($forum_ids) $unviewable";

Add:
Code:
$forumlist2 = "AND p.fid IN ($forum_ids) $unviewable2";

After:
Code:
$forumlist = $unviewable;

Add:
Code:
$forumlist2 = $unviewable2;

Comment out (add // at the beginning):
Code:
$query = $db->simple_select("threads", "subject, tid, dateline, firstpost", "visible='1' AND closed NOT LIKE 'moved|%' ".$forumlist, array('order_by' => 'dateline', 'order_dir' => 'DESC', 'limit' => $thread_limit));

Insert after:
Code:
$query = $db->query("
    SELECT t.tid, p.pid, t.subject
    FROM ".TABLE_PREFIX."posts p
    LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
    WHERE t.visible=1 AND t.closed NOT LIKE 'moved|%' ".$permsql." ".$forumlist2."
    ORDER BY p.pid DESC
    LIMIT 0,".$thread_limit
);

Remove (including the first comma):
Code:
,
"date" => $thread['dateline'],
"link" => $channel['link'].get_thread_link($thread['tid']),

Replace:
Code:
$firstposts[] = $thread['firstpost'];

With:
Code:
$firstposts[] = $thread['pid'];

Comment out:
Code:
$query = $db->simple_select("posts", "message, edittime, tid, fid", $firstpostlist, array('order_by' => 'dateline', 'order_dir' => 'desc'));

Insert after:
Code:
$query = $db->query("
        SELECT p.message, p.edittime, p.dateline, p.tid, p.pid, p.fid, u.username
        FROM ".TABLE_PREFIX."posts p
        LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid)
        WHERE ".$firstpostlist."
        ORDER BY p.pid DESC"
    );

Find:
Code:
$items[$post['tid']]['updated'] = $post['edittime'];

Add after:
Code:
$items[$post['tid']]['author'] = $post['username'];
$items[$post['tid']]['date'] = $post['dateline'];
$items[$post['tid']]['link'] = $channel['link'].get_thread_link($post['tid']).'&pid='.$post['pid'].'#pid'.$post['pid'];

And also follow through with the changes mentioned in Post #14.

Fix to make the Last Modified timestamp used as the date/time (if exists) in RSS:

In inc/class_feedgeneration, find:

Code:
$this->xml .= "\t\t\t<pubDate>".$item['date']."</pubDate>\n";

Replace with:

Code:
if($item['updated'])
                    {
                    $this->xml .= "\t\t\t<pubDate>".date("D, d M Y H:i:s O", $item['updated'])."</pubDate>\n";
                    } else {
                    $this->xml .= "\t\t\t<pubDate>".$item['date']."</pubDate>\n";
                    }
Visit this user's website
Add Thank You Quote this message in a reply
Post Reply 


Messages In This Thread
Petition to improve the RSS feeds - lnminente - Dec. 05, 2008, 07:26 PM
RE: Petition to improve the RSS feeds - Kye-U - Dec. 13, 2008, 09:56 PM
RE: Petition to improve the RSS feeds - Kye-U - Dec. 16, 2008, 03:10 AM
RE: Petition to improve the RSS feeds - Kye-U - Mar. 23, 2009, 02:30 AM
RE: Petition to improve the RSS feeds - Kye-U - May. 04, 2009 06:50 PM
RE: Petition to improve the RSS feeds - Kye-U - May. 04, 2009, 07:19 PM
RE: Petition to improve the RSS feeds - Kye-U - May. 04, 2009, 07:30 PM
RE: Petition to improve the RSS feeds - Kye-U - May. 04, 2009, 07:43 PM
RE: Petition to improve the RSS feeds - Kye-U - May. 04, 2009, 08:39 PM
RE: Petition to improve the RSS feeds - Kye-U - May. 07, 2009, 06:04 PM
RE: Petition to improve the RSS feeds - Kye-U - May. 07, 2009, 07:20 PM

Forum Jump: