Быстрое редактирование название темы git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@418 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
nanosimbiot 2012-05-18 10:39:40 +00:00
commit 8fc8a331a9
9 changed files with 78 additions and 33 deletions

View file

@ -56,8 +56,8 @@ $domain_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : $do
// Increase number of revision after update // Increase number of revision after update
$bb_cfg['tp_version'] = '2.5 Beta'; $bb_cfg['tp_version'] = '2.5 Beta';
$bb_cfg['tp_release_state'] = 'R416'; $bb_cfg['tp_release_state'] = 'R418';
$bb_cfg['tp_release_date'] = '12-05-2012'; $bb_cfg['tp_release_date'] = '18-05-2012';
// Database // Database
$charset = 'utf8'; $charset = 'utf8';

View file

@ -13,9 +13,10 @@ $user_id = $userdata['user_id'];
$start = isset($_GET['start']) ? abs(intval($_GET['start'])) : 0; $start = isset($_GET['start']) ? abs(intval($_GET['start'])) : 0;
$per_page = $bb_cfg['topics_per_page']; $per_page = $bb_cfg['topics_per_page'];
if ( isset($HTTP_POST_VARS['watch_list']) ) if ( isset($_POST['topic_id_list']) )
{ {
$topic_ids = implode(",", $HTTP_POST_VARS['watch_list']); $topic_ids = implode(",", $_POST['topic_id_list']);
$sql = "DELETE FROM ". BB_TOPICS_WATCH ." $sql = "DELETE FROM ". BB_TOPICS_WATCH ."
WHERE topic_id IN(". $topic_ids .") WHERE topic_id IN(". $topic_ids .")
AND user_id = $user_id"; AND user_id = $user_id";
@ -74,8 +75,8 @@ if ($watch_count > 0)
'FORUM_TITLE' => wbr($watch[$i]['forum_name']), 'FORUM_TITLE' => wbr($watch[$i]['forum_name']),
'U_FORUM' => FORUM_URL . $watch[$i]['forum_id'], 'U_FORUM' => FORUM_URL . $watch[$i]['forum_id'],
'REPLIES' => $watch[$i]['topic_replies'], 'REPLIES' => $watch[$i]['topic_replies'],
'AUTHOR' => profile_url(array('username' => $watch[$i]['username'], 'user_rank' => $watch[$i]['user_rank'])) .'</a>', 'AUTHOR' => profile_url($watch[$i]),
'LAST_POST' => bb_date($watch[$i]['topic_last_post_time']) .'<br />'. profile_url(array('username' => $watch[$i]['last_username'], 'user_rank' => $watch[$i]['last_user_rank'])), 'LAST_POST' => bb_date($watch[$i]['topic_last_post_time']) .'<br />'. profile_url(array('user_id' => $watch[$i]['last_user_id'], 'username' => $watch[$i]['last_username'], 'user_rank' => $watch[$i]['last_user_rank'])),
'LAST_POST_ID' => $watch[$i]['topic_last_post_id'], 'LAST_POST_ID' => $watch[$i]['topic_last_post_id'],
'IS_UNREAD' => $is_unread, 'IS_UNREAD' => $is_unread,
'TOPIC_ICON' => get_topic_icon($watch[$i], $is_unread), 'TOPIC_ICON' => get_topic_icon($watch[$i], $is_unread),

View file

@ -100,6 +100,7 @@ $template->assign_vars(array(
'PAGE_TITLE' => sprintf($lang['VIEWING_USER_PROFILE'], $profiledata['username']), 'PAGE_TITLE' => sprintf($lang['VIEWING_USER_PROFILE'], $profiledata['username']),
'USERNAME' => $profiledata['username'], 'USERNAME' => $profiledata['username'],
'PROFILE_USER_ID' => $profiledata['user_id'], 'PROFILE_USER_ID' => $profiledata['user_id'],
'PROFILE_USER' => $profile_user_id,
'USER_REGDATE' => bb_date($profiledata['user_regdate'], 'Y-m-d H:i', 'false'), 'USER_REGDATE' => bb_date($profiledata['user_regdate'], 'Y-m-d H:i', 'false'),
'POSTER_RANK' => ($poster_rank) ? "<span class=\"$rank_style\">". $poster_rank ."</span>" : $lang['USER'], 'POSTER_RANK' => ($poster_rank) ? "<span class=\"$rank_style\">". $poster_rank ."</span>" : $lang['USER'],
'RANK_IMAGE' => $rank_image, 'RANK_IMAGE' => $rank_image,

View file

@ -1632,6 +1632,7 @@ $lang['DOWNLOAD_TORRENT'] = 'Download torrent';
$lang['SEND_PM'] = 'Send PM'; $lang['SEND_PM'] = 'Send PM';
$lang['SEND_MESSAGE'] = 'Send message'; $lang['SEND_MESSAGE'] = 'Send message';
$lang['EDIT_POST'] = 'Edit Post'; $lang['EDIT_POST'] = 'Edit Post';
$lang['EDIT_TOPIC_TITLE'] = 'Edit Topic title';
$lang['NEW_THREADS'] = 'New Threads'; $lang['NEW_THREADS'] = 'New Threads';
$lang['PROFILE_NOT_FOUND'] = 'Profile not found'; $lang['PROFILE_NOT_FOUND'] = 'Profile not found';
@ -1763,6 +1764,10 @@ $lang['DEL_LIST_MY_MESSAGE'] = 'Delete the selected topic from the list';
$lang['DEL_LIST_MY_MESSAGE_INFO'] = 'After removal of up to update the <b>entire list</b> it can be shown already deleted threads'; $lang['DEL_LIST_MY_MESSAGE_INFO'] = 'After removal of up to update the <b>entire list</b> it can be shown already deleted threads';
$lang['DEL_LIST_INFO'] = 'To delete an order from the list, click on the icon to the left of the names of any section'; $lang['DEL_LIST_INFO'] = 'To delete an order from the list, click on the icon to the left of the names of any section';
//Îòñëåæèâàåìûå òåìû
$lang['WATCHED_TOPICS'] = 'Watched Topics';
$lang['NO_WATCHED_TOPICS'] = 'You are not watching any topics';
// set_die_append_msg // set_die_append_msg
$lang['INDEX_RETURN'] = 'Back to home page'; $lang['INDEX_RETURN'] = 'Back to home page';
$lang['FORUM_RETURN'] = 'Back to Forum'; $lang['FORUM_RETURN'] = 'Back to Forum';

View file

@ -322,6 +322,7 @@ $lang['POST_A_NEW_TOPIC'] = 'Начать новую тему';
$lang['POST_A_REPLY'] = 'Ответить'; $lang['POST_A_REPLY'] = 'Ответить';
$lang['POST_TOPIC_AS'] = 'Статус создаваемой темы'; $lang['POST_TOPIC_AS'] = 'Статус создаваемой темы';
$lang['EDIT_POST'] = 'Редактировать сообщение'; $lang['EDIT_POST'] = 'Редактировать сообщение';
$lang['EDIT_TOPIC_TITLE'] = 'Изменить название темы';
$lang['EDIT_POST_NOT_1'] = 'Вам запрещено '; $lang['EDIT_POST_NOT_1'] = 'Вам запрещено ';
$lang['EDIT_POST_NOT_2'] = 'Вы не можете '; $lang['EDIT_POST_NOT_2'] = 'Вы не можете ';
$lang['EDIT_POST_AJAX'] = 'редактировать сообщение со статусом'; $lang['EDIT_POST_AJAX'] = 'редактировать сообщение со статусом';
@ -1636,7 +1637,6 @@ $lang['SHOW_CAPTION'] = 'Показывать подпись';
$lang['DOWNLOAD_TORRENT'] = 'Скачивать торренты'; $lang['DOWNLOAD_TORRENT'] = 'Скачивать торренты';
$lang['SEND_PM'] = 'Отправлять ЛС'; $lang['SEND_PM'] = 'Отправлять ЛС';
$lang['SEND_MESSAGE'] = 'Отправлять сообщения'; $lang['SEND_MESSAGE'] = 'Отправлять сообщения';
$lang['EDIT_POST'] = 'Редактировать сообщения';
$lang['NEW_THREADS'] = 'Создавать темы'; $lang['NEW_THREADS'] = 'Создавать темы';
$lang['PROFILE_NOT_FOUND'] = 'Профиль не найден'; $lang['PROFILE_NOT_FOUND'] = 'Профиль не найден';

View file

@ -1,7 +1,6 @@
<script type="text/javascript"> <script type="text/javascript">
ajax.in_edit_mode = false; ajax.in_edit_mode = false;
$(document).ready(function(){ $(document).ready(function(){
$('#show-edit-btn a').click(function(){ $('#show-edit-btn a').click(function(){
show_edit_options(); show_edit_options();
@ -9,9 +8,6 @@ $(document).ready(function(){
return false; return false;
}); });
$('td.topic_id').click(function(){ $('td.topic_id').click(function(){
if (!ajax.in_edit_mode) { if (!ajax.in_edit_mode) {
$('#show-edit-btn a').click(); $('#show-edit-btn a').click();
@ -20,7 +16,6 @@ $(document).ready(function(){
}); });
}); });
function show_edit_options () function show_edit_options ()
{ {
$('td.topic_id').each(function(){ $('td.topic_id').each(function(){
@ -29,7 +24,6 @@ function show_edit_options ()
$(this).html(input); $(this).html(input);
}); });
$('input.topic-chbox').click(function(){ $('input.topic-chbox').click(function(){
if ($.browser.mozilla) { if ($.browser.mozilla) {
$('#tr-'+this.value+' td').toggleClass('hl-selected-row'); $('#tr-'+this.value+' td').toggleClass('hl-selected-row');
@ -42,7 +36,6 @@ function show_edit_options ()
$('#mod-action-cell').append( $('#mod-action-content')[0] ); $('#mod-action-cell').append( $('#mod-action-content')[0] );
$('#mod-action-row, #mod-action-content').show(); $('#mod-action-row, #mod-action-content').show();
$('#mod-action').submit(function(){ $('#mod-action').submit(function(){
var $form = $(this); var $form = $(this);
$('input[name~=topic_id_list]', $form).remove(); $('input[name~=topic_id_list]', $form).remove();

View file

@ -326,7 +326,7 @@ ajax.callback.gen_passkey = function(data){
[ <a href="{U_SEARCH_USER}" class="med">{L_SEARCH_USER_POSTS}</a> ] [ <a href="{U_SEARCH_USER}" class="med">{L_SEARCH_USER_POSTS}</a> ]
[ <a href="{U_SEARCH_TOPICS}" class="med">{L_SEARCH_USER_TOPICS}</a> ] [ <a href="{U_SEARCH_TOPICS}" class="med">{L_SEARCH_USER_TOPICS}</a> ]
[ <a class="med" href="{U_SEARCH_RELEASES}">{L_SEARCH_RELEASES}</a> ] [ <a class="med" href="{U_SEARCH_RELEASES}">{L_SEARCH_RELEASES}</a> ]
[ <a class="med" href="{U_WATCHED_TOPICS}">{L_WATCHED_TOPICS}</a> ] <!-- IF PROFILE_USER -->[ <a class="med" href="{U_WATCHED_TOPICS}">{L_WATCHED_TOPICS}</a> ]<!-- ENDIF -->
</p> </p>
</td> </td>
</tr> </tr>

View file

@ -178,8 +178,8 @@ ajax.callback.mod_action = function(data) {
<div id="tt-edit-tpl" style="display: none;"> <div id="tt-edit-tpl" style="display: none;">
<div class="tt-edit" style="padding: 4px;"> <div class="tt-edit" style="padding: 4px;">
<textarea class="tt-edit-input" rows="2" cols="50" style="width: 98%; height: 35px;"></textarea> <textarea class="tt-edit-input" rows="2" cols="50" style="width: 98%; height: 35px;"></textarea>
<a href="#" onclick="tte_submit('save'); return false;" class="adm">[{L_SAVE}]</a> &middot; <input type="button" value="{L_SAVE}" onclick="tte_submit('save'); return false;" />
<a href="#" onclick="tte_submit('cancel'); return false;" class="med">{L_CANCEL}</a> <input type="button" value="{L_CANCEL}" onclick="tte_submit('cancel'); return false;" />
</div> </div>
</div> </div>

View file

@ -83,7 +83,52 @@ function set_hid_chbox (id)
<div class="spacer_6"></div> <div class="spacer_6"></div>
<h1 class="maintitle"><a href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a></h1> <h1 class="maintitle">
<a class="tt-text" href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a>
<!-- IF AUTH_MOD -->
<script type="text/javascript">
var $tt_td = $('.maintitle');
function edit_topic_title (mode)
{
if (mode == 'edit') { var tt_text = $tt_td.find('.tt-text').text();
ajax.tte_orig_html = $tt_td.html();
$tt_td.html( $('#tt-edit-tpl').html() );
$('.tt-edit-input', $tt_td).val(tt_text).focus(); }
else if (mode == 'save') {
var topic_title = $('.tt-edit-input', $tt_td).val();
ajax.edit_topic_title(topic_title);
}
else {
$tt_td.html(ajax.tte_orig_html);
}
}
ajax.edit_topic_title = function(topic_title) {
ajax.exec({
action : 'mod_action',
mode : 'edit_topic_title',
topic_id : {TOPIC_ID},
topic_title : topic_title
});
}
ajax.callback.mod_action = function(data) {
$tt_td.html(ajax.tte_orig_html);
$('.tt-text', $tt_td).html(data.topic_title);
}
</script>
<a style="cursor: help; color: #800000;" title="{L_EDIT_TOPIC_TITLE}" onclick="edit_topic_title('edit'); return false" href="#">&para;</a>
<div id="tt-edit-tpl" style="display: none;">
<div class="tt-edit" style="padding: 4px;">
<textarea class="tt-edit-input" rows="2" cols="50" style="width: 98%; height: 35px;"></textarea>
<input type="button" value="{L_SAVE}" onclick="edit_topic_title('save'); return false;" />
<input type="button" value="{L_CANCEL}" onclick="edit_topic_title('cancel'); return false;" />
</div>
</div>
<!-- ENDIF -->
</h1>
<!-- IF PAGINATION --> <!-- IF PAGINATION -->
<p class="small" style="padding: 1px 6px 5px;"><b>{PAGINATION}</b></p> <p class="small" style="padding: 1px 6px 5px;"><b>{PAGINATION}</b></p>
<!-- ENDIF --> <!-- ENDIF -->