2 sam2kb Dec 31, 2009 21:01

Thanks sam2kb!
I managed to get str_replace to work as well, but your solution is much better.
Much appreciated :)
I have a new issue where twitter doesn't accept some updates because various titles are long and exceed the allotted character count when combined with the url.
If you're using b2evo 3.3 you can try this
$content = strmaxlen( format_to_output( $Item->title, 'htmlattr' ).' '.$Item->get_permanent_url(), 135 );
If you are still on b2evo 2 use this
$content = substr( format_to_output( $Item->title, 'htmlattr' ).' '.$Item->get_permanent_url(), 0, 135 );
<a id="tweet" target="_blank" href="http://twitter.com/home?status=<?php echo urlencode( $content ); ?>@yourname"></a>
You can save some space for content by using short pemalinks like
yourblog.com?p=222 where 222 is post ID
e.g.
$content = strmaxlen( format_to_output( $Item->title, 'htmlattr' ).' '.url_add_param( $Blog->gen_blogurl(), 'p='.$Item->ID ), 135 );
Not tested, use at your own risk ;)
Thanks again, I will test these out. (I am on b2evo 3.3.2)
You can get escaped title with
This should work