Being promoted… Syukur Alhamdulillah

As of 1st July 2012, I am now serving the Digital Library of Open University Malaysia as Senior Librarian (In Government Service is equivalent to S44). Syukur Alhamdulillah. Rezki from Him for my lovely wife and kids.

Being a Librarian for nearly 8 years; working enthusiastically and actively looking for ways to improve the library services to the best of my ability. If you love your job… well you will be rewarded in time. The rezki from Him will come… surely.

The 1st task I did when starting to work at Tan Sri Dr. Abdullah Sanusi Digital Library, if I am not mistaken is redesigning the Library Catalogue. Luckily I am well versed with Virtua VTLS Library System (thanks to En Azhar Md. Noor of Perdana Leadership Foundation. Hint: Tun Dr. Mahathir). Giving new look to OUM Digital Library was a piece of cake. Almost anyone could do it. It was purely HTML and CSS. No programming involved.

After sometimes, I came to realize that there was a need for student authentication. At first it was a simple PHP login script, exploiting exposed variables (not secure and dirty, but hey. It worked Okay!)

A year later I came across Drupal. Something like Joomla but much more powerful and robust. Drupal has a high learning curve. It is built on security and usability comes later. Hmmmm! Challenge accepted. Within 3 months a new Library Portal based on Drupal was introduced, somewhere in January 2010.

By now Drupal in the Library is being used as:

  • Authentication System
  • Error Reporting
  • Enquiries System
  • Document Delivery, InterLibrary and IntraLibrary Loan Request
  • Remote Access via EZproxy
  • Library Database Management System
  • Library Catalogue Replacement

I learnt Drupal by trial and error and with help from Drupal Communities, Drupal Books and some code snippets.

Ahhhh. I could still remember the day I was trying to write my 1st custom module. Nothing worked and I almost gave up. Luckily Drupal has good API documentation and I was able to write a module to programmatically add user into the system and log them in. It was a breakthrough. Nothing is impossible if you put your heart into it.

Still learning Drupal and is aiming to become a Drupal Ninja

Load User Profile Items in Node : Drupal

Drupal is so robust that you can do almost anything. However, they will be a time when you will have to do some programming to achieve your goal. For instance, loading user profile into node. In general to load author’s profile item into node. By default, node saves only author’s username into every post. Sometimes, you will want to display author’s Full Name instead of username. It does make better sense, doesn’t it?

Here goes… in node.tpl.php or any custom node.tpl.php, insert this code:

$node_author->uid = $node->uid;

This function will call upon the profile items of the author and then load it up for your perusal. You can then call any fields of the profile items to be displayed in your nodes. For example, you may want to load the Full Name and Work Designation of the author in your node. As shown here:

print t('<span class="date_post">Posted on ') . 
format_date($node->created, 'custom', "d F Y") . ' by ' . ucwords(strtolower($node_author->profile_name)) . ' ' .
'(' . ucwords(strtolower($node_author->profile_designation)) . ')' .

As you can see here, instead of calling node->name which is the username and the only available information of the author by default, you can now call any profile items of the author. The profile_load_profile function has loaded the author’s information and you may call any of the profile items available.

Before using the profile_load_profile to call author’s profile item


After loading author’s profile items into node usng profile_load_profile