Exemple #1
0
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')));
}
Exemple #2
0
function add_message()
{
    safe('message');
    global $global, $smarty, $lang;
    $mes_type = post('type');
    $mes_username = post('username');
    $mes_email = post('email');
    $mes_title = post('title');
    $mes_text = post('text');
    $mes_show = post('show');
    if ($mes_type == '' || $mes_username == '' || $mes_email == '' || $mes_title == '' || $mes_text == '') {
        $info_text = $lang['submit_error_info'];
    } else {
        $mes_add_time = time();
        if ($mes_show != '2') {
            $mes_show = '0';
        }
        $obj = new message();
        $obj->set_value('mes_type', $mes_type);
        $obj->set_value('mes_username', $mes_username);
        $obj->set_value('mes_email', $mes_email);
        $obj->set_value('mes_title', $mes_title);
        $obj->set_value('mes_text', $mes_text);
        $obj->set_value('mes_add_time', $mes_add_time);
        $obj->set_value('mes_show', $mes_show);
        $obj->set_value('mes_lang', S_LANG);
        $obj->add();
        if (intval(get_varia('sentmail'))) {
            $email_title = '您的网站有了新的留言';
            $email_text = "[{$mes_type}] {$mes_title} <br /> {$mes_text}";
            call_send_email($email_title, $email_text, $mes_username, $mes_email);
        }
        $info_text = $lang['submit_message'];
    }
    $smarty->assign('info_text', $info_text);
    $smarty->assign('link_text', $lang['go_back']);
    $smarty->assign('link_href', url(array('channel' => 'message')));
}