Skip to content

Commit 278c9de

Browse files
committed
Merge pull request featherbb#48 from featherbb/development
Fix double post bug
2 parents 10039ce + 489900e commit 278c9de

2 files changed

Lines changed: 1 addition & 6 deletions

File tree

include/idiorm.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,9 +1061,6 @@ protected function _add_join_source($join_operator, $table, $constraint, $table_
10611061
*/
10621062
public function raw_join($table, $constraint, $table_alias, $parameters = array())
10631063
{
1064-
$feather = \Slim\Slim::getInstance();
1065-
$table = $feather->prefix.$table;
1066-
10671064
// Add table alias if present
10681065
if (!is_null($table_alias)) {
10691066
$table_alias = $this->_quote_identifier($table_alias);

model/viewtopic.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,9 +265,7 @@ public function print_posts($topic_id, $start_from, $cur_topic, $is_admmod)
265265
->select_many($select_print_posts)
266266
->inner_join('users', array('u.id', '=', 'p.poster_id'), 'u')
267267
->inner_join('groups', array('g.g_id', '=', 'u.group_id'), 'g')
268-
->left_outer_join('online', array('o.user_id', '=', 'u.id'), 'o')
269-
->left_outer_join('online', array('o2.user_id', '!=', 1), 'o2', true)
270-
->left_outer_join('online', array('o.idle', '=', 0), null, true)
268+
->raw_join('LEFT OUTER JOIN '.$this->feather->prefix.'online', "o.user_id!=1 AND o.idle=0 AND o.user_id=u.id", 'o')
271269
->where_in('p.id', $post_ids)
272270
->order_by('p.id')
273271
->find_array();

0 commit comments

Comments
 (0)