<?php

/**
 * [BEGIN_COT_EXT]
 * Hooks=market.index.presearch.query
 * [END_COT_EXT]
 */

defined('COT_CODE') or die('Wrong URL');

if($index_presearch == 'favs') {
  require_once cot_incfile('marketfav', 'plug');
  $favsids = $db->query("SELECT fav_pid FROM $db_marketfav WHERE fav_uid=".$usr['id'])->fetchAll(PDO::FETCH_COLUMN);
  $where['favs'] = (count($favsids) > 0 ? '(item_id='.implode(' OR item_id=', $favsids).')' : 'item_id=0');
}