• 全国400电话网上服务平台
    强大号码库资源任选,方便,快捷,快速开通。
    咨询热线:400-1100-266  

    dede 问答模块匿名提问的简单处理方法
    POST TIME:2018-10-30 21:57

    post.php文件

    if(empty($uid) && $action != ‘rate’)
    {
    showmsgs(‘no_login’,’../member/login.php?gourl=../ask/’);
    exit;
    }

    1,修改成 或注释掉
    if(empty($uid) && $action != ‘rate’)
    {
    if($action!=’ask’ & $action!=”)
    {
    showmsgs(‘no_login’,’../member/login.php?gourl=../ask/’);
    exit;
    }
    }

    2,注释掉

    /*if($question['uid'] == $uid)

    {

    showmsgs(‘asker_cannot_answer’, ‘-1′);

    }else*/

    3,然后

    if($answer['uid'] != $uid)

    {

    showmsgs(‘unallowed_action’, $backurl);

    }else

    替换成

    if($question['uid'] == $uid)

    {

    showmsgs(‘asker_cannot_answer’, ‘-1′);

    }else

    这样就不能修改答案了,不过这个提示是不会回答自己的问题。

    或者直接注释掉:修改答案部分

    else if($action == ‘modifyanswer’)

    {

    $answer = $dsql->getone("SELECT answer.id, answer.uid, ask.dateline, ask.solvetime, ask.status, ask.expiredtime FROM `2d30_askanswer` answer left join 2d30_ask ask on ask.id=answer.askid WHERE answer.id=’$id’");

    if($answer)

    {

    if($answer['uid'] != $uid)

    {

    showmsgs(‘unallowed_action’, $backurl);

    }elseif($answer['status'] != 0)

    {

    showmsgs(‘question_solved’, $backurl);

    }elseif($answer['expiredtime'] < $timestamp)

    {

    showmsgs(‘question_expired’, $backurl);

    }

    } else

    {

    showmsgs(‘question_nonexistence’);

    }

    if(trim($content) == ”)

    {

    showmsgs(‘post_answer_isnull’);

    }

    if(strlen($content) > 10000)

    {

    showmsgs(‘post_answer_toolong’);

    }

    if(strlen($brief) > 200)

    {

    showmsgs(‘post_brief_toolong’, ‘-1′);

    }

    if($dsql->ExecuteNoneQuery("update 2d30_askanswer set content=’$content’, brief=’$brief’ where id=’$id’"))

    {

    showmsgs(‘modifyanswer_success’,$backurl);

    }else

    {

    showmsgs(‘modifyanswer_failed’,$backurl);

    }

    }

    question.php

    注释

    if($question['uid'] == $uid)

    {

    $publisher = 1;

    }

     

    
    关于我们 | 付款方式 | 建站知识 | 增值服务 | 网站模板
    Copyright © 2003-2016
    时间:9:00-21:00 (节假日不休)
    版权所有:巨人网络(扬州)科技有限公司
    总部地址:江苏省信息产业基地11号楼四层
    《增值电信业务经营许可证》 苏B2-20120278
    X

    截屏,微信识别二维码

    微信号:veteran88

    (点击微信号复制,添加好友)

     打开微信

    微信号已复制,请打开微信添加咨询详情!