-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathpost.php
More file actions
62 lines (51 loc) · 1.8 KB
/
Copy pathpost.php
File metadata and controls
62 lines (51 loc) · 1.8 KB
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
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit;
?>
<?php $this->need('compoment/head.php');?>
<?php $this->widget('Widget_Metas_Category_List')->to($categorys);?>
<?php while ($categorys->next()): ?> <?php if ($this->category ==
$categorys->slug):?>
<?php $slug = $categorys->slug; ?>
<?php $slug_name = $categorys->title; ?>
<?php endif; ?>
<?php endwhile; ?>
<?php
$category = array();
if(empty(CategoryEncrypt(categeid($slug))['Cate_Encrypt_Password'])){
$category['md5_password'] = md5Encode('654321');//初始密码,即加密密码没填的情况下的默认密码,可改动
}
else{
$category['md5_password'] = md5Encode(CategoryEncrypt(categeid($slug))['Cate_Encrypt_Password']);
}
$category['type'] = "category";
$category['category'] = $slug;
$_POST['data'] = $category;
$password = Typecho_Cookie::get('category_'.$slug);
if ((!empty($password) && $password == $category['md5_password']) || $this->user->hasLogin()){
$cookie = true;
}
?>
<?php if(Bsoptions('Cate_Encrypt_open') == true && !empty(CategoryEncrypt(categeid($slug))) && !$cookie):?>
<?php $this->need('modules/lock_article.php'); ?>
<?php else:?>
<?php $this->need('pages/post.php'); ?>
<?php endif; ?>
<script>
articleCid=<?php echo $this->cid;?>;
articleType= 'post';
function addPostView(){if (typeof articleCid != 'undefined' && articleCid) $.post('/',{postview:articleCid,postType:articleType},function (res) {articleCid='';
$('#ahot').html(res.data);
})}
function addPostEditBtn(){
$.post('<?php getIsLogin(); ?>',{action:'find'},function (res) {
res = JSON.parse(res);
switch(res.code){
case 1 :
$('#editbtn').show();
break;
}
})
}
$(function(){addPostView();addPostEditBtn();})
</script>
<?php $this->need('compoment/sidebar.php'); ?>
<?php $this->need('compoment/foot.php'); ?>