<?php

/**
 * [BEGIN_COT_EXT]
 * Hooks=projects.list.query
 * [END_COT_EXT]
 */

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

if($a == 1) {
  $marketdistusrcat = ($usr['id'] > 0 ? $db->query("SELECT DISTINCT(item_cat) FROM $db_market WHERE item_userid=".$usr['id'].' AND item_state=0 AND item_cost>0')->fetchAll(PDO::FETCH_COLUMN) : array());

  if(count($marketdistusrcat) > 0) {
    $where['cat'] = "item_cat IN ('" . implode("','", $marketdistusrcat) . "')";
  }
  //$catsub = cot_structure_children('market', $c);
	//$where['cat'] = "item_cat IN ('" . implode("','", $catsub) . "')";
}