About $variables, $hook,...
By: Arshad
15 Jan 2010Step 1 : Since we'll be using php codes in a block to display menu, the first thing to do is to enable the PHP Filter under modules.
Step 2 : Go to administer->block->add block and create a new block. Add a description (i use submenu). Choose PHP Code as the filter and paste the code below in the body textarea.
By: Arshad
13 Jan 2010Step 1 : Enable the trigger module if you haven't done so. (To enable the trigger module, go to administer->site building->module. check the trigger module and press save.)
Step 2 : Go the administration panel and click on action. Under Make a new advanced action available, select Redirect to URL... and hit create.
Enter a description and the url to redirect to. You can use internal url like node/123 to redirect the user on login.
Press Save.
By: Arshad
7 Jan 2010Update : This works in google chrome too. Press CTRL+B to show your bookmark toolbar. then follow the steps below.
Step 1 : Right-click on the bookmark tab and create a new bookmark.
Step 2 : In the new pop up window enter "Drupal Search" as name and the javascript code below in location.

Code
By: Arshad
5 Jan 2010By: Arshad
5 Jan 2010A Google Chrome extension that make searching drupal.org and the drupal API quick and easy.
Download the extension here .
By default, any text entered in the search box is searched on drupal.org website.
Use 6:keyword or 7:keyword to search for the respective api version.
By: Arshad
4 Jan 2010Actually there are many ways this can be achieved. There are some efficient ways and some quick ones. Below is one quick and simple way of checking if a string has html tags or not.
/** * This function will return true is the string contains html tags and false otherwise */ function hasHtml($str){ //we compare the length of the string with html tags and without html tags if(strlen($str) != strlen(strip_tags($str))) return true; return false; }
By: Arshad
31 Dec 2009Code to select the content of an input box on click
//set select when clicking on an input $('input[type=text]').click(function(){ $(this).select(); });
sometimes you want it to occur on focus. replace click(function(){.. by focus(function()...
By: Arshad
31 Dec 2009Select Link is a jquery plugin that provides a pop up when words on your website are selected.
The plugin can be found here.
This plugin can be used in many ways. Some examples :
Hello I'm Arshad. I'm a 21 years old Drupal Web Developer. This is a site i put up for some reasons i can't remember and this is where i write stuffs i need to remember.;)
In the Web world, i head the Drupal Mauritius User Group and the jQuery user Group Mauritius and i'm a campus representative for Mozilla Firefox.