I have a block that shows the info for the blogger when on a node or blog associated with that blogger(see code below). What I would like to do is add recent posts (just titles)to the bottom of it. I've tried to use the code listed here:
Display the (x) most recent weblog entries from a specific user
http://drupal.org/node/23230
but i can't get it to display the recent posts. The above snippet is for 4.6 and I am on 4.7. How can I get this to work? I'll bake you brownies for your insight...
<?php
$uid = arg(1);
$user = user_load(array((is_numeric($uid) ? 'uid' : 'name') => $uid, 'status' => 1));
profile_load_profile($user);
if (arg(0) == 'node' && is_numeric(arg(1))) {
// This line works for Drupal 4.7; if using 4.6 uncomment the line below it and comment this one.
$node = node_load(arg(1));
// $node = node_load(array('nid' => arg(1)));
if ($node->type != 'blog') {
return;
}
$user = user_load(array('uid' => $node->uid));
}
if (arg(0) == 'blog' && is_numeric(arg(1))) {
$user = user_load(array('uid' => arg(1)));
}
if (arg(0) == 'forum' && is_numeric(arg(1))) {
$user = user_load(array('uid' => arg(1)));
}
if (!$user) {
return;
}
// ... insert your snippet here. $user is loaded; if it's a blog node, $node is also loaded.
if ($user->picture){print "uid\">
picture\">";}
if ($user->profile_blog_title){
print l($user->profile_blog_title, "blog/$user->uid");}
if ($user->profile_blog_description){print "