MyBB Community Forums

Full Version: $mybb->user['avatar'] gives wrong URL?!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi! when using $mybb->user['avatar'] outside the main mybb folder, like in /mybb/subfolder/page.php, It dosn't return the correct URL for the user avator?! it retreive somthing like:
http://www.mydomain.com/mybb/subfolder/images/avatars/avatorimage.gif

how can I solve that?!

Thank's in advance
Include the global.php file?
You'll have to set the path. Inside the database the avatars are "example.gif" and have a type. The type helps set whether the path is the uploads dir, the avatar dir, or a url.

The avatar dir and uploads dir are in settings. If it's a url it should be full url in the DB. Code is going to be required and just adding "$mybb->user['avatar']" to a template won't work.
I think something like "{$mybb->settings['bburl']}/{$mybb->user['avatar']}" would work.
(2010-07-12, 08:27 AM)Mushu Wrote: [ -> ]I think something like "{$mybb->settings['bburl']}/{$mybb->user['avatar']}" would work.

That would not work. See my previous post.
Isn't it just easier to use some sortof custom pages plugin?
MyBBSource has one I think.
labrocca, you are right. I did some changes on template files each in a diff. way to make it work!!! But, that's mean when I change the style of the forum I have to do that again... I don't know why there are alot of problems with the mybb variables!!! I mean they can find a way to make them suitable!? Its not that hard. In a place they work, in another directory they don't, in another they retreive diff. values?!

Polarbear541 & Mushu ... Thank's alot for reply.