Image Not Showing In Feedburner (Bugs)

by pawnindia ⌂ @, Thursday, February 19, 2015, 05:53 (1992 days ago)

Image Not Showing In Feedburner

[image]

Any Solution To Fix This Issue

Avatar

Image Not Showing In Feedburner

by Auge ⌂ @, Thursday, February 19, 2015, 11:59 (1992 days ago) @ pawnindia

Hello

Image Not Showing In Feedburner

[image]

Any Solution To Fix This Issue

Is this a question?

I don't know the details about generating the RSS-feed in this script, but not-showing Images smells like relative URLs for the source attributes of image elements and this alone breaks the feed in some readers. Maybe the script generates relative URLs and feedburner therefore is unable to load the images. Remember: at this point this is a speculation. It needs a review of the relevant parts of the code.

Tschö, Auge

--
Trenne niemals Müll, denn er hat nur eine Silbe!

Image Not Showing In Feedburner

by pawnindia ⌂ @, Sunday, March 01, 2015, 14:11 (1982 days ago) @ Auge

thanks for the reply
plz fix this bug

Avatar

relative image path in RSS feed

by Mardor ⌂, Monday, May 20, 2019, 10:48 (441 days ago) @ Auge

It's a bit late, but I just noticed that I have the same problem.

The RSS feeds produced by rss.inc.php (at least up to version 2.4.11) includes image URLs as relative paths. They should become prefixed by the forum_address setting instead.

I added the following line 54 in rss.inc.php:

$rss_items[$i]['text'] = str_replace('src="images', 'src="'.$settings['forum_address'].'images', $rss_items[$i]['text']);

It's a bad hack and there should be a more adequate way to do this, so I would appreciate to receive a comment about a better solution.

regards
Martin

Avatar

relative image path in RSS feed

by Auge ⌂ @, Monday, May 20, 2019, 12:17 (441 days ago) @ Mardor

Hello

The RSS feeds produced by rss.inc.php (at least up to version 2.4.11) includes image URLs as relative paths. They should become prefixed by the forum_address setting instead.

Yes, that's true. At the time pawnindia brought this up, I thought about a solution for this issue. Either we could remove the images from the feed or we could add the necessary informations to genererate an absolute URL for the images. But at that time I was not a member of the team and with the time the issue disappeared from my sight.

I added the following line 54 in rss.inc.php:

$rss_items[$i]['text'] = str_replace('src="images', 'src="'.$settings['forum_address'].'images', $rss_items[$i]['text']);

It's a bad hack …

No, it isn't. Adding $settings['forum_address'] to the string for the src-attribute is correct but the way you does it, looks a bit hacky. But that is only the look of the code.

The relevant code of version 2.4.11 beginning with line #44:

 
while ($row = mysqli_fetch_array($result)) {
  if ($row['pid'] != 0) $rss_items[$i]['reply'] = true;
  if ($row['cache_text'] == '') {
    $rss_items[$i]['text'] = html_format($row['text']);
    @mysqli_query($connid, "DELETE FROM ".$db_settings['entry_cache_table']." WHERE cache_id = ". intval($row['id']));
    @mysqli_query($connid, "INSERT INTO ".$db_settings['entry_cache_table']." (cache_id, cache_text) VALUES (". intval($row['id']) .",'". mysqli_real_escape_string($connid, $rss_items[$i]['text']) ."')");
  } else {
    $rss_items[$i]['text'] = $row['cache_text'];
  }
  $rss_items[$i]['title'] = htmlspecialchars(filter_control_characters($row['subject'])); // this is line #54
  /* ... */
 

If you inserted your line of code in front of the last shown line (#54), you will hit the posting text in every case. Is that the case?

… and there should be a more adequate way to do this, so I would appreciate to receive a comment about a better solution.

The entry is taken from the posting cache or from the posting table and in the latter case it is instantaneously formatted as HTML with $rss_items[$i]['text'] = html_format($row['text']);. The main purpose of the if-else-block beginning with if ($row['cache_text'] == '') is to unify the text resulting in the text in HTML-elements.

The alternatve to your solution would be to handle both cases separately inside the if-else-block but that would doubling the code and the case of the else-part (posting text from cache) is the same as in your solution. So it is IMHO better to replace the URL-string afterwards as you did.

If noone presents a better solution I will add your code to the repository. It will be part of the first open preview for My Little Forum 2.5 which will land in the public within the next days.

Tschö, Auge

--
Trenne niemals Müll, denn er hat nur eine Silbe!

RSS Feed of thread
powered by my little forum