-
Notifications
You must be signed in to change notification settings - Fork 55
/
functions.php
64 lines (59 loc) · 1.64 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
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
57
58
59
60
61
62
63
64
<?php if (!defined("__TYPECHO_ROOT_DIR__")) {
exit();
}
error_reporting(E_ERROR);
require_once "core/index.php";
/**
* 初始化主题
* @param $archive
* @return void
*/
function themeInit($archive)
{
//评论回复楼层最高999层.这个正常设置最高只有7层
Helper::options()->commentsMaxNestingLevels = 999;
//将最新的评论展示在前
Helper::options()->commentsOrder = "DESC";
// 关闭检查评论来源URL与文章链接是否一致判断
// Helper::options()->commentsCheckReferer = false;
// 强制开启评论markdown
// Helper::options()->commentsMarkdown = "1";
// Helper::options()->commentsHTMLTagAllowed .= "<img class src alt><div class>";
// if (getOptions()->pjaxLoadPage) {
// Helper::options()->commentsAntiSpam = false;
// }
}
/**
* 文章与独立页自定义字段
*/
function themeFields(Typecho_Widget_Helper_Layout $layout)
{
$banner = new Typecho_Widget_Helper_Form_Element_Text(
"thumbnail",
null,
null,
_t("缩略图"),
_t("输入一个图片 url,作为缩略图显示在文章列表,没有则不显示")
);
$layout->addItem($banner);
$keyword = new Typecho_Widget_Helper_Form_Element_Textarea(
"keyword",
null,
null,
_t("SEO 关键词"),
_t("多个关键词用英文下逗号隔开")
);
$layout->addItem($keyword);
$description = new Typecho_Widget_Helper_Form_Element_Textarea(
"description",
null,
null,
_t("SEO 描述"),
_t("简单一句话描述")
);
$layout->addItem($description);
}
$custom_functions = __DIR__ . "/custom/functions.php";
if (file_exists($custom_functions)) {
include_once $custom_functions;
}