Re: rss building with rss-helper in 1.2 does not work

2007-05-15 Thread Thomas

I fixed the problems.
1. The reason for the problem of the spaces as first characters in the
html-source was a few spaces in a few file after the php-closure (like
this ?  ). After removing it, everything worked as a charm.
2. I fixed the other problem by using the code:

if ($this-RequestHandler-isRss()) {
$this-layout = 'rss';
}

Does anyone have a better solution for the layout?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



RE: rss building with rss-helper in 1.2 does not work

2007-05-14 Thread Mariano Iglesias

First of all, don't assume things are not working just because it doesn't
work for you:

http://bakery.cakephp.org/comments.rss

That's an RSS feed generated with CakePHP 1.2 and works like a charm. So you
know this is how it works:

On app/config/routes.php add:

Router::parseExtensions( 'rss' );

Then on CommentsController there's this (I removed some things for
readability):

function index($articleId = null) {
$conditions = array('Comment.published' = 1);

$this-Comment-recursive = 0;
$this-set('comments', $this-Comment-findAll($conditions, null,
'Comment.created DESC, Comment.id DESC', 15));
}

Then on app/views/comments you have an rss folder, and inside an index.ctp
file that reads:

?php
if (!empty($comments)):
$this-pageTitle = 'Latest Bakery Comments';
echo $rss-items($comments, 'transformRSS');
endif;

function transformRSS($comment) {
return array(
'title' = $comment['Comment']['title'],
'link' =
array('url'='/articles/view/'.$comment['Article']['slug'].'#comment-'.$comm
ent['Comment']['id']),
'description' = substr($comment['Comment']['body'], 0,
200),
'pubDate' = date('r',
strtotime($comment['Comment']['created'])),
);
}
?

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de Thomas
Enviado el: Lunes, 14 de Mayo de 2007 08:45 a.m.
Para: Cake PHP
Asunto: rss building with rss-helper in 1.2 does not work

I am trying to get the rss working with the help of the rss-helper of
1.2, but somehow cake doesn't spit out valid rss.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: rss building with rss-helper in 1.2 does not work

2007-05-14 Thread Dr. Tarique Sani

On 5/14/07, Mariano Iglesias [EMAIL PROTECTED] wrote:

 First of all, don't assume things are not working just because it doesn't
 work for you:

 http://bakery.cakephp.org/comments.rss


Corollary to above - Don't assume it will work for everyone just
because it works for you / some

That said rss does indeed seems to be working fine.

Cheers
Tarique

-- 
My motto for everyone else -  Just shut up, damnit!!
=
PHP for E-Biz: http://sanisoft.com
=

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



RE: rss building with rss-helper in 1.2 does not work

2007-05-14 Thread Mariano Iglesias

Not applicable. If you want to start a car without gas, don't come and say
the engine is not working.

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de Dr. Tarique Sani
Enviado el: Lunes, 14 de Mayo de 2007 09:51 a.m.
Para: cake-php@googlegroups.com
Asunto: Re: rss building with rss-helper in 1.2 does not work

Corollary to above - Don't assume it will work for everyone just
because it works for you / some

That said rss does indeed seems to be working fine.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: rss building with rss-helper in 1.2 does not work

2007-05-14 Thread bbuchs

This is what I was talking about. Mariano posted some code that should
be helpful. But was it necessary to mock the poster?





On May 14, 7:58 am, Mariano Iglesias [EMAIL PROTECTED]
wrote:
 Not applicable. If you want to start a car without gas, don't come and say
 the engine is not working.

 -MI

 ---

 Remember, smart coders answer ten questions for every question they ask.
 So be smart, be cool, and share your knowledge.

 BAKE ON!

 blog:http://www.MarianoIglesias.com.ar

 -Mensaje original-
 De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
 de Dr. Tarique Sani
 Enviado el: Lunes, 14 de Mayo de 2007 09:51 a.m.
 Para: cake-php@googlegroups.com
 Asunto: Re: rss building with rss-helper in 1.2 does not work

 Corollary to above - Don't assume it will work for everyone just
 because it works for you / some

 That said rss does indeed seems to be working fine.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



RE: rss building with rss-helper in 1.2 does not work

2007-05-14 Thread Mariano Iglesias

Who's mocking who?

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de bbuchs
Enviado el: Lunes, 14 de Mayo de 2007 10:10 a.m.
Para: Cake PHP
Asunto: Re: rss building with rss-helper in 1.2 does not work

This is what I was talking about. Mariano posted some code that should
be helpful. But was it necessary to mock the poster?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: rss building with rss-helper in 1.2 does not work

2007-05-14 Thread Thomas

Thanks for the replies. It is indeed helpful.

Maybe I should stated it more clearly, but nowhere in my post I was
blaming the problem on cakephp... I was just strugling with this
problem and I was really looking for a solution. The only thing I said
was that it I could not get valid RSS. Of course the problem lies with
me and not with cake, since many others got their RSS working.

So my car indeed would not start, and the only thing I asked was, how
can I start my car. Then you must say: maybe some gas will help. I did
not say anything about my engine broke down...
(to speak in metaphors :D).

On May 14, 3:13 pm, Mariano Iglesias [EMAIL PROTECTED]
wrote:
 Who's mocking who?

 -MI

 ---

 Remember, smart coders answer ten questions for every question they ask.
 So be smart, be cool, and share your knowledge.

 BAKE ON!

 blog:http://www.MarianoIglesias.com.ar

 -Mensaje original-
 De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
 de bbuchs
 Enviado el: Lunes, 14 de Mayo de 2007 10:10 a.m.
 Para: Cake PHP
 Asunto: Re: rss building with rss-helper in 1.2 does not work

 This is what I was talking about. Mariano posted some code that should
 be helpful. But was it necessary to mock the poster?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



RE: rss building with rss-helper in 1.2 does not work

2007-05-14 Thread Mariano Iglesias

Cool, try with that car model I sent you, it should show you how to start
your engine.

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de Thomas
Enviado el: Lunes, 14 de Mayo de 2007 10:25 a.m.
Para: Cake PHP
Asunto: Re: rss building with rss-helper in 1.2 does not work

So my car indeed would not start, and the only thing I asked was, how
can I start my car. Then you must say: maybe some gas will help. I did
not say anything about my engine broke down...
(to speak in metaphors :D).


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



RE: rss building with rss-helper in 1.2 does not work

2007-05-14 Thread Mariano Iglesias

Geez that's freaking hot.

6 C here.

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de Dr. Tarique Sani
Enviado el: Lunes, 14 de Mayo de 2007 10:45 a.m.
Para: cake-php@googlegroups.com
Asunto: Re: rss building with rss-helper in 1.2 does not work

Whats with all the people being so touchy - must be the weather, it is
still 43C out here


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: rss building with rss-helper in 1.2 does not work

2007-05-14 Thread Thomas

Damn, 43! 15 here...

Still two unresolved issues.
1. For some reason, the RSS is not valid yet. The reason: about 8
spaces before the ?xml... ? starts. Anyone have a clue how I can get
rid of these spaces? When I save the rss file and I remove these
spaces, everything works!

2. There is still a problem with the layout. I use a model called
'Artikel'. Standard layout is of course 'default.tpl' inside the
directory appviewslayouts. If I keep this default for the rss, I get
my rss inside a lot of html-code. How can I manage it that cake
ignores the default.tpl file and just shows the rss?

Thanks a lot!

On May 14, 3:52 pm, Mariano Iglesias [EMAIL PROTECTED]
wrote:
 Geez that's freaking hot.

 6 C here.

 -MI

 ---

 Remember, smart coders answer ten questions for every question they ask.
 So be smart, be cool, and share your knowledge.

 BAKE ON!

 blog:http://www.MarianoIglesias.com.ar

 -Mensaje original-
 De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
 de Dr. Tarique Sani
 Enviado el: Lunes, 14 de Mayo de 2007 10:45 a.m.
 Para: cake-php@googlegroups.com
 Asunto: Re: rss building with rss-helper in 1.2 does not work

 Whats with all the people being so touchy - must be the weather, it is
 still 43C out here


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: rss building with rss-helper in 1.2 does not work

2007-05-14 Thread Thomas

Oh, and maybe it is also good to show how my template file (in view/
rss) looks:

-
?xml version=1.0 encoding=iso-8859-1?
rss version=2.0
channel
titletitle/title
descriptiondescr/description
linkhttp://link.com//link
webMaster[EMAIL PROTECTED]/webMaster
copyrightCopyright 2007, company/copyright
languagenl/language
managingEditor[EMAIL PROTECTED]/managingEditor
image
titletitle/title
urlhttp://test.link.nl/img/site/logo.jpg/url
linkhttp://link.com/artikel.rss/link
/image
{if (!empty($artikelen))}
{$rss-items($artikelen, 'transformRSS')}
{/if}

{php}
function transformRSS($artikelen) {
return array(
'title' = $artikelen['Artikel']['artTitel'],
'link' = array('url'='/artikelen/view/'.
$artikelen['Artikel']['artId']),
'description' = $artikelen['Artikel']
['artInleiding'],
'guid' = array('url'='/artikelen/view/'.
$artikelen['Artikel']['artId']),

);
}
{/php}
/channel
/rss
-

I left some details out to make it more readable.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---