mirror of
https://github.com/typecho/typecho.git
synced 2025-04-21 02:01:52 +02:00
修正评论bug
This commit is contained in:
parent
d3f417c95c
commit
5249a641ce
@ -5,6 +5,7 @@ include 'menu.php';
|
||||
|
||||
$stat = Typecho_Widget::widget('Widget_Stat');
|
||||
$comments = Typecho_Widget::widget('Widget_Comments_Admin');
|
||||
$isAllComments = ('on' == $request->get('__typecho_all_comments') || 'on' == Typecho_Cookie::get('__typecho_all_comments'));
|
||||
?>
|
||||
<div class="main">
|
||||
<div class="body container">
|
||||
@ -16,9 +17,9 @@ $comments = Typecho_Widget::widget('Widget_Comments_Admin');
|
||||
. (isset($request->cid) ? '?cid=' . $request->cid : '')); ?>"><?php _e('已通过'); ?></a></li>
|
||||
<li<?php if('waiting' == $request->get('status')): ?> class="current"<?php endif; ?>><a href="<?php $options->adminUrl('manage-comments.php?status=waiting'
|
||||
. (isset($request->cid) ? '&cid=' . $request->cid : '')); ?>"><?php _e('待审核'); ?>
|
||||
<?php if('on' != $request->get('__typecho_all_comments') && $stat->myWaitingCommentsNum > 0 && !isset($request->cid)): ?>
|
||||
<?php if(!$isAllComments && $stat->myWaitingCommentsNum > 0 && !isset($request->cid)): ?>
|
||||
<span class="balloon"><?php $stat->myWaitingCommentsNum(); ?></span>
|
||||
<?php elseif('on' == $request->get('__typecho_all_comments') && $stat->waitingCommentsNum > 0 && !isset($request->cid)): ?>
|
||||
<?php elseif($isAllComments && $stat->waitingCommentsNum > 0 && !isset($request->cid)): ?>
|
||||
<span class="balloon"><?php $stat->waitingCommentsNum(); ?></span>
|
||||
<?php elseif(isset($request->cid) && $stat->currentWaitingCommentsNum > 0): ?>
|
||||
<span class="balloon"><?php $stat->currentWaitingCommentsNum(); ?></span>
|
||||
@ -26,17 +27,17 @@ $comments = Typecho_Widget::widget('Widget_Comments_Admin');
|
||||
</a></li>
|
||||
<li<?php if('spam' == $request->get('status')): ?> class="current"<?php endif; ?>><a href="<?php $options->adminUrl('manage-comments.php?status=spam'
|
||||
. (isset($request->cid) ? '&cid=' . $request->cid : '')); ?>"><?php _e('垃圾'); ?>
|
||||
<?php if('on' != $request->get('__typecho_all_comments') && $stat->mySpamCommentsNum > 0 && !isset($request->cid)): ?>
|
||||
<?php if(!$isAllComments && $stat->mySpamCommentsNum > 0 && !isset($request->cid)): ?>
|
||||
<span class="balloon"><?php $stat->mySpamCommentsNum(); ?></span>
|
||||
<?php elseif('on' == $request->get('__typecho_all_comments') && $stat->spamCommentsNum > 0 && !isset($request->cid)): ?>
|
||||
<?php elseif($isAllComments && $stat->spamCommentsNum > 0 && !isset($request->cid)): ?>
|
||||
<span class="balloon"><?php $stat->spamCommentsNum(); ?></span>
|
||||
<?php elseif(isset($request->cid) && $stat->currentSpamCommentsNum > 0): ?>
|
||||
<span class="balloon"><?php $stat->currentSpamCommentsNum(); ?></span>
|
||||
<?php endif; ?>
|
||||
</a></li>
|
||||
<?php if($user->pass('editor', true) && !isset($request->cid)): ?>
|
||||
<li class="right<?php if('on' == $request->get('__typecho_all_comments')): ?> current<?php endif; ?>"><a href="<?php echo $request->makeUriByRequest('__typecho_all_comments=on'); ?>"><?php _e('所有'); ?></a></li>
|
||||
<li class="right<?php if('on' != $request->get('__typecho_all_comments')): ?> current<?php endif; ?>"><a href="<?php echo $request->makeUriByRequest('__typecho_all_comments=off'); ?>"><?php _e('我的'); ?></a></li>
|
||||
<li class="right<?php if($isAllComments): ?> current<?php endif; ?>"><a href="<?php echo $request->makeUriByRequest('__typecho_all_comments=on'); ?>"><?php _e('所有'); ?></a></li>
|
||||
<li class="right<?php if(!$isAllComments): ?> current<?php endif; ?>"><a href="<?php echo $request->makeUriByRequest('__typecho_all_comments=off'); ?>"><?php _e('我的'); ?></a></li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
|
||||
|
@ -9,7 +9,7 @@ include 'menu.php';
|
||||
<div class="col-group typecho-page-main">
|
||||
<div class="col-mb-12 typecho-list">
|
||||
<?php Typecho_Widget::widget('Widget_Plugins_List_Activated')->to($activatedPlugins); ?>
|
||||
<?php if ($activatedPlugins->have()): ?>
|
||||
<?php if ($activatedPlugins->have() && !empty($activatedPlugins->activatedPlugins)): ?>
|
||||
<h4 class="typecho-list-table-title"><?php _e('启用的插件'); ?></h4>
|
||||
<table class="typecho-list-table">
|
||||
<colgroup>
|
||||
|
@ -13,7 +13,7 @@ update:
|
||||
rm -Rf build/.git
|
||||
rm -Rf build/.gitignore
|
||||
for i in `find build/ -name '*.css'`; do echo $$i && java -Xmx32m -jar yuicompressor-2.4.2.jar $$i --charset UTF-8 -o $$i; done;
|
||||
for i in `find build/admin/javascript/ -name '*.js'`; do echo $$i && java -Xmx32m -jar yuicompressor-2.4.2.jar $$i --charset UTF-8 -o $$i; done;
|
||||
for i in `find build/admin/js/ -name '*.js'`; do echo $$i && java -Xmx32m -jar yuicompressor-2.4.2.jar $$i --charset UTF-8 -o $$i; done;
|
||||
for i in `find build/ -name '*.php'`; do php -l $$i; done;
|
||||
|
||||
|
||||
|
@ -96,6 +96,8 @@ class Typecho_Cookie
|
||||
} else {
|
||||
setcookie($key, $value, $expire, $path);
|
||||
}
|
||||
|
||||
$_COOKIE[$key] = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -128,5 +130,8 @@ class Typecho_Cookie
|
||||
} else {
|
||||
setcookie($key, '', time() - 2592000, $path);
|
||||
}
|
||||
|
||||
unset($_COOKIE[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -100,7 +100,10 @@ class Widget_Comments_Admin extends Widget_Abstract_Comments
|
||||
if ('off' == $this->request->__typecho_all_comments) {
|
||||
Typecho_Cookie::set('__typecho_all_comments', 'off');
|
||||
}
|
||||
$select->where('table.comments.ownerId = ?', $this->user->uid);
|
||||
|
||||
if ('on' != Typecho_Cookie::get('__typecho_all_comments')) {
|
||||
$select->where('table.comments.ownerId = ?', $this->user->uid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user