-
Notifications
You must be signed in to change notification settings - Fork 0
/
gravatar.addon.php
38 lines (30 loc) · 1.11 KB
/
gravatar.addon.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
<?php
/* Copyright (c) 2018 Xvezda <https://xvezda.com> */
if (!defined('__XE__')) exit();
// Load function libraries
require_once(_XE_PATH_ . 'addons/gravatar/gravatar.func.php');
if ($called_position == 'after_module_proc') {
$oMemberModel = getModel('member');
$vars = getGravatarAddonVariables();
// If user login
$logged_info = Context::get('logged_info');
if ($logged_info) {
if (!$logged_info->profile_image || $vars->image_priority) {
$logged_info->profile_image = getGravatarImageByMemberSrl($logged_info->member_srl);
}
}
switch ($this->act) {
case 'dispBoardContent':
if ($this->module_info->use_anonymous === 'Y' && !$vars->anon_active) return;
$oDocument = Context::get('oDocument');
setGravatarImageByMemberSrl($oDocument->getMemberSrl());
$oComments = $oDocument->getComments();
foreach ($oComments as $comment) {
setGravatarImageByMemberSrl($comment->member_srl);
}
default:
break;
}
}
/* End of file gravatar.addon.php */
/* Location: ./addons/gravatar/gravatar.addon.php */