Ejemplo n.º 1
0
 function Copy($BANNER_ID, $CHECK_RIGHTS = "Y")
 {
     $ID = 0;
     $rsBanner = CAdvBanner::GetByID($BANNER_ID, $CHECK_RIGHTS);
     if ($arBanner = $rsBanner->Fetch()) {
         $arFields = array("CONTRACT_ID" => $arBanner["CONTRACT_ID"], "TYPE_SID" => $arBanner["TYPE_SID"], "STATUS_SID" => $arBanner["STATUS_SID"], "STATUS_COMMENTS" => $arBanner["STATUS_COMMENTS"], "NAME" => $arBanner["NAME"], "GROUP_SID" => $arBanner["GROUP_SID"], "ACTIVE" => $arBanner["ACTIVE"], "WEIGHT" => $arBanner["WEIGHT"], "MAX_VISITOR_COUNT" => $arBanner["MAX_VISITOR_COUNT"], "RESET_VISITOR_COUNT" => "Y", "SHOWS_FOR_VISITOR" => $arBanner["SHOWS_FOR_VISITOR"], "MAX_SHOW_COUNT" => $arBanner["MAX_SHOW_COUNT"], "RESET_SHOW_COUNT" => "Y", "FIX_CLICK" => $arBanner["FIX_CLICK"], "MAX_CLICK_COUNT" => $arBanner["MAX_CLICK_COUNT"], "RESET_CLICK_COUNT" => $arBanner["RESET_CLICK_COUNT"], "DATE_SHOW_FROM" => $arBanner["DATE_SHOW_FROM"], "DATE_SHOW_TO" => $arBanner["DATE_SHOW_TO"], "IMAGE_ALT" => $arBanner["IMAGE_ALT"], "URL" => $arBanner["URL"], "URL_TARGET" => $arBanner["URL_TARGET"], "NO_URL_IN_FLASH" => $arBanner["NO_URL_IN_FLASH"], "CODE" => $arBanner["CODE"], "CODE_TYPE" => $arBanner["CODE_TYPE"], "STAT_EVENT_1" => $arBanner["STAT_EVENT_1"], "STAT_EVENT_2" => $arBanner["STAT_EVENT_2"], "STAT_EVENT_3" => $arBanner["STAT_EVENT_3"], "FOR_NEW_GUEST" => $arBanner["FOR_NEW_GUEST"], "COMMENTS" => $arBanner["COMMENTS"], "SHOW_USER_GROUP" => $arBanner["SHOW_USER_GROUP"], "arrSHOW_PAGE" => CAdvBanner::GetPageArray($BANNER_ID, "SHOW"), "arrNOT_SHOW_PAGE" => CAdvBanner::GetPageArray($BANNER_ID, "NOT_SHOW"), "STAT_TYPE" => $arBanner["STAT_TYPE"], "arrCOUNTRY" => CAdvBanner::GetCountryArray($BANNER_ID, array("COUNTRY_ID", "REGION", "CITY_ID")), "arrSTAT_ADV" => CAdvBanner::GetStatAdvArray($BANNER_ID), "arrWEEKDAY" => CAdvBanner::GetWeekdayArray($BANNER_ID), "arrSITE" => CAdvBanner::GetSiteArray($BANNER_ID), "arrUSERGROUP" => CAdvBanner::GetGroupArray($BANNER_ID), "KEYWORDS" => $arBanner["KEYWORDS"], "SEND_EMAIL" => "Y", "AD_TYPE" => $arBanner["AD_TYPE"], "FLASH_TRANSPARENT" => $arBanner["FLASH_TRANSPARENT"], "arrFlashIMAGE_ID" => $arBanner["arrFlashIMAGE_ID"], "FLASH_JS" => $arBanner["FLASH_JS"], "FLASH_VER" => $arBanner["FLASH_VER"]);
         if (intval($arBanner["IMAGE_ID"]) > 0) {
             $arrIMAGE = CFile::MakeFileArray($arBanner["IMAGE_ID"]);
             $arrIMAGE["MODULE_ID"] = "advertising";
             $arFields["arrIMAGE_ID"] = $arrIMAGE;
         }
         $ID = CAdvBanner::Set($arFields, 0);
     }
     return $ID;
 }
Ejemplo n.º 2
0
} else {
    if (strlen($strError) <= 0) {
        if (strlen($str_KEYWORDS) > 0) {
            $arrKEYWORDS = preg_split('/[\\n\\r]+/', $str_KEYWORDS);
            TrimArr($arrKEYWORDS);
        }
        $arrSITE = CAdvBanner::GetSiteArray($ID);
        $arrSHOW_PAGE = CAdvBanner::GetPageArray($ID, "SHOW");
        $str_SHOW_PAGE = implode("\n", $arrSHOW_PAGE);
        $arrNOT_SHOW_PAGE = CAdvBanner::GetPageArray($ID, "NOT_SHOW");
        $str_NOT_SHOW_PAGE = implode("\n", $arrNOT_SHOW_PAGE);
        if ($str_STAT_TYPE !== "CITY" && $str_STAT_TYPE != "REGION") {
            $str_STAT_TYPE = "COUNTRY";
        }
        $arrSTAT_TYPE_VALUES = CAdvBanner::GetCountryArray($ID, $str_STAT_TYPE);
        $arrWEEKDAY = CAdvBanner::GetWeekdayArray($ID);
        while (list($key, $value) = each($arrWEEKDAY)) {
            ${"arr" . $key} = $value;
        }
        $arrSTAT_ADV = CAdvBanner::GetStatAdvArray($ID);
        $arrUSERGROUP = CAdvBanner::GetGroupArray($ID);
    }
}
if (strlen($strError) > 0) {
    $DB->InitTableVarsForEdit("b_adv_banner", "", "str_");
    $str_SHOW_PAGE = htmlspecialcharsbx($SHOW_PAGE);
    $str_NOT_SHOW_PAGE = htmlspecialcharsbx($NOT_SHOW_PAGE);
    $str_IMAGE_ID = 0;
    $str_FLASH_IMAGE = 0;
}
if (strlen($SEND_EMAIL) <= 0) {