Index: blog.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/blog/blog.module,v
retrieving revision 1.281
diff -u -r1.281 blog.module
--- blog.module	21 Jun 2007 04:38:41 -0000	1.281
+++ blog.module	25 Jun 2007 09:09:54 -0000
@@ -137,19 +137,7 @@
   if (!empty($account->uid)) {
     drupal_set_title($title = t("@name's blog", array('@name' => $account->name)));
 
-    if (($account->uid == $user->uid) && user_access('edit own blog')) {
-      $output = '<li>'. l(t('Post new blog entry.'), "node/add/blog") .'</li>';
-    }
-    else if ($account->uid == $user->uid) {
-      $output = '<li>'. t('You are not allowed to post a new blog entry.') .'</li>';
-    }
-
-    if ($output) {
-      $output = '<ul>'. $output .'</ul>';
-    }
-    else {
-      $output = '';
-    }
+    $output = theme('blog_new_entry', $account);
 
     $result = pager_query(db_rewrite_sql("SELECT n.nid, n.sticky, n.created FROM {node} n WHERE n.type = 'blog' AND n.uid = %d AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC"), variable_get('default_nodes_main', 10), 0, NULL, $account->uid);
     while ($node = db_fetch_object($result)) {
@@ -291,3 +279,37 @@
     }
   }
 }
+
+/**
+ * Implementation of hook_theme().
+ */
+function blog_theme() {
+  return array(
+    'blog_new_entry' => array(
+      'arguments' => array('account' => NULL),
+    ),
+  );
+}
+
+/**
+ * Theme the 'Post new blog entry' link
+ */
+function theme_blog_new_entry($account) {
+  global $user;
+
+  if (($account->uid == $user->uid) && user_access('edit own blog')) {
+    $output = '<li>'. l(t('Post new blog entry.'), "node/add/blog") .'</li>';
+  }
+  else if ($account->uid == $user->uid) {
+    $output = '<li>'. t('You are not allowed to post a new blog entry.') .'</li>';
+  }
+
+  if (!empty($output)) {
+    $output = '<ul>'. $output .'</ul>';
+  }
+  else {
+    $output = '';
+  }
+
+  return $output;
+}
