Posts

Showing posts from May, 2013

Set menu item active using custom code.

If you want to set a menu item of the main menu as active (class="active"). Here is how you can do this.. function mymodule_init() { $link=menu_link_load(2570); $link["options"]["attributes"]["class"]="active"; menu_link_save($link); } 2570 is mlid of that perticuler menu item. You can check it by editing that perticuler menu item "admin/build/menu/item/2570/edit" Now, I just want to set it active on some specific pages... like "mypage01", "mypage02" etc function mymodule_init() { if((arg(0) == 'mypage01') || (arg(0) == 'mypage02')) { $link=menu_link_load(2570); $link["options"]["attributes"]["class"]="active"; menu_link_save($link); $menu_active = 1; } else { if($menu_active == 1) { $link=menu_link_load(2570); $link["options"]["attributes"]["class"]=""; m

Downgrading PHP 5.4 to 5.3 on Ubuntu

Download the shell script from here Once you have php5_4_downgrade_5.3.sh file you need to change the permissions using the following command su root chmod u+x ./php5_4_downgrade_5.3.sh Now you can run the script using the following command sudo sh php5_4_downgrade_5.3.sh Follow the on instructions