PDA

View Full Version : Banners Review - Bug? - Disapproved Banners Still Display in Directory


Mark Brookes
11-28-2006, 02:24 PM
Ver PRO 2.0.01

Even after a banner has been made status = Approval. That banner still displays in the directory pages.

I would think that 'disapproved' banners were intended to behave the same as disapproved links (?) ... In which case when is is status =approval then it should not display.

please see attached - this example banner which was disapproved did still display (I have now deleted it, as I did not want it to display)

(rank 4/5 - it affects visitors & banner partners)

Regards
Mark

Dave Baker
12-09-2006, 07:09 PM
Hi Mark,
Yes it's bug, but has the easy decision.
***Open classes/Dir.php and find the function ***

function getBanner($position='',$id=false,$current=false)

***In the function find the following code***

$sql = "SELECT b.* ";
$sql .= "FROM `{$this->mPrefix}banners_categories` bc LEFT JOIN `{$this->mPrefix}banners` b";
$sql .= " ON bc.banner_id=b.id
WHERE
position='$position' AND bc.category_id='$current'
OR
b.recursive='1'";
$sql.=" AND bc.category_id IN($parents)";

***Replace red line of code with following code***

position='$position' AND bc.category_id='$current' AND status='active'

***Save file***