Skip to content

Commit 39cde26

Browse files
committed
.
1 parent 9a2bc39 commit 39cde26

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+664
-455
lines changed

admin/route/content.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@
272272
empty($message) ? message('message', lang('please_input_message')) : xn_strlen($message) > 2028000 AND message('message', lang('message_too_long'));
273273

274274
// 过滤所有html标签
275-
$_message = filter_all_html($message);
275+
$_message = htmlspecialchars(filter_all_html($message), ENT_QUOTES);
276276

277277
// 过滤内容 关键词
278278

@@ -541,7 +541,7 @@
541541
$message = trim($message);
542542
empty($message) ? message('message', lang('please_input_message')) : xn_strlen($message) > 2028000 AND message('message', lang('message_too_long'));
543543

544-
$_message = filter_all_html($message);
544+
$_message = htmlspecialchars(filter_all_html($message), ENT_QUOTES);
545545
// 过滤内容 关键词
546546

547547
// hook admin_content_update_post_message_center.php
@@ -691,7 +691,8 @@
691691
$tag_json = $len ? xn_substr($tag_json, 0, $len) . '}' : '';
692692
}
693693
}
694-
$arr['tag'] = $tag_json != $thread['tag_fmt'] ? $tag_json : $thread['tag_fmt'];
694+
695+
$tag_json != $thread['tag'] AND $arr['tag'] = $tag_json;
695696

696697
// hook admin_content_update_post_tag_after.php
697698

@@ -721,10 +722,8 @@
721722

722723
// hook admin_content_update_post_arr_after.php
723724

724-
if (!empty($arr)) {
725-
FALSE === well_thread_update($tid, $arr) AND message(-1, lang('update_thread_failed'));
726-
unset($arr);
727-
}
725+
!empty($arr) && FALSE === well_thread_update($tid, $arr) AND message(-1, lang('update_thread_failed'));
726+
unset($arr);
728727

729728
// hook admin_content_update_post_before.php
730729

admin/view/htm/comment_list.htm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
</label>
3030
</div>
3131
<?php } ?>
32-
<!--{hook reply_list_inc_avatar_after.htm}-->
32+
<!--{hook admin_comment__list_inc_avatar_after.htm}-->
3333
<div class="media-body">
3434
<div class="d-flex justify-content-between small text-muted">
3535
<div>
@@ -47,7 +47,7 @@
4747
<span class="date text-grey ml-2"><?php echo $_post['create_date_fmt'];?></span>
4848
<!--{hook admin_comment_list_inc_create_date_after.htm}-->
4949
</div>
50-
<div class="text-right text-grey">
50+
<div class="text-grey">
5151

5252
<!--{hook admin_comment_list_inc_update_before.htm}-->
5353
<?php if($_post['allowupdate']) { ?>
@@ -63,11 +63,11 @@
6363

6464
</div>
6565
</div>
66-
<div class="message mt-1 text-break">
66+
<div class="message mt-2 text-break">
6767

6868
<!--{hook admin_comment_list_inc_subject_before.htm}-->
6969
<?php if('read' != $route && !empty($_post['subject'])) { ?>
70-
<h6><a href="<?php echo ($conf['url_rewrite_on'] < 2 ? '../' : ''),url('read-' . $_post['tid'], '', 2);?>" target="_blank"><?php echo $_post['subject'];?></a></h6>
70+
<h6 class="h6 text-break font-weight-bold"><a href="<?php echo ($conf['url_rewrite_on'] < 2 ? '../' : ''),url('read-' . $_post['tid'], '', 2);?>" target="_blank"><?php echo $_post['subject'];?></a></h6>
7171
<?php } ?>
7272
<!--{hook admin_comment_list_inc_subject_after.htm}-->
7373

admin/view/htm/content_post.htm

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -161,23 +161,24 @@
161161
var files = xn.get_files_from_event(e);
162162
if (!files) return;
163163

164-
var fid = jfid.val();
164+
var fid = jfid.checked();
165165
var forum = forumlist[fid];
166166
var picture_size = forum.thumbnail;
167167

168168
$.each_sync(files, function (i, callback) {
169169
var file = files[i];
170170
xn.upload_file(file, xn.url('attach-create-1', '', 2), {
171-
is_image: 1,
172-
convert: 1, /*转码*/
173-
filetype: 'jpeg', /*压缩类型*/
174-
qulity: '0.7', /*压缩比例*/
175-
width: picture_size.width || "<?php echo $pic_width; ?>",
176-
height: picture_size.height || "<?php echo $pic_height; ?>",
177-
action: "<?php echo array_value($conf, 'upload_resize', 'clip'); ?>",
178-
n: n,
179-
mode: 1, /*缩略图*/
180-
safe_token: safe_token
171+
'fid': fid,
172+
'is_image': 1,
173+
'convert': 1, /*转码*/
174+
'filetype': 'jpeg', /*压缩类型*/
175+
'qulity': '0.7', /*压缩比例*/
176+
'width': picture_size.width || "<?php echo $pic_width; ?>",
177+
'height': picture_size.height || "<?php echo $pic_height; ?>",
178+
'action': "<?php echo array_value($conf, 'upload_resize', 'clip'); ?>",
179+
'n': n,
180+
'mode': 1, /*缩略图*/
181+
'safe_token': safe_token
181182
}, function (code, message) {
182183
if (code != 0) return $.alert(message);
183184
jassoc.attr('src', message.url);
@@ -301,6 +302,10 @@
301302

302303
jform.find('[name="fid"]').checked(fid);
303304

305+
if ($(document.body).width() < 992) {
306+
$('#nav-show').css({"position": "fixed", "top": "0", "bottom": "0", "right": "0", "margin-top": "3.625rem", "z-index": "1032"});
307+
}
308+
304309
$('#content').addClass('show');
305310
$('li.<?php echo $route;?>').addClass('active');
306311
</script>

admin/view/htm/other_cache.htm

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?php include _include(ADMIN_PATH.'view/htm/header.inc.htm');?>
2-
32
<!--{hook admin_other_cache_start.htm}-->
43
<div class="container-fluid">
54
<div class="row">
@@ -8,20 +7,22 @@
87
<div class="card-body">
98
<form action="<?php echo url('other-cache', '', TRUE);?>" method="post" id="form">
109
<?php echo $input['safe_token'];?>
11-
<div class="form-group row">
12-
<label class="col-sm-6 form-control-label"><?php echo lang('admin_clear_tmp');?></label>
13-
<div class="col-sm-6">
14-
<?php echo $input['clear_tmp'];?>
15-
</div>
16-
</div>
17-
18-
<div class="form-group row">
19-
<label class="col-sm-6 form-control-label"><?php echo lang('admin_clear_cache');?></label>
20-
<div class="col-sm-6">
21-
<?php echo $input['clear_cache'];?>
22-
</div>
23-
</div>
24-
10+
<div class="row">
11+
<div class="col-6 col-md-3 mx-auto">
12+
<div class="form-group d-flex justify-content-between">
13+
<label class="form-control-label"><?php echo lang('admin_clear_tmp');?></label>
14+
<div>
15+
<?php echo $input['clear_tmp'];?>
16+
</div>
17+
</div>
18+
<div class="form-group d-flex d-flex justify-content-between">
19+
<label class="form-control-label"><?php echo lang('admin_clear_cache');?></label>
20+
<div>
21+
<?php echo $input['clear_cache'];?>
22+
</div>
23+
</div>
24+
</div>
25+
</div>
2526
<div class="form-group row">
2627
<div class="col-sm-12">
2728
<button type="submit" class="btn btn-danger btn-block col-md-3 mx-auto" id="submit" data-loading-text="<?php echo lang('submiting');?>..."><?php echo lang('confirm');?></button>
@@ -33,10 +34,8 @@
3334
</div>
3435
</div>
3536
</div>
36-
<!--{hook admin_other_cache_end.htm}-->
37-
37+
<!--{hook admin_other_cache_end.htm}-->
3838
<?php include _include(ADMIN_PATH.'view/htm/footer.inc.htm');?>
39-
4039
<script>
4140
var jform = $('#form');
4241
jform.on('submit', function() {

admin/view/htm/plugin_list.htm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919

2020
<article class="d-flex thread" dir="<?php echo $dir; ?>">
2121
<div class="d-none d-md-block mx-3">
22-
<a data-modal-title="<?php echo $plugin['name']; ?>" data-modal-size="lg" href="<?php echo url('plugin-read', array('dir'=>$dir), TRUE);?>">
22+
<a href="<?php echo url('plugin-read', array('dir'=>$dir), TRUE);?>">
2323
<img src="<?php echo $plugin['icon_url']; ?>" width="54" height="54" />
2424
</a>
2525
</div>
2626
<div class="col row p-0 m-0">
2727
<div class="col-lg-3">
2828
<p class="text-break font-weight-bold d-inline m-0">
29-
<a data-modal-title="<?php echo $plugin['name']; ?>" href="<?php echo url('plugin-read', array('dir'=>$dir), TRUE);?>" data-modal-size="lg">
29+
<a href="<?php echo url('plugin-read', array('dir'=>$dir), TRUE);?>">
3030
<?php echo $plugin['name']; ?>
3131
</a>
3232
<i class="icon-rmb mx-1"></i>
@@ -46,7 +46,7 @@
4646
<div class="d-flex justify-content-start mb-3">
4747
<!-- 付费查看详情 -->
4848
<?php if('official_fee' == $action && !$plugin['downloaded']) { ?>
49-
<a role="button" data-modal-title="<?php echo $plugin['name']; ?>" data-modal-size="lg" class="btn btn-primary btn-sm buy mx-1" href="<?php echo url('plugin-read', array('dir'=>$dir), TRUE);?>"><?php echo lang('buy');?></a>
49+
<a role="button" class="btn btn-primary btn-sm buy mx-1" href="<?php echo url('plugin-read', array('dir'=>$dir), TRUE);?>"><?php echo lang('buy');?></a>
5050
<?php } ?>
5151

5252
<?php if('official_free' == $action && !$plugin['downloaded']) { ?>

admin/view/htm/plugin_read.htm

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,19 +135,20 @@ <h4>
135135
<?php } ?>
136136

137137
<?php if($plugin['installed'] && !$plugin['enable'] && 1 != $plugin['type']) { ?>
138-
<a role="button" class="btn btn-secondary mx-1" href="<?php echo url('plugin-enable', array('dir'=>$dir,'safe_token' => $safe_token), TRUE); ?>"><?php echo lang('enable');?></a>
138+
<a role="button" class="install btn btn-secondary mx-1" data-href="<?php echo url('plugin-enable', array('dir'=>$dir,'safe_token' => $safe_token), TRUE); ?>" href="javascript:void(0);"><?php echo lang('enable');?></a>
139139
<?php } ?>
140140

141141
<?php if($plugin['installed'] && 1 != $plugin['type']) { ?>
142-
<a role="button" class="btn btn-danger mx-1 confirm" data-method="post" data-confirm-text="<?php echo lang('plugin_uninstall_confirm_tips', array('name'=>$plugin['name']));?>" href="<?php echo url('plugin-uninstall', array('dir'=>$dir,'safe_token' => $safe_token), TRUE); ?>"><?php echo lang('uninstall');?></a>
142+
<a role="button" class="uninstall btn btn-danger confirm mx-1" data-method="post" data-confirm-text="<?php echo lang('plugin_uninstall_confirm_tips', array('name'=>$plugin['name']));?>" href="<?php echo url('plugin-uninstall', array('dir'=> $dir, 'safe_token' => $safe_token), TRUE); ?>"><?php echo lang('uninstall');?></a>
143143
<?php } ?>
144144

145145
<?php if($islocal && !$plugin['installed'] && 1 == $plugin['type']) { ?>
146146
<a role="button" class="btn btn-primary mx-1 install" data-href="<?php echo url('plugin-theme', array('dir'=>$dir,'type'=>1,'safe_token' => $safe_token), TRUE);?>" href="javascript:void(0);"><?php echo lang('install');?></a>
147+
147148
<?php } ?>
148149

149150
<?php if($plugin['installed'] && 1 == $plugin['type']) { ?>
150-
<a role="button" class="btn btn-danger mx-1 uninstall" data-href="<?php echo url('plugin-theme', array('dir'=>$dir,'type'=>0,'safe_token' => $safe_token), TRUE);?>" href="javascript:void(0);"><?php echo lang('uninstall');?></a>
151+
<a role="button" class="uninstall btn btn-danger confirm mx-1" data-method="post" data-confirm-text="<?php echo lang('plugin_uninstall_confirm_tips', array('name'=>$plugin['name']));?>" data-href="<?php echo url('plugin-theme', array('dir'=>$dir,'type'=>0), TRUE);?>" href="javascript:void(0);"><?php echo lang('uninstall');?></a>
151152
<?php } ?>
152153

153154
<?php if($plugin['have_upgrade']) { ?>

admin/view/htm/thread_post.inc.htm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
<div class="form-group">
88
<!--{hook admin_thread_post_inc_fid_select_before.htm}-->
99
<select class="custom-select mr-1 w-auto" name="fid">
10-
<?php foreach ($columnlist as $forum) { ?>
11-
<option value="<?php echo $forum['fid']; ?>">
12-
<?php echo $forum['name']; ?>
10+
<?php foreach ($columnlist as $_column) { ?>
11+
<option value="<?php echo $_column['fid']; ?>">
12+
<?php echo $_column['name']; ?>
1313
</option>
1414
<?php } ?>
1515
</select>

index.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
$header = array(
4141
'title' => $conf['sitename'],
4242
'mobile_title' => '',
43-
'mobile_link' => './',
43+
'mobile_link' => $conf['path'],
4444
'keywords' => '',
4545
'description' => strip_tags($conf['sitebrief']),
4646
'navs' => array(),

install/install.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ CREATE TABLE `wellcms_kv` (
134134
`expiry` int(11) unsigned NOT NULL default '0', # 过期时间
135135
PRIMARY KEY(`k`)
136136
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
137-
INSERT INTO `wellcms_kv` (`k`, `v`, `expiry`) VALUES ('setting', '{"conf":{"name":"WellCMS Oriental Lion","version":"2.0.11","official_version":"2.0.11","last_version":"0","version_date":"0","installed":0,"setting":{"website_mode":2,"tpl_mode":0,"map":"map","verify_thread":0,"verify_post":0,"verify_special":0,"thumbnail_on":1,"save_image_on":1},"picture_size":{"width":170,"height":113},"theme":"","shield":[],"index_stickys":0,"index_flags":"0","index_flagstr":""}}', 0);
137+
INSERT INTO `wellcms_kv` (`k`, `v`, `expiry`) VALUES ('setting', '{"conf":{"name":"WellCMS Oriental Lion","version":"2.0.12","official_version":"2.0.12","last_version":"0","version_date":"0","installed":0,"setting":{"website_mode":2,"tpl_mode":0,"map":"map","verify_thread":0,"verify_post":0,"verify_special":0,"thumbnail_on":1,"save_image_on":1},"picture_size":{"width":170,"height":113},"theme":"","shield":[],"index_stickys":0,"index_flags":"0","index_flagstr":""}}', 0);
138138

139139
# 缓存表 用来保存临时数据
140140
DROP TABLE IF EXISTS `wellcms_cache`;
@@ -261,7 +261,7 @@ CREATE TABLE `wellcms_website_flag_thread` (
261261
DROP TABLE IF EXISTS `wellcms_website_operate`;
262262
CREATE TABLE `wellcms_website_operate` (
263263
`logid` int(11) unsigned NOT NULL AUTO_INCREMENT,
264-
`type` tinyint(3) NOT NULL DEFAULT '0', # 1删除 2移动 3置顶 4取消置顶 5禁止回复 6关闭 7打开 8操作人民币 9操作金币 10操作积分 11删除节点 12删除节点分类 13审核专题 14删除专题 15归类专题主题 16删除专题主题 17删除用户 18禁止用户 19编辑用户
264+
`type` tinyint(3) NOT NULL DEFAULT '0', # 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审核评论
265265
`uid` int(11) unsigned NOT NULL DEFAULT '0', # 版主 uid
266266
`tid` int(11) unsigned NOT NULL DEFAULT '0', # 主题tid
267267
`pid` int(11) unsigned NOT NULL DEFAULT '0', # 评论pid

model/attach.func.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,30 @@ function well_attach_delete_by_tid($tid)
181181
return count($attachlist);
182182
}
183183

184+
/*
185+
* @param $tids 数组array(1,2,3)
186+
* @param $n 图片和附件总数量
187+
* @return int 返回清理数量
188+
*/
189+
function well_attach_delete_by_tids($tids, $n)
190+
{
191+
global $conf;
192+
193+
$attachlist = well_attach__find(array('tid' => $tids), array('aid' => 1), 1, $n);
194+
if (!$attachlist) return 0;
195+
196+
$aids = array();
197+
foreach ($attachlist as $attach) {
198+
$path = $conf['upload_path'] . 'website_attach/' . $attach['filename'];
199+
is_file($path) AND unlink($path);
200+
$aids[] = $attach['aid'];
201+
}
202+
203+
well_attach__delete($aids);
204+
205+
return count($aids);
206+
}
207+
184208
// 获取 $filelist $imagelist
185209
function well_attach_find_by_pid($pid)
186210
{

0 commit comments

Comments
 (0)