As a rule of thumb, all of the /data content files (attachments, avatars, etc.) are stored in a folder name that is the ID value divided by 1000 and then taking the 'floor' value of it.how does it work out the 21 folder, why not 2 or 219?
floor($this->user_id / 1000); It works out to 1,000 files per folder as Brogan mentioned.178664/1000 = 178 (rounded)where is it getting the 178 directory from though?
As a rule of thumb, all of the /data content files (attachments, avatars, etc.) are stored in a folder name that is the ID value divided by 1000 and then taking the 'floor' value of it.floor($this->user_id / 1000);It works out to 1,000 files per folder as Brogan mentioned.
178664/1000 = 178 (rounded)
Thanks Kevin & Brogan
<xf:set var="$image">{$User.getAvatarUrl('s', null, true)}</xf:set> to set a variable named '$image' to get the user's avatar URL assuming that $User is your user entity. If you're working with a thread then you could use something like <xf:set var="$image">{$thread.User.getAvatarUrl('s', null, true)}</xf:set> instead.If this is something you're doing inside of XF, you can use the function $User.getAvatarUrl({size}) to grab the URL where {size} would be 's' for small. In a template, for example, you could use this inline
<xf:set var="$image">{$User.getAvatarUrl('s', null, true)}</xf:set>to set a variable named '$image' to get the user's avatar URL assuming that $User is your user entity. If you're working with a thread then you could use something like<xf:set var="$image">{$thread.User.getAvatarUrl('s', null, true)}</xf:set>instead.
We use essential cookies to make this site work, and optional cookies to enhance your experience.