Ger wrote: ↑Wed Oct 04, 2017 8:56 am
I'm trying to understand the issue here. Am I correct about:
- The DAE extension hooks into
core.get_avatar_after
to check if the avatar is empty (or always overridden)
- If so, it returns the full HTML string for the avatar image
- In theory, every extension that calls for an avatar should call
phpbb_get_avatar()
so it would call your event
Correct, plus has the feature to be able to override also gravatars (phpBB bug), see ext.php and /config if interested.
Ger wrote: ↑Wed Oct 04, 2017 8:56 am
Now, 1 thing I know for sure is that one extension of mine (cmBB), I use my own avatar fetching, hence the DAE function won't be executed. That might not be the issue for you but I thought it might be worth noting.
Me too in TPOTM I use a my own TPOTM default avatar fetch..but for compatibility with DAE I coded such a condition (here I am making a short case with no bell and whistles)
Code: Select all
public function style_mini_badge()
{
return '<img src="' . $this->ext_path_web() . 'styles/' . rawurlencode($this->user->style['style_path']) . '/theme/images/tpotm_badge.png" />';
}
/* DAE (Default Avatar Extended) extension compatibility */
if ($this->config['threedi_default_avatar_extended'] && $this->config['threedi_default_avatar_exists'])
{
$user_avatar = phpbb_get_avatar($row_avatar, '');
}
else
{
$user_avatar = (!empty($row['user_avatar'])) ? phpbb_get_avatar($row_avatar, '') : $this->style_mini_badge();
}
And DAE it works well on index, both functions work ("use only if no avatar" (and overrides also my default TPOTM) and "replace always" - or if disabled then returns my TPOTM settings) ..
but not in my controller which uses the same conditions.. that leads me to think there is something wrong in my TPOTM controller, also because gives me false negatives.. I will open a new topic for that.
I think the issue isn't of DAE but my TPOTM's controller somehow, I am not able to catch the issue, I recoded a lot of stuffs but the result is the same.
Ger wrote: ↑Wed Oct 04, 2017 8:56 am
Next, the
phpbb_get_avatar()
has 3 different
return
points, 2 of them before your event. That may also be the issue here. You can try all you want with paths and stuff, but you won't succeed since the event isn't called.
Could you pls expand, I read the code but I am missing your point sorry.
Thx.