4
4
function themeInit ($ data )
5
5
{
6
6
if ($ data ->is ('category ' )||$ data ->is ('search ' )||$ data ->is ('tag ' )||$ data ->is ('author ' )||$ data ->parameter ->type == 'Morecho_archive_page ' )
7
- $ data ->parameter ->pageSize = 2 ^ 32 ;
7
+ $ data ->parameter ->pageSize = 2 << 30 ;
8
8
}
9
9
10
10
function themeConfig ($ form )
@@ -48,6 +48,9 @@ function themeConfig($form)
48
48
$ backgroundsm = new Typecho_Widget_Helper_Form_Element_Text ('backgroundsm ' , NULL , NULL , _t ('移动端背景图片地址 ' ), _t ('在移动端使用长图替换宽图体验更好 ' ));
49
49
$ form ->addInput ($ backgroundsm ->addRule ('xssCheck ' , _t ('请不要使用特殊字符 ' )));
50
50
51
+ $ blurCard = new Typecho_Widget_Helper_Form_Element_Radio ('blurCard ' , array ('false ' => _t ('不启用 ' ), 'true ' => _t ('启用 ' )), 'false ' , _t ('是否启用半透明卡片效果(实验性) ' ), _t ('' ));
52
+ $ form ->addInput ($ blurCard );
53
+
51
54
$ title2 = new Typecho_Widget_Helper_Layout ('div ' , array ('class= ' => 'typecho-page-title ' ));
52
55
$ title2 ->html ('<h2>头衔</h2>
53
56
<p>会在左侧栏和评论区显示</p> ' );
@@ -70,15 +73,15 @@ function themeFields($layout)
70
73
if (preg_match ("/write-page.php/ " , $ _SERVER ['REQUEST_URI ' ])) {
71
74
$ textIndent = new Typecho_Widget_Helper_Form_Element_Select ('textIndent ' , array ('false ' => '不缩进 ' , 'true ' => '缩进 ' ), 'false ' , '开启全文首行缩进 ' );
72
75
$ layout ->addItem ($ textIndent );
73
- $ headImage = new Typecho_Widget_Helper_Form_Element_Text ('headImage ' , NULL , NULL , _t ('头图 ' ), _t ('' ));
76
+ $ headImage = new Typecho_Widget_Helper_Form_Element_Text ('headImage ' , NULL , NULL , _t ('头图 ' ), _t ('输入图片链接 ' ));
74
77
$ layout ->addItem ($ headImage );
75
78
}
76
79
if (preg_match ("/write-post.php/ " , $ _SERVER ['REQUEST_URI ' ])) {
77
80
$ textIndent = new Typecho_Widget_Helper_Form_Element_Select ('textIndent ' , array ('false ' => '不缩进 ' , 'true ' => '缩进 ' ), 'false ' , '开启全文首行缩进 ' );
78
81
$ layout ->addItem ($ textIndent );
79
82
$ foldInIndex = new Typecho_Widget_Helper_Form_Element_Select ('foldInIndex ' , array ('false ' => '不折叠 ' , 'true ' => '折叠 ' ), 'false ' , '在主页列表中折叠 ' );
80
83
$ layout ->addItem ($ foldInIndex );
81
- $ headImage = new Typecho_Widget_Helper_Form_Element_Text ('headImage ' , NULL , NULL , _t ('头图 ' ), _t ('' ));
84
+ $ headImage = new Typecho_Widget_Helper_Form_Element_Text ('headImage ' , NULL , NULL , _t ('头图 ' ), _t ('输入图片链接 ' ));
82
85
$ layout ->addItem ($ headImage );
83
86
$ subtitle = new Typecho_Widget_Helper_Form_Element_Text ('subtitle ' , NULL , NULL , _t ('副标题 ' ), _t ('首页模板功能 ' ));
84
87
$ layout ->addItem ($ subtitle );
@@ -95,18 +98,30 @@ function get_user($uid){
95
98
96
99
function get_post_num ($ id = false ){
97
100
$ db = Typecho_Db::get ();
98
- if ($ id == false ) $ postnum =$ db ->fetchRow ($ db ->select (array ('COUNT(authorId) ' =>'allpostnum ' ))->from ('table.contents ' )->where ('table.contents.type=? ' , 'post ' ));
99
- else $ postnum =$ db ->fetchRow ($ db ->select (array ('COUNT(authorId) ' =>'allpostnum ' ))->from ('table.contents ' )->where ('table.contents.authorId=? ' ,$ id )->where ('table.contents.type=? ' , 'post ' ));
100
- $ postnum = $ postnum ['allpostnum ' ];
101
- return $ postnum ;
101
+ if ($ id == false ) $ postnum =$ db ->fetchRow ($ db
102
+ ->select (array ('COUNT(authorId) ' =>'allpostnum ' ))
103
+ ->from ('table.contents ' )
104
+ ->where ('table.contents.type=? ' , 'post ' ));
105
+ else $ postnum =$ db ->fetchRow ($ db
106
+ ->select (array ('COUNT(authorId) ' =>'allpostnum ' ))
107
+ ->from ('table.contents ' )
108
+ ->where ('table.contents.authorId=? ' ,$ id )
109
+ ->where ('table.contents.type=? ' , 'post ' ));
110
+ return $ postnum ['allpostnum ' ];
102
111
}
103
112
104
113
function get_comment_num ($ id = false ){
105
114
$ db = Typecho_Db::get ();
106
- if ($ id == false ) $ commentnum =$ db ->fetchRow ($ db ->select (array ('COUNT(authorId) ' =>'commentnum ' ))->from ('table.comments ' )->where ('table.comments.authorId=? ' ,$ id )->where ('table.comments.type=? ' , 'comment ' ));
107
- else $ commentnum =$ db ->fetchRow ($ db ->select (array ('COUNT(authorId) ' =>'commentnum ' ))->from ('table.comments ' )->where ('table.comments.type=? ' , 'comment ' ));
108
- $ commentnum = $ commentnum ['commentnum ' ];
109
- return $ commentnum ;
115
+ if ($ id == false ) $ commentnum =$ db ->fetchRow ($ db
116
+ ->select (array ('COUNT(authorId) ' =>'commentnum ' ))
117
+ ->from ('table.comments ' )
118
+ ->where ('table.comments.type=? ' , 'comment ' ));
119
+ else $ commentnum =$ db ->fetchRow ($ db
120
+ ->select (array ('COUNT(authorId) ' =>'commentnum ' ))
121
+ ->from ('table.comments ' )
122
+ ->where ('table.comments.authorId=? ' ,$ id )
123
+ ->where ('table.comments.type=? ' , 'comment ' ));
124
+ return $ commentnum ['commentnum ' ];
110
125
}
111
126
112
127
function get_last_update (){
@@ -123,23 +138,6 @@ function get_last_update(){
123
138
}
124
139
}
125
140
126
- function get_PublishedPostsNum ($ uid ){
127
- $ db = Typecho_Db::get ();
128
- return $ db ->fetchObject ($ db ->select (array ('COUNT(cid) ' => 'num ' ))
129
- ->from ('table.contents ' )
130
- ->where ('table.contents.type = ? ' , 'post ' )
131
- ->where ('table.contents.status = ? ' , 'publish ' )
132
- ->where ('table.contents.authorId = ? ' , $ uid ))->num ;
133
- }
134
-
135
- function get_SpamCommentsNum ($ uid ){
136
- $ db = Typecho_Db::get ();
137
- return $ db ->fetchObject ($ db ->select (array ('COUNT(coid) ' => 'num ' ))
138
- ->from ('table.comments ' )
139
- ->where ('table.comments.status = ? ' , 'spam ' )
140
- ->where ('table.comments.ownerId = ? ' , $ uid ))->num ;
141
- }
142
-
143
141
function get_user_group ($ name = NULL ){
144
142
$ options = Helper::options ();
145
143
$ db = Typecho_Db::get ();
0 commit comments