Snippet: Show user profile anywhere.

Snippet: Show user profile anywhere.

what if you want to show the full user profile in a custom block?

global $user;
$userdata = user_load($user->uid);
return drupal_render(user_view($userdata));

15/12/2011 0 comments
fixing Drush 4.5 and Mamp (pro) 2.0

fixing Drush 4.5 and Mamp (pro) 2.0

I am using Drush and Mamp for quite some time now on my mac.

Drush was installed with homebrew and was recently updated to the 4.5 version.

I upgraded my Mamp Pro to version 2.0 and started having issues with my Drush commands.

I started looking into it and discovered some changes to Mamp which led to drush not being able to do anything.

I will go trough the process I did to make things work again.

1. PDO::__construct(): [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock)

This was fixed by implementing the changes proposed in a comment in  the issue queue for drush

mamp changed the directories so to fix this asap i added
/Applications/MAMP/bin/php/php5.2.17/bin/php
/Applications/MAMP/bin/php/php5.3.6/bin/php
to drush/drush

The error went away but I now had issues with my memory limits, which was strange, as my memory limits in all php.ini-files were set high enough.

After some digging in Drush i found some information in the Readme-file that was worth trying to fix my issue.

As the memory limits were set high enough, but Drush wasn’t taking those limits in account, i tried the following:

Alternately, if you only want to override a few values, copy example.drush.ini from the “examples” folder into $HOME/.drush or the folder /etc/drush and edit to suit. See comments in example.drush.ini for more details.

I set the memory_limit in the newly created drush.ini in my drush-folder, and all was working again.

14/10/2011 1 comment Read More
Disable rss.xml and replace with own feed(s)

Disable rss.xml and replace with own feed(s)

While Drupal has no way of disabling the rss-feeds by default, it is possible to override the rss-output, and tell Drupal to use another feed.

Create a new module with following code, and make sure to replace with the naming of your choice. In this blog post I assume you know how to create your own modules.


function _menu_alter(&$items) {
unset($items['rss.xml']);
}

function _init() {
drupal_add_feed(url('feed/news', array('absolute' => TRUE)), 'Website News RSS');
// You can add as many feeds as you want.
}

05/09/2011 1 comment Read More
merge folders in OSX

merge folders in OSX

One of the biggest frustrations in Finder is that you cannot merge folders when moving them around.

This Commandline solution does everything for you.
ditto -V source destination

29/08/2011 0 comments Read More
Ubercart Checkout Tabs

Ubercart Checkout Tabs

One of the clients I work for requested the ability to have the checkout of Ubercart split up in a multi-step process.

Ubercart is built having a one-page checkout process in mind, so refactoring Ubercart to have a multi-page checkout process would take quite a lot of work, and make the process of updating the core modules quite difficult.

This module provides some jQuery to convert the fieldsets in the checkout process of ubercart to a tabbed interface.

Enable this module and the checkout page gets tabbed.

The modules requires following modules:

  • jquery_ui
  • jquery_update
  • uc_cart
Download this module from drupal.org sandbox.
22/08/2011 2 comments Read More
Domain module not working.

Domain module not working.

DrupliconOne of my colleagues had issues with the domain-module while setting it up.

It was impossible to get trough the checklist of the module-configuration, while he actually followed the installation-instructions.

22/08/2011 1 comment Read More