<?php

/**
 * [BEGIN_COT_EXT]
 * Hooks=markettags.main
 * [END_COT_EXT]
 */

defined('COT_CODE') or die('Wrong URL');
global $cfg, $mavatar, $mav_rowset_list;

require_once cot_incfile('mavatars', 'plug');

$mavatar_description = new mavatar('market', 'description', $item_data['item_id'], '', $mav_rowset_list);

$temp_array['MAVATAR'] = array(
                                'description' => array(),
                              );
$temp_array['MAVATARCOUNT'] = array(
                                'description' => 0,
                              );

foreach($mavatar_description->tags() as $mav) {
  $mav['FILEEXTICON'] = 'doc';
  if(cot_mavatar_is_photo($mavtg['FILEEXT'])) {
    $mav['FILEEXTICON'] = 'image';
  } elseif(cot_mavatar_is_audio($mavtg['FILEEXT'])) {
    $mav['FILEEXTICON'] = 'audio';
  } elseif($mavtg['FILEEXT'] == 'zip' || $mavtg['FILEEXT'] == 'rar') {
    $mav['FILEEXTICON'] = 'zip';
  }
  $temp_array['MAVATAR']['description'][] = $mav;
  $temp_array['MAVATARCOUNT']['description']++;
}