-
Notifications
You must be signed in to change notification settings - Fork 0
/
class.mcheads.plugin.php
36 lines (33 loc) · 1.22 KB
/
class.mcheads.plugin.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
<?php if (!defined('APPLICATION')) exit();
/**
* @copyright Copyright 2008, 2009 Vanilla Forums Inc.
* @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2
* @author Jordan Jones <mister_fix@mc-gc.net>
*/
$PluginInfo['MCHeads Minecraft avatars'] = array(
'Name' => 'MCHeads Minecraft avatars',
'Description' => "Sets your default profile picture as your minecraft avatar.",
'Version' => '1.0.0',
'RequiredApplications' => array('Vanilla' => '2.0.18'),
'Author' => 'Jordan Jones',
'AuthorEmail' => 'Mister_Fix@mc-gc.net',
'AuthorUrl' => 'http://vanillaforums.org/profile/Mister_Fix',
'RequiredTheme' => FALSE,
'HasLocale' => FALSE,
'MobileFriendly' => TRUE,
);
class VanilliconPlugin extends Gdn_Plugin {
public function ProfileController_AfterAddSideMenu_Handler($Sender, $Args) {
if (!$Sender->User->Photo) {
$UserName = GetValue('Name', $Sender->User);
$Sender->User->Photo = 'https://mc-heads.net/avatar/'.$UserName;
}
}
}
if (!function_exists('UserPhotoDefaultUrl')) {
function UserPhotoDefaultUrl($User, $Options = array()) {
$UserName = GetValue('Name', $User);
$PhotoUrl = 'https://mc-heads.net/avatar/'.$UserName;
return $PhotoUrl;
}
}