From a9c560282b4f7b8b21695b304c8cc89402a8efd1 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Fri, 18 Jun 2004 22:20:36 +0000 Subject: [PATCH] - Patch #8598 by cetron: fixed typo in the help text: 'shuold' -> 'should' --- modules/block.module | 2 +- modules/block/block.module | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/block.module b/modules/block.module index fb3f2d50a9c..0c3d8001fbf 100644 --- a/modules/block.module +++ b/modules/block.module @@ -20,7 +20,7 @@ function block_help($section) {

PHP in admin-defined blocks

If you know how to script in PHP, Drupal gives you the power to embed any script you like inside a block. It will be executed when the page is viewed and dynamically embedded into the page. This gives you amazing flexibility and power, but of course with that comes danger and insecurity if you don't write good code. If you are not familiar with PHP, SQL or with the site engine, avoid experimenting with PHP blocks because you can corrupt your database or render your site insecure or even unusable! If you don't plan to do fancy stuff with your blocks then you're probably better off with straight HTML.

Remember that the code within each PHP block must be valid PHP code - including things like correctly terminating statements with a semicolon so that the parser won't die. It is highly recommended that you develop your blocks separately using a simple test script on top of a test database before migrating to your production environment.

-

Notes:

+

Notes:

A basic example:

You want to have a box with the title \"Welcome\" that you use to greet your visitors. The content for this box could be created by going:

diff --git a/modules/block/block.module b/modules/block/block.module
index fb3f2d50a9c..0c3d8001fbf 100644
--- a/modules/block/block.module
+++ b/modules/block/block.module
@@ -20,7 +20,7 @@ function block_help($section) {
 

PHP in admin-defined blocks

If you know how to script in PHP, Drupal gives you the power to embed any script you like inside a block. It will be executed when the page is viewed and dynamically embedded into the page. This gives you amazing flexibility and power, but of course with that comes danger and insecurity if you don't write good code. If you are not familiar with PHP, SQL or with the site engine, avoid experimenting with PHP blocks because you can corrupt your database or render your site insecure or even unusable! If you don't plan to do fancy stuff with your blocks then you're probably better off with straight HTML.

Remember that the code within each PHP block must be valid PHP code - including things like correctly terminating statements with a semicolon so that the parser won't die. It is highly recommended that you develop your blocks separately using a simple test script on top of a test database before migrating to your production environment.

-

Notes:

  • You can use global variables, such as configuration parameters, within the scope of a PHP box but remember that variables which have been given values in a PHP box will retain these values in the engine or module afterwards.
  • register_globals is now set to off by default. If you need form information you need to get it from the \"superglobals\" \$_POST, \$_GET, etc.
  • You shuold use the return statement to return the actual content for your block.
+

Notes:

  • You can use global variables, such as configuration parameters, within the scope of a PHP box but remember that variables which have been given values in a PHP box will retain these values in the engine or module afterwards.
  • register_globals is now set to off by default. If you need form information you need to get it from the \"superglobals\" \$_POST, \$_GET, etc.
  • You should use the return statement to return the actual content for your block.

A basic example:

You want to have a box with the title \"Welcome\" that you use to greet your visitors. The content for this box could be created by going: