mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 22:33:55 -07:00
Продолжение удаления аттач-мода
Промежуточная ревизия - большое число правок в постинге, переименование проблемного (ad) смайлика, удаление устаревших неиспользуемых функций.
This commit is contained in:
parent
b1e7e18470
commit
264355d79b
9 changed files with 152 additions and 189 deletions
|
@ -256,7 +256,7 @@ else if ( $mode != '' )
|
||||||
'TPL_SMILE_EDIT' => true,
|
'TPL_SMILE_EDIT' => true,
|
||||||
'SMILEY_CODE' => $smile_data['code'],
|
'SMILEY_CODE' => $smile_data['code'],
|
||||||
'SMILEY_EMOTICON' => $smile_data['emoticon'],
|
'SMILEY_EMOTICON' => $smile_data['emoticon'],
|
||||||
'SMILEY_IMG' => BB_ROOT . $bb_cfg['smilies_path'] . '/' . $smiley_edit_img,
|
'SMILEY_IMG' => BB_ROOT . $bb_cfg['smilies_path'] . '/' . $smiley_edit_img, // TODO
|
||||||
'S_SMILEY_ACTION' => "admin_smilies.php",
|
'S_SMILEY_ACTION' => "admin_smilies.php",
|
||||||
'S_HIDDEN_FIELDS' => $s_hidden_fields,
|
'S_HIDDEN_FIELDS' => $s_hidden_fields,
|
||||||
'S_FILENAME_OPTIONS' => $filename_list,
|
'S_FILENAME_OPTIONS' => $filename_list,
|
||||||
|
|
|
@ -881,7 +881,6 @@ CREATE TABLE IF NOT EXISTS `bb_smilies` (
|
||||||
INSERT INTO `bb_smilies` VALUES ('', ':aa:', 'aa.gif', 'aa');
|
INSERT INTO `bb_smilies` VALUES ('', ':aa:', 'aa.gif', 'aa');
|
||||||
INSERT INTO `bb_smilies` VALUES ('', ':ab:', 'ab.gif', 'ab');
|
INSERT INTO `bb_smilies` VALUES ('', ':ab:', 'ab.gif', 'ab');
|
||||||
INSERT INTO `bb_smilies` VALUES ('', ':ac:', 'ac.gif', 'ac');
|
INSERT INTO `bb_smilies` VALUES ('', ':ac:', 'ac.gif', 'ac');
|
||||||
INSERT INTO `bb_smilies` VALUES ('', ':ad:', 'ad.gif', 'ad');
|
|
||||||
INSERT INTO `bb_smilies` VALUES ('', ':ae:', 'ae.gif', 'ae');
|
INSERT INTO `bb_smilies` VALUES ('', ':ae:', 'ae.gif', 'ae');
|
||||||
INSERT INTO `bb_smilies` VALUES ('', ':af:', 'af.gif', 'af');
|
INSERT INTO `bb_smilies` VALUES ('', ':af:', 'af.gif', 'af');
|
||||||
INSERT INTO `bb_smilies` VALUES ('', ':ag:', 'ag.gif', 'ag');
|
INSERT INTO `bb_smilies` VALUES ('', ':ag:', 'ag.gif', 'ag');
|
||||||
|
@ -933,6 +932,7 @@ INSERT INTO `bb_smilies` VALUES ('', ':bz:', 'bz.gif', 'bz');
|
||||||
INSERT INTO `bb_smilies` VALUES ('', ':ca:', 'ca.gif', 'ca');
|
INSERT INTO `bb_smilies` VALUES ('', ':ca:', 'ca.gif', 'ca');
|
||||||
INSERT INTO `bb_smilies` VALUES ('', ':cb:', 'cb.gif', 'cb');
|
INSERT INTO `bb_smilies` VALUES ('', ':cb:', 'cb.gif', 'cb');
|
||||||
INSERT INTO `bb_smilies` VALUES ('', ':cc:', 'cc.gif', 'cc');
|
INSERT INTO `bb_smilies` VALUES ('', ':cc:', 'cc.gif', 'cc');
|
||||||
|
INSERT INTO `bb_smilies` VALUES ('', ':сd:', 'сd.gif', 'сd');
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Table structure for `bb_topics`
|
-- Table structure for `bb_topics`
|
||||||
|
|
|
@ -505,38 +505,3 @@ function insert_post ($mode, $topic_id, $forum_id = '', $old_forum_id = '', $new
|
||||||
|
|
||||||
DB()->query("INSERT INTO ". BB_POSTS_TEXT ." ($post_text_columns) VALUES ($post_text_values)");
|
DB()->query("INSERT INTO ". BB_POSTS_TEXT ." ($post_text_columns) VALUES ($post_text_values)");
|
||||||
}
|
}
|
||||||
|
|
||||||
function topic_review ($topic_id)
|
|
||||||
{
|
|
||||||
global $bb_cfg, $template;
|
|
||||||
|
|
||||||
// Fetch posts data
|
|
||||||
$review_posts = DB()->fetch_rowset("
|
|
||||||
SELECT
|
|
||||||
p.*, h.post_html, IF(h.post_html IS NULL, pt.post_text, NULL) AS post_text,
|
|
||||||
IF(p.poster_id = ". GUEST_UID .", p.post_username, u.username) AS username, u.user_rank
|
|
||||||
FROM ". BB_POSTS ." p
|
|
||||||
LEFT JOIN ". BB_USERS ." u ON(u.user_id = p.poster_id)
|
|
||||||
LEFT JOIN ". BB_POSTS_TEXT ." pt ON(pt.post_id = p.post_id)
|
|
||||||
LEFT JOIN ". BB_POSTS_HTML ." h ON(h.post_id = p.post_id)
|
|
||||||
WHERE p.topic_id = ". (int) $topic_id ."
|
|
||||||
ORDER BY p.post_time DESC
|
|
||||||
LIMIT ". $bb_cfg['posts_per_page'] ."
|
|
||||||
");
|
|
||||||
|
|
||||||
// Topic posts block
|
|
||||||
foreach ($review_posts as $i => $post)
|
|
||||||
{
|
|
||||||
$template->assign_block_vars('review', array(
|
|
||||||
'ROW_CLASS' => !($i % 2) ? 'row1' : 'row2',
|
|
||||||
'POSTER' => profile_url($post),
|
|
||||||
'POSTER_NAME_JS' => addslashes($post['username']),
|
|
||||||
'POST_DATE' => bb_date($post['post_time'], $bb_cfg['post_date_format']),
|
|
||||||
'MESSAGE' => get_parsed_post($post),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
$template->assign_vars(array(
|
|
||||||
'TPL_TOPIC_REVIEW' => (bool) $review_posts,
|
|
||||||
));
|
|
||||||
}
|
|
|
@ -279,8 +279,6 @@ $lang['MODERATE_TOPIC'] = 'Moderate this topic';
|
||||||
$lang['SELECT_POSTS_PER_PAGE'] = 'posts per page';
|
$lang['SELECT_POSTS_PER_PAGE'] = 'posts per page';
|
||||||
|
|
||||||
// Posting/Replying (Not private messaging!)
|
// Posting/Replying (Not private messaging!)
|
||||||
$lang['TOPIC_REVIEW'] = 'Topic review';
|
|
||||||
|
|
||||||
$lang['NO_POST_MODE'] = 'No post mode selected'; // If posting.php is called without a mode (newtopic/reply/delete/etc, shouldn't be shown normaly)
|
$lang['NO_POST_MODE'] = 'No post mode selected'; // If posting.php is called without a mode (newtopic/reply/delete/etc, shouldn't be shown normaly)
|
||||||
|
|
||||||
$lang['POST_A_NEW_TOPIC'] = 'Post new topic';
|
$lang['POST_A_NEW_TOPIC'] = 'Post new topic';
|
||||||
|
|
|
@ -279,8 +279,6 @@ $lang['MODERATE_TOPIC'] = 'Модерировать этот топик';
|
||||||
$lang['SELECT_POSTS_PER_PAGE'] = 'сообщ. на страницу';
|
$lang['SELECT_POSTS_PER_PAGE'] = 'сообщ. на страницу';
|
||||||
|
|
||||||
// Posting/Replying (Not private messaging!)
|
// Posting/Replying (Not private messaging!)
|
||||||
$lang['TOPIC_REVIEW'] = 'Обзор темы';
|
|
||||||
|
|
||||||
$lang['NO_POST_MODE'] = 'Не указан режим сообщения';
|
$lang['NO_POST_MODE'] = 'Не указан режим сообщения';
|
||||||
|
|
||||||
$lang['POST_A_NEW_TOPIC'] = 'Начать новую тему';
|
$lang['POST_A_NEW_TOPIC'] = 'Начать новую тему';
|
||||||
|
|
|
@ -279,8 +279,6 @@ $lang['MODERATE_TOPIC'] = 'Модерувати цей топік';
|
||||||
$lang['SELECT_POSTS_PER_PAGE'] = 'повідомл. на сторінку';
|
$lang['SELECT_POSTS_PER_PAGE'] = 'повідомл. на сторінку';
|
||||||
|
|
||||||
// Posting/Replying (Not private messaging!)
|
// Posting/Replying (Not private messaging!)
|
||||||
$lang['TOPIC_REVIEW'] = 'Огляд теми';
|
|
||||||
|
|
||||||
$lang['NO_POST_MODE'] = 'Не вказано режим повідомлення';
|
$lang['NO_POST_MODE'] = 'Не вказано режим повідомлення';
|
||||||
|
|
||||||
$lang['POST_A_NEW_TOPIC'] = 'Почати нову тему';
|
$lang['POST_A_NEW_TOPIC'] = 'Почати нову тему';
|
||||||
|
|
127
posting.php
127
posting.php
|
@ -6,6 +6,9 @@ require(BB_ROOT ."common.php");
|
||||||
require(INC_DIR .'bbcode.php');
|
require(INC_DIR .'bbcode.php');
|
||||||
require(INC_DIR .'functions_post.php');
|
require(INC_DIR .'functions_post.php');
|
||||||
|
|
||||||
|
// Start session management
|
||||||
|
$user->session_start();
|
||||||
|
|
||||||
$page_cfg['load_tpl_vars'] = array('post_icons');
|
$page_cfg['load_tpl_vars'] = array('post_icons');
|
||||||
|
|
||||||
$submit = (bool) @$_REQUEST['post'];
|
$submit = (bool) @$_REQUEST['post'];
|
||||||
|
@ -20,7 +23,6 @@ $mode = (string) @$_REQUEST['mode'];
|
||||||
|
|
||||||
$confirm = isset($_POST['confirm']);
|
$confirm = isset($_POST['confirm']);
|
||||||
|
|
||||||
$refresh = $preview;
|
|
||||||
$orig_word = $replacement_word = array();
|
$orig_word = $replacement_word = array();
|
||||||
|
|
||||||
// Set topic type
|
// Set topic type
|
||||||
|
@ -40,8 +42,7 @@ if ($mode == 'smilies')
|
||||||
$tracking_topics = get_tracks('topic');
|
$tracking_topics = get_tracks('topic');
|
||||||
$tracking_forums = get_tracks('forum');
|
$tracking_forums = get_tracks('forum');
|
||||||
|
|
||||||
// Start session management
|
|
||||||
$user->session_start();
|
|
||||||
|
|
||||||
set_die_append_msg($forum_id, $topic_id);
|
set_die_append_msg($forum_id, $topic_id);
|
||||||
|
|
||||||
|
@ -261,7 +262,7 @@ if ($mode == 'new_rel')
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify
|
// Notify
|
||||||
if ($submit || $refresh)
|
if ($submit || $preview)
|
||||||
{
|
{
|
||||||
$notify_user = (int) !empty($_POST['notify']);
|
$notify_user = (int) !empty($_POST['notify']);
|
||||||
}
|
}
|
||||||
|
@ -317,23 +318,17 @@ if (!IS_GUEST && $mode != 'newtopic' && ($submit || $preview || $mode == 'quote'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// --------------------
|
// Confirm deletion
|
||||||
// What shall we do?
|
if ($mode == 'delete' && !$confirm)
|
||||||
//
|
|
||||||
if ( ( $delete || $mode == 'delete' ) && !$confirm )
|
|
||||||
{
|
{
|
||||||
if (isset($_POST['cancel']))
|
if (isset($_POST['cancel']))
|
||||||
{
|
{
|
||||||
redirect(POST_URL . "$post_id#$post_id");
|
redirect(POST_URL . "$post_id#$post_id");
|
||||||
}
|
}
|
||||||
//
|
|
||||||
// Confirm deletion
|
|
||||||
//
|
|
||||||
$hidden_fields = array(
|
$hidden_fields = array(
|
||||||
'p' => $post_id,
|
'p' => $post_id,
|
||||||
'mode' => 'delete',
|
'mode' => 'delete',
|
||||||
);
|
);
|
||||||
|
|
||||||
print_confirmation(array(
|
print_confirmation(array(
|
||||||
'QUESTION' => $lang['CONFIRM_DELETE'],
|
'QUESTION' => $lang['CONFIRM_DELETE'],
|
||||||
'FORM_ACTION' => POSTING_URL,
|
'FORM_ACTION' => POSTING_URL,
|
||||||
|
@ -353,11 +348,11 @@ elseif ( ($submit || $confirm) && !$topic_has_new_posts )
|
||||||
case 'editpost':
|
case 'editpost':
|
||||||
case 'newtopic':
|
case 'newtopic':
|
||||||
case 'reply':
|
case 'reply':
|
||||||
$username = ( !empty($_POST['username']) ) ? clean_username($_POST['username']) : '';
|
$username = (!empty($_POST['username'])) ? clean_username($_POST['username']) : '';
|
||||||
$subject = ( !empty($_POST['subject']) ) ? clean_title($_POST['subject']) : '';
|
$subject = (!empty($_POST['subject'])) ? clean_title($_POST['subject']) : '';
|
||||||
$message = ( !empty($_POST['message']) ) ? prepare_message($_POST['message']) : '';
|
$message = (!empty($_POST['message'])) ? prepare_message($_POST['message']) : '';
|
||||||
$attach_rg_sig = (isset($_POST['attach_rg_sig']) && isset($_POST['poster_rg']) && $_POST['poster_rg'] != -1) ? 1 : 0;
|
$attach_rg_sig = (isset($_POST['attach_rg_sig']) && isset($_POST['poster_rg']) && $_POST['poster_rg'] != -1) ? 1 : 0;
|
||||||
$poster_rg_id = (isset($_POST['poster_rg']) && $_POST['poster_rg'] != -1) ? (int) $_POST['poster_rg'] : 0;
|
$poster_rg_id = (isset($_POST['poster_rg']) && $_POST['poster_rg'] != -1) ? (int)$_POST['poster_rg'] : 0;
|
||||||
|
|
||||||
prepare_post($mode, $post_data, $error_msg, $username, $subject, $message);
|
prepare_post($mode, $post_data, $error_msg, $username, $subject, $message);
|
||||||
|
|
||||||
|
@ -459,7 +454,7 @@ elseif ( ($submit || $confirm) && !$topic_has_new_posts )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($refresh || $error_msg || ($submit && $topic_has_new_posts))
|
if ($preview || $error_msg || ($submit && $topic_has_new_posts))
|
||||||
{
|
{
|
||||||
$username = ( !empty($_POST['username']) ) ? clean_username($_POST['username']) : '';
|
$username = ( !empty($_POST['username']) ) ? clean_username($_POST['username']) : '';
|
||||||
$subject = ( !empty($_POST['subject']) ) ? clean_title($_POST['subject']) : '';
|
$subject = ( !empty($_POST['subject']) ) ? clean_title($_POST['subject']) : '';
|
||||||
|
@ -588,46 +583,9 @@ if ( $mode == 'newtopic' || ( $mode == 'editpost' && $post_data['first_post'] )
|
||||||
|
|
||||||
if ( $topic_type_toggle != '' )
|
if ( $topic_type_toggle != '' )
|
||||||
{
|
{
|
||||||
$topic_type_toggle = $lang['POST_TOPIC_AS'] . ': <label><input type="radio" name="topictype" value="' . POST_NORMAL .'"' . ( (!isset($post_data['topic_type']) || $post_data['topic_type'] == POST_NORMAL || $topic_type == POST_NORMAL) ? ' checked="checked"' : '' ) . ' /> ' . $lang['POST_NORMAL'] . '</label> ' . $topic_type_toggle;
|
$topic_type_toggle = '<label><input type="radio" name="topictype" value="' . POST_NORMAL .'"' . ( (!isset($post_data['topic_type']) || $post_data['topic_type'] == POST_NORMAL || $topic_type == POST_NORMAL) ? ' checked="checked"' : '' ) . ' /> ' . $lang['POST_NORMAL'] . '</label> ' . $topic_type_toggle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//bt
|
|
||||||
$topic_dl_type = (isset($post_info['topic_dl_type'])) ? $post_info['topic_dl_type'] : 0;
|
|
||||||
|
|
||||||
if ($post_info['allow_reg_tracker'] && $post_data['first_post'] && ($topic_dl_type || $is_auth['auth_mod']))
|
|
||||||
{
|
|
||||||
$sql = "
|
|
||||||
SELECT tor.attach_id
|
|
||||||
FROM ". BB_POSTS ." p
|
|
||||||
LEFT JOIN ". BB_BT_TORRENTS ." tor ON (p.post_id = tor.post_id)
|
|
||||||
WHERE p.post_id = $post_id
|
|
||||||
";
|
|
||||||
$result = DB()->fetch_row($sql);
|
|
||||||
if (!empty($result['attach_id']))
|
|
||||||
{
|
|
||||||
if (!$topic_type_toggle)
|
|
||||||
{
|
|
||||||
$topic_type_toggle = $lang['POST_TOPIC_AS'] . ': ';
|
|
||||||
}
|
|
||||||
|
|
||||||
$dl_ds = $dl_ch = $dl_hid = '';
|
|
||||||
$dl_type_name = 'topic_dl_type';
|
|
||||||
$dl_type_val = ($topic_dl_type) ? 1 : 0;
|
|
||||||
|
|
||||||
if (!$post_info['allow_reg_tracker'] && !$is_auth['auth_mod'])
|
|
||||||
{
|
|
||||||
$dl_ds = ' disabled="disabled" ';
|
|
||||||
$dl_hid = '<input type="hidden" name="topic_dl_type" value="'. $dl_type_val .'" />';
|
|
||||||
$dl_type_name = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
$dl_ch = ($mode == 'editpost' && $post_data['first_post'] && $topic_dl_type) ? ' checked="checked" ' : '';
|
|
||||||
|
|
||||||
$topic_type_toggle .= '<nobr><input type="checkbox" name="'. $dl_type_name .'" id="topic_dl_type_id" '. $dl_ds . $dl_ch .' /><label for="topic_dl_type_id"> '.$lang['POST_DOWNLOAD'].'</label></nobr>';
|
|
||||||
$topic_type_toggle .= $dl_hid;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//bt end
|
|
||||||
|
|
||||||
// Get poster release group data
|
// Get poster release group data
|
||||||
if ($userdata['user_level'] == GROUP_MEMBER || IS_AM)
|
if ($userdata['user_level'] == GROUP_MEMBER || IS_AM)
|
||||||
|
@ -648,23 +606,25 @@ if ($userdata['user_level'] == GROUP_MEMBER || IS_AM)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$hidden_form_fields = '<input type="hidden" name="mode" value="' . $mode . '" />';
|
$hidden_fields = array(
|
||||||
|
'mode' => $mode,
|
||||||
|
'f' => $forum_id,
|
||||||
|
't' => $topic_id,
|
||||||
|
'p' => $post_id,
|
||||||
|
);
|
||||||
|
|
||||||
switch( $mode )
|
switch ($mode)
|
||||||
{
|
{
|
||||||
case 'newtopic':
|
case 'newtopic':
|
||||||
$page_title = $lang['POST_A_NEW_TOPIC'];
|
$page_title = $lang['POST_A_NEW_TOPIC'];
|
||||||
$hidden_form_fields .= '<input type="hidden" name="' . POST_FORUM_URL . '" value="' . $forum_id . '" />';
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'reply':
|
case 'reply':
|
||||||
$page_title = $lang['POST_A_REPLY'];
|
$page_title = $lang['POST_A_REPLY'];
|
||||||
$hidden_form_fields .= '<input type="hidden" name="' . POST_TOPIC_URL . '" value="' . $topic_id . '" />';
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'editpost':
|
case 'editpost':
|
||||||
$page_title = $lang['EDIT_POST'];
|
$page_title = $lang['EDIT_POST'];
|
||||||
$hidden_form_fields .= '<input type="hidden" name="' . POST_POST_URL . '" value="' . $post_id . '" />';
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -675,35 +635,34 @@ $template->set_filenames(array(
|
||||||
'body' => 'posting.tpl',
|
'body' => 'posting.tpl',
|
||||||
));
|
));
|
||||||
|
|
||||||
// Output the data to the template
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'FORUM_NAME' => htmlCHR($forum_name),
|
'FORUM_NAME' => htmlCHR($forum_name),
|
||||||
'PAGE_TITLE' => $page_title,
|
'PAGE_TITLE' => $page_title,
|
||||||
'POSTING_TYPE_TITLE' => $page_title,
|
'POSTING_TYPE_TITLE' => $page_title,
|
||||||
'POSTING_TOPIC_ID' => ($mode != 'newtopic') ? $topic_id : '',
|
'POSTING_TOPIC_ID' => ($mode != 'newtopic') ? $topic_id : '',
|
||||||
'POSTING_TOPIC_TITLE' => ($mode != 'newtopic') ? wbr($post_info['topic_title']) : '',
|
'POSTING_TOPIC_TITLE' => ($mode != 'newtopic') ? wbr($post_info['topic_title']) : '',
|
||||||
'U_VIEW_FORUM' => "viewforum.php?" . POST_FORUM_URL . "=$forum_id",
|
|
||||||
|
|
||||||
'USERNAME' => @$username,
|
|
||||||
'CAPTCHA_HTML' => (IS_GUEST) ? bb_captcha('get') : '',
|
'CAPTCHA_HTML' => (IS_GUEST) ? bb_captcha('get') : '',
|
||||||
'SUBJECT' => $subject,
|
|
||||||
'MESSAGE' => $message,
|
|
||||||
|
|
||||||
'POSTER_RGROUPS' => isset($poster_rgroups) && !empty($poster_rgroups) ? $poster_rgroups : '',
|
'POSTER_RGROUPS' => isset($poster_rgroups) && !empty($poster_rgroups) ? $poster_rgroups : '',
|
||||||
'ATTACH_RG_SIG' => ($switch_rg_sig) ? $switch_rg_sig : false,
|
'ATTACH_RG_SIG' => ($switch_rg_sig) ? $switch_rg_sig : false,
|
||||||
|
|
||||||
'U_VIEWTOPIC' => ($mode == 'reply') ? "viewtopic.php?" . POST_TOPIC_URL . "=$topic_id&postorder=desc" : '',
|
|
||||||
|
|
||||||
'S_NOTIFY_CHECKED' => ($notify_user) ? 'checked="checked"' : '',
|
|
||||||
'S_TYPE_TOGGLE' => $topic_type_toggle,
|
|
||||||
'S_TOPIC_ID' => $topic_id,
|
|
||||||
'S_POST_ACTION' => POSTING_URL,
|
|
||||||
'S_HIDDEN_FORM_FIELDS' => $hidden_form_fields,
|
|
||||||
));
|
));
|
||||||
|
|
||||||
if ($mode == 'newtopic' || $post_data['first_post'])
|
if ($mode == 'newtopic' || $post_data['first_post'])
|
||||||
{
|
{
|
||||||
$template->assign_var('POSTING_SUBJECT');
|
$file_attached = !empty($post_info['attach_ext_id']);
|
||||||
|
$allowed_ext = $bb_cfg['attach']['allowed_ext'];
|
||||||
|
|
||||||
|
$template->assign_vars(array(
|
||||||
|
'POSTING_SUBJECT' => true,
|
||||||
|
'SHOW_ATTACH' => ($file_attached || $allowed_ext),
|
||||||
|
'S_FORM_ENCTYPE' => 'enctype="multipart/form-data"',
|
||||||
|
'FILE_ATTACHED' => $file_attached,
|
||||||
|
'ATTACH_MAX_SIZE' => humn_size($bb_cfg['attach']['max_size']),
|
||||||
|
'ALLOWED_EXT' => ($allowed_ext) ? '*.' . join(', *.', $allowed_ext) : 'прикреплять запрещено',
|
||||||
|
'TOR_REQUIRED' => !empty($_POST['tor_required']),
|
||||||
|
'POLL_TIP' => ($mode == 'newtopic') ? 'Вы сможете добавить опрос после создания темы' : 'Вы можете добавить опрос со страницы просмотра темы', // TODO
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update post time
|
// Update post time
|
||||||
|
@ -715,11 +674,21 @@ if ($mode == 'editpost' && $post_data['last_post'] && !$post_data['first_post'])
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Topic review
|
// Output the data to the template
|
||||||
if( $mode == 'reply' && $is_auth['auth_read'] )
|
$template->assign_vars(array(
|
||||||
{
|
'SUBJECT' => $subject,
|
||||||
topic_review($topic_id);
|
'MESSAGE' => $message,
|
||||||
}
|
'AUTH_MOD' => $is_auth['auth_mod'],
|
||||||
|
|
||||||
|
'U_VIEWTOPIC' => ($mode == 'reply') ? "viewtopic.php?" . POST_TOPIC_URL . "=$topic_id" : '',
|
||||||
|
'U_VIEW_FORUM' => "viewforum.php?" . POST_FORUM_URL . "=$forum_id",
|
||||||
|
|
||||||
|
'S_NOTIFY_CHECKED' => ($notify_user) ? 'checked="checked"' : '',
|
||||||
|
'S_TYPE_TOGGLE' => $topic_type_toggle,
|
||||||
|
'S_TOPIC_ID' => $topic_id,
|
||||||
|
'S_POST_ACTION' => POSTING_URL,
|
||||||
|
'S_HIDDEN_FORM_FIELDS' => build_hidden_fields($hidden_fields),
|
||||||
|
));
|
||||||
|
|
||||||
require(PAGE_HEADER);
|
require(PAGE_HEADER);
|
||||||
|
|
||||||
|
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
|
@ -56,10 +56,9 @@
|
||||||
<!-- IF POSTING_TOPIC_ID --><em>»</em> <a class="normal" href="{TOPIC_URL}{POSTING_TOPIC_ID}">{POSTING_TOPIC_TITLE}</a><!-- ENDIF -->
|
<!-- IF POSTING_TOPIC_ID --><em>»</em> <a class="normal" href="{TOPIC_URL}{POSTING_TOPIC_ID}">{POSTING_TOPIC_TITLE}</a><!-- ENDIF -->
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<form action="{S_POST_ACTION}" method="post" name="post" onsubmit="if(checkForm(this)){ dis_submit_btn(); }else{ return false; }" {S_FORM_ENCTYPE}>
|
<form method="post" action="{S_POST_ACTION}" name="post" {S_FORM_ENCTYPE} class="tokenized" onsubmit="if(checkForm(this)){ dis_submit_btn(); }else{ return false; }">
|
||||||
{S_HIDDEN_FORM_FIELDS}
|
{S_HIDDEN_FORM_FIELDS}
|
||||||
{ADD_ATTACH_HIDDEN_FIELDS}
|
<!-- IF TOR_REQUIRED --><input type="hidden" name="tor_required" value="1" /><!-- ENDIF -->
|
||||||
{POSTED_ATTACHMENTS_HIDDEN_FIELDS}
|
|
||||||
|
|
||||||
<table class="bordered">
|
<table class="bordered">
|
||||||
<col class="row1">
|
<col class="row1">
|
||||||
|
@ -98,7 +97,7 @@
|
||||||
<!-- BEGIN smilies_row -->
|
<!-- BEGIN smilies_row -->
|
||||||
<tr>
|
<tr>
|
||||||
<!-- BEGIN smilies_col -->
|
<!-- BEGIN smilies_col -->
|
||||||
<td><a href="#" onclick="bbcode && bbcode.emoticon('{smilies_row.smilies_col.SMILEY_CODE}'); return false;"><img src="{smilies_row.smilies_col.SMILEY_IMG}" alt="" title="{smilies_row.smilies_col.SMILEY_DESC}" /></a></td>
|
<td><a href="#" onclick="bbcode.emoticon('{smilies_row.smilies_col.SMILEY_CODE}'); return false;"><img src="{smilies_row.smilies_col.SMILEY_IMG}" alt="" title="{smilies_row.smilies_col.SMILEY_DESC}" /></a></td>
|
||||||
<!-- END smilies_col -->
|
<!-- END smilies_col -->
|
||||||
</tr>
|
</tr>
|
||||||
<!-- END smilies_row -->
|
<!-- END smilies_row -->
|
||||||
|
@ -111,13 +110,16 @@
|
||||||
</td>
|
</td>
|
||||||
<td class="vTop pad_0 w100"><!-- INCLUDE posting_editor.tpl --></td>
|
<td class="vTop pad_0 w100"><!-- INCLUDE posting_editor.tpl --></td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- IF IN_PM -->
|
|
||||||
<!-- ELSEIF LOGGED_IN -->
|
<!-- IF SHOW_UPDATE_POST_TIME -->
|
||||||
<tr>
|
<tr>
|
||||||
<td class="vTop pad_4" valign="top">
|
<td class="row1 vTop pad_4" valign="top">
|
||||||
<p><b>{L_OPTIONS}</b></p>
|
<p><b>{L_OPTIONS}</b></p>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td class="row2">
|
||||||
|
<!-- IF IN_PM -->
|
||||||
|
<!-- ELSEIF LOGGED_IN -->
|
||||||
|
<div class="floatL"> </div>
|
||||||
<div class="floatL">
|
<div class="floatL">
|
||||||
<table class="borderless inline">
|
<table class="borderless inline">
|
||||||
<!-- IF SHOW_UPDATE_POST_TIME -->
|
<!-- IF SHOW_UPDATE_POST_TIME -->
|
||||||
|
@ -134,9 +136,11 @@
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- ENDIF / LOGGED_IN -->
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- IF ATTACHBOX -->
|
<!-- ENDIF -->
|
||||||
|
|
||||||
<!-- IF POSTER_RGROUPS -->
|
<!-- IF POSTER_RGROUPS -->
|
||||||
<tr>
|
<tr>
|
||||||
<td class="vTop pad_4" valign="top"><b>{L_POST_RELEASE_FROM_GROUP}</b></td>
|
<td class="vTop pad_4" valign="top"><b>{L_POST_RELEASE_FROM_GROUP}</b></td>
|
||||||
|
@ -149,49 +153,80 @@
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- ENDIF / POSTER_RGROUPS -->
|
<!-- ENDIF / POSTER_RGROUPS -->
|
||||||
<!-- ENDIF / ATTACHBOX -->
|
|
||||||
<!-- ENDIF / LOGGED_IN -->
|
|
||||||
<!-- BEGIN switch_type_toggle -->
|
<!-- BEGIN switch_type_toggle -->
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" class="row2 tCenter pad_6">{S_TYPE_TOGGLE}</td>
|
<td class="vTop pad_4" valign="top"><b>{L_POST_TOPIC_AS}</b></td>
|
||||||
|
<td>
|
||||||
|
{S_TYPE_TOGGLE}
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- END switch_type_toggle -->
|
<!-- END switch_type_toggle -->
|
||||||
<!-- IF ATTACHBOX --><!-- INCLUDE posting_attach.tpl --><!-- ENDIF -->
|
|
||||||
|
<!-- IF POLL_TIP -->
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" class="pad_4 med">{POLL_TIP}</td>
|
||||||
|
</tr>
|
||||||
|
<!-- ENDIF -->
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<!-- IF TPL_TOPIC_REVIEW -->
|
<!-- IF SHOW_ATTACH -->
|
||||||
<!--========================================================================-->
|
<div style="display: none;">
|
||||||
|
|
||||||
<div class="spacer_12"></div>
|
<div id="file-up-input">
|
||||||
|
<input type="hidden" name="MAX_FILE_SIZE" value="{$bb_cfg['attach']['max_size']}" />
|
||||||
|
<input type="file" name="attach" size="50" id="file-up-btn" />
|
||||||
|
|
||||||
|
<a href="#" class="med" onclick="show_load_file_link(); return false;">удалить</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
<table class="topic" cellpadding="0" cellspacing="0">
|
<div id="file-up-new">
|
||||||
<tr>
|
<a id="file-up-a" href="#" class="med bold" onclick="show_file_up_input(); return false;">загрузить файл</a>
|
||||||
<td colspan="2" class="catTitle td2">{L_TOPIC_REVIEW}</td>
|
</div>
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th class="thHead td1">{L_AUTHOR}</th>
|
|
||||||
<th class="thHead td2">{L_MESSAGE}</th>
|
|
||||||
</tr>
|
|
||||||
<!-- BEGIN review -->
|
|
||||||
<tr class="{review.ROW_CLASS}">
|
|
||||||
<td width="120" class="poster_info td1">
|
|
||||||
<p class="nick" onclick="bbcode.onclickPoster('{review.POSTER_NAME_JS}');">
|
|
||||||
<a href="#" onclick="return false;">{review.POSTER}</a>
|
|
||||||
</p>
|
|
||||||
<p><img src="{SPACER}" width="120" height="10" alt="" /></p>
|
|
||||||
</td>
|
|
||||||
<td class="message td2">
|
|
||||||
<div class="post_head pad_4">{MINIPOST_IMG} {review.POST_DATE}</div>
|
|
||||||
<div class="post_wrap post_body">{review.MESSAGE}</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<!-- END review -->
|
|
||||||
|
|
||||||
</table>
|
<div id="file-up-del">
|
||||||
|
<a href="#" class="med bold" onclick="if (window.confirm(this.innerHTML+'?')){ ajax.del_attach() } return false;">удалить прикреплённый файл</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="spacer_12"></div>
|
</div>
|
||||||
|
|
||||||
<!--========================================================================-->
|
<script type="text/javascript">
|
||||||
<!-- ENDIF / TPL_TOPIC_REVIEW -->
|
$(document).ready(function(){
|
||||||
|
<!-- IF FILE_ATTACHED -->
|
||||||
|
$('#file-up-box').html( $('#file-up-del').html() );
|
||||||
|
<!-- ELSE -->
|
||||||
|
show_load_file_link();
|
||||||
|
<!-- ENDIF -->
|
||||||
|
$('#file-up').show();
|
||||||
|
$('#post-preview-btn').click(function(){
|
||||||
|
if ( $('#file-up-btn').val() ) {
|
||||||
|
return window.confirm('Вы можете прикрепить файл только вместе с отправкой сообщения.\n\nОтменить загрузку файла?\n ');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
function show_load_file_link ()
|
||||||
|
{
|
||||||
|
$('#file-up-box').html( $('#file-up-new').html() );
|
||||||
|
$('#file-up-desc').show();
|
||||||
|
}
|
||||||
|
function show_file_up_input ()
|
||||||
|
{
|
||||||
|
$('#file-up-box').html( $('#file-up-input').html() );
|
||||||
|
$('#file-up-desc').html('выберите нужный файл, он будет загружен автоматически при отправке сообщения');
|
||||||
|
}
|
||||||
|
|
||||||
|
ajax.del_attach = function() {
|
||||||
|
ajax.exec({
|
||||||
|
action : 'del_attach',
|
||||||
|
topic_id : '{POSTING_TOPIC_ID}'
|
||||||
|
});
|
||||||
|
};
|
||||||
|
ajax.callback.del_attach = function(data){
|
||||||
|
show_load_file_link();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<!-- ENDIF / SHOW_ATTACH -->
|
Loading…
Add table
Add a link
Reference in a new issue