Hi
I'm looking for a nice way to make a "diary" print-out of an image-heavy blog. Entries in ascending order and, naturally, with images.
After searching here for articles on blogpdf and hacking that, I've decided the best way would be to open the "export" RSS feed and print from that, either using an RSS->PDF service or printing directly from an RSS reader.
Only one problem: on the blog, and understandably also in the RSS feed, images are shown as thumbnails. In a printed document, they should be of the original quality.
So, I'm looking for the right place to tweak the PHP code so that I could show full-size images in the feed. Preferably only when calling rss.php with the "all" variable set, but any suggestions are welcome.
I know enough PHP to simply parse the ".serendipityThumb" part off of the image link, but not enough to follow where exactly rss.php calls to build it's content.
Thank you in advance for any pointers,
Petri
Tweaking RSS feed
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Tweaking RSS feed
Hi!
This might work with a trick like you mentioned: Create a custom smarty function that replaces the string '.serendipityThumb' with an empty string ''. Create that function in a config.inc.php file of your template:
In your feed*.tpl templates (copy them over from the default/ directory) you replace all occurences of {$entry.body} with:
The same with {$entry.extended}.
HTH,
Garvin
This might work with a trick like you mentioned: Create a custom smarty function that replaces the string '.serendipityThumb' with an empty string ''. Create that function in a config.inc.php file of your template:
Code: Select all
function replace_thumb($str) {
return str_replace('.serendipityThumb', '', $str);
}
$serendipity['smarty']->register_modifier('replace_thumb','replace_thumb');
Code: Select all
{$entry.body|replace_thumb}
HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Re: Tweaking RSS feed
Hello Garvin,
Thank you for the timely reply.
Just as I got your advice, I had found an ugly solution via editing my template's feed_2.0.tpl.php file, adding the str_replace there. It looks like it's working now, but I'll get to know the "smarty" concept tomorrow in hope of making it a bit prettier.
I went the dirty way since I was hoping to get this out of the way today, but when Serendipity started to co-operate, Safari (OS X browser/RSS reader)insists on showing RSS articles in reversed date order, no matter how they come out of the feed...
I'll just have to leave it 'till tomorrow.
Once again, thank you for the help, and even more, for the great software.
Petri
Thank you for the timely reply.
Just as I got your advice, I had found an ugly solution via editing my template's feed_2.0.tpl.php file, adding the str_replace there. It looks like it's working now, but I'll get to know the "smarty" concept tomorrow in hope of making it a bit prettier.
I went the dirty way since I was hoping to get this out of the way today, but when Serendipity started to co-operate, Safari (OS X browser/RSS reader)insists on showing RSS articles in reversed date order, no matter how they come out of the feed...
I'll just have to leave it 'till tomorrow.
Once again, thank you for the help, and even more, for the great software.
Petri
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Tweaking RSS feed
Hi!
Yeah, the str_replace way there is also not bad, I think you could leave it that way.
Hope you can solve the other issue - if not, don't hesitate to come back here
Have fun,
Garvin
Yeah, the str_replace way there is also not bad, I think you could leave it that way.
Hope you can solve the other issue - if not, don't hesitate to come back here
Have fun,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/