BVB Source Codes

Shandong kernel enterprise stand the source code Show mail.php Source code

Return Download Shandong kernel enterprise stand the source code: download mail.php Source code - Download Shandong kernel enterprise stand the source code Source code - Type:.php
  1. <?php
  2. require_once(dirname(__FILE__)."/config.php");
  3. CheckRank(0,0);
  4. $menutype = 'mydede';
  5. setcookie("ENV_GOBACK_URL",$dedeNowurl,time()+3600,"/");
  6. $dopost = isset($dopost) ? trim($dopost) : '';
  7. $folder = isset($folder) ? trim($folder) : '';
  8. $mid = $cfg_ml->M_ID;
  9. if($dopost == '')
  10. {
  11.         if($cfg_mb_spacesta!="-10"){
  12.                 if($cfg_checkemail=='Y'){
  13.                         $row=$dsql->GetOne("SELECT email,checkmail FROM `#@__member` WHERE mid=$mid");
  14.                         if($row['checkmail']=="-1"){
  15.                                  $msg="邮件订阅需要您先进行邮箱验证!</br><a href='mail.php?dopost=sendmail'>点击进行验证</a>";
  16.                            ShowMsg($msg,'-1');
  17.                      exit();
  18.                         }
  19.                 }
  20.         }
  21.         $db->SetQuery("SELECT typeid FROM `#@__mail_order` WHERE mid=$mid");   
  22.         $db->Execute();
  23.         $typeid="";
  24.         while($row = $db->GetArray())
  25.         {
  26.            $typeid.=$row['typeid'].",";
  27.         }
  28.         if($folder=="drop"){
  29.                 $dsql->SetQuery("SELECT t.*,o.mid FROM `#@__mail_type` AS t LEFT JOIN `#@__mail_order` AS o ON t.id=o.typeid WHERE mid=$mid ORDER BY t.id asc");
  30.           $dsql->Execute();
  31.           while($arr = $dsql->GetArray())
  32.           {
  33.                 $rows[]=$arr;
  34.           }
  35.           $rows=empty($rows)? "" : $rows;
  36.           $tpl = new DedeTemplate();
  37.           $tpl->LoadTemplate(DEDEMEMBER.'/templets/mail_drop.htm');
  38.           $tpl->Display();
  39.         }else{
  40.                 $typeid=explode(",",$typeid);
  41.           $dsql->SetQuery("SELECT * FROM `#@__mail_type` ORDER BY id asc");
  42.           $dsql->Execute();
  43.           $inputbox="";
  44.           while($row = $dsql->GetObject())
  45.           {
  46.                 if(in_array($row->id,$typeid)){
  47.         $inputbox.="<li><input type='checkbox' name='mailtype[]' id='{$row->id}' value='{$row->id}' class='np' checked/> <label>{$row->typename}</label></li>\r\n";
  48.         }else{
  49.                 $inputbox.="<li><input type='checkbox' name='mailtype[]' id='{$row->id}' value='{$row->id}' class='np' /> <label>{$row->typename}</label></li>\r\n";
  50.                 }
  51.           }
  52.           $tpl = new DedeTemplate();
  53.           $tpl->LoadTemplate(DEDEMEMBER.'/templets/mail.htm');
  54.           $tpl->Display();
  55.         }
  56. }elseif($dopost == 'save' || $dopost == 'drop'){
  57.         $mailtype=empty($mailtype)? "" : $mailtype;
  58.         $dsql->ExecuteNoneQuery("DELETE FROM #@__mail_order WHERE mid=$mid");
  59.         if($dopost == 'save' && $mailtype==""){
  60.                 ShowMsg("请选择订阅类型!",'mail.php');
  61.           exit();
  62.         }      
  63.         if($dopost=="save") $msg="订阅成功!";
  64.         elseif($dopost=="drop") $msg="退订成功!";
  65.         if(is_array($mailtype)){
  66.                 foreach($mailtype as $type){
  67.                                 $dsql->ExecuteNoneQuery("INSERT INTO #@__mail_order(`typeid` , `mid`)VALUES ('$type', '$mid')");
  68.                 }
  69.         }      
  70.         ShowMsg($msg,'mail.php');
  71.         exit();
  72. }elseif($dopost=='sendmail'){
  73.         $userhash = md5($cfg_cookie_encode.'--'.$cfg_ml->fields['mid'].'--'.$cfg_ml->fields['email']);
  74.   $url = $cfg_basehost.(empty($cfg_cmspath) ? '/' : $cfg_cmspath)."/member/mail.php?dopost=checkmail&mid={$cfg_ml->fields['mid']}&userhash={$userhash}&do=1";
  75.   $url = eregi_replace('http://', '', $url);
  76.   $url = 'http://'.eregi_replace('//', '/', $url);
  77.   $mailtitle = "{$cfg_webname}--会员邮件验证通知";
  78.   $mailbody = '';
  79.   $mailbody .= "尊敬的用户[{$cfg_ml->fields['uname']}],您好:\r\n";
  80.   $mailbody .= "欢迎使用邮件订阅功能。\r\n";
  81.   $mailbody .= "要通过验证,请点击或复制下面链接到地址栏访问这地址:\r\n\r\n";
  82.   $mailbody .= "{$url}\r\n\r\n";
  83.  
  84.         if($cfg_sendmail_bysmtp == 'Y' && !empty($cfg_smtp_server))
  85.         {              
  86.                 $mailtype = 'TXT';
  87.                 require_once(DEDEINC.'/mail.class.php');
  88.                 $smtp = new smtp($cfg_smtp_server,$cfg_smtp_port,true,$cfg_smtp_usermail,$cfg_smtp_password);
  89.                 $smtp->debug = false;
  90.                 if(!$smtp->smtp_sockopen($cfg_smtp_server)){
  91.                   ShowMsg('邮件发送失败,请联系管理员','index.php');
  92.             exit();
  93.                 }
  94.                 $smtp->sendmail($cfg_ml->fields['email'], $cfg_webname,$cfg_smtp_usermail, $mailtitle, $mailbody, $mailtype);
  95.         }else{
  96.                 @mail($cfg_ml->fields['email'], $mailtitle, $mailbody);
  97.         }
  98.         if(empty($cfg_smtp_server)){
  99.                 ShowMsg('邮件发送失败,请联系管理员','index.php');
  100.           exit();
  101.         }else{
  102.                 ShowMsg('成功发送邮件,请登录你的邮箱进行接收!', 'index.php');
  103.                 exit();
  104.         }
  105. }else if($dopost=='checkmail'){
  106.         $mid = intval($mid);
  107.         if(empty($mid))
  108.         {
  109.                 ShowMsg('你的效验串不合法!', '-1');
  110.                 exit();
  111.         }
  112.         $row = $dsql->GetOne("Select * From `#@__member` where mid='{$mid}' ");
  113.         $needUserhash = md5($cfg_cookie_encode.'--'.$mid.'--'.$row['email']);
  114.         if($needUserhash != $userhash)
  115.         {
  116.                 ShowMsg('你的效验串不合法!', '-1');
  117.                 exit();
  118.         }
  119.         $dsql->ExecuteNoneQuery("Update `#@__member` set checkmail=0 where mid='{$mid}' ");
  120.         ShowMsg('操作成功,欢迎使用邮件订阅!', 'mail.php');
  121.         exit();
  122. }
  123. ?>
  124.  
downloadmail.php Source code - Download Shandong kernel enterprise stand the source code Source code
Related Source Codes/Software:
Dede V2.2 dance music program - This system is based on DEDE5.7 sp1 production dan... 2016-11-11
Search engine v1.0 eight grams of novels - This program consists of WEB side and collection p... 2016-11-11
A thief free Jacky novel CMS, support for multiple station collection, support pseudo original SEO - A thief free Jacky novel CMS, support for multiple... 2016-11-11
Kunlun lubricating oil companies stand the source code - Just testing, free, source code is very beautiful ... 2016-11-11
Imitation of Chinese stationmaster net source dreams to 5.7 sp1 source code - Exactly the same and the Director of China network... 2016-11-11
Newscoop CMS v4.0.4 multilingual version - Newscoop is a content management system is mainly ... 2016-11-11
Ku978 navigator free send you department (with acquisition module) - Is I purchase the commercial version of this progr... 2016-11-11
Think of concise message this v1.1 - Wisdom of concise message this V1.1 main functions... 2016-11-11
nvidia-docker - Build and run Docker containers leveraging NVIDIA ... 2017-04-08
quickstart - Angular 2 QuickStart - source from the documentati... 2017-04-08
jQuery-Autocomplete - Ajax Autocomplete for jQuery allows you to easily ... 2017-04-08
Android-Best-Practices - Android best practice examples 2017-04-08
Bootstrap-Admin-Template - Metis - Free Bootstrap Admin Dashboard Template ... 2017-04-08
CocoaSPDY - SPDY for iOS and OS X 2017-04-08
parse-dashboard - A dashboard for managing your Parse apps that aren... 2017-04-08
HoloEverywhere - NO LONGER MAINTAINED. DEVELOP FOR 4.X+ DUDE. 2017-04-08
side-comments - [UNMAINTAINED] An interface component to give your... 2017-04-08
SVG-Morpheus - JavaScript library enabling SVG icons to morph fro... 2017-04-08

 Back to top