예제 #1
0
파일: deal.php 프로젝트: jechiy/xiu-cms
function reply_mes()
{
    global $smarty, $lang;
    $mes_id = post('mes_id');
    $mes_reply = post('mes_reply');
    $obj = new message();
    $obj->set_value('mes_reply', $mes_reply);
    $obj->set_where("mes_id = {$mes_id}");
    $obj->edit();
    $smarty->assign('info_text', '回复留言成功');
    $smarty->assign('link_text', $lang['return_list']);
    $smarty->assign('link_href', url(array('channel' => 'service', 'mod' => 'message_sheet')));
}
예제 #2
0
             dmsg(isset($message['save']) ? $L['message_msg_save_draft'] : $L['message_msg_send'], $forward);
         } else {
             message($do->errmsg);
         }
     } else {
         $touser = isset($touser) ? trim($touser) : '';
         $title = isset($title) ? stripslashes($title) : '';
         $content = isset($content) ? stripslashes($content) : '';
     }
     break;
 case 'edit':
     $itemid or message($L['message_msg_choose']);
     $do->itemid = $itemid;
     if ($submit) {
         clear_upload($message['content']);
         if ($do->edit($message)) {
             dmsg(isset($message['send']) ? $L['message_msg_send'] : $L['message_msg_edit_draft'], '?action=draft');
         } else {
             message($do->errmsg);
         }
     } else {
         $message = $do->get_one();
         if (!$message || $message['status'] != 1 || $message['fromuser'] != $_username) {
             message($L['message_msg_deny']);
         }
         $touser = $message['touser'];
         $title = $message['title'];
         $content = $message['content'];
     }
     break;
 case 'clear':
예제 #3
0
    $template->assign("async", "yes");
    // get the message to edit
    $message = $msg->getMessage($mid);
    $template->assign("message", $message);
    $template->display("editmessageform.tpl");
} elseif ($action == "edit") {
    // check if the user is allowed to edit messages
    if (!$userpermissions["messages"]["edit"]) {
        $errtxt = $langfile["nopermission"];
        $noperm = $langfile["accessdenied"];
        $template->assign("errortext", "<h2>{$errtxt}</h2><br>{$noperm}");
        $template->display("error.tpl");
        die;
    }
    // edit the msg
    if ($msg->edit($mid_post, $title, $text)) {
        if ($redir) {
            $redir = $url . $redir;
            header("Location: {$redir}");
        } else {
            $loc = $url . "managemessage.php?action=showproject&id={$id}&mode=edited";
            header("Location: {$loc}");
        }
    }
} elseif ($action == "del") {
    // check if the user is allowed to delete messages
    if (!$userpermissions["messages"]["del"]) {
        $errtxt = $langfile["nopermission"];
        $noperm = $langfile["accessdenied"];
        $template->assign("errortext", "<h2>{$errtxt}</h2><br>{$noperm}");
        $template->display("error.tpl");
예제 #4
0
} elseif ($action == "edit")
{
    // check if the user is allowed to edit messages
    if (!$userpermissions["messages"]["edit"])
    {
        $errtxt = $langfile["nopermission"];
        $noperm = $langfile["accessdenied"];
        $template->assign("errortext", "<h2>$errtxt</h2><br>$noperm");
        $template->display("error.tpl");
        die();
    }

    $tagobj = new tags();
    $tags = $tagobj->formatInputTags($tags);
    // edit the msg
    if ($msg->edit($mid_post, $title, $text, $tags))
    {
        if ($redir)
        {
            $redir = $url . $redir;
            header("Location: $redir");
        }
        else
        {
            $loc = $url . "managemessage.php?action=showproject&id=$id&mode=edited";
            header("Location: $loc");
        }
    }
} elseif ($action == "del")
{
    // check if the user is allowed to delete messages