Default Avatar url - Printable Version +- MyBB Community Forums (https://community.mybb.com) +-- Forum: Extensions (https://community.mybb.com/forum-201.html) +--- Forum: Plugins (https://community.mybb.com/forum-73.html) +---- Forum: Plugin Development (https://community.mybb.com/forum-68.html) +---- Thread: Default Avatar url (/thread-177009.html) |
Default Avatar url - Leefish - 2015-08-31 I am working on a plugin, and I have this code to display avatars:
But if the default avatar path is different to default (or it isnt a png) then the image link will break. How would I make that default avatar link work with a custom path to a default avatar? RE: Default Avatar url - Devilshakerz - 2015-08-31 You can use the actual default avatar path from settings:
RE: Default Avatar url - Leefish - 2015-08-31 Perfect, thank you very much RE: Default Avatar url - Euan T - 2015-08-31 Also, if you're using 1.8, you can make things even easier using MyBB::get_asset_url():
This will also take into account CDN settings and such. RE: Default Avatar url - Destroy666 - 2015-09-02 Or, even simplier and properly scaled, use format_avatar() in 1.8 which was made exactly for this:
|