Hi there,
I’m hoping you can help me.
I have a custom plugin that gets member data, essentially I want to display the {bio} field for a given user. And I’d like to format the text accordingly.
My code currently gets the {bio} field and returns it. However if the {bio} text itself contains a simple URL (e.g: ‘www.google.com) then the following error appears on the page: Parse error: syntax error, unexpected T_STRING in /system/core/core.functions.php(635) : eval()’d code on line 77
It seems whenever it has to auto-format a URL or such, it throws a fit. I’m guessing that I’m doing something wrong with the typography class - but I simply can’t see what it is I should be doing.
An example of the code is such:
$bio = $this->TYPE->parse_type($query->row['bio'], array('text_format'=>'xhtml', 'html_format'=>'all','auto_links'=>'y','allow_img_url'=>'n'));
$text = str_replace('{bio}',$bio, $text);
Previously I discussed some more details about the plugin I have written, in here: http://ellislab.com/forums/viewthread/58374/
Any help much appreciated!
I’m using EE 1.6.
[mod edit: moved to plugin forums]
Why not try my plugin? It works for the forum… I imagine it would work for the member templates as well. here is the link to it
I got it to work fine, I believe.
Hey Barry,
Thanks for your reply on this. I’ve been tinkering and it looks like my code is just not good enough to do this successfully. I need to rewrite using the template class I think…
hmm, need to put it in a file, I’ll PM you.
Gah. My plugin is rather a mess I think. This is why I’m a designer!
I’ll have to start over and rewrite this plugin at some point, or pick up a copy of SolSpaces “User” Module.
I run www.crawlofthedead.com, a community site for zombies.
I’ve had to be somewhat rather hacky to achieve my goals. The user profiles however are pretty much exactly as I need them, bar this bug.
The custom profile tag is perhaps useful, but does not include the functionality in my own plugin, which is tailored quite finely for my site. In time, I hope to move to SolSpaces’ extensive User module, so I can remove my hacks and have a ‘safer’ site (which I can upgrade without fear).
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.