Happy new year 2013

Happy new year 2013 everyone. Hopefully this year will be better than last year, we will strive to improve the quality of every aspect of our lives, we can do it.

This is the fifth year for this blog, a certain satisfaction when looking at to the archive pages. Thanks for your supports.

Purge all the comments

Recently, I cleaned all of the comments, too many comments are just spamming without giving the slightest value to the post. Comments should provide additional information or at least add a value to an existing post, and put a link only to support or to add further discussion possibility related to the topic.

Indeed, a lot of valuable comments but I do not want to spend my time just to re-examine previous comments. From now on I use Disqus for blog commenting system.

If you want some kind of signature to promote your blog, then this blog is not the right place, you can try to register on my forum that provides this feature.

Replr.com: DoFollow forum based on Drupal

After going through the alpha stage, finally Replr.com now entering the beta release and opened to the public. All outbound links on this forum is DoFollow.

There is a point system, which is planned to be exchanged for directory listings. And of course there are premium members who do not have to collect a certain point to be able to obtain a personal blog or directory listings.

You can register to become a member of Replr.com here.

Creating responsive Drupal theme (Simplified)

There are various ways to create a responsive Drupal theme, one of them is using template_preprocess_html() function in template.php.

First create template.php if your theme do not already have it. Than add below codes:

/**
* Preprocess html
*/
function themename_preprocess_html(&$vars) {

  drupal_add_css(path_to_theme() . '/css/smartphone.css', array('group' => CSS_THEME, 'media' => 'only screen and (min-width : 240px) and (max-width : 480px)', 'preprocess' => FALSE));

  $meta_viewport = array(
   '#type' => 'html_tag',
   '#tag' => 'meta',
   '#attributes' => array(
     'name' => 'viewport',
     'content' => 'width=device-width, initial-scale=1'
   )
  );

  drupal_add_html_head($meta_viewport, 'viewport');
}

It is clear if the minimum screen size of 240px and 480px maximum it will use smartphone.css, so please create smartphone.css in css folder and you can add your css code there.

Besides using template.php, you can also add the css via theme's info file like below

stylesheets[screen and (min-width: 240px) and (max-width: 480px)][] = css/smartphone.css
stylesheets[screen and (max-width: 320)][] = css/320.css

And do not forget to add meta viewport via template.php or Android devices will not recognize our responsive layout.

Clear your Drupal cache, once you make above changes.