From 51aed15b4e0225d547301e5c66976c3e3eba3f3b Mon Sep 17 00:00:00 2001 From: pherum83 Date: Mon, 3 Sep 2012 22:58:47 +0000 Subject: [PATCH] r451 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ссылка на цитируемый пост git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@451 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293 --- upload/ajax/posts.php | 2 +- upload/config.php | 2 +- upload/includes/bbcode.php | 1 + upload/posting.php | 2 +- upload/templates/default/page_header.tpl | 10 ++++++++-- 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/upload/ajax/posts.php b/upload/ajax/posts.php index 72e3b4a3a..917b6c1a0 100644 --- a/upload/ajax/posts.php +++ b/upload/ajax/posts.php @@ -78,7 +78,7 @@ switch($this->request['type']) // Use trim to get rid of spaces placed there by MS-SQL 2000 $quote_username = (trim($post['post_username']) != '') ? $post['post_username'] : get_username($post['poster_id']); - $message = "[quote=\"". $quote_username ."\"]". $post['post_text'] ."[/quote]\n"; + $message = "[quote=\"". $quote_username ."\"][qpost=". $post['post_id'] ."]". $post['post_text'] ."[/quote]\n"; // hide user passkey $message = preg_replace('#(?<=\?uk=)[a-zA-Z0-9]{10}(?=&)#', 'passkey', $message); // hide sid diff --git a/upload/config.php b/upload/config.php index 2d610e0ec..b9dfffb16 100644 --- a/upload/config.php +++ b/upload/config.php @@ -56,7 +56,7 @@ $domain_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : $do // Increase number of revision after update $bb_cfg['tp_version'] = '2.5 Beta'; -$bb_cfg['tp_release_state'] = 'R450'; +$bb_cfg['tp_release_state'] = 'R451'; $bb_cfg['tp_release_date'] = '04-09-2012'; // Database diff --git a/upload/includes/bbcode.php b/upload/includes/bbcode.php index b428d19cb..e5f99bc61 100644 --- a/upload/includes/bbcode.php +++ b/upload/includes/bbcode.php @@ -509,6 +509,7 @@ class bbcode "#\[url=(https?://$url_exp)\]([^?\n\t].*?)\[/url\]#isu" => '$2', "#\[url=(www\.$url_exp)\]([^?\n\t].*?)\[/url\]#isu" => '$2', "#\[email\]($email_exp)\[/email\]#isu" => '$1', + "#\[qpost=([0-9]*)\]#isu" => '$1', ); $this->str = array( diff --git a/upload/posting.php b/upload/posting.php index f8fcb419b..d87eb4c58 100644 --- a/upload/posting.php +++ b/upload/posting.php @@ -678,7 +678,7 @@ else // Use trim to get rid of spaces placed there by MS-SQL 2000 $quote_username = ( trim($post_info['post_username']) != '' ) ? $post_info['post_username'] : $post_info['username']; - $message = '[quote="' . $quote_username . '"]' . $message . '[/quote]'; + $message = '[quote="'. $quote_username .'"][qpost='. $post_info['post_id'] .']' . $message . '[/quote]'; // hide user passkey $message = preg_replace('#(?<=\?uk=)[a-zA-Z0-9]{10}(?=&)#', 'passkey', $message); // hide sid diff --git a/upload/templates/default/page_header.tpl b/upload/templates/default/page_header.tpl index f2043ce8f..18f3171d4 100644 --- a/upload/templates/default/page_header.tpl +++ b/upload/templates/default/page_header.tpl @@ -43,7 +43,13 @@ function initQuotes(context) $('div.q', context).each(function(){ var $q = $(this); var name = $(this).attr('head'); - $q.before('
'+ (name ? ''+name+' {L_WROTE}:' : '{L_QUOTE}') +'
'); + var q_title = (name ? ''+name+' {L_WROTE}:' : '{L_QUOTE}'); + if ( quoted_pid = $q.children('u.q-post:first').text() ) { + var on_this_page = $('#post_'+quoted_pid).length; + var href = (on_this_page) ? '#'+ quoted_pid : './viewtopic.php?p='+ quoted_pid +'#'+ quoted_pid; + q_title += ' '; + } + $q.before('
'+ q_title +'
'); }); } function initPostImages(context) @@ -256,7 +262,7 @@ function OpenInEditor ($file, $line)