From 986af43f37342953bff548630aa33904c21234f4 Mon Sep 17 00:00:00 2001 From: JoshyPHP Date: Fri, 1 May 2015 08:47:01 +0200 Subject: [ticket/13803] Added plugins PHPBB3-13803 --- phpBB/phpbb/textreparser/plugins/poll_title.php | 50 +++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 phpBB/phpbb/textreparser/plugins/poll_title.php (limited to 'phpBB/phpbb/textreparser/plugins/poll_title.php') diff --git a/phpBB/phpbb/textreparser/plugins/poll_title.php b/phpBB/phpbb/textreparser/plugins/poll_title.php new file mode 100644 index 0000000000..e794780eba --- /dev/null +++ b/phpBB/phpbb/textreparser/plugins/poll_title.php @@ -0,0 +1,50 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\textreparser\plugins; + +class poll_title extends \phpbb\textreparser\row_based_plugin +{ + /** + * {@inheritdoc} + */ + protected function get_columns() + { + return array( + 'id' => 'topic_id', + 'text' => 'poll_title', + ); + } + + /** + * {@inheritdoc} + */ + protected function get_records_query($min_id, $max_id) + { + $sql = 'SELECT t.topic_id AS id, t.poll_title AS text, p.bbcode_uid + FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . ' p + WHERE t.topic_id BETWEEN ' . $min_id . ' AND ' . $max_id .' + AND t.poll_max_options > 0 + AND p.post_id = t.topic_first_post_id'; + + return $sql; + } + + /** + * {@inheritdoc} + */ + protected function get_table_name() + { + return TOPICS_TABLE; + } +} -- cgit v1.2.1 From 459f1d4c1f26658c70d29ac7c4e3f3389a973a59 Mon Sep 17 00:00:00 2001 From: JoshyPHP Date: Fri, 1 May 2015 20:05:15 +0200 Subject: [ticket/13803] Refactored test PHPBB3-13803 --- phpBB/phpbb/textreparser/plugins/poll_title.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb/textreparser/plugins/poll_title.php') diff --git a/phpBB/phpbb/textreparser/plugins/poll_title.php b/phpBB/phpbb/textreparser/plugins/poll_title.php index e794780eba..6665d68847 100644 --- a/phpBB/phpbb/textreparser/plugins/poll_title.php +++ b/phpBB/phpbb/textreparser/plugins/poll_title.php @@ -18,7 +18,7 @@ class poll_title extends \phpbb\textreparser\row_based_plugin /** * {@inheritdoc} */ - protected function get_columns() + public function get_columns() { return array( 'id' => 'topic_id', @@ -43,7 +43,7 @@ class poll_title extends \phpbb\textreparser\row_based_plugin /** * {@inheritdoc} */ - protected function get_table_name() + public function get_table_name() { return TOPICS_TABLE; } -- cgit v1.2.1 From 1bff7d1175cb92f10d9fc872c2bae05b1f955174 Mon Sep 17 00:00:00 2001 From: JoshyPHP Date: Tue, 19 May 2015 11:29:52 +0200 Subject: [ticket/13803] Fixed method name PHPBB3-13803 --- phpBB/phpbb/textreparser/plugins/poll_title.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/textreparser/plugins/poll_title.php') diff --git a/phpBB/phpbb/textreparser/plugins/poll_title.php b/phpBB/phpbb/textreparser/plugins/poll_title.php index 6665d68847..b447004527 100644 --- a/phpBB/phpbb/textreparser/plugins/poll_title.php +++ b/phpBB/phpbb/textreparser/plugins/poll_title.php @@ -29,7 +29,7 @@ class poll_title extends \phpbb\textreparser\row_based_plugin /** * {@inheritdoc} */ - protected function get_records_query($min_id, $max_id) + protected function get_records_by_range_query($min_id, $max_id) { $sql = 'SELECT t.topic_id AS id, t.poll_title AS text, p.bbcode_uid FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . ' p -- cgit v1.2.1