фикс первого поста, аттача, репортов в топике, прочие мелочи git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@166 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
pherum83 2011-07-27 14:55:05 +00:00
commit 2f22c39c2d
12 changed files with 59 additions and 55 deletions

View file

@ -124,6 +124,24 @@ $lang['KB_TRANSLIT_OPERA7'] = 'Нажмите здесь для перевода
<!-- IF SHOW_VIRTUAL_KEYBOARD --><!-- INCLUDE kb.tpl --><!-- ENDIF --> <!-- IF SHOW_VIRTUAL_KEYBOARD --><!-- INCLUDE kb.tpl --><!-- ENDIF -->
#
#-----[ OPEN / Открыть ]-----------------------------------------
#
templates/default/posting_editor.tpl
#
#-----[ FIND / Найти ]-------------------------------------------
#
class="editor mrg_4" name="message" id="message" rows="18" cols="92"
#
#-----[ ADD / Добавить]------------------------------
#
<!-- IF SHOW_VIRTUAL_KEYBOARD -->
onkeypress = "if(use_kb) return decode(event);"
<!-- ENDIF -->
# #
#-----[ SAVE/CLOSE ALL FILES / Сохранить/Закрыть все файлы]------------------------------------------ #-----[ SAVE/CLOSE ALL FILES / Сохранить/Закрыть все файлы]------------------------------------------

View file

@ -80,11 +80,13 @@ switch($type)
break; break;
case 'del_torrent'; case 'del_torrent';
if (empty($this->request['confirmed'])) $this->prompt_for_confirm('Вы уверены, что хотите удалить торрент?');
delete_torrent($attach_id); delete_torrent($attach_id);
$url = make_url(TOPIC_URL . $torrent['topic_id']); $url = make_url(TOPIC_URL . $torrent['topic_id']);
break; break;
case 'del_torrent_move_topic'; case 'del_torrent_move_topic';
if (empty($this->request['confirmed'])) $this->prompt_for_confirm('Вы уверены, что хотите удалить и перенести топик?');
delete_torrent($attach_id); delete_torrent($attach_id);
$url = make_url("modcp.php?t={$torrent['topic_id']}&mode=move&sid={$userdata['session_id']}"); $url = make_url("modcp.php?t={$torrent['topic_id']}&mode=move&sid={$userdata['session_id']}");
break; } break; }

View file

@ -29,21 +29,26 @@ if (!defined('WORD_LIST_OBTAINED'))
} }
switch($this->request['type']) switch($this->request['type'])
{ case 'delete'; {
case 'delete';
if(!$post) $this->ajax_die('not post'); if(!$post) $this->ajax_die('not post');
$is_auth = auth(AUTH_ALL, $post['forum_id'], $userdata, $post); $is_auth = auth(AUTH_ALL, $post['forum_id'], $userdata, $post);
if($post['post_id'] != $post['topic_first_post_id'] && ($is_auth['auth_mod'] || ($userdata['user_id'] == $post['poster_id'] && $is_auth['auth_delete'] && $post['topic_last_post_id'] == $post['post_id'] && $post['post_time'] + 3600*3 > TIMENOW))) if($post['post_id'] != $post['topic_first_post_id'] && ($is_auth['auth_mod'] || ($userdata['user_id'] == $post['poster_id'] && $is_auth['auth_delete'] && $post['topic_last_post_id'] == $post['post_id'] && $post['post_time'] + 3600*3 > TIMENOW)))
{ if (empty($this->request['confirmed'])) {
if (empty($this->request['confirmed']))
{ {
$this->prompt_for_confirm($lang['CONFIRM_DELETE']); $this->prompt_for_confirm($lang['CONFIRM_DELETE']);
} }
post_delete($post_id); post_delete($post_id);
$this->response['hide'] = true; $this->response['hide'] = true;
$this->response['post_id'] = $post_id; } $this->response['post_id'] = $post_id;
}
else else
{ $this->ajax_die(sprintf($lang['SORRY_AUTH_DELETE'], strip_tags($is_auth['auth_delete_type']))); } {
$this->ajax_die(sprintf($lang['SORRY_AUTH_DELETE'], strip_tags($is_auth['auth_delete_type'])));
}
break; break;
case 'reply'; case 'reply';
@ -73,7 +78,9 @@ switch($this->request['type'])
} }
if(mb_strlen($message, 'UTF-8') > 1000) if(mb_strlen($message, 'UTF-8') > 1000)
{ $this->response['redirect'] = make_url('posting.php?mode=quote&p='. $post_id); } {
$this->response['redirect'] = make_url('posting.php?mode=quote&p='. $post_id);
}
$this->response['quote'] = true; $this->response['quote'] = true;
$this->response['message'] = $message; $this->response['message'] = $message;
@ -91,7 +98,9 @@ switch($this->request['type'])
if(!$post) $this->ajax_die('not post'); if(!$post) $this->ajax_die('not post');
if(mb_strlen($post['post_text'], 'UTF-8') > 1000) if(mb_strlen($post['post_text'], 'UTF-8') > 1000)
{ $this->response['redirect'] = make_url('posting.php?mode=editpost&p='. $post_id); } {
$this->response['redirect'] = make_url('posting.php?mode=editpost&p='. $post_id);
}
else if($this->request['type'] == 'editor') else if($this->request['type'] == 'editor')
{ {
$text = (string) $this->request['text']; $text = (string) $this->request['text'];
@ -160,11 +169,14 @@ switch($this->request['type'])
} }
} }
} }
$hidden_form = '<input type="hidden" name="mode" value="editpost" />';
$hidden_form .= '<input type="hidden" name="'. POST_POST_URL .'" value="'. $post_id .'" />';
$submit = $this->response['redirect'] = make_url('posting.php?mode=editpost&p='. $post_id);
$this->response['text'] = ' $this->response['text'] = '
<form action="posting.php" method="post" name="post"> <form action="posting.php" method="post" name="post">
<input type="hidden" name="mode" value="reply" /> '. $hidden_form .'
<input type="hidden" name="t" value="'. $post['topic_id'] .'" />
<div class="buttons mrg_4"> <div class="buttons mrg_4">
<input type="button" value=" B " name="codeB" title="Bold (Ctrl+B)" style="font-weight: bold; width: 30px;" /> <input type="button" value=" B " name="codeB" title="Bold (Ctrl+B)" style="font-weight: bold; width: 30px;" />
<input type="button" value=" i " name="codeI" title="Italic (Ctrl+I)" style="width: 30px; font-style: italic;" /> <input type="button" value=" i " name="codeI" title="Italic (Ctrl+I)" style="width: 30px; font-style: italic;" />
@ -181,7 +193,7 @@ switch($this->request['type'])
</div> </div>
<textarea id="message-'. $post_id .'" class="editor mrg_4" name="message" rows="18" cols="92">'. $post['post_text'] .'</textarea> <textarea id="message-'. $post_id .'" class="editor mrg_4" name="message" rows="18" cols="92">'. $post['post_text'] .'</textarea>
<div class="mrg_4 tCenter"> <div class="mrg_4 tCenter">
<input title="Alt+Enter" type="submit" name="preview" value="'. $lang['PREVIEW'] .'"> <input title="Alt+Enter" type="'.$submit.'" name="preview" value="'. $lang['PREVIEW'] .'">
<input type="button" onclick="edit_post('. $post_id .');" value="'. $lang['CANCEL'] .'"> <input type="button" onclick="edit_post('. $post_id .');" value="'. $lang['CANCEL'] .'">
<input type="button" onclick="edit_post('. $post_id .', \'editor\', $(\'#message-'. $post_id .'\').val()); return false;" class="bold" value="'. $lang['EDIT_POST'] .'"> <input type="button" onclick="edit_post('. $post_id .', \'editor\', $(\'#message-'. $post_id .'\').val()); return false;" class="bold" value="'. $lang['EDIT_POST'] .'">
</div><hr> </div><hr>
@ -299,7 +311,8 @@ switch($this->request['type'])
default: default:
$this->ajax_die('empty type'); $this->ajax_die('empty type');
break; } break;
}

View file

@ -16,7 +16,6 @@ $sql = "
SELECT SELECT
p.*, p.*,
h.post_html, IF(h.post_html IS NULL, pt.post_text, NULL) AS post_text, h.post_html, IF(h.post_html IS NULL, pt.post_text, NULL) AS post_text,
pt.post_subject,
f.auth_read f.auth_read
FROM ". BB_POSTS ." p FROM ". BB_POSTS ." p
INNER JOIN ". BB_POSTS_TEXT ." pt ON(pt.post_id = p.post_id) INNER JOIN ". BB_POSTS_TEXT ." pt ON(pt.post_id = p.post_id)

View file

@ -13,6 +13,7 @@ define('FILENAME_CRYPTIC', false);
define('FILENAME_CRYPTIC_LENGTH', 64); define('FILENAME_CRYPTIC_LENGTH', 64);
define('FILENAME_TRANSLITERATE', true); define('FILENAME_TRANSLITERATE', true);
class attach_parent class attach_parent
{ {
var $post_attach = false; var $post_attach = false;
@ -789,6 +790,7 @@ class attach_parent
if ($this->add_attachment_body) if ($this->add_attachment_body)
{ {
$template->assign_vars(array( $template->assign_vars(array(
'TPL_ADD_ATTACHMENT' => true,
'FILE_COMMENT' => htmlspecialchars($this->file_comment), 'FILE_COMMENT' => htmlspecialchars($this->file_comment),
'FILESIZE' => $attach_config['max_filesize'], 'FILESIZE' => $attach_config['max_filesize'],
'FILENAME' => htmlspecialchars($this->filename), 'FILENAME' => htmlspecialchars($this->filename),

View file

@ -57,7 +57,7 @@ $bb_cfg['css_ver'] = 1;
// Increase number of revision after update // Increase number of revision after update
$bb_cfg['tp_version'] = '2.0.2'; $bb_cfg['tp_version'] = '2.0.2';
$bb_cfg['tp_release_state'] = 'TP II r165'; $bb_cfg['tp_release_state'] = 'TP II r166';
$bb_cfg['tp_release_date'] = '27-07-2011'; $bb_cfg['tp_release_date'] = '27-07-2011';
$bb_cfg['board_disabled_msg'] = 'форум временно отключен'; // 'forums temporarily disabled'; // show this msg if board has been disabled via ON/OFF trigger $bb_cfg['board_disabled_msg'] = 'форум временно отключен'; // 'forums temporarily disabled'; // show this msg if board has been disabled via ON/OFF trigger

View file

@ -1,24 +1,4 @@
<?php <?php
/***************************************************************************
* functions_post.php
* -------------------
* begin : Saturday, Feb 13, 2001
* copyright : (C) 2001 The phpBB Group
* email : support@phpbb.com
*
* $Id: functions_post.php,v 1.9.2.40 2005/12/22 11:34:02 acydburn Exp $
*
*
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
if (!defined('BB_ROOT')) die(basename(__FILE__)); if (!defined('BB_ROOT')) die(basename(__FILE__));
@ -126,8 +106,7 @@ function prepare_post(&$mode, &$post_data, &$error_msg, &$username, &$subject, &
// //
function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, $post_username, $post_subject, $post_message, $poll_title, &$poll_options, &$poll_length, $update_post_time) function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, $post_username, $post_subject, $post_message, $poll_title, &$poll_options, &$poll_length, $update_post_time)
{ {
global $bb_cfg, $lang; global $userdata, $post_info, $is_auth, $bb_cfg, $lang;
global $userdata, $post_info, $is_auth;
$current_time = time(); $current_time = time();
@ -646,8 +625,7 @@ function user_notification($mode, &$post_data, &$topic_title, &$forum_id, &$topi
function insert_post ($mode, $topic_id, $forum_id = '', $old_forum_id = '', $new_topic_id = '', $new_topic_title = '', $old_topic_id = '', $message = '', $poster_id = '') function insert_post ($mode, $topic_id, $forum_id = '', $old_forum_id = '', $new_topic_id = '', $new_topic_title = '', $old_topic_id = '', $message = '', $poster_id = '')
{ {
global $bb_cfg, $lang; global $userdata, $is_auth, $bb_cfg, $lang;
global $userdata, $is_auth;
require(DEFAULT_LANG_DIR .'lang_bot.php'); require(DEFAULT_LANG_DIR .'lang_bot.php');
@ -761,6 +739,5 @@ function topic_review ($topic_id)
$template->assign_vars(array( $template->assign_vars(array(
'TPL_TOPIC_REVIEW' => (bool) $review_posts, 'TPL_TOPIC_REVIEW' => (bool) $review_posts,
'L_TOPIC_REVIEW' => $lang['TOPIC_REVIEW'],
)); ));
} }

View file

@ -172,7 +172,7 @@ class report_post extends report_module
// //
function subject_obtain($report_subject) function subject_obtain($report_subject)
{ {
$sql = 'SELECT pt.post_subject, t.topic_title, t.topic_first_post_id $sql = 'SELECT t.topic_title, t.topic_first_post_id
FROM ' . BB_POSTS . ' p FROM ' . BB_POSTS . ' p
INNER JOIN ' . BB_POSTS_TEXT . ' pt INNER JOIN ' . BB_POSTS_TEXT . ' pt
ON pt.post_id = p.post_id ON pt.post_id = p.post_id
@ -192,9 +192,9 @@ class report_post extends report_module
return false; return false;
} }
if ($row['post_subject'] != '') if ($row['topic_title'] != '')
{ {
return $row['post_subject']; return $row['topic_title'];
} }
else else
{ {

View file

@ -616,7 +616,7 @@ else
} }
else if ( $mode == 'quote' || $mode == 'editpost' ) else if ( $mode == 'quote' || $mode == 'editpost' )
{ {
$subject = ( $post_data['first_post'] ) ? $post_info['topic_title'] : $post_info['post_subject']; $subject = ( $post_data['first_post'] ) ? $post_info['topic_title'] : '';
$message = $post_info['post_text']; $message = $post_info['post_text'];
if ( $mode == 'quote' ) if ( $mode == 'quote' )

View file

@ -5,7 +5,7 @@
<th colspan="2" class="thHead">{L_ADD_ATTACHMENT_TITLE}</th> <th colspan="2" class="thHead">{L_ADD_ATTACHMENT_TITLE}</th>
</tr> </tr>
<tr> <tr>
<td class="pad_4"><b>{L_FILE_NAME}</b></td> <td class="pad_4"><b>{L_FILENAME}</b></td>
<td> <td>
<table class="borderless" cellspacing="0"> <table class="borderless" cellspacing="0">
<tr> <tr>
@ -39,7 +39,7 @@
</tr> </tr>
<!-- BEGIN attach_row --> <!-- BEGIN attach_row -->
<tr> <tr>
<td class="row5"><b>{L_FILE_NAME}</b></td> <td class="row5"><b>{L_FILENAME}</b></td>
<td class="row5"><a class="gen" href="{attach_row.U_VIEW_ATTACHMENT}" target="_blank"><b>{attach_row.FILE_NAME}</b></a></td> <td class="row5"><a class="gen" href="{attach_row.U_VIEW_ATTACHMENT}" target="_blank"><b>{attach_row.FILE_NAME}</b></a></td>
</tr> </tr>
<tr> <tr>

View file

@ -92,9 +92,6 @@ ajax.callback.posts = function(data){
<textarea <textarea
class="editor mrg_4" name="message" id="message" rows="18" cols="92" class="editor mrg_4" name="message" id="message" rows="18" cols="92"
<!-- IF SHOW_VIRTUAL_KEYBOARD -->
onkeypress = "if(use_kb) return decode(event);"
<!-- ENDIF -->
onfocus = "storeCaret(this);" onfocus = "storeCaret(this);"
onselect = "storeCaret(this);" onselect = "storeCaret(this);"
onclick = "storeCaret(this);" onclick = "storeCaret(this);"

View file

@ -200,10 +200,8 @@
<option value="del_torrent">{L_DELETE_TORRENT}</option> <option value="del_torrent">{L_DELETE_TORRENT}</option>
<option value="del_torrent_move_topic">{L_DEL_MOVE_TORRENT}</option> <option value="del_torrent_move_topic">{L_DEL_MOVE_TORRENT}</option>
</select> </select>
<label>
<input name="confirm" id="tor-confirm-{postrow.attach.tor_not_reged.ATTACH_ID}" type="checkbox" value="1" onclick="if( $('#tor-select-{postrow.attach.tor_not_reged.ATTACH_ID}')[0].selectedIndex != 0 ){ $('#tor-submit-{postrow.attach.tor_not_reged.ATTACH_ID}').click(function(){ change_torrents(); }); $('#tor-submit-{postrow.attach.tor_not_reged.ATTACH_ID}').attr('disabled', !this.checked); } else { return false; }" />&nbsp;{L_CONFIRM}&nbsp; &nbsp; <a href="#" onclick="change_torrents($('#tor-{postrow.attach.tor_reged.ATTACH_ID} select').val()); return false;"><input type="submit" value="{L_DO_SUBMIT}" class="liteoption" /></a>
</label>
<input name="" id="tor-submit-{postrow.attach.tor_not_reged.ATTACH_ID}" type="submit" value="{L_DO_SUBMIT}" class="liteoption" style="width: 110px;" disabled="disabled" />&nbsp;
<!-- ENDIF --> <!-- ENDIF -->
&nbsp;</td> &nbsp;</td>
</tr> </tr>
@ -282,7 +280,7 @@
<span id="tor-{postrow.attach.tor_reged.ATTACH_ID}">{postrow.attach.tor_reged.TOR_STATUS_SELECT}</span> <span id="tor-{postrow.attach.tor_reged.ATTACH_ID}">{postrow.attach.tor_reged.TOR_STATUS_SELECT}</span>
<a href="#" onclick="ajax.change_tor_status($('#tor-{postrow.attach.tor_reged.ATTACH_ID} select').val()); return false;" class="txtb">[Изменить]</a> <a href="#" onclick="ajax.change_tor_status($('#tor-{postrow.attach.tor_reged.ATTACH_ID} select').val()); return false;"><input type="submit" value="{L_DO_SUBMIT}" class="liteoption" /></a>
<!-- ENDIF --> <!-- ENDIF -->
</td> </td>
@ -338,10 +336,8 @@
<!-- ENDIF --> <!-- ENDIF -->
<!-- ENDIF --> <!-- ENDIF -->
</select> </select>
<label>
<input name="confirm" id="tor-confirm-{postrow.attach.tor_reged.ATTACH_ID}" type="checkbox" value="1" onclick="if( $('#tor-select-{postrow.attach.tor_reged.ATTACH_ID}')[0].selectedIndex != 0 ){ $('#tor-submit-{postrow.attach.tor_reged.ATTACH_ID}').click(function(){ change_torrents(); }); $('#tor-submit-{postrow.attach.tor_reged.ATTACH_ID}').attr('disabled', !this.checked); } else { return false; }" />&nbsp;{L_CONFIRM}&nbsp; &nbsp; <a href="#" onclick="change_torrents($('#tor-{postrow.attach.tor_reged.ATTACH_ID} select').val()); return false;"><input type="submit" value="{L_DO_SUBMIT}" class="liteoption" /></a>
</label>
<input name="" id="tor-submit-{postrow.attach.tor_reged.ATTACH_ID}" type="button" value="{L_DO_SUBMIT}" class="liteoption" style="width: 110px;" disabled="disabled" />&nbsp;
<!-- ELSEIF TOR_HELP_LINKS --> <!-- ELSEIF TOR_HELP_LINKS -->
{TOR_HELP_LINKS} {TOR_HELP_LINKS}