SilverBoy
10-24-2015, 12:58 AM
Hi dears
I used this code to show author avatar in both article page and article preview page (section page).
require_once(DIR . '/includes/functions_user.php');
$avatarurl = fetch_avatar_url($this->content->getUserId());
if ($avatarurl[0]) {
$avatarurl = $avatarurl[0];
}
/* render template and register variables */
vB_Template::preRegister('vbcms_content_article_pa ge',array('avatarurl' => $avatarurl));
vB_Template::preRegister('vbcms_content_article_pr eview',array('avatarurl' => $avatarurl));
I use the hook vbcms_article_populate-end and it works great in article page, but it show the same avatar for all authors in section page, any suggestion to make it works right in section page?
this is the code I use in the templates.
<img class="cms_article_preview_image" src="{vb:raw avatarurl}" alt="{vb:raw $authorname}">
I used this code to show author avatar in both article page and article preview page (section page).
require_once(DIR . '/includes/functions_user.php');
$avatarurl = fetch_avatar_url($this->content->getUserId());
if ($avatarurl[0]) {
$avatarurl = $avatarurl[0];
}
/* render template and register variables */
vB_Template::preRegister('vbcms_content_article_pa ge',array('avatarurl' => $avatarurl));
vB_Template::preRegister('vbcms_content_article_pr eview',array('avatarurl' => $avatarurl));
I use the hook vbcms_article_populate-end and it works great in article page, but it show the same avatar for all authors in section page, any suggestion to make it works right in section page?
this is the code I use in the templates.
<img class="cms_article_preview_image" src="{vb:raw avatarurl}" alt="{vb:raw $authorname}">