Adding new variable for the Author Pane (Follow Links)

Here's how to adding new variable for the Author Pane (Follow links). The demo is on Bersosial.com.

function template_preprocess_author_pane(&$variables) {

  $variables['user_follow'] = '';
  $uid = $variables['account']->uid;
  $name1 = 'twitter';
  $name2 = 'googleplus';

  $twitter = db_query('SELECT path FROM {follow_links} WHERE uid = :uid and name = :name', array(':uid' => $uid, ':name' => $name1))->fetchField();
  $googleplus = db_query('SELECT path FROM {follow_links} WHERE uid = :uid and name = :name', array(':uid' => $uid, ':name' => $name2))->fetchField();
  
  if (!empty($twitter)) {
     $twitter = ' <a href="' .$twitter. '"><img typeof="foaf:Image" alt="Follow me on Twitter" title="Follow me on Twitter" src="/sites/all/modules/follow/icons/wpzoom26/icon-twitter.png"/></a> ';
     $variables['user_follow'] .= $twitter;
  }

  if (!empty($googleplus)) {
     $google = ' <a rel="author" href="' .$googleplus. '"><img typeof="foaf:Image" alt="Follow me on Google+" title="Follow me on Google+" src="/sites/all/modules/follow/icons/wpzoom26/icon-googleplus.png"/></a> ';
     $variables['user_follow'] .= $google;
  }

}

After that add the following code in author-pane.tpl.php or advanced-forum.naked.author-pane.tpl.php.

<?php /* Follow */ ?>
<?php if (isset($user_follow)): ?>
  <div class="author-pane-line author-follow">
    <?php print $user_follow; ?>
  </div>
<?php endif; ?>

Module used are Follow, Author Pane, and Advanced Forum.

Latest Reform commit: Exclude UID 1

Here is the latest commit for one of my Drupal module, Reform.

But first, what is Reform module?

Perhaps sometimes you want something simple, such as limiting the minimum length and maximum length of a username. This module allows you to do simple things like that.
function reform_name_validate($form, &$form_state) {
  global $user;
  if (isset($form_state['values']['name'])) {
    if ($user->uid != 1) {
      if ($error = reform_validate_name($form_state['values']['name'])) {
        form_set_error('name', $error);
      }
    }
  }
}

UID 1 will always be able to pass through all the long and the short boundaries of username. Read the release note for Reform 7.x-1.0-alpha2.