From 042ac2de79131c32f162708c7a82e2606b4fec33 Mon Sep 17 00:00:00 2001 From: Daniel Spiljar Date: Sat, 15 Nov 2014 23:36:45 +0100 Subject: [PATCH] Update index.php When moreedit is used to moderate ads, the category item count is incorrect - unapproved ads are counted and approved ones are counted twice. This fixes the issue. --- moreedit/index.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/moreedit/index.php b/moreedit/index.php index acc8fcd..dc4a0fe 100755 --- a/moreedit/index.php +++ b/moreedit/index.php @@ -97,7 +97,8 @@ function moreedit_posted_item($item) if($error=='') { Session::newInstance()->_set('moreedit_fm_info', __('Your ad needs to be approved by the administrator, it could take a while until it appear on the website', 'moreedit') ); } - Item::newInstance()->update(array('b_enabled' => 0), array('pk_i_id' => $item['pk_i_id'])); + $mItem = new ItemActions(true); + $mItem->disable($item['pk_i_id']); } } @@ -142,7 +143,8 @@ function moreedit_moderate_edit($item_) osc_sendMail($emailParams); } if (osc_get_preference('moderate_edit', 'moreedit') == '1') { - Item::newInstance()->update(array('b_enabled' => 0), array('pk_i_id' => $item_id)); + $mItem = new ItemActions(true); + $mItem->disable($item['pk_i_id']); } } @@ -177,7 +179,8 @@ function moreedit_edited_item($item) { if($error=='') { Session::newInstance()->_set('moreedit_fm_info', __('Your ad needs to be approved by the administrator, it could take a while until it appear on the website', 'moreedit') ); } - Item::newInstance()->update(array('b_enabled' => 0), array('pk_i_id' => $item['pk_i_id'])); + $mItem = new ItemActions(true); + $mItem->disable($item['pk_i_id']); } }