This extension allows you to display a Gravatar in your view files. Full documented and customizable.
Installation Instructions: ¶
- Download the extension
- Unzip the file contents
- Upload the VGGravatarWidget.php file to the extensions folder located under WebRoot/protected/extensions
- Read Usage Instructions.
This should work on all Yii versions (That has widgets working in them), But was tested on version 1.0.9 & 1.1.x .
Inside your view file just paste the following code:
<?php $this->widget('application.extensions.VGGravatarWidget', array( 'email' => 'firstname.lastname@example.org', // email to display the gravatar belonging to it 'hashed' => false, // if the email provided above is already md5 hashed then set this property to true, defaults to false 'default' => 'http://www.mysite.com/default_gravatar_image.jpg', // if an email is not associated with a gravatar this image will be displayed, // by default this is omitted so the Blue Gravatar icon will be displayed you can also set this to // "identicon" "monsterid" and "wavatar" which are default gravatar icons 'size' => 50, // the gravatar icon size in px defaults to 40 'rating' => 'PG', // the Gravatar ratings, Can be G, PG, R, X, Defaults to G 'htmlOptions' => array( 'alt' => 'Gravatar Icon' ), // Html options that will be appended to the image tag )); ?>
Change Log ¶
March 31, 2010 ¶
- Initial release.