Hi,
I’m working with the feedgrab plugin to pull Twitter posts into ee. I’m having a rather tough time figuring out one simple thing. How to knock the username: off of the post for display when pulled out of exp_weblog_titles.
A normal post looks like: Steve Smith: is going out to see a fight with the guys.
What I’m trying to get rid of is Steve Smith: and leave everything else. I tried the following:
$string = Steve Smith: is going out to see a fight with the guys.;
echo preg_replace("/.*:/", "", $string);
This works fine if there are no more colons in the sentence. Which looks like this: Steve Smith: is going out to: see a fight with the guys. Has this return: see a fight with the guys.
Thanks in advance for any help.
In case anybody else searches on this, I found another way to do the same thing, using the Trimmer plugin. I’m removing my name, plus the colon-space, more or less like so:
{exp:weblog:entries weblog="twitter" orderby="date" limit="10"}
{exp:trimmer left="15" right="0"}
{twitter_description}
{/exp:trimmer}
{/exp:weblog:entries}
This only seems to work if I include “right=0”.
(And, I removed my extra code for styling, because it’s ugly and Unclean.)
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.