Show Recent Posts 2, a RapidWeaver snippet

The “Show Recent Posts 2″ snippet is a cute little implementation of SimplePie RSS parser designed with RapidWeaver in mind. “Show Recent Posts 2″ allows you to do just that, show your most recent blog posts on any other page (aside from you blog page of course), while maintaining some of your blogs original formating. This version also includes the function for controlling the length of the posts. “Show Recent Posts 2″ can be used in your main content area, in your sidebar, or where ever you think it would fit. You can get a copy here: showrecentposts2.zip
And for those looking for further assistance, please see this tutorial here.


I can't get this snippet to work, this is what I get:
'; echo '
'; echo ''; echo $item->get_title() . ''; echo '
'; echo '
' . $item->get_date('j M Y') . '
'; echo '
'; echo shortdesc($item->get_description(), 150); echo ''; echo 'Lees verder.' . ''; echo '
You haven’t followed all the directions. Also, it can’t be previewed in RapidWeaver, only live on a web server.
Well, if you can tell me where I went wrong … I’ll pay you a beer:
http://www.flyingdutchman.info/index.html
Yes you didn't mark your code with "Format > Ignore Formatting"
Sorry, no beer.
I tried both using HTML (sidebar) and Styled with ‘Ignrore Formatting’. Both don’t work.
I tested the server config, that’s OK. And the simplepie.inc file is on the server too …
B.
Tell me I’m wrong all you like,
but I can tell by looking at the source code that RapidWeaver is treating it like rich text and and not PHP code. Otherwise I wouldn’t see the PHP code there. You need to make sure you paste it in as plain text and make sure formatting is turned off.
I have the same problem as Bert.
The Page I use is HTML so I guess it should work , but it doesn't.
I'm very curious how this got solved, because I see on Bert's link that it's working there.
@David, do you have a link?
Hi Adam,
It's http://www.kaspi.tv
I applied it to the page called 'samenvatting'.
And a page calle 'test', a styled text page.
Made an invisible cache page (styled text page).
And the 'samenvatting' page is is a HTML page.
Changed the index to php, but that doesn't seem to do anything.
I also applied it to the homepage, a stacks page, that also has the RSS stack applied. It works, but that looks to much like a Google ad to me..:)
Maybe it has to do with the cache page, in your manual, you write it should be 'inline' with the page. What do you mean by that?
@David it looks like everything is fine on your end, you just haven't specified a proper feed URL. Follow the exact (I can't stress "exact" enough) directions, step-by-step, as they really are the only directions I can provide.
Hi Adam, thanks for your quick reply. Because in the snippet the URL ends with .php, I thought my feed address wasn't correct, because it ends with .xml.
I thought, I'd try it first with the standard feed you provided.
I've entered the correct URL and on the HTML page it seems to work (yippeee), but the styled text still looks the same.
Is there any way I can include the pictures too?
@David as I have mentioned in earlier comments, you need to paste the code in as plain text (see RapidWeaver Edit menu) and you need to mark it as "Ignore Formatting" (see RapidWeaver Format menu).
Hello Adam, after a few hours of trying, still no result.
You were right the first time,I just checked Clear formatting, so there I went wrong.
But now my styled text page is completely blank, even no theme, and the background of my homepage is disappeared causing my extra content container to look funy.
The harder it gets, the more I'm determined to solve this. Especially the feed looks fantastic on
http://simplepie.org/demo/?feed=http%3A%2F%2Fwww.kaspi.tv%2Fblog%2Ffiles%2Fblog.xml
Seems it's gonna be a loong night.. (I live in Amsterdam, The Netherlands)
I followed all the instructions; Pasted the text as plane style.
The background of the Edit window is red, indicating that Formatting is Ignored.
http://www.kaspi.tv
and
http://www.kaspi.tv/styledtext
both have the simplepie.inc in the assets window of the Page Info
I just switched from iWeb to Rapidweaver, and this is my fist big web-project, so kind of new to all of this coding.
The rest of my site was quite easy, but I don't seem to get my head wrapped around this one.
Not sure if this helps, but I get the same problem with contact form.
Strange code in my input fields.
The index I've changed to .php.
that was me, the Anonymous.
sorry, forgot to fill in my name
Hi Adam,
It seems that I got it finally to work.
Is there any way that I also can display the pictures in the list?
@David pictures are stripped out due to the fact that code required to display images would completely take up the character count and more.
Hi Adam,
I've read the instructions, and the comments here, but I'm having troubles. What have I done wrong?
http://www.vincentiasailingclub.com.au/index1.html
I have the cache page as a child of this page
php only works on pages with a php extension.
I put this on the homepage of my site hoping to show up posts from my own blog but though it will work with any other feed address I try it won’t work with mine. my feed address is feed://wedding-photography.ie/blog/?feed=rss2 Any ideas?
@Steve, I say this over and over and over again… if you follow the instructions — the very thorough instructions — step-by-step then this script will work. I can do nothing more then have you refer to those instructions. If you follow each step, word for word then this script works. If you can’t get it to work then PHP scripting is not for you.
Read through some of the above comments and see if you haven’t fallen in to some of those traps already.
Hello~
Building my first site, and I believe I’ve followed the instrucitons verbatim, but I keep running to this error:
Fatal error: main() [function.require]: Failed opening required ‘assets/simplepie.inc’ (include_path=’.:/usr/lib/php’) in /homepages/39/d301138392/htdocs/export attempt iii/Geocurrent Events/index.php on line 140
I’m really a veteran of scripting, so any advice on what is causing the problem here would be greatly appreciated.
Refer to my last comment.
Hi,
Probably I am missing something but as far as I can tell I followed the instructions in Recentposts2 including paste as plain text and ignore formatiing. The problem I have is, I can get it to work in a html page but not in the styled text page. These are the test urls.
HTML Page: http://www.japanseacupunctuur.com/test/ Styled text page: http://www.japanseacupunctuur.com/test2/test.php
As you can see with the styled text I get: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ‘)’ in /home/bazhang/public_html/test2/test.php on line 313
It should display the same as the html text. Is there any solution for this or can you see what I did wrong?
I don’t know about writing code at all so any help would be great.
Ronald
Nothing I can do since I can’t see the source code generating the error. But it you look on 313 of your source you’ll find an errant character that is not supposed to be there. In RapidWeaver, go to View > View Source.