Recent Topics

1 Apr 19, 2007 19:03    

My b2evolution Version: 1.9.x

Hi all, after doing one last searching, found the answer on file "inc/MODEL/items/_item.class.php

Starting from line: 1077
or search " Template function: display content of item "

The magic..


$Item->get_content( 0, true )

Where?
Open the _main.php of:

-Atom
Search for:


<content type="html"><![CDATA[<?php
					$Item->url_link( '<p>', '</p>' );
					echo make_rel_links_abs( $Item->get_content() );
				?>]]></content>

Just change the bit to look like this:


$Item->get_content( 0, true )

- RSS2 and RDF
Search:


<description><?php
						$Item->url_link( '', ' ', '%s', array(), 'xml' );
						$content = $Item->get_content( 1, falseT_('[...] Read more!'), '', '', '', 'xml', $rss_excerpt_length );
						echo make_rel_links_abs( $content );
					?></description>
					<content:encoded><![CDATA[<?php
						$Item->url_link( '<p>', '</p>' );
						echo make_rel_links_abs( $Item->get_content() );
					?>]]></content:encoded>

Change this:


$content = $Item->get_content( 1, false, T_('[...] Read more!'), '', '', '', 'xml', $rss_excerpt_length );

To this:


$content = $Item->get_content( 1, true, T_('[...] Read more!'), '', '', '', 'xml', $rss_excerpt_length );

and
this:

echo make_rel_links_abs( $Item->get_content() );


to this:

echo make_rel_links_abs( $Item->get_content( 1, true ) );

- for RSS1
Just change:

$content = $Item->get_content( 1, false, T_('[...] Read more!'), '', '', '', 'entityencoded' );

to this:

$content = $Item->get_content( 1, true, T_('[...] Read more!'), '', '', '', 'entityencoded' );

The explanation:
The 0 or 1 part tells b2e to load page 0 or page 1, so normally you will set this to 1 (I will explain the 0 option below).

false/true - turns on the showing of content after the "read more/more" part.

The "0" option:
This is a suggestion, as I've tested, the code currently supports only showing 1 page of a post. If the post is multi-paged, you only have an option to show 1 page of that post. So choosing 4, will show page 4. For non-multi-paged post, the 1st page will always show in your feed.

Another thing, your feed will not show, or give hints that there are other pages for that specific post.

I suggest we use "0" (zero) to indicate that we want to show everything in the post including the other pages (if it is a multi-page post).

I set mine to "0", since it works fine (though it seems to be wrong).

I'm not sure if there's a way to show the other pages on your feed, but as far as I've read _item.class.php, there's no option for it.

Hope that helps, and hope the suggestion will be implemented ('all' is better I think).

:D

UPDATE:
Forgot to mention one more thing. I think this will increment the "view/read" stat of your post because the 'more' (which is using the permalink) is called everytime someone loads the feed (ie read).

There is an option on the _item.class.php that explains how to prevent the increments, I didn't bother about it for now.

2 May 04, 2007 21:17

doesn't work with b2evolution v1.10, dunno why. The code is still the same but b2evolution won't parse the full post. Not sure if its a bug of v1.1...


Form is loading...