} $sql = $db->query("SELECT * FROM {$db_market} WHERE item_id='{$id}' LIMIT 1"); cot_die($sql->rowCount() == 0); $item = $sql->fetch(); list($usr['auth_read'], $usr['auth_write'], $usr['isadmin']) = cot_auth('market', $item['item_cat']); cot_block($usr['isadmin'] || $usr['auth_write'] && $usr['id'] == $item['item_userid']); $sys['parser'] = $item['item_parser']; $parser_list = cot_get_parsers(); if ($a == 'update') { /* === Hook === */ foreach (cot_getextplugins('market.edit.update.first') as $pl) { include $pl; } /* ===== */ cot_block($usr['isadmin'] || $usr['auth_write'] && $usr['id'] == $item['item_userid']); $ritem = cot_market_import('POST', $item, $usr); if ($_SERVER['REQUEST_METHOD'] == 'POST') { $rdelete = cot_import('rdelete', 'P', 'BOL'); } else { $rdelete = cot_import('delete', 'G', 'BOL'); cot_check_xg(); } if ($rdelete) { cot_market_delete($id, $item); cot_redirect(cot_url('market', "c=" . $item['item_cat'], '', true)); } /* === Hook === */ foreach (cot_getextplugins('market.edit.update.import') as $pl) { include $pl; } /* ===== */
$extp = cot_getextplugins('market.add.first'); foreach ($extp as $pl) { include $pl; } /* ===== */ $sys['parser'] = $cfg['market']['parser']; $parser_list = cot_get_parsers(); if ($a == 'add') { cot_shield_protect(); $ritem = array(); /* === Hook === */ foreach (cot_getextplugins('market.add.add.first') as $pl) { include $pl; } /* ===== */ $ritem = cot_market_import('POST', array(), $usr); list($usr['auth_read'], $usr['auth_write'], $usr['isadmin']) = cot_auth('market', $ritem['item_cat']); cot_block($usr['auth_write']); /* === Hook === */ foreach (cot_getextplugins('market.add.add.import') as $pl) { include $pl; } /* ===== */ cot_market_validate($ritem); /* === Hook === */ foreach (cot_getextplugins('market.add.add.error') as $pl) { include $pl; } /* ===== */ if (!cot_error_found()) { $id = cot_market_add($ritem, $usr);