-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmkp_gravatar.php
56 lines (47 loc) · 1.35 KB
/
mkp_gravatar.php
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
47
48
49
50
51
52
53
54
55
56
function mkp_gravatar($atts)
{
global $thiscomment;
extract(lAtts(array(
'secure' => '0',
'email' => '',
'size' => '80',
'rating' => 'g',
'default' => '',
'force' => '',
'image' => '1',
'alt' => '',
'class' => '',
'id' => '',
'style' => '',
'title' => '',
'disable' => '',
),$atts));
$url = ($secure=='1' || $secure=='y' || $secure=='true') ? 'https://secure.gravatar.com/avatar/' : 'http://www.gravatar.com/avatar/';
$url .= (!empty($email)) ? md5(strtolower(trim(parse($email)))) : md5(strtolower(trim($thiscomment['email'])));
$url .= '?s='. $size . '&r=' . $rating;
if (!empty($default)) {
$url .= '&d='.$default;
$url .= ($force=='1' || $force=='y' || $force=='true') ? '&f=y' : '';
}
if ($image=='1' || $image=='y' || $image=='true') {
$url = '<img src="' . $url . '" height="' . $size . '" width="' . $size . '" ';
if (!empty($alt)) {
$url .= 'alt="' . $alt . '" ';
}
if (!empty($class)) {
$url .= 'class="' . $class . '" ';
}
if (!empty($id)) {
$url .= 'id="' . $id . '" ';
}
if (!empty($style)) {
$url .= 'style="' . $style . '" ';
}
if (!empty($title)) {
$url .= 'title="' . $title . '" ';
}
$url .= '/>';
}
$url = ($disable=='1' || $disable=='y' || $disable=='true') ? '' : $url;
return $url;
}