sfGravatarPlugin - 0.8.0

Lets you easily use Gravatar from http://www.gravatar.com

« Back to the Plugins Home

Signin


Forgot your password?
Create an account

Tools

Stats

Module plugins

Some of the plugins offer one-click modules to easily add complete features to your symfony applications

advanced search
Plugin Information License Installation Readme All Releases Changelog Contribute
sfGravatarPlugin 0.8.0stable for sf 1.1sf 1.0 MIT

Description

This plugins permits to easily enable the gravatars in your Symfony application.

Categories

Leads

Name Email
gravatar Mickael KURMANN moc.liamg <<ta>> nnamruk.leakcim

Developers

Name Email
gravatar Xavier Lacot gro.tocal <<ta>> reivax

sfGravatarPlugin symfony plugin

Overview

Lets you easily use Gravatar from http://site.gravatar.com. Currently supports:

  • caching of the gravatars, with a configurable expiration delay
  • all gravatar options (rating, resizing, etc.)

Installation

Step 1

    symfony plugin-install http://plugins.symfony-project.com/sfGravatarPlugin

    symfony cc

Step 2

Create a directory named g_cache in web/uploads and add full rights to it (note : you can change the directory's name but don't forget to change it in config file).

Step 3 (optional)

  • You can configure you gravatar plugin to your needs by adding the config above in your app.yml
  • You can copy the gravatar_default.png in your cache directory or create yours

Usage

    <?php use_helper('Gravatar') ?>

    <?php echo gravatar_image_tag($email, $gravatar_rating = null, $gravatar_size = null) ?>

More information about rating and size on the gravatar website.

You can set some default option that are common for all of your gravatar in your app.yml:

    all:
      gravatar:
        default_size:   80
        default_rating: G
        default_image:  gravatar_default.png
        cache_dir_name: g_cache
        cache_expiration: 3 days # refer to strtotime() php function for more infos, but you can write 1 week, 1 year, whatever you want

License

For the full copyright and license information, please view the LICENSE file that was distributed with this source code.

The plugin is being developed by Mickael Kurmann (mickael.kurmann <> gmail.com) and Xavier Lacot (xavier@lacot.org)

Todo

  • automatically remove cached gravatar through a cron
  • add unit tests

Changelog

version 0.8 - 2008-08-10:

  • stable release
  • changed documentation to Markdown format (Xavier)
  • added cache for non-existing gravatar emails (Xavier)

version 0.0.1 - 2007-09-22:

  • initial release (Mickael)