index.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. require("../../../class/connect.php");
  3. require("../../../class/q_functions.php");
  4. require("../../../class/db_sql.php");
  5. require("../../class/user.php");
  6. $link=db_connect();
  7. $empire=new mysqlquery();
  8. $editor=2;
  9. eCheckCloseMods('member');//关闭模块
  10. $user=islogin();
  11. $mid=(int)$_GET['mid'];
  12. if(empty($mid))
  13. {
  14. printerror("HaveNotMsg","",1);
  15. }
  16. $r=$empire->fetch1("select mid,title,msgtext,from_userid,from_username,msgtime,haveread,issys from {$dbtbpre}enewsqmsg where mid=$mid and to_username='$user[username]' limit 1");
  17. if(empty($r[mid]))
  18. {
  19. printerror("HaveNotMsg","",1);
  20. }
  21. if($r['issys'])
  22. {
  23. $r[from_username]="<b>系统信息</b>";
  24. }
  25. if(!$r['haveread'])
  26. {
  27. $newhavemsg=0;
  28. if($user['havemsg']==3)
  29. {
  30. $newhavemsg=2;
  31. }
  32. $usql=$empire->query("update ".eReturnMemberTable()." set ".egetmf('havemsg')."='$newhavemsg' where ".egetmf('userid')."='$user[userid]'");
  33. $usql=$empire->query("update {$dbtbpre}enewsqmsg set haveread=1 where mid=$mid");
  34. }
  35. //导入模板
  36. require(ECMS_PATH.'e/template/member/ViewMsg.php');
  37. db_close();
  38. $empire=null;
  39. ?>