diff --git a/src/member/pm.php b/src/member/pm.php index 7955e9b1..78e44818 100755 --- a/src/member/pm.php +++ b/src/member/pm.php @@ -26,29 +26,10 @@ if(!isset($dopost)) //检查用户是否被禁言 CheckNotAllow(); $state=(empty($state))? 0 : intval($state); -/*-------------------- -function __send(){ } -----------------------*/ -if($dopost=='send') -{ - /** 好友记录 **/ - $sql = "SELECT * FROM `#@__member_friends` WHERE mid='{$cfg_ml->M_ID}' AND ftype!='-1' ORDER BY addtime DESC LIMIT 20"; - $friends = array(); - $dsql->SetQuery($sql); - $dsql->Execute(); - while ($row = $dsql->GetArray()) { - $friends[] = $row; - } - include_once(dirname(__FILE__).'/templets/pm-send.htm'); - exit(); -} -/*----------------------- -function __read(){ } -----------------------*/ -else if($dopost=='read') +if($dopost=='read') { - $sql = "SELECT * FROM `#@__member_friends` WHERE mid='{$cfg_ml->M_ID}' AND ftype!='-1' ORDER BY addtime DESC LIMIT 20"; + $sql = "SELECT * FROM `#@__member_friends` WHERE mid='{$cfg_ml->M_ID}' AND ftype!='-1' ORDER BY addtime DESC LIMIT 20"; $friends = array(); $dsql->SetQuery($sql); $dsql->Execute(); @@ -59,12 +40,26 @@ else if($dopost=='read') $row = $dsql->GetOne("SELECT * FROM `#@__member_pms` WHERE id='$id' AND (fromid='{$cfg_ml->M_ID}' OR toid='{$cfg_ml->M_ID}')"); if(!is_array($row)) { - ShowMsg('对不起,你指定的消息不存在或你没权限查看!','-1'); + $result = array( + "code" => -1, + "data" => null, + "msg" => "对不起,你指定的消息不存在或你没权限查看", + ); + echo json_encode($result); exit(); } $dsql->ExecuteNoneQuery("UPDATE `#@__member_pms` SET hasview=1 WHERE id='$id' AND folder='inbox' AND toid='{$cfg_ml->M_ID}'"); $dsql->ExecuteNoneQuery("UPDATE `#@__member_pms` SET hasview=1 WHERE folder='outbox' AND toid='{$cfg_ml->M_ID}'"); - include_once(dirname(__FILE__).'/templets/pm-read.htm'); + $result = array( + "code" => 200, + "data" => array( + "subject" => $row['subject'], + "message" => $row['message'], + "sendtime" => MyDate("Y-m-d H:i", $row['sendtime']), + ), + "msg" => "", + ); + echo json_encode($result); exit(); } /*----------------------- diff --git a/src/member/templets/pm-main.htm b/src/member/templets/pm-main.htm index 68bf47de..eac10975 100755 --- a/src/member/templets/pm-main.htm +++ b/src/member/templets/pm-main.htm @@ -9,7 +9,25 @@ + + 消息管理 - 会员中心 - <?php echo $cfg_webname; ?> + @@ -45,6 +63,8 @@
+
+
@@ -64,8 +84,8 @@ {/dede:datalist} @@ -120,13 +142,15 @@ function DoSubmit(myfolder) { var selid = GetCheckfolderItem(); if (selid == '') { - alert("你没选中任何信息!"); + ShowMsg("你没选中任何信息!"); return false; } if (window.confirm("你确定要删除这些消息么?")) { location = "pm.php?dopost=del&ids=" + selid + "&folder=" + myfolder; } } + + diff --git a/src/member/templets/pm-read.htm b/src/member/templets/pm-read.htm deleted file mode 100755 index d73cbe6b..00000000 --- a/src/member/templets/pm-read.htm +++ /dev/null @@ -1,94 +0,0 @@ - - - - -消息管理 - 会员中心 - <?php echo $cfg_webname; ?> - - - - - - - -
- -
- -
- - -
- -

短消息内容

-
-

- - [回复]

-

- -

-
-
- -
-
- -
- - diff --git a/src/member/templets/pm-send.htm b/src/member/templets/pm-send.htm deleted file mode 100755 index bfffe08b..00000000 --- a/src/member/templets/pm-send.htm +++ /dev/null @@ -1,162 +0,0 @@ - - - - -消息管理 - 会员中心 - <?php echo $cfg_webname; ?> - - - - - - - -
- -
- -
- -
-

发送新短消息

-
- - -

- - - (填写用户的登录id(网址uid=后面跟的id) -

-

- - - (60个字符节以内) -

-

- - - (1000个字符以内) -

- -

- - 看不清?点击更换 - 看不清? 点击更换 -

- - -

- - (答案:) - - -

-

- -
- - -
- - -
-
好友列表
- 管理 -
-
-
所有好友
-
-
    - '.$friend['funame'].''; - } - ?> -
-
-
- -
-
- - - -
-
-
- -
-
- -
- -
{$fields['subject']}"; - else echo "{$fields['subject']}"; + if($fields['hasview']==0) echo "{$fields['subject']}"; + else echo "{$fields['subject']}"; ?> - 未阅读" : '已阅读'); - echo $readmsg; - ?> +
+ 未阅读" : '已阅读'); + echo $readmsg; + ?> +