private function vxCreateSubstance($rt)
 {
     /* when error */
     if ($rt['errors'] > 0) {
         echo '<div id="main"><span class="text"><table width="385" cellpadding="0" cellspacing="0" border="0">';
         echo '<form action="/message/create.vx" method="post">';
         echo '<tr><td width="385" height="28" colspan="2" valign="middle"><h3><img src="/img/mtico_mail_new.gif" align="absmiddle" />&nbsp;&nbsp;' . Vocabulary::action_composemessage . ' | 有些错误</h3></td></tr>';
         echo '<tr><td width="65" height="20" align="right">收件人&nbsp;&nbsp;</td><td width="320" height="20" align="left"><input type="text" name="msg_receivers" class="sl" value="' . make_single_return($rt['msg_receivers_value']) . '" /></td></tr>';
         echo '<tr><td width="65" height="20" align="right"></td><td width="320" height="20" align="left"><span class="tip">';
         if ($rt['msg_receivers_error'] > 0) {
             echo $rt['msg_receivers_error_msg'][$rt['msg_receivers_error']];
         } else {
             echo '&nbsp;';
         }
         echo '</span></td></tr>';
         echo '<tr><td width="65" height="20" align="right" valign="top">消息内容&nbsp;&nbsp;</td><td width="320" height="120" align="left"><span class="tip"><textarea id="msgBody" name="msg_body" class="ml">' . make_multi_return($rt['msg_body_value']) . '</textarea></td></tr>';
         echo '<tr><td width="65" height="20" align="right"></td><td width="320" height="20" align="left"><span class="tip">';
         if ($rt['msg_body_error'] > 0) {
             echo $rt['msg_body_error_msg'][$rt['msg_body_error']];
         } else {
             echo '&nbsp;';
         }
         echo '</span></td></tr>';
         echo '<tr><td width="65" height="20" align="right"></td><td width="320" height="20" align="right"><input type="image" src="/img/mbtn_send.gif" />&nbsp;</td></tr>';
         echo '</form>';
         echo '</table></span></div>';
     } else {
         /* when ok */
         echo '<div id="main">';
         if ($this->User->usr_portrait != '') {
             $img_p = '/img/p/' . $this->User->usr_portrait . '.' . BABEL_PORTRAIT_EXT;
         } else {
             $img_p = '/img/portrait.png';
         }
         echo '<img src="' . $img_p . '" align="left" style="margin: 5px 5px 0px 5px;" class="portrait" />';
         echo '<h1>' . make_plaintext($this->User->usr_nick) . ' | 短消息成功发送!</h1>';
         echo '<h6>' . $this->User->usr_email . '</h6>';
         echo '<h5><br />你口袋里有 ' . $this->User->usr_money_a['str'] . '<h5>';
         echo '<span class="text"><br /><br /><img src="/img/mico_msg.gif" align="absmiddle" />&nbsp;&nbsp;短消息已经被成功发送到以下收件人:<br /><br />';
         foreach ($rt['msg_receivers_n'] as $receiver) {
             echo '&nbsp;&nbsp;<input type="button" class="recv" onclick="location.href=' . "'/message/sent.vx';" . '" value="' . make_single_return($receiver) . '" />';
         }
         $count = count($rt['msg_receivers_v']);
         $expense = BABEL_MSG_PRICE * $count;
         echo '<hr size="1" color="#CACB98" /><img src="/img/mico_info.gif" align="absmiddle" />&nbsp;&nbsp;发送这 ' . $count . ' 条短消息花费了 ' . $expense . ' 个铜币。</span>';
         echo '</div>';
     }
 }
 if ($rt['errors'] > 0) {
     echo '<div class="notify">';
     _v_ico_silk('exclamation');
     echo ' Please check the comment you just submitted.';
     echo '</div>';
     echo '<div class="form">';
     echo '<table width="500" cellspacing="0" cellpadding="2" border="0">';
     echo '<form action="/blog/comment?entry_id=' . $entry_id . '" method="post" id="form_blog_comment">';
     echo '<tr><td width="300">Nick name</td><td width="200" rowspan="7"></td></tr>';
     echo '<tr><td width="300"><input type="text" name="bec_nick" class="sl" value="' . make_single_return($rt['bec_nick_value'], 0) . '" /></td></tr>';
     echo '<tr><td width="300">E-mail&nbsp;&nbsp;<span class="tip"><small>This will not be published.</small></span></td></tr>';
     echo '<tr><td width="300"><input type="text" name="bec_email" class="sl" value="' . make_single_return($rt['bec_email_value'], 0) . '" /></td></tr>';
     echo '<tr><td width="300">Website URL</td></tr>';
     echo '<tr><td width="300"><input type="text" name="bec_url" class="sl" value="' . make_single_return($rt['bec_url_value'], 0) . '" /></td></tr>';
     echo '<tr><td width="300">Comment&nbsp;&nbsp;<span class="tip"><small>Some HTML is OK.</small></span></td></tr>';
     echo '<tr><td width="500" colspan="2"><textarea class="ml" rows="10" name="bec_body">' . make_multi_return($rt['bec_body_value'], 0) . '</textarea></td></tr>';
     if (!$User->vxIsLogin()) {
         echo '<tr><td width="500" colspan="2" align="left"><span class="info">';
         if ($remember) {
             echo '<input checked="checked" class="cb" type="checkbox" name="remember" />';
         } else {
             echo '<input class="cb" type="checkbox" name="remember" />';
         }
         echo ' <small>Remember me on this computer.</info></td></tr>';
     } else {
         echo '<input type="hidden" name="remember" value="on" />';
     }
     echo '<tr><td width="500" colspan="2" align="left">';
     _v_btn_f('Post', 'form_blog_comment');
     echo '</td></tr>';
     echo '</form>';
Ejemplo n.º 3
0
 public function vxBlogEditSave($rt)
 {
     $Entry =& $rt['Entry'];
     $_modes = Weblog::vxGetEditorModes();
     $_comment_permissions = Weblog::vxGetCommentPermissions();
     $Weblog = new Weblog($Entry->bge_pid);
     if ($Entry->bge_published != 0) {
         $published_date = date('Y-n-j', $Entry->bge_published);
         $published_time = date('G:i:s', $Entry->bge_published);
     } else {
         $published_date = date('Y-n-j', time());
         $published_time = date('G:i:s', time());
     }
     _v_m_s();
     echo '<link type="text/css" rel="stylesheet" href="/css/themes/' . BABEL_THEME . '/css_weblog.css" />';
     _v_b_l_s();
     _v_ico_map();
     echo ' <a href="/">' . Vocabulary::site_name . '</a> &gt; ' . $this->User->usr_nick_plain . ' &gt; <a href="/blog/admin.vx">博客网志</a> &gt; <a href="/blog/' . Weblog::DEFAULT_ACTION . '/' . $Weblog->blg_id . '.vx">' . make_plaintext($Weblog->blg_title) . '</a> &gt; ' . make_plaintext($Entry->bge_title) . ' &gt; 编辑文章 <span class="tip_i"><small>alpha</small></span>';
     _v_d_e();
     _v_b_l_s();
     echo '<div align="left"><table cellpadding="5" cellspacing="" border="0" class="form">';
     echo '<form action="/blog/edit/save/' . $Entry->bge_id . '.vx" method="post" id="form_blog_edit">';
     echo '<tr><td colspan="2" align="left"><h1 class="ititle">';
     _v_ico_tango_32('actions/document-new');
     echo ' 撰写新文章</h1> <span class="tip_i">刚才提交的数据中有些问题需要修正</span></td></tr>';
     echo '<tr><td colspan="2" align="right"><input onfocus="brightBox(this);" onblur="dimBox(this);" type="text" class="sllt" name="bge_title" value="' . make_single_return($rt['bge_title_value'], 0) . '" />';
     if ($rt['bge_title_error'] > 0) {
         echo '<br /><span class="tip_i">' . _vo_ico_silk('exclamation') . ' ' . $rt['bge_title_error_msg'][$rt['bge_title_error']] . '</span>';
     }
     echo '</td></tr>';
     echo '<tr><td colspan="2" align="right"><textarea class="ml" rows="30" name="bge_body" style="width: 550px;">' . make_multi_return($rt['bge_body_value'], 0) . '</textarea>';
     if ($rt['bge_body_error'] > 0) {
         echo '<br /><span class="tip_i">' . _vo_ico_silk('exclamation') . ' ' . $rt['bge_body_error_msg'][$rt['bge_body_error']] . '</span>';
     }
     echo '</td></tr>';
     echo '<tr><td width="100" align="right">格式</td><td align="left">';
     echo '<select name="bge_mode">';
     foreach ($_modes as $key => $mode) {
         if ($rt['bge_mode_value'] == $key) {
             echo '<option value="' . $key . '" selected="selected">' . $mode . '</option>';
         } else {
             echo '<option value="' . $key . '">' . $mode . '</option>';
         }
     }
     echo '</select>';
     echo '</td></tr>';
     echo '<tr><td width="100" align="right">评论许可</td><td align="left">';
     echo '<select name="bge_comment_permission">';
     foreach ($_comment_permissions as $key => $mode) {
         if ($rt['bge_comment_permission_value'] == $key) {
             echo '<option value="' . $key . '" selected="selected">' . $mode . '</option>';
         } else {
             echo '<option value="' . $key . '">' . $mode . '</option>';
         }
     }
     echo '</select>';
     echo '</td></tr>';
     echo '<tr><td width="100" align="right">标签</td><td align="left"><input onfocus="brightBox(this);" onblur="dimBox(this);" type="text" class="sll" name="bge_tags" value="" /></td></tr>';
     echo '<tr><td width="100" align="right">状态</td><td align="left">';
     echo '<select name="bge_status">';
     if ($rt['bge_status_value'] == 1) {
         echo '<option value="0">草稿</option>';
         echo '<option value="1" selected="selected">公开发布</option>';
     } else {
         echo '<option value="0" selected="selected">草稿</option>';
         echo '<option value="1">公开发布</option>';
     }
     echo '</select>';
     echo '</td></tr>';
     echo '<tr><td width="100" align="right">发布时间</td><td align="left"><input onfocus="brightBox(this);" onblur="dimBox(this);" type="text" class="sl" name="bge_published_date" value="' . $published_date . '" /> <input onfocus="brightBox(this);" onblur="dimBox(this);" type="text" class="sl" name="bge_published_time" value="' . $published_time . '" /></td></tr>';
     echo '<tr><td colspan="2" valign="middle" align="right" class="toolbar">';
     echo '<input type="submit" value="保存" class="btn_white" /> ';
     echo '<input type="button" value="取消" class="btn_white" onclick="location.href=' . "'/blog/list/{$Weblog->blg_id}.vx'" . ';" /> ';
     echo '<input type="button" value="删除" class="btn_white" onclick="if (confirm(' . "'确认删除?'" . ')) { location.href = ' . "'/blog/erase/24.vx'" . '; } else { return false; }" />';
     echo '</td></tr>';
     echo '</form>';
     echo '</table></div>';
     _v_d_e();
     _v_d_e();
 }
Ejemplo n.º 4
0
 public function vxPostCreate()
 {
     if ($this->User->vxIsLogin()) {
         if (isset($_GET['topic_id'])) {
             $topic_id = intval($_GET['topic_id']);
             if ($this->Validator->vxExistTopic($topic_id)) {
                 $rt = $this->Validator->vxPostCreateMobileCheck($topic_id, $this->User);
                 if ($rt['errors'] == 0) {
                     $this->Validator->vxPostCreateInsert($rt['topic_id'], $this->User->usr_id, '', $rt['reply_value'], $rt['exp_amount']);
                     $Topic = new Topic($rt['topic_id'], $this->db);
                     $Topic->vxTouch();
                     $Topic->vxUpdatePosts();
                     $this->URL->vxToRedirect($this->URL->vxGetTopicViewMobile($topic_id, $_SESSION['babel_page_topic_last_mobile']));
                 } else {
                     $Topic = new Topic($rt['topic_id'], $this->db);
                     $Node = new Node($Topic->tpc_pid, $this->db);
                     $Section = $Node->vxGetNodeInfo($Node->nod_pid);
                     $this->vxHeader(make_plaintext($Topic->tpc_title) . ' - 回复出错');
                     $this->vxBodyStart();
                     $this->vxH1();
                     echo '<div class="content"><small><a href="/' . $_SESSION['babel_page_home_mobile'] . '">V2EX</a> &gt; ' . make_plaintext($Section->nod_title) . ' &gt; ' . make_plaintext($Node->nod_title) . ' &gt; <a href="/t/' . $Topic->tpc_id . '/' . $_SESSION['babel_page_topic_mobile'] . '">' . make_plaintext($Topic->tpc_title) . '</a> &gt; 回复出错</small></div>';
                     echo '<div class="content"><form action="/post/create/mobile/' . $Topic->tpc_id . '.vx" method="post"><small class="error">' . $rt['reply_error_msg'][$rt['reply_error']] . '</small><br /><textarea name="reply" class="textbox" cols="30" rows="4" maxlength="1000">' . make_multi_return($rt['reply_value']) . '</textarea><br /><input type="submit" value="回 复" class="go" />&nbsp;&nbsp;<input type="button" value="取 消" class="go" onclick="location.href=' . "'/t/{$Topic->tpc_id}/{$_SESSION['babel_page_topic_mobile']}';" . '" /></form></div>';
                     $this->vxBottom();
                     $this->vxBodyEnd();
                     $this->vxHTMLEnd();
                 }
             } else {
                 $this->URL->vxToRedirect($this->vxURL->vxGetHome());
             }
         } else {
             $this->URL->vxToRedirect($this->vxURL->vxGetHome());
         }
     } else {
         if (isset($_GET['topic_id'])) {
             $topic_id = intval($_GET['topic_id']);
             $this->URL->vxToRedirect($this->URL->vxGetLogin($this->URL->vxGetTopicViewMoblie($topic_id)));
         } else {
             $this->URL->vxToRedirect($this->URL->vxGetLogin($this->URL->vxGetHome()));
         }
     }
 }
Ejemplo n.º 5
0
function js_alert($msg, $dst, $header = true)
{
    if ($header) {
        header('Content-type: text/html; charset=UTF-8');
    }
    echo '<script type="text/javascript">alert("' . make_multi_return($msg) . '"); location.href = "' . $dst . '";</script>';
}