Is there a map for templates?
I don't like the idea of going through every single one or searching for them one by one.
I don't like the idea of going through every single one or searching for them one by one.
Ah okay! Then i'd suggest checking out https://xenforo.com/community/resources/xb-user-profile-styles.9916/ as this already seems to do something similar to what your looking for.No lol. My goal is just to create an overlay on avatars, Obviously I won't try to edit each avatar one by one.
src/XF/Template/Compiler/Tag/Avatar.php then running the command php cmd.php xf-dev:recompile-templates will work.return "{$compiler->templaterVariable}->func('avatar', array($user, $size, $canonical, $attributesCode))";
return '"<div class=\'avatar-wrapper\'>" . '
...
data/avatars/h/0/1.jpgdata/avatars/l/0/1.jpgdata/avatars/m/0/1.jpgdata/avatars/o/0/1.jpgdata/avatars/s/0/1.jpg| Folder | Meaning |
| s | small (thumbnail) |
| m | medium |
| l | large |
| h | high-resolution |
| o | original upload |
1 this refers to the user id. These are the files you want to swap.src/XF/Template/Compiler/Tag/Avatar.php and modifying this to render in a new tag? I've never done this before though, and i'm unfamiliar with how the compiler works exactly. So i'd suggest looking into the source code before attempting this.No lol. My goal is just to create an overlay on avatars, Obviously I won't try to edit each avatar one by one.I'm a little confused on what your asking for exactly, but I don't think your going to achieve that using templates alone.
Now I only did a quick look into avatars so if anyone notices incorrect information please do let me know.
Avatars are stored in these files:
data/avatars/h/0/1.jpg
data/avatars/l/0/1.jpg
data/avatars/m/0/1.jpg
data/avatars/o/0/1.jpg
data/avatars/s/0/1.jpg
Folder Meaning s small (thumbnail) m medium l large h high-resolution o original upload
The file is called1this refers to the user id. These are the files you want to swap.
What might be better than manualy editing the avatar files is extending thesrc/XF/Template/Compiler/Tag/Avatar.phpand modifying this to render in a new tag? I've never done this before though, and i'm unfamiliar with how the compiler works exactly. So i'd suggest looking into the source code before attempting this.
Ah okay! Then i'd suggest checking out https://xenforo.com/community/resources/xb-user-profile-styles.9916/ as this already seems to do something similar to what your looking for.No lol. My goal is just to create an overlay on avatars, Obviously I won't try to edit each avatar one by one.
src/XF/Template/Compiler/Tag/Avatar.php then running the command php cmd.php xf-dev:recompile-templates will work.return "{$compiler->templaterVariable}->func('avatar', array($user, $size, $canonical, $attributesCode))";
return '"<div class=\'avatar-wrapper\'>" . '
. $compiler->templaterVariable . '->func("avatar", array(' . $user . ', ' . $size . ', ' . $canonical . ', ' . $attributesCode . ')) . '
. '"<span>Modified!</span></div>"';

Yeah my bad I should have specified that, I was just aiming to show how it could be affected.Better approach:
Extend\XF\Template\Templater::fnAvatarand add the wrapper there.
We use essential cookies to make this site work, and optional cookies to enhance your experience.