Recent Topics

1 Nov 05, 2006 16:40    

$Item->content () does always echo the content but I am not able to put it in another variable to do stuff like this with it:


$text = Item->content ('#', '#', T_('Read more …'), '' );
		$anfang = strpos($text,'"http:');
                $ab_http = substr($text,$anfang+1);
                $ende = strpos($ab_http,"\"");
                $http_string = substr($ab_http,0,$ende);
		echo $http_string;

How am I able to do this?

2 Nov 05, 2006 16:59

If thats your code directly from your source, you are forgetting a $ in your first line

3 Nov 05, 2006 17:07

no, thats not the problem. That was just a typo. The problem is, that the method "->content()" always echos the content but I want to to something with this afterwards..

4 Nov 05, 2006 17:13

Post it as a feature request to get it so there is a new function get_content which returns the content which content calls and echos.

In the meantime this code will do what you want;

ob_start();
$Item->content();
$Item_content = ob_get_contents();
ob_end_clean();

5 Nov 05, 2006 20:26

JFI: Item::get_content() is in CVS already and may appear in 1.9.

6 Nov 05, 2006 20:32

You know your my hero blueyed ;)

7 Nov 06, 2006 07:56

You can get the content without echoing it (as long as you don't need the renderers to do any work) with :

$text = $Item->content;

¥

8 Nov 06, 2006 19:47

Yes, ¥åßßå. But note that Item::content() (the function) also splits "more...", pages etc.

9 Nov 07, 2006 09:20

Damn, I forgot about that, there goes my one line solution :p

¥

10 Nov 07, 2006 11:30

Balupton - 1
Yabba - 0....

Actually you got that one on the login_required, or are we gonna call that a draw :P

12 Nov 07, 2006 16:15

I'll give yabba dabba do 2 points for having the answer to the extra li thing on the auto-credits feature long before baluptron noticed there was an issue to address.

B = 1
Y = 2

:)

(Re was it a double: no - I don't cut back for anyone, although technically it was a double round of triple shots.)

13 Nov 07, 2006 18:03

The Impeccable EdB wrote:

(Re was it a double: no - I don't cut back for anyone, although technically it was a double round of triple shots.)

That's my kind of double :D

¥

14 Nov 07, 2006 18:53

;)

So if Yabba fixed the thingo already, why wasn't there a fix for it avaliable, or would it be in the v-1-8 branch in the cvs?

Cause to me, if it ain't fixed on my copy, and i don't know about it, it ain't fixed yet ;)


Form is loading...