Skip to content

Instantly share code, notes, and snippets.

View justcaldwell's full-sized avatar

Michael Caldwell justcaldwell

View GitHub Profile
@justcaldwell
justcaldwell / gist:9143394
Last active August 29, 2015 13:56
One solution when a drush command 'needs a higher bootstrap level to run' on a local install - https://drupal.org/node/1428638. In settings.php, $databases array...
'host' => php_sapi_name() == 'cli' ? '127.0.0.1' : 'localhost',
@justcaldwell
justcaldwell / gist:2843432
Created May 31, 2012 13:29
An implementation of theme_username() shared at the 2012 UT Austin DrupalCamp - Theming 101 Session. Not sure of the original source. This should be pasted into your template.php file.
/**
* Implementation of theme_username()
* Change theme_username below to your_theme_name_username
*/
function theme_username($object, $link = TRUE) {
if ( !$object->profile_first_name && !$object->profile_last_name ) {
if ( $object->uid && function_exists('profile_load_profile') ) {
profile_load_profile($object);
}
}