Пример #1
0
 def POST(self,xiu_id):
     authuser()
     if not xiu_id:
         xiu_id='修改失败,请稍后重试'
     else:
         sql="UPDATE article_class SET class_title='"+string_to_mysqlstr(web.input().atc_class_name)+"', v_id='"+web.input().atc_class_id+"' where class_id=  "+xiu_id+" and class_author='"+web.session.Session.user+"'"
         config.dbw.query(sql)
         html="修改成功"
     return render.menu('',context=html)
Пример #2
0
    def POST(self,gid=None):
        if not web.input().atc_title:
            return render.menu('',context='文章标题不能为空')
        else:
            title=web.input().atc_title
        if not web.input().area_atc:
            return render.menu('',context='文章内容不能为空')
        else:
            text=web.input().area_atc


        sql="update article set atc_title='"+string_to_mysqlstr(title)+"', atc_contents='"+string_to_mysqlstr(text)+"'"+"where atc_id="+gid+";"
        if config.dbw.query(sql):
            res='修改成功'
        else:
            res='修改失败,可能由于您刚才未做任何修改'

        return render.menu('',context=res)
Пример #3
0
def class_add(user,new_class_name):

    sql="insert into article_class(class_author,class_title)values('"+user+"','"+string_to_mysqlstr(new_class_name)+"')"
    return config.dbw.query(sql)
Пример #4
0
        def POST(self):
            from app.models.madmin import authidentcode
            web.header("Content-Type","text/html; charset=utf-8;")
            if cmp(web.session.Session.yzm.upper(),web.input().yzm.upper()):
                return "<script type='text/javascript'>alert('验证码错误,请重新输入');window.location='"+web.input().atc_url+"';</script>"
            else:
                pass

            if not web.input().lyname:

                return "<script type='text/javascript'>alert('姓名是必填项,请输入您的名字');window.location='"+web.input().atc_url+"';</script>"
            elif not web.input().lyemail :

                return "<script type='text/javascript'>alert('邮箱是必填项,请输入您的邮箱地址');window.location='"+web.input().atc_url+"';</script>"
            elif not web.input().lytext:

                return "<script type='text/javascript'>alert('评论内容不能为空');window.location='"+web.input().atc_url+"';</script>"
            else:
                pass

            if  name_ck(web.input().lyname):
                pass
            else:

                return "<script type='text/javascript'>alert('请正确输入您的名字:格式为字母+数字,并且大于3位');window.location='"+web.input().atc_url+"';</script>"


            if  mail_ck(web.input().lyemail):
                pass
            else:
                return "<script type='text/javascript'>alert('请正确输入您的邮箱');window.location='"+web.input().atc_url+"';</script>"

            sql="insert into ly_tb(atc_id,mes_author,email,mes_text,date) value('"+web.input().atc_id+"','"+web.input().lyname+"','"+web.input().lyemail+"','"+string_to_mysqlstr(web.input().lytext)+"','"+nowtime()+"');"
            config.dbw.query(sql)


            return "<script type='text/javascript'>alert('评论成功!');window.location='"+web.input().atc_url+"';</script>"
Пример #5
0
def add_moods(user,context):

    sql="insert into moods(mood_title,push_date,mood_author) values('"+string_to_mysqlstr(context)+"','"+nowtime()+"','"+user+"')"
    return config.dbw.query(sql)
Пример #6
0
    def POST(self):
        authuser()
        a=web.input().atc_title+"<br>"+web.input().atc_type+"<br>"+web.input().area_atc

        if not web.input().atc_title:
            return render.menu('',context='文章标题不能为空')
        else:
            title=web.input().atc_title
        if not web.input().area_atc:
            return render.menu('',context='文章内容不能为空')
        else:
            text=web.input().area_atc
        if not web.input().atc_type:
            return render.menu('',context='发表文章之前,请先添加文章分类')
        else:
            atc_fl=web.input().atc_type

        sql="insert into article(atc_title,atc_contents,atc_author,push_date,class_id) values('"+string_to_mysqlstr(title)+"','"+string_to_mysqlstr(text)+"','"+web.session.Session.user+"','"+nowtime()+"','"+str(atc_fl)+"')"
        if config.dbw.query(sql):
            res='发表成功'
        else:
            res='发表失败'

        return render.menu('',context=res)