def admin_editcomment(): comments = None if request.method == 'GET': print('----------admin_editcomment-----GET--------') if request.args.get('act', '')=='del': commentid = request.args.get('commentid', '') operatorDB.del_comment_by_id(commentid) post_id = request.args.get('post_id', '') comments = operatorDB.get_post_comments(post_id) if request.method == 'POST': post_id = request.form.get('id', '') comments = operatorDB.get_post_comments(post_id) return render_template('admin/editcomment_admin.html',comments=comments,SITE_TITLE=setting.SITE_TITLE,BASE_URL=setting.BASE_URL)
def admin_editcomment(): comments = None if request.method == 'GET': print('----------admin_editcomment-----GET--------') if request.args.get('act', '')=='del': commentid = request.args.get('commentid', '') operatorDB.del_comment_by_id(commentid) post_id = request.args.get('post_id', '') comments = operatorDB.get_post_comments(post_id) if request.method == 'POST': post_id = request.form.get('id', '') comments = operatorDB.get_post_comments(post_id) return render_template('admin/editcomment_admin.html',comments=comments,SITE_TITLE=setting.SITE_TITLE,BASE_URL=setting.BASE_URL)
def detailpost(post_id): if request.method == 'POST': operatorDB.add_new_comment(post_id,request.form.get('author', ''),request.form.get('email', ''),request.form.get('url', ''),1,request.form.get('comment', '')) _article = operatorDB.detail_post_by_id(post_id) comments = operatorDB.get_post_comments(post_id) comLen = len(comments) _older,_newer = operatorDB.get_post_older_newer(post_id) return render_template('detailpost.html',_older=_older,_newer=_newer,coms=operatorDB.get_comments_new(),tags = operatorDB.get_all_tag_name(),cats=operatorDB.get_all_cat_name(),links=operatorDB.get_all_links(),post_id=post_id,comLen=comLen,comments=comments,obj=_article,add_time=time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(_article._add_time)))
def detailpost(post_id): if request.method == 'POST': operatorDB.add_new_comment(post_id,request.form.get('author', ''),request.form.get('email', ''),request.form.get('url', ''),1,request.form.get('comment', '')) _article = operatorDB.detail_post_by_id(post_id) comments = operatorDB.get_post_comments(post_id) comLen = len(comments) _older,_newer = operatorDB.get_post_older_newer(post_id) if request.args.get('weixin', '') != '': return render_template('detailpost_weixin.html',post_id=post_id,obj=_article,add_time=time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(_article._add_time))) else: return render_template('detailpost.html',_older=_older,_newer=_newer,coms=operatorDB.get_comments_new(),tags = operatorDB.get_all_tag_name(),cats=operatorDB.get_all_cat_name(),links=operatorDB.get_all_links(),post_id=post_id,comLen=comLen,comments=comments,obj=_article,add_time=time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(_article._add_time)))