Adding php to a block
I am using a rss2html php script to make my RSS feeds searchable by the C5's default search engine.
In order to make it work I have tried two options:
1. Creating a single page. Then adding a php block (addon) and pasting the code. I get the following error. I checked the file view.php and saw anything suspicious.
Parse error: syntax error, unexpected T_STRING in /usr/home/jobs4librarians.com/web/packages/nd_php_package/blocks/nd_php/view.php(4) : eval()'d code on line 1
2. Adding HTML block with the script embedded in the html.
It just doesn't display the listings (Nothing happens).
However the script works perfectly. Here an example:
Please some help!!!!
Or just copy the script and paste it where you want it on your page type.
I am using the PHP block. However it doesn't work I get the error specified above.
Any idea why?
If the code parsed correctly before you added it to the php block, sometimes you may have to escape some quotes in order for it to work within the eval() that the php block uses.
Another solution to the same problem is to add your php code to a custom template for the html block. It won't be as easy to edit afterwards, but it does avoid the eval() and is an easy way to just get a bit of php into a view.
Sorry I do not understand what you mean. Could you please explain it? Maybe I am not used to some terminology...Thanks for the translation!