From 489900ea00f5faf15f63030b98c37f4774e670f7 Mon Sep 17 00:00:00 2001 From: adaur Date: Tue, 11 Aug 2015 23:28:51 +0200 Subject: [PATCH] Fix double post bug --- include/idiorm.php | 3 --- model/viewtopic.php | 4 +--- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/include/idiorm.php b/include/idiorm.php index 64768fd3..22675040 100644 --- a/include/idiorm.php +++ b/include/idiorm.php @@ -1061,9 +1061,6 @@ protected function _add_join_source($join_operator, $table, $constraint, $table_ */ public function raw_join($table, $constraint, $table_alias, $parameters = array()) { - $feather = \Slim\Slim::getInstance(); - $table = $feather->prefix.$table; - // Add table alias if present if (!is_null($table_alias)) { $table_alias = $this->_quote_identifier($table_alias); diff --git a/model/viewtopic.php b/model/viewtopic.php index a4dcb441..c3006d89 100644 --- a/model/viewtopic.php +++ b/model/viewtopic.php @@ -265,9 +265,7 @@ public function print_posts($topic_id, $start_from, $cur_topic, $is_admmod) ->select_many($select_print_posts) ->inner_join('users', array('u.id', '=', 'p.poster_id'), 'u') ->inner_join('groups', array('g.g_id', '=', 'u.group_id'), 'g') - ->left_outer_join('online', array('o.user_id', '=', 'u.id'), 'o') - ->left_outer_join('online', array('o2.user_id', '!=', 1), 'o2', true) - ->left_outer_join('online', array('o.idle', '=', 0), null, true) + ->raw_join('LEFT OUTER JOIN '.$this->feather->prefix.'online', "o.user_id!=1 AND o.idle=0 AND o.user_id=u.id", 'o') ->where_in('p.id', $post_ids) ->order_by('p.id') ->find_array();