[support] php-code in block is not executed...

Mr. Jarry mr.jarry at gmail.com
Thu Jan 20 08:22:52 UTC 2011


You say block with php-script is bad idea, module is preferred solution.
Unfortunatelly writing modules goes far beyond my capabilities (i'm quite
new to drupal, and what is even worse, to php too).

But what about creating block with iframe which calls this script within?
Would it be better solution, than block with php-code? I could even move
that script completely away, to different web-vhost (on the same physical
server). In such a case, if that script fails, it should not crash the whole
web-page, only that frame, I think...

That php-script works, when I call it directly. It does not need mysql,
only its own subdirectory structure, with files. I just want to include it
on my web-page, but rewriting it to module would take me at least
a few months...

Jarry

On Wed, Jan 19, 2011 at 8:40 AM, Mukesh Agarwal
<mukesh.agarwal17 at gmail.com>wrote:

> I second Fred. Making a module is always a good idea. The code gets
> compiled before whereas in case of block, only while execution does the code
> get loaded from db and then is compiled and executed. I think the php
> accelerators like eaccelerator and stuff will not be able to cache the op
> code from the code which is saved in db.
>
> On Wed, Jan 19, 2011 at 4:31 AM, Fred Jones <fredthejonester at gmail.com>wrote:
>
>> >> In general tho mate, this is bad practice.  Put it in code somewhere,
>> >> not in a block. (like page.tpl.php or node.tpl.php).
>> >
>> > But where? And how can I have it displayed where I want,
>> > like blocks? I'm quite new to drupal...
>>
>> Make a module and use:
>>
>> http://api.drupal.org/api/drupal/developer--hooks--core.php/function/hook_block/6
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20110120/579812d3/attachment.html 


More information about the support mailing list