Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Template Tags: User Profile Information

edited April 2011 in Vanilla 2.0 - 2.8
Hello, I am working on a theme and I want to display some user profile info in the top right corner of my banner including their user name which links to their profile. Their avatar, the number of unread messsages, and the number of bookmarked discussions.

I'm using the smarty default.master.tpl file so I'm not sure if that data is already available or if I have to write a small plugin to pull that data first.

Comments

  • Check out the old Vanilla forums theme in the addons section, it does something similar and will probably give you the code you need.
  • edited April 2011
    Thanks @SteveW that definitely helps!

    For future reference the theme is found here:
    http://vanillaforums.org/addon/vanillaclassic-theme
  • Ok I got everything working except the user's profile photo.

    I assumed it would be {$User.Photo} but I guess that column isn't loaded into the $User object.
  • Ok good news! I got it to work, I had to write my own plugin though as I didn't want to modify any files.

    The library/smarty.class.php file puts the user info into it with it's own assign method so I just made a small plugin that gets session info and loads it into a UserData variable including profile avatar.

    I'll try to release shortly as it may come in handy for theme developers.
Sign In or Register to comment.