You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 350 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
How to create a block, theoretical approach

20.2.1. How to create a block, theoretical approach

You have to follow these rules when creating a block:

  • In every block you create you have to insert the following code at the beginning:

    if (eregi("block-Name_of_Block.php", $PHP_SELF)) {
    Header("Location: index.php");
    die();
    }
    

    By using this code you protect the file avoiding users approaching it directly from the blocks folder, and the block will be displayed only when selected from your site.

  • In the blocks you can include everything you want, Perl, java, php, flash etc...

  • All the block output must have a value that can be obtained from the variable $content.

Remember that you have a limited amount of space in the block, pay special attention to the layout!

Warning Warning
 

In order to have W3C standard compatible blocks, Francisco Burzi says:

"To respect the W3c standards for HTML 4.01 Transitional, it is very important that you replace all "instances of &" in the URL by the tag "& "

For example the URL:
<a href="modules.php?op=modload&name=FAQ&file=index">
must be written:
<a href="modules.php?op=modload&amp;name=FAQ&amp;file=index">
and don't use, for example, the tag "li" (used to create a list), but leave that in the style sheet (CSS) which will make it for you.

The background for the tables and font etc., are better left to the style sheet (CSS).

We will now see how to construct a block starting from the beginning.


Help us make a better PHP-Nuke HOWTO!

Want to contribute to this HOWTO? Have a suggestion or a solution to a problem that was not treated here? Post your comments on my PHP-Nuke Forum!

Chris Karakas, Maintainer PHP-Nuke HOWTO

Powered by TOGETHER TEAM srl ITALY http://www.togetherteam.it - DONDELEO E-COMMERCE http://www.DonDeLeo.com - TUTTISU E-COMMERCE http://www.tuttisu.it
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.025 Seconds - 320 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::