• R/O
  • SSH
  • HTTPS

jeanscms: コミット


コミットメタ情報

リビジョン341 (tree)
日時2014-10-16 07:10:05
作者kmorimatsu

ログメッセージ

Support hiding/disabling comments.

変更サマリ

差分

--- jeanscms/trunk/jeans/libs/admin/admin_comments.php (revision 340)
+++ jeanscms/trunk/jeans/libs/admin/admin_comments.php (revision 341)
@@ -46,24 +46,24 @@
4646 static public function tag_list(&$data,$skin,$limit=20){
4747 switch(self::$mode){
4848 case 'comment':
49- $query='SELECT id,author,itemid,body,xml,"comment" as xtable
49+ $query='SELECT id,author,itemid,body,xml,flags,"comment" as xtable
5050 FROM jeans_comment
5151 WHERE id=<%id%>';
5252 break;
5353 case 'item':
54- $query='SELECT id,author,itemid,body,xml,"comment" as xtable
54+ $query='SELECT id,author,itemid,body,xml,flags,"comment" as xtable
5555 FROM jeans_comment
5656 WHERE itemid=<%id%>
5757 ORDER by id DESC LIMIT <%limit%> OFFSET <%offset%>';
5858 break;
5959 case 'member':
60- $query='SELECT id,author,itemid,body,xml,"comment" as xtable
60+ $query='SELECT id,author,itemid,body,xml,flags,"comment" as xtable
6161 FROM jeans_comment
6262 WHERE author=<%id%>
6363 ORDER by id DESC LIMIT <%limit%> OFFSET <%offset%>';
6464 break;
6565 case 'group':
66- $query='SELECT c.id as id, c.author as author, c.itemid as itemid ,c.body as body, c.xml as xml, "comment" as xtable
66+ $query='SELECT c.id as id, c.author as author, c.itemid as itemid ,c.body as body, c.xml as xml, c.flags as flags, "comment" as xtable
6767 FROM jeans_comment as c, jeans_item as i
6868 WHERE c.itemid=i.id AND i.gid=<%id%>
6969 ORDER by c.id DESC LIMIT <%limit%> OFFSET <%offset%>';
--- jeanscms/trunk/jeans/libs/admin/admin_comment.php (revision 340)
+++ jeanscms/trunk/jeans/libs/admin/admin_comment.php (revision 341)
@@ -61,10 +61,12 @@
6161 static public function action_post_edit(){
6262 if (!self::$itemdata) return;
6363 // use $_GET['commentid'] and $_POST['body_text']
64- if (member::is_admin()) $query='UPDATE jeans_comment SET body=<%body%> WHERE id=<%id%>';
65- elseif (member::logged_in()) $query='UPDATE jeans_comment SET body=<%body%> WHERE id=<%id%> AND author=<%author%>';
64+ if (member::is_admin()) $query='UPDATE jeans_comment SET body=<%body%>, flags=<%flags%> WHERE id=<%id%>';
65+ elseif (member::logged_in()) $query='UPDATE jeans_comment SET body=<%body%>, flags=<%flags%> WHERE id=<%id%> AND author=<%author%>';
6666 else return error::fatal('_ADMIN_NO_PERMISSION');
67- $array=array('body'=>$_POST['body_text'],'id'=>$_GET['cid'], 'author'=>member::setting('id'));
67+ // prepare data array
68+ $post=admin::item_from_post('jeans_comment');
69+ $array=array('body'=>$post['body'],'id'=>$_GET['cid'],'author'=>member::setting('id'),'flags'=>$post['flags']);
6870 sql::query($query,$array);
6971 if (sql::pdo()->errorCode()=='00000') {
7072 $url=empty($_POST['redirect_url'])?_CONF_SELF:$_POST['redirect_url'];
旧リポジトリブラウザで表示