не работает добавление банера через функцию CAdvBanner::Set($arFields)....
написал вот такой код:
Код |
---|
CModule::IncludeModule("advertising");
$arFields = array(
"CONTRACT_ID" => 10,
"TYPE_SID" => $_GET['type'],
"STATUS_SID" => 'READY',
"STATUS_COMMENTS" => $STATUS_COMMENTS,
"NAME" => 'NAME',
"GROUP_SID" => '',
"ACTIVE" => 'N',
"arrSITE" => 'ru',
"WEIGHT" => 100,
"MAX_SHOW_COUNT" => 3000,
"RESET_SHOW_COUNT" => $RESET_SHOW_COUNT,
"MAX_CLICK_COUNT" => 3000,
"RESET_CLICK_COUNT" => $RESET_CLICK_COUNT,
"DATE_SHOW_FROM" => date('d.j.Y'),
"DATE_SHOW_TO" => $DATE_SHOW_TO,
"arrIMAGE_ID" => '',
"IMAGE_ALT" => '',
"URL" => '',
"URL_TARGET" => '',
"CODE" => $_POST['html'],
"CODE_TYPE" => 'html',
"STAT_EVENT_1" => $STAT_EVENT_1,
"STAT_EVENT_2" => $STAT_EVENT_2,
"STAT_EVENT_3" => $STAT_EVENT_3,
"FOR_NEW_GUEST" => $FOR_NEW_GUEST,
"COMMENTS" => '',
"arrSHOW_PAGE" => split("[\n\r]",$SHOW_PAGE),
"arrNOT_SHOW_PAGE" => split("[\n\r]",$NOT_SHOW_PAGE),
"arrCOUNTRY" => 'ru',
"arrSTAT_ADV" => $arrSTAT_ADV,
"arrWEEKDAY" => $arrWEEKDAY,
"SEND_EMAIL" => 'Y'
);
echo '<pre>';print_r($arFields); echo '</pre>';
if ($ID = CAdvBanner::Set($arFields))
{
echo 'Банер добавлен';
}else{
echo 'ошибка';
}
$DB->PrepareFields("b_adv_banner");
|
На выходе получается:
Код |
---|
Array
(
[CONTRACT_ID] => 10
[TYPE_SID] => doc_baner_left
[STATUS_SID] => READY
[STATUS_COMMENTS] =>
[NAME] => NAME
[GROUP_SID] =>
[ACTIVE] => N
[arrSITE] => ru
[WEIGHT] => 100
[MAX_SHOW_COUNT] => 3000
[RESET_SHOW_COUNT] =>
[MAX_CLICK_COUNT] => 3000
[RESET_CLICK_COUNT] =>
[DATE_SHOW_FROM] => 14.14.2011
[DATE_SHOW_TO] =>
[arrIMAGE_ID] =>
[IMAGE_ALT] =>
[URL] =>
[URL_TARGET] =>
[CODE] => HTML - код
[CODE_TYPE] => html
[STAT_EVENT_1] =>
[STAT_EVENT_2] =>
[STAT_EVENT_3] =>
[FOR_NEW_GUEST] =>
[COMMENTS] =>
[arrSHOW_PAGE] => Array
(
[0] =>
)
[arrNOT_SHOW_PAGE] => Array
(
[0] =>
)
[arrCOUNTRY] => ru
[arrSTAT_ADV] =>
[arrWEEKDAY] =>
[SEND_EMAIL] => Y
)
ошибка
|
В чем может быть ошибка?