2.2.4 - Manually adding user picture to a page
Bit of a strange question, but I'm working on custom profile pages for my forum, and I need to know how to add a user's profile picture to userinfo.php.
I'm guessing I can't just add {photo_link} and expect it to work, so I'd love it if you guys could help me out here. Any input appreciated, as always.
Best Answer
-
Bleistivt Moderator
The default mobile theme does something similar with a themehook:
https://github.com/vanilla/vanilla/blob/e91124/themes/mobile/class.mobilethemehooks.php#L107-L111
Don't use User->Photo directly. This circumvents vanillicon / gravatar and the "User is banned" picture
UserPhoto()
orUserPhotoUrl()
(<- as of 2.2./2.3) can be used.My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations
VanillaSkins.com - Plugins, Themes and Graphics for Vanillaforums OS
6
Answers
Hey @Zhaan
This seems like a late answer, but I have written a quick tip on this topic. You can check it out on my blog/forum here:
http://forum.rastercode.com/9-adding-user-thumbnail-on-vanilla-forum-custom-profile-pages
Preview:
cheers.
That reminds me of http://vanillaforums.org/discussion/28705/for-people-looking-where-to-edit-panel-asset-the-wrong-way
I think your tip is incomplete. People who know how to duplicate a view in their custom theme would be able to make such a small change by themselves. Those who do not know about view overrides would simply search for the file and make the change in the original file.
You better solve it a with a plugin or a theme hook. Or you have to add a short explanation on how to override the view correctly.
Yes I meant to direct this tip to advanced users like the OP's question (since this has not been answered for almost a year), but anyway just updated that post and will add a new article about that next.
And as I have mentioned above, it's a quick tip that I have written for a couple of minutes. I'm sure there are more full solutions than this but that's another topic.
cheers.
The default mobile theme does something similar with a themehook:
https://github.com/vanilla/vanilla/blob/e91124/themes/mobile/class.mobilethemehooks.php#L107-L111
Don't use User->Photo directly. This circumvents vanillicon / gravatar and the "User is banned" picture
UserPhoto()
orUserPhotoUrl()
(<- as of 2.2./2.3) can be used.My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations
VanillaSkins.com - Plugins, Themes and Graphics for Vanillaforums OS
Hey @Bleistivt That function/object
UserPhoto()
is also a good option but will also generate and display the change profile picture feature which it already has in the sidebar, and it will duplicate that functionality. For a fix on that, it still needs to extract the image tag/resource only via pregmatch or similar.. so it can be customized and display as a normal thumbnail picture.Ok so just have updated with that here..
http://forum.rastercode.com/9-adding-user-thumbnail-on-vanilla-forum-custom-profile-pages/p1#p9
I suggest making tutorials in the tutorial category, you can always link to an old thread rather than bringing up an old question.
grep is your friend.
@rasteron
As x00 says, it would be better to have tutorials on this site, rather than spread around the interwebby. You might also like to contribute tips and tutorials to the community wiki.
Yes, I also have my site to start with and is very related. I'm offering free support here with just my link. I'm sure you also have your own reasons with your time and knowledge spent here.
will do if I got something relevant to add.
@rasteron
Yes, to give something back to the community which has helped me immensely to get my forum exactly how I need and like it.
Personally, I'm not a fan of people using this site to boost their own hits.
I guess we see things differently.
Since we have a tutorials section here, I don't see why you wouldn't add your information there, except that you want to plug you site.
You're being too serious dude, calm down It's just a back link like any other forum and site activity.
yep, not everyone is the same. Like Vanilla there's the opensource side here and there's the business side there. Still nothing wrong with that.
cheers.
Not true, since you're a moderator, check out all my help comments if they are all the same. thank you