酒店行业,物流行业,电子行业,商务培训行业,电气机械行业等解决方案。
  • 经典案例
  • 化工建材
  • 物流速递
  • 机械电子
  • 企业官网
  • 净水环保
  • 2000多个易胜博足球案例,10年的经验积累!
  • 百度排名
  • SEO顾问
  • 百度优化
  • 谷歌优化
  • 常见问题
  • 提供专业百度搜索排名服务,目前已经有100多家企业享受我们的服务。
  • 增值业务
  • 网络营销
  • 企业邮箱
  • 域名抢注
  • 云建站
  • 易胜博足球模板
  • 虚拟主机
  • 我们提供一站式服务,空间、域名、云主机、国内外企业邮箱等。
  • 关于我们
  • 联系我们
  • 关于我们
  • 公司08年9月成立,九易网络和家悠电商。
    Ecms帝国系统-信息反馈发送到邮箱代码
    发布: 2012-09-12 14:05:04 编辑: 浏览:

    方法请修改e/class/q_functions.php文件,直接复制,修改邮箱地址即可.
    //提交反馈信息
    function AddFeedback($add){
            global $empire,$dbtbpre,$level_r,$public_r;
            CheckCanPostUrl();//验证来源
            $bid=(int)getcvar('feedbackbid');
            if(empty($bid))
            {
                    $bid=intval($add[bid]);
            }
            if(empty($bid))
            {
                    printerror("EmptyFeedbackname","history.go(-1)",1);
        }
            //验证码
            $keyvname='checkfeedbackkey';
            if($public_r['fbkey_ok'])
            {
                    ecmsCheckShowKey($keyvname,$add['key'],1);
            }
            //版面是否存在
            $br=$empire->fetch1("select bid,enter,mustenter,filef,groupid,checkboxf from {$dbtbpre}enewsfeedbackclass where bid='$bid';");
            if(empty($br['bid']))
            {
                    printerror("EmptyFeedback","history.go(-1)",1);
            }
            //权限
            if($br['groupid'])
            {
                    $user=islogin();
                    if($level_r[$br[groupid]][level]>$level_r[$user[groupid]][level])
                    {
                            printerror("HaveNotEnLevel","history.go(-1)",1);
                    }
            }
            $pr=$empire->fetch1("select feedbacktfile,feedbackfilesize,feedbackfiletype from {$dbtbpre}enewspublic limit 1");
            //必填项
            $mustr=explode(",",$br['mustenter']);
            $count=count($mustr);

            for($i=1;$i<$count-1;$i++)
            {
                    $mf=$mustr[$i];
                    if(strstr($br['filef'],",".$mf.","))//附件
                    {
                            if(!$pr['feedbacktfile'])
                            {
                                    printerror("NotOpenFBFile","",1);
                            }
                            if(!$_FILES[$mf]['name'])
                            {
                                    printerror("EmptyFeedbackname","",1);
                            }
                    }
                    else
                    {
                            $chmustval=ReturnFBCheckboxAddF($add[$mf],$mf,$br['checkboxf']);
                            if(!trim($chmustval))
                            {
                                echo $add[$mf].'-'.$mf.'-'.$br['checkboxf'];
                                    exit();
                                    printerror("EmptyFeedbackname","",1);
                            }
                    }
            }

            $saytime=date("Y-m-d H:i:s");
            //字段处理
            $dh="";
            $tranf="";
            $record="<!--record-->";
            $field="<!--field--->";
            $er=explode($record,$br['enter']);
            $count=count($er);
            for($i=0;$i<$count-1;$i++)
            {
                    $er1=explode($field,$er[$i]);
                    $f=$er1[1];
                    //附件
                    $add[$f]=str_replace('[!#@-','',$add[$f]);
                    if(strstr($br['filef'],",".$f.","))
                    {
                            if($_FILES[$f]['name'])
                            {
                                    if(!$pr['feedbacktfile'])
                                    {
                                            printerror("NotOpenFBFile","",1);
                                    }
                                    $filetype=GetFiletype($_FILES[$f]['name']);//取得文件类型
                                    if(CheckSaveTranFiletype($filetype))
                                    {
                                            printerror("NotQTranFiletype","",1);
                                    }
                                    if(!strstr($pr['feedbackfiletype'],"|".$filetype."|"))
                                    {
                                            printerror("NotQTranFiletype","",1);
                                    }
                                    if($_FILES[$f]['size']>$pr['feedbackfilesize']*1024)//文件大小
                                    {
                                            printerror("TooBigQTranFile","",1);
                                    }
                                    $tranf.=$dh.$f;
                                    $dh=",";
                                    $fval="[!#@-".$f."-@!]";
                            }
                            else
                            {
                                    $fval="";
                            }
                    }
                    else
                    {
                            $add[$f]=ReturnFBCheckboxAddF($add[$f],$f,$br['checkboxf']);
                            $fval=$add[$f];
                    }
                    $addf.=",`".$f."`";
                    $addval.=",'".doaddslashes(RepPostStr($fval))."'";
            }
            $type=0;
            $userid=(int)getcvar('mluserid');
            $username=RepPostVar(getcvar('mlusername'));
            //上传附件
            if($tranf)
            {
                    $filepath=date("Y-m-d");
                    $path1=ECMS_PATH."d/file/p/".$filepath;
                    $mk=DoMkdir($path1);//不存在则建立目录
                    $dh="";
                    $tranr=explode(",",$tranf);
                    $count=count($tranr);
                    for($i=0;$i<$count;$i++)
                    {
                            $tf=$tranr[$i];
                            //文件名
                            $filetype=GetFiletype($_FILES[$tf]['name']);//取得文件类型
                            $insertfile=md5(uniqid(microtime()));
                            $tranfilename=$insertfile.$filetype;
                            $path=$path1."/".$tranfilename;
                            //上传文件
                            $cp=@move_uploaded_file($_FILES[$tf]['tmp_name'],$path);
                            if($cp)
                            {
                                    DoChmodFile($path);
                                    //写入数据库
                                    $filetime=$saytime;
                                    $filesize=(int)$_FILES[$tf]['size'];
                                    $classid=(int)$classid;
                                    $sql=$empire->query("insert into {$dbtbpre}enewsfile(filename,filesize,adduser,path,filetime,classid,no,type,id,cjid,fpath) values('$tranfilename',$filesize,'[Member]".$username."','$filepath','$filetime',$classid,'[FB]".addslashes(RepPostStr($add[title]))."','$type',0,0,'$public_r[fpath]');");
                                    $repfval=$filepath."/".$tranfilename;
                                    $filename.=$dh.$tranfilename;
                                    $dh=",";
                            }
                            else
                            {
                                    $repfval="";
                            }
                            $addval=str_replace("[!#@-".$tf."-@!]",$repfval,$addval);
                    }
            }
            $ip=egetip();
            $sql=$empire->query("insert into {$dbtbpre}enewsfeedback(bid,saytime,ip,filepath,filename,userid,username".$addf.") values('$bid','$saytime','$ip','$filepath','$filename',$userid,'$username'".$addval.");");
            ecmsEmptyShowKey($keyvname);//清空验证码
            if($sql)
            {
                $feed_id = $empire->lastid();
                $feedback_body = feedback_body($feed_id);
                @include(ECMS_PATH.'e/class/SendEmail.inc.php');
                EcmsToSendMail('要发送的邮件地址',$feedback_body[1],$feedback_body[2]);
                $feedback_url=empty($_POST['feedback_url'])?$public_r[newsurl]:$_POST['feedback_url'];
                    $reurl=DoingReturnUrl($feedback_url,$add['ecmsfrom']);
                    printerror("AddFeedbackSuccess",$reurl,1);
            }
            else
            {printerror("DbError","history.go(-1)",1);}
    }

    /*----信息反馈内容----*/
    function feedback_body($id)
    {
            global $empire,$dbtbpre,$level_r,$public_r;
        $r=$empire->fetch1("select * from {$dbtbpre}enewsfeedback where id='$id' limit 1");
        $br=$empire->fetch1("select bname,enter,filef from {$dbtbpre}enewsfeedbackclass where bid='$r[bid]'");
        $username="游客";
        if($r['userid'])
        {
                $username="<a href="../nfncfs/BeeNfncfs.qiq?fofxt=FejuNfncfs&bnq;vtfsje=&rvpu;.$s["userid']."' target=_blank>".$r['username']."</a>";
        }
        $record="<!--record-->";
        $field="<!--field--->";
        $er=explode($record,$br['enter']);
        $count=count($er);
        for($i=0;$i<$count-1;$i++)
        {
                $er1=explode($field,$er[$i]);
                //附件
                if(strstr($br['filef'],",".$er1[1].","))
                {
                        if($r[$er1[1]])
                        {
                                $fileurl=$public_r['fileurl']."p/".$r[$er1[1]];
                                $val="<b>附件:</b><a href="&rvpu;.$gjmfvsm.&rvpu;" target=_blank>".$r[$er1[1]]."</a>";
                        }
                        else
                        {
                                $val="";
                        }
                    }
                    else
                    {
                            $val=$r[$er1[1]];
                    }
                    $feedbackinfo.="<tr bgcolor='#FFFFFF'><td height=25>".$er1[0].":</td><td><div align=left>".nl2br($val)."</div></td></tr>";
        }
            $body[1]=$br[bname];
            $body[2]='<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#8CBDEF"> <tr class=header>
        <td height="25" colspan="2" bgcolor="#8CBDEF"><font color="#FFFFFF">&nbsp;&nbsp;'.$br['bname'].'</font></td>
      </tr><tr bgcolor="#FFFFFF">
        <td height="25" width="19%">发送时间:</td>
        <td height="25" width="81%" align=left>'.date('Y-m-d',time()).'</td>
      </tr>'.$feedbackinfo.'</table>';
        return $body;
    }
     

    标签:

    旗下业务:筝悦坊 | 古筝网guzheng.wang | 晶彩印务
    版权所有:上海家悠电子商务有限公司 E-mail:lu@9ewl.com
    地址:上海市杨浦区政悦路88弄 沪ICP备14045517号

    收起
    展开