seekyt
05-15-2012, 06:03 PM
I am having a syntax problem that I hope one of you can help me with.
I have found a way to display the avatars of the post authors in the "Related Posts" part of an article.
By opening up content/plugins/related_posts/related_posts.php and navigating to ~line 250
I add this:
$user = $user = new UserBase();
$user->getUserBasic($h, $h->post->author);
if ($h->isActive('avatar')) {
$h->setAvatar($user->id, 10);
echo
$output .= $h->wrapAvatar();
}
Right before this line:
$output .= "<div class=\"related_posts_link " . $indent . "\">";
Voila - the avatars are displayed. However, I get this major problem:
1624
As you can see, the related posts get repeated - first 0 posts, then 1, then 2, then 3, then 4, and then 5 (I set the max to 5 in the plugin settings). Any idea what I did wrong?
I have found a way to display the avatars of the post authors in the "Related Posts" part of an article.
By opening up content/plugins/related_posts/related_posts.php and navigating to ~line 250
I add this:
$user = $user = new UserBase();
$user->getUserBasic($h, $h->post->author);
if ($h->isActive('avatar')) {
$h->setAvatar($user->id, 10);
echo
$output .= $h->wrapAvatar();
}
Right before this line:
$output .= "<div class=\"related_posts_link " . $indent . "\">";
Voila - the avatars are displayed. However, I get this major problem:
1624
As you can see, the related posts get repeated - first 0 posts, then 1, then 2, then 3, then 4, and then 5 (I set the max to 5 in the plugin settings). Any idea what I did wrong?