Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-01-08 10:58:07

freaky
Member
From: Austria
Registered: 2004-10-14
Posts: 55
Website

Selfcoded plugin: parse error in publish.php : eval()'d code

Hello!

I’m trying to write my own pluging. But I always get an error. The thing is that I didn’t modified that much in the plugin-template.

Thats my modified part of the template (all other parts remain the same).
<code>function xxx_myplugin($atts) { $test = 1; return $test;
}</code>

I’m able to install/active the plugin without error in the admin section. But if I’m looking on my site I get this error:
Parse error: parse error in D:\www\tp\textpattern\publish.php(767) : eval()’d code on line 3

What’s wrong with the plugin? Or what I do wrong?

Last edited by freaky (2005-01-08 10:59:09)

Offline

#2 2005-01-08 11:54:34

freaky
Member
From: Austria
Registered: 2004-10-14
Posts: 55
Website

Re: Selfcoded plugin: parse error in publish.php : eval()'d code

I got it! :)

It took me more than 1.5h to find a solution – and read the forum!

Solution:
_Instead of this:
<pre>
$plugin[‘code’] = <<<eod function xxx_myplugin($atts) { }
eod;
</pre>

write this:
<pre>
$plugin[‘code’] = <<<eod function xxx_myplugin(\$atts) { // <= notice the \ char ! }
eod;
</pre>_

Thanks to Bubba Ho Tep

Offline

Board footer

Powered by FluxBB