Quantcast
Channel: Module: Gravatar
Viewing all articles
Browse latest Browse all 42

Re: Module: Gravatar

$
0
0
Your idea should already be supported by gravatar module. By default, the module automatically inserts the gravatar into phorum output, without any template changes. But if you want to modify your templates, you can disable "gravatar autoinsert" in the module's Admin settings, and then use the template variables. The module's Readme file has some example snippets.

To specifically do what you are suggestion, i.e., code for both modules and make the gravatars to be the fallback default, you could do something like this (example shown places either the avatar or gravatar on the Profile, aligned to the right):

Language: HTML
{IF PROFILE->user_avatar} <img src="{PROFILE->user_avatar}" alt="avatar" {IF PROFILE->user_avatar_w} style="width:{PROFILE->user_avatar_w}px; height:{PROFILE->user_avatar_h}px" {/IF} align="right" /> {ELSE} {IF PROFILE->MOD_GRAVATAR} <img src="{PROFILE->MOD_GRAVATAR->url}" align="right"> {/IF} {/IF}

This snippet should display the user's avatar if he has one available, and if not show the user's gravatar. If there is no gravatar for the user, then it will display the default image or a blank gif. Those last options are controlled in the module's Admin settings.

Viewing all articles
Browse latest Browse all 42

Trending Articles