Flash clickTag Banner

What is clickTAG?

Data Types

PHP Data Types

PHP data types are divided in two main categories: scalar and composite.

SuEXEC

Apache suEXEC is a feature of the Apache Web server to give more security to the files in a shared server (virtual host).

Most websites are hosted at commercial web hosts who are able to give their customers run scripts, suEXEC allows the cgi files to be executed with the account of the owner, so it can cause some risks.

Language Comments

One of the most important parts in any programming language is comments. Is a very good practice to comment every part of the code (variables, functions, classes, etc).

PHP has several types of comments:

Single line comment:

//Comment goes here

Single line comment (another option):

#Comment goes here

Multi line comment:

/*
Comment goes here
*/

API Documentation:

/**
* Function Description
*
* @param string $my_var
*/

function my_function($my_var) {
   "code goes here"
}

PHP Tags

The code in PHP must be inserted into a text file using a special tags, then PHP will process everything between those tags, the rest is just ignored. There are the types of tags:

Customizing Search Block Form

In Drupal we can customize everything, even the search forms. This example show you how to make a custom search block. First you have to make a file named "search-block-form.tpl.php" with this content:

<div class="container-inline">
  <?php print $search_form; ?>
</div>

even if it isn't different from the one in the core distribution; otherwise the preprocess function isn't executed.

After that you must to open the template.php and use the mechanism of preprocess function to modify template variables before they are passed into the template files.
 

Place blocks and menus anywhere on the site

When you make a theme sometimes need to place a block directly into the theme instead of using the blocks section. For example, you need to insert the block in the page.tpl.php file what have to do is:

Print comments block:

<?php
$block = module_invoke('comment', 'block', 'view', 1);
print $block['subject'];
print $block['content'];
?>

Print locale block:

<?php
$block = module_invoke('locale', 'block', 'view', 0);
print $block['subject'];
print $block['content'];
?>

Print search block:

<?php

URL with trailing slash

Some people prefer use trailing slash for urls for example http://example.com/something/ instead of http://example.com/something, actually, according to RFC 3986 it does make a difference. Any two URLs are not a character-by-character match (ignoring URL encoding which does not apply in this case) are considered to indicate different resources.

Syndicate content