-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgravatar.php
More file actions
executable file
·46 lines (33 loc) · 958 Bytes
/
gravatar.php
File metadata and controls
executable file
·46 lines (33 loc) · 958 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
*
* @author Bo Watts http://c3webstudio.com
* @package CodeIgniter
* @subpackage Gravatar
*
*/
class Gravatar {
function __construct()
{
}
public function get_url( $email = '', $size = '100', $default = 'mm' )
{
$email = strtolower($email);
$email = trim($email);
$base_url = 'https://www.gravatar.com/avatar/';
$hash = md5( $email );
$gravatar = $base_url . $hash . '?s='.$size.'d='.$default;
return $gravatar;
}
public function get_img( $email = '', $size = '100', $default = 'mm', $class = '' )
{
$email = strtolower($email);
$email = trim($email);
$base_url = 'https://www.gravatar.com/avatar/';
$hash = md5( $email );
$gravatar = '<img src="'.$base_url . $hash . '?s='.$size.'&d='.$default.'" class="'.$class.'">';
return $gravatar;
}
}
/* End of file gravatar.php */
/* Location: ./application/libraries/gravatar.php */