As bugs are reported I will post them here. This bug log is effective with Version 1.1.
| Bug Found in Version |
Severity |
Date |
Issue and Fix |
for phpBB 3
The bug log for phpBB3 Smartfeed is contained in my support forum. I recommend subscribing to it as a newsfeed (RSS 2.0, RSS 1.0, Atom). |
for phpBB 2
Any new bugs for phpBB2 Smartfeed will be posted in my support forum. I recommend subscribing to it as a newsfeed (RSS 2.0, RSS 1.0, Atom). |
| 1.12 |
Minor |
4/20/2008 |
Several users have noted that in their language Smartfeed renders unintelligible characters, or nothing at all. I think this is related to the early version of the feedcreator.class.php file I used, which is in the /includes folder.
Try changing line 626 from:
var $encoding = "ISO-8859-1";
to:
var $encoding = "UTF-8";
I notice in the version of the class I am using for phpBB 3, UTF-8 is the default. |
| 1.12 |
Critical |
11/2/2007 |
The phpBB mod team is concerned that the encryption algorithm I chose is too basic and thus could be cracked. It is best not to get into details and I am aware of no one who has actually had a security issue, however you need to be aware of this vulnerability.
I have released a version 1.2 that I believe addresses this issue. However, it is still undergoing formal testing. It will likely undergo more changes. You are welcome to download and install it but make sure you backup your files so you can rever to the earlier version if necessary. And please send me any feedback you have so I can improve it. |
| 1.11 |
Minor |
7/5/2007 |
Reported by graham from snowheads.com. In certain cases using the first posts options you may think you will be getting more posts in the feed than you will actually get. This case is unusual but if it happens it is misleading. I classify this bug as minor.
I will release a new version soon that will incorporate this bug fix as well as others since 1.11 was released, as well as hopefully an improved Spanish translation.
All changes are to smartfeed.php.
Replace lines 464-468 which are:
-
if (($first_post_only <> 0) && ($first_post_only <>1))
{
// Bad firstpostonly value, trigger error
$error_msg = $lang['smartfeed_first_post_only_error'];
$error = true;
with:
-
$first_post_only_str = '';
if ($first_post_only <> 0)
{
if ($first_post_only <>1)
{
// Bad firstpostonly value, trigger error
$error_msg = $lang['smartfeed_first_post_only_error'];
$error = true;
}
else
{
$first_post_only_str = ' AND t.topic_first_post_id = p.post_id';
}
Replace lines 863 which is:
-
f.cat_id = c.cat_id AND t.topic_id = p.topic_id AND p.post_id = pt.post_id AND p.poster_id = u.user_id ' . $removemine_str . $limit_text_str . $fetched_forums_str . $topics_only_str . '
with:
-
f.cat_id = c.cat_id AND t.topic_id = p.topic_id AND p.post_id = pt.post_id AND p.poster_id = u.user_id ' . $removemine_str . $limit_text_str . $fetched_forums_str . $topics_only_str . $first_post_only_str . '
The next change is large, but essentially you are removing some unneeded logic (it is handled by the SQL), which means you have to unident to make it look pretty. Replace lines 911-1035 which are:
// Do not publish item if new topics_only, first post only was selected and post is not the first post for the topic
if (!($topics_only && $first_post_only && !$first_post_for_topic))
{
$item->link = SMARTFEED_SITE_URL . 'viewtopic.' . $phpEx . '?' . POST_POST_URL . '=' . $row['post_id'] . '#' . $row['post_id'];
// This logic ensures the time shown for each item in the newsfeed reflects the time in the timezone based on the users phpBB profile.
// Post times are stored in the database in UT (GMT), so for the feeds to show accurately time must be offset from UT/GMT
$item->date = $row['post_time'] + ($user_timezone * 3600);
$item->pubDate = $row['post_time'] + ($user_timezone * 3600);
$item->source = SMARTFEED_SITE_URL;
$item->category = $row['cat_title'];
$item->guid = $item->link;
$item->descriptionHtmlSyndicated = true;
$item->comments = SMARTFEED_SITE_URL . 'posting.' . $phpEx . '?mode=reply&t=' . $row['topic_id'];
if (($feed_type==SMARTFEED_RSS_091_VALUE) || ($feed_type==SMARTFEED_RSS_20_VALUE)) // RSS 0.91 and 2.0 requires an email field to validate. Use a fake email address set in smartfeed_constants.php unless in user profile it says it is okay to show email address.
{
$row['username'] = ($row['username'] == 'Anonymous') ? $row['post_username'] : $row['username'];
$row['username'] = ($row['username'] == '') ? $lang['Guest'] : $row['username'];
$item->author = (($row['user_viewemail'] == '1') && ((SMARTFEED_PRIVACY_MODE == false) || $phpBB_forum_user)) ? $row['user_email'] . ' (' . $row['username'] . ')' : SMARTFEED_FAKE_EMAIL . ' (' . $row['username'] . ')';
}
else
{
$row['username'] = ($row['username'] == 'Anonymous') ? $row['post_username'] : $row['username'];
$row['username'] = ($row['username'] == '') ? $lang['Guest'] : $row['username'];
$item->author = $row['username'];
}
// Begin: The following code minimally modified from viewtopic.php (2.0.22). That's why it works!
$post_text = convert_encoding($row['post_text']);
$bbcode_uid = $row['bbcode_uid'];
$user_sig = ( $row['enable_sig'] && $row['user_sig'] != '' && $board_config['allow_sig'] && ((SMARTFEED_PRIVACY_MODE == false) || $phpBB_forum_user) ) ? $row['user_sig'] : '';
$user_sig = convert_encoding($user_sig);
$user_sig_bbcode_uid = $row['user_sig_bbcode_uid'];
//
// Note! The order used for parsing the message _is_ important, moving things around could break any
// output
//
//
// If the board has HTML off but the post has HTML
// on then we process it, else leave it alone
//
if ( !$board_config['allow_html'] || !$row['user_allowhtml'])
{
if ( $user_sig != '' )
{
$user_sig = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\2>", $user_sig);
}
if ( $row['enable_html'] )
{
$post_text = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\2>", $post_text);
}
}
//
// Parse message and/or sig for BBCode if reqd
//
if ($user_sig != '' && $user_sig_bbcode_uid != '')
{
$user_sig = ($board_config['allow_bbcode']) ? bbencode_second_pass($user_sig, $user_sig_bbcode_uid) : preg_replace("/\:$user_sig_bbcode_uid/si", '', $user_sig);
}
if ($bbcode_uid != '')
{
$post_text = ($board_config['allow_bbcode']) ? bbencode_second_pass($post_text, $bbcode_uid) : preg_replace("/\:$bbcode_uid/si", '', $post_text);
}
if ( $user_sig != '' )
{
$user_sig = '<br />_________________<br />' . make_clickable($user_sig);
}
//
// Parse smilies
//
if ( $board_config['allow_smilies'] )
{
if ( $row['user_allowsmile'] && $user_sig != '' )
{
$user_sig = smilies_pass_smartfeed($user_sig);
}
if ( $row['enable_smilies'] )
{
$post_text = smilies_pass_smartfeed($post_text);
}
}
$post_text = make_clickable($post_text . $user_sig);
// End: The following code minimally modified from viewtopic.php
$post_text = preg_replace('/\\n/', '<br />', $post_text);
$item->link = SMARTFEED_SITE_URL . 'viewtopic.' . $phpEx . '?' . POST_POST_URL . '=' . $row['post_id'] . '#' . $row['post_id'];
// Limit size of post text, if requested
$post_text = ($max_word_size <> $lang['smartfeed_max_words_wanted']) ? truncate_words($post_text, $max_word_size) : $post_text;
$item->description = entity_decode($post_text);
$rss->addItem($item); // Add this post to the feed
$item_count++;
// Place an ad inside the feed ever X items, if so enabled
if ($display_ads && $smartfeed_ads->enable_block_2 && ($item_count % $smartfeed_ads->block_2_num_items_to_skip == 0) && !(($smartfeed_ads->show_ads_to_public_only == true) && $phpBB_forum_user))
{
// Place an ad at the middle of the feed
$item = new FeedItem();
$item->title = entity_decode($lang['smartfeed_ad_feed_category'] . ': ' . $smartfeed_ads->block_2_title);
$item->link = entity_decode($smartfeed_ads->block_2_link);
$item->description = entity_decode($smartfeed_ads->block_2_desc);
$item->descriptionHtmlSyndicated = true;
$item->category = entity_decode($lang['smartfeed_ad_feed_category']);
$item->source = SMARTFEED_SITE_URL;
$item->guid = $item->link;
$item->date = time();
$item->pubDate = time();
$rss->addItem($item);
}
}
with:
-
$item->link = SMARTFEED_SITE_URL . 'viewtopic.' . $phpEx . '?' . POST_POST_URL . '=' . $row['post_id'] . '#' . $row['post_id'];
// This logic ensures the time shown for each item in the newsfeed reflects the time in the timezone based on the users phpBB profile.
// Post times are stored in the database in UT (GMT), so for the feeds to show accurately time must be offset from UT/GMT
$item->date = $row['post_time'] + ($user_timezone * 3600);
$item->pubDate = $row['post_time'] + ($user_timezone * 3600);
$item->source = SMARTFEED_SITE_URL;
$item->category = $row['cat_title'];
$item->guid = $item->link;
$item->descriptionHtmlSyndicated = true;
$item->comments = SMARTFEED_SITE_URL . 'posting.' . $phpEx . '?mode=reply&t=' . $row['topic_id'];
if (($feed_type==SMARTFEED_RSS_091_VALUE) || ($feed_type==SMARTFEED_RSS_20_VALUE)) // RSS 0.91 and 2.0 requires an email field to validate. Use a fake email address set in smartfeed_constants.php unless in user profile it says it is okay to show email address.
{
$row['username'] = ($row['username'] == 'Anonymous') ? $row['post_username'] : $row['username'];
$row['username'] = ($row['username'] == '') ? $lang['Guest'] : $row['username'];
$item->author = (($row['user_viewemail'] == '1') && ((SMARTFEED_PRIVACY_MODE == false) || $phpBB_forum_user)) ? $row['user_email'] . ' (' . $row['username'] . ')' : SMARTFEED_FAKE_EMAIL . ' (' . $row['username'] . ')';
}
else
{
$row['username'] = ($row['username'] == 'Anonymous') ? $row['post_username'] : $row['username'];
$row['username'] = ($row['username'] == '') ? $lang['Guest'] : $row['username'];
$item->author = $row['username'];
}
// Begin: The following code minimally modified from viewtopic.php (2.0.22). That's why it works!
$post_text = convert_encoding($row['post_text']);
$bbcode_uid = $row['bbcode_uid'];
$user_sig = ( $row['enable_sig'] && $row['user_sig'] != '' && $board_config['allow_sig'] && ((SMARTFEED_PRIVACY_MODE == false) || $phpBB_forum_user) ) ? $row['user_sig'] : '';
$user_sig = convert_encoding($user_sig);
$user_sig_bbcode_uid = $row['user_sig_bbcode_uid'];
//
// Note! The order used for parsing the message _is_ important, moving things around could break any
// output
//
//
// If the board has HTML off but the post has HTML
// on then we process it, else leave it alone
//
if ( !$board_config['allow_html'] || !$row['user_allowhtml'])
{
if ( $user_sig != '' )
{
$user_sig = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\2>", $user_sig);
}
if ( $row['enable_html'] )
{
$post_text = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\2>", $post_text);
}
}
//
// Parse message and/or sig for BBCode if reqd
//
if ($user_sig != '' && $user_sig_bbcode_uid != '')
{
$user_sig = ($board_config['allow_bbcode']) ? bbencode_second_pass($user_sig, $user_sig_bbcode_uid) : preg_replace("/\:$user_sig_bbcode_uid/si", '', $user_sig);
}
if ($bbcode_uid != '')
{
$post_text = ($board_config['allow_bbcode']) ? bbencode_second_pass($post_text, $bbcode_uid) : preg_replace("/\:$bbcode_uid/si", '', $post_text);
}
if ( $user_sig != '' )
{
$user_sig = '<br />_________________<br />' . make_clickable($user_sig);
}
//
// Parse smilies
//
if ( $board_config['allow_smilies'] )
{
if ( $row['user_allowsmile'] && $user_sig != '' )
{
$user_sig = smilies_pass_smartfeed($user_sig);
}
if ( $row['enable_smilies'] )
{
$post_text = smilies_pass_smartfeed($post_text);
}
}
$post_text = make_clickable($post_text . $user_sig);
// End: The following code minimally modified from viewtopic.php
$post_text = preg_replace('/\\n/', '<br />', $post_text);
$item->link = SMARTFEED_SITE_URL . 'viewtopic.' . $phpEx . '?' . POST_POST_URL . '=' . $row['post_id'] . '#' . $row['post_id'];
// Limit size of post text, if requested
$post_text = ($max_word_size <> $lang['smartfeed_max_words_wanted']) ? truncate_words($post_text, $max_word_size) : $post_text;
$item->description = entity_decode($post_text);
$rss->addItem($item); // Add this post to the feed
$item_count++;
// Place an ad inside the feed ever X items, if so enabled
if ($display_ads && $smartfeed_ads->enable_block_2 && ($item_count % $smartfeed_ads->block_2_num_items_to_skip == 0) && !(($smartfeed_ads->show_ads_to_public_only == true) && $phpBB_forum_user))
{
// Place an ad at the middle of the feed
$item = new FeedItem();
$item->title = entity_decode($lang['smartfeed_ad_feed_category'] . ': ' . $smartfeed_ads->block_2_title);
$item->link = entity_decode($smartfeed_ads->block_2_link);
$item->description = entity_decode($smartfeed_ads->block_2_desc);
$item->descriptionHtmlSyndicated = true;
$item->category = entity_decode($lang['smartfeed_ad_feed_category']);
$item->source = SMARTFEED_SITE_URL;
$item->guid = $item->link;
$item->date = time();
$item->pubDate = time();
$rss->addItem($item);
}
|
| 1.11 |
Minor |
7/4/2007 |
Reported by graham from snowheads.com
This improves the usability of copying and pasting the URL generated by smartfeed_url.php by selecting the field when you focus on it.
In /templates/subSilver/smartfeed_url_body.tpl replace line 580:
<td colspan="2" align="center" class="row1" style="padding: 5px;"><span class="gen"><input type="text" name="url" id="url" size="120" maxlength="3000" class="post" /></span></td>
with:
<td colspan="2" align="center" class="row1" style="padding: 5px;"><span class="gen"><input type="text" name="url" id="url" size="120" maxlength="3000" class="post" onfocus="this.select();" /></span></td>
|
| 1.11 |
Minor |
6/29/2007 |
Reported by scott_thewspot. This bug affects site using MS SQL Server and may affect users of other database management systems. It does not appear to bother MySQL at all since that was my test bed. Note that the new code is more syntactically correct than the old code:
To fix replace lines 579-585 in smartfeed.php, which are:
// If no new posts since the last fetch, return a 304 HTTP code. No point in regenerating a potentially very long newsfeed! $sql = "SELECT max(p.post_time) AS Last_Post_Timestamp FROM " . POSTS_TABLE . ' lp, ' . FORUMS_TABLE . ' f, ' . TOPICS_TABLE . ' t, ' . CATEGORIES_TABLE . ' c, ' . POSTS_TABLE . ' p, ' . POSTS_TEXT_TABLE . ' pt, ' . USERS_TABLE . ' u WHERE lp.post_id = t.topic_last_post_id AND f.forum_id = t.forum_id AND f.cat_id = c.cat_id AND t.topic_id = p.topic_id AND p.post_id = pt.post_id AND p.poster_id = u.user_id ' . $removemine_str . $limit_text_str . $fetched_forums_str . $topics_only_str . ' ORDER BY ' . $order_by_str . $limit_str; with:
// If no new posts since the last fetch, return a 304 HTTP code. No point in regenerating a potentially very long newsfeed! $sql = "SELECT max(p.post_time) AS Last_Post_Timestamp FROM " . POSTS_TABLE . ' lp, ' . FORUMS_TABLE . ' f, ' . TOPICS_TABLE . ' t, ' . CATEGORIES_TABLE . ' c, ' . POSTS_TABLE . ' p, ' . POSTS_TEXT_TABLE . ' pt, ' . USERS_TABLE . ' u WHERE lp.post_id = t.topic_last_post_id AND f.forum_id = t.forum_id AND f.cat_id = c.cat_id AND t.topic_id = p.topic_id AND p.post_id = pt.post_id AND p.poster_id = u.user_id ' . $removemine_str . $limit_text_str . $fetched_forums_str . $topics_only_str ; |
| 1.11 |
Serious |
5/12/2007 |
This bug is serious only if you have granted special forum permissions to private forums to individual users outside of the phpBB user group system. In this case users cannot select these forums in their feed, nor will they show in the feed.
This is fairly easy to correct.
In lang_smartfeed.php change line 92 to:
$lang['smartfeed_auth_acl_text']='<i>(Special Access Only)</i>';
In smartfeed_url.php change line 123 to:
AND a.group_id = ug.group_id AND ug.group_id = g.group_id AND
In smartfeed.php change line 247 to:
AND a.group_id = ug.group_id AND ug.group_id = g.group_id AND |
| 1.1 |
Minor |
2/24/2007 |
A minor bug was found by a user that applies only to version 1.1. If your instance of PHP was not compiled with mbstring, then the convert_encoding function will fail, and the feed will not generate, giving a parser error.
This will be fixed in the next version. In the meanwhile you can change line 1278 in smartfeed.php to this if you get this error:
| Code: |
if (ini_get('mbstring') == '') |
|
| 1.1 |
Serious |
2/19/2007 |
If all your forums are restricted from public viewing, then Smartfeed may return some posts in the feed for non-registered (public) users. What should happen is that the feed should generate, but be blank.
To fix, in smartfeed_php starting around line 569 replace:
| Code: |
if (!$error)
{
// If no new posts since the last fetch, return a 304 HTTP code. No point in regenerating a potentially very long newsfeed!
$sql = "SELECT max(p.post_time) AS 'Last Post Timestamp'
FROM " . POSTS_TABLE . ' lp, ' . FORUMS_TABLE . ' f, ' . TOPICS_TABLE . ' t, ' . CATEGORIES_TABLE . ' c, ' . POSTS_TABLE . ' p, ' . POSTS_TEXT_TABLE . ' pt, ' . USERS_TABLE . ' u
WHERE lp.post_id = t.topic_last_post_id AND f.forum_id = t.forum_id AND
f.cat_id = c.cat_id AND t.topic_id = p.topic_id AND p.post_id = pt.post_id AND p.poster_id = u.user_id ' . $removemine_str . $limit_text_str . $fetched_forums_str . $topics_only_str . '
ORDER BY ' . $order_by_str . $limit_str;
if ( !($result = $db->sql_query($sql)))
{
$error_msg = $lang['smartfeed_retrieve_error'];
$error = true;
}
else
{
$last_timestamp = $row['Last Post Timestamp'];
doConditionalGet($last_timestamp); // Program may exit if no new content, returning 304 HTTP code
}
} |
with:
| Code: |
if (!$error)
{
if ($fetched_forums_str <> '')
{
// If no new posts since the last fetch, return a 304 HTTP code. No point in regenerating a potentially very long newsfeed!
$sql = "SELECT max(p.post_time) AS 'Last Post Timestamp'
FROM " . POSTS_TABLE . ' lp, ' . FORUMS_TABLE . ' f, ' . TOPICS_TABLE . ' t, ' . CATEGORIES_TABLE . ' c, ' . POSTS_TABLE . ' p, ' . POSTS_TEXT_TABLE . ' pt, ' . USERS_TABLE . ' u
WHERE lp.post_id = t.topic_last_post_id AND f.forum_id = t.forum_id AND
f.cat_id = c.cat_id AND t.topic_id = p.topic_id AND p.post_id = pt.post_id AND p.poster_id = u.user_id ' . $removemine_str . $limit_text_str . $fetched_forums_str . $topics_only_str . '
ORDER BY ' . $order_by_str . $limit_str;
if ( !($result = $db->sql_query($sql)))
{
$error_msg = $lang['smartfeed_retrieve_error'];
$error = true;
}
else
{
$last_timestamp = $row['Last Post Timestamp'];
doConditionalGet($last_timestamp); // Program may exit if no new content, returning 304 HTTP code
}
}
} |
and starting near line 865 replace this line:
| Code: |
while ($row = $db->sql_fetchrow ($result)) |
with:
| Code: |
while (($row = $db->sql_fetchrow ($result)) && ($fetched_forums_str <> '')) |
Thanks to calebsg for reporting this. |
| 1.1 |
Trivial |
1/19/2007 |
Here's another tiny bug reported by Sylvain Bourdoun. The ad at the bottom of the newsfeed does not carry the current date with the ad, like the others. If it bothers you, around line 1049 you will see:
$item->guid = $item->link;
After, add:
$item->date = time();
$item->pubDate = time(); |
| 1.1 |
Minor |
1/18/2007 |
Here is a non-critical bug to 1.1 you might want to fix. It allowed a guest to see and select from member only forums in smartfeed_url.php. While they can select from forums they cannot actually read, they will not actually appear in the feed.
Thanks to Sylvain Bourdon for reporting this.
Starting at line 64 in smartfeed_url.php replace:
// This logic ensures that those with special privileges (moderators, administrators) always see forums where they have read permissions
switch($userdata['user_level'])
{
case USER:
// Retrieve a list of forum_ids that all members can access
$sql = 'SELECT f.forum_id, f.forum_name, c.cat_order, f.forum_order, f.auth_read
FROM ' . FORUMS_TABLE . ' f, ' . CATEGORIES_TABLE . ' c
WHERE f.cat_id = c.cat_id AND auth_read IN (' . AUTH_ALL . ',' . AUTH_REG .')
ORDER BY c.cat_order, f.forum_order';
break;
case MOD:
$sql = 'SELECT f.forum_id, f.forum_name, c.cat_order, f.forum_order, f.auth_read
FROM ' . FORUMS_TABLE . ' f, ' . CATEGORIES_TABLE . ' c
WHERE f.cat_id = c.cat_id AND auth_read IN (' . AUTH_ALL . ',' . AUTH_REG . ',' . AUTH_MOD .')
ORDER BY c.cat_order, f.forum_order';
break;
case ADMIN:
$sql = 'SELECT f.forum_id, f.forum_name, c.cat_order, f.forum_order, f.auth_read
FROM ' . FORUMS_TABLE . ' f, ' . CATEGORIES_TABLE . ' c
WHERE f.cat_id = c.cat_id
ORDER BY c.cat_order, f.forum_order';
break;
}
with:
// This logic ensures that those with special privileges (moderators, administrators) always see forums where they have read permissions
$auth_restrict = ($userdata['session_user_id'] <> ANONYMOUS) ? AUTH_ALL . ',' . AUTH_REG : AUTH_ALL;
switch($userdata['user_level'])
{
case USER:
// Retrieve a list of forum_ids that all members can access
$sql = 'SELECT f.forum_id, f.forum_name, c.cat_order, f.forum_order, f.auth_read
FROM ' . FORUMS_TABLE . ' f, ' . CATEGORIES_TABLE . ' c
WHERE f.cat_id = c.cat_id AND auth_read IN (' . $auth_restrict .')
ORDER BY c.cat_order, f.forum_order';
break;
case MOD:
$sql = 'SELECT f.forum_id, f.forum_name, c.cat_order, f.forum_order, f.auth_read
FROM ' . FORUMS_TABLE . ' f, ' . CATEGORIES_TABLE . ' c
WHERE f.cat_id = c.cat_id AND auth_read IN (' . $auth_restrict . ',' . AUTH_MOD .')
ORDER BY c.cat_order, f.forum_order';
break;
case ADMIN:
$sql = 'SELECT f.forum_id, f.forum_name, c.cat_order, f.forum_order, f.auth_read
FROM ' . FORUMS_TABLE . ' f, ' . CATEGORIES_TABLE . ' c
WHERE f.cat_id = c.cat_id
ORDER BY c.cat_order, f.forum_order';
break;
}
|