/
functions.php
executable file
·31 lines (21 loc) · 1.12 KB
/
functions.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
<?php
function themeConfig($form) {
$navy_gravatar = new Typecho_Widget_Helper_Form_Element_Text('navy_gravatar', NULL, 'claymoreboy@126.com', _t('底部头像'), _t(''));
$navy_gravatar->input->setAttribute('class', 'w-100 mono');
$form->addInput($navy_gravatar->addRule('email', '请填写一个邮箱地址'));
$navy_tips = new Typecho_Widget_Helper_Form_Element_Text('navy_tips', NULL, '一个高端大气上档次的网站', _t('头像提示'), _t(''));
$form->addInput($navy_tips);
$sidebarBlock = new Typecho_Widget_Helper_Form_Element_Checkbox('sidebarBlock',
array('ShowRecentPosts' => _t('显示最新文章'),
'ShowCategory' => _t('显示分类'),
'ShowArchive' => _t('显示归档'),
'ShowRecentComments' => _t('显示最新回复'),
'ShowOther' => _t('显示其它杂项')),
array('ShowRecentPosts', 'ShowCategory'), _t('侧边栏显示'));
$form->addInput($sidebarBlock->multiMode());
}
function getGravatar($email, $s = 40, $d = 'mm', $g = 'g') {
$hash = md5($email);
$avatar = "http://cn.gravatar.com/avatar/$hash?s=$s&d=$d&r=$g";
return $avatar;
}