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.

[Mobile Theme] How to use a default userpicture for discussions (requires Gravatar-Plugin)

oliverraduneroliverraduner Contributing to Vanilla since 2010Switzerland ✭✭
edited February 2011 in Vanilla 2.0 - 2.8
It bugged me, that in the mobile view (using the default mobile theme) no userpicture is shown if a user has not uploaded such in his profile. To clarify: a default userimage is only added in your forum, when the Gravatar-Plugin is enabled - but still this does not get applied in the mobile theme.

I fixed this behavior by modifying the mobile theme with the following code.
NOTE: this requires the "Gravatar"-Plugin to be enabled!
  1. Open the file /themes/mobile/views/discussions/helper_functions.php
  2. Replace the code at Line 33 as follows:
    } else { if (Gdn::Config('EnabledPlugins.Gravatar')<>'') { echo Img(Gdn::Config('Plugins.Gravatar.DefaultAvatar', 'plugins/Gravatar/default.gif'), array('alt' => $Discussion->FirstName)); } }
  3. Save & done
Here's a preview of the result:
Vanilla Mobile Theme: apply the default Userpicture from the Gravatar Plugin

@Mark would be nice, if this could be added by default to the Gravatar plugin - or probably even the mobile theme.


Sign In or Register to comment.