About $variables, $hook,...
By: Arshad
22 Mar 2010Is this the new Google?
Check out a larger image here.
Update : you can access the new google homepage if you are on ubuntu. It works with the latest beta version of chrome only. Screenshots :

By: Arshad
22 Mar 2010If you look a drupal node, drupal displays the author of this node as the username of the user or anonymous if the author is not registered user. Now if we want to display the real name of the user (a field we will add in the profile module) instead of the username, drupal provides a theming function that let's you modify the output of the username before it is printed on a node. Let's see how we can do this.
By: Arshad
21 Mar 2010Most of us have more than many functions in our template.php file. Hooks and preprocess function to make our site look as good as the designer did it. In many cases where a site requires advanced theming,the template.php file gets huge. To keep a structured and clean coding style consider using file includes. This way you can have codes in seperate php files loaded into template.php during execution.
This is a very similar approach to how Drupal core calls files from the "includes" folder.
Here's the code to include files :
By: Arshad
20 Mar 2010How many times do we use a quick print_r to see what's in $node or $result or anything else? When coding modules , it's not very easy to output data structures to the screen unless you do a print_r($node) and view the source code. or do it like this :
[php]<pre><?php print_r($node); ?></pre>[/php]
Here's a clean and simple way you can output such data on screen. If you have the developer module enable (devel), use the dsm() (drupal_set_message) function.
By: Arshad
19 Mar 2010I'll go directly to the code
This one goes in your template.php (under sites/all/themes/yourtheme/).
function phptemplate_menu_item_link($link) { } $link['localized_options']['attributes']['class'] = 'menu-'. $link['mlid']; } else { $link['localized_options']['attributes']['class'] .= ' menu-'. $link['mlid']; } return l($link['title'], $link['href'], $link['localized_options']); }
By: Arshad
19 Mar 2010
There are time when CTRL+SHIFT+J tells you no error found. Still your fancy scripts won't load on internet explorer. After killing the whole day trying to figure out you decide to scrap everything and restart or even remove the whole javascript from the site..In time like that JSLint is the tool you need.
Simply copy and paste your javascript in on the site homepage. It will automatically check for JS errors.
By: Arshad
19 Mar 2010
I still have about 23 wave invitations left. anyone with a gmail account reply to this post i'll invite you. ;)
By: Arshad
22 Jan 2010There are three ways of centering an element on a page: using margins, using percentages, or using absolute sizes in css. The first method seems to work better for most. But unfortunately, Microsoft Famous Internet Explorer for Windows - has a fairly serious bug regarding the treatment of block level elements and margins. So here's a jquery plugin that solve this problem with ease.
By: Arshad
22 Jan 2010Willaim Reynolds, Firefox Campus Rep Head

This week we are super excited about the release of Firefox 3.6!
Our best version of Firefox is officially ready for you to download! What's new in Firefox 3.6? Lots!
By: Arshad
17 Jan 2010Snippet to add a class to the current active link for styling with css.
$(document).ready(function(){ //set class active-anchor to active anchor $('a').each(function(){ if($(this).attr('href')==window.location.search) $(this).addClass('active-anchor') }); });
There you go. Now the anchor that points to the current page will have the class active-anchor. You can style it in you css using .active-anchor.
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.