Пример #1
0
 public function get($typeSID)
 {
     // ƒл¤ показа баннера одного типа только 1 раз на странице
     if (!empty($this->_typeSids[$typeSID])) {
         return false;
     }
     if (!empty($_SESSION['SESS_SHOW_INCLUDE_TIME_EXEC'])) {
         $debugKey = $_SESSION['SESS_SHOW_INCLUDE_TIME_EXEC'];
         $_SESSION["SESS_SHOW_INCLUDE_TIME_EXEC"] = 'N';
     }
     $cacheBlock = new CPHPCache();
     $url = CAdvBanner::GetCurUri();
     if (($pos = strpos(CAdvBanner::GetCurUri(), '?')) !== false) {
         $url = substr($url, 0, $pos);
     }
     $cacheId = $typeSID . '-' . $url;
     if ($cacheBlock->StartDataCache($this->_cacheTime, $cacheId, $this->_cacheDir)) {
         $result = CAdvBanner::Show($typeSID, '', '');
         $cacheBlock->EndDataCache(array('VARS' => $result));
     } else {
         $vars = $cacheBlock->GetVars();
         $result = $vars['VARS'];
     }
     if (!empty($_SESSION['SESS_SHOW_INCLUDE_TIME_EXEC'])) {
         $_SESSION['SESS_SHOW_INCLUDE_TIME_EXEC'] = $debugKey;
     }
     /*ѕодсчЄт показов*/
     if (empty($this->_typeSids[$typeSID])) {
         $this->_typeSids[$typeSID] = 1;
     } else {
         $this->_typeSids[$typeSID] = $this->_typeSids[$typeSID] + 1;
     }
     /**/
     return $result;
 }
Пример #2
0
                    if (!CAdvBanner::Delete($ID)) {
                        $DB->Rollback();
                        $lAdmin->AddGroupError(GetMessage("DELETE_ERROR"), $ID);
                    }
                    $DB->Commit();
                    break;
                case "activate":
                case "deactivate":
                    $cData = new CAdvBanner();
                    $arFields = array("ACTIVE" => $_REQUEST['action'] == "activate" ? "Y" : "N");
                    if (!$cData->Set($arFields, $ID)) {
                        $lAdmin->AddGroupError(GetMessage("MAIN_EDIT_ERROR") . $cData->LAST_ERROR, $ID);
                    }
                    break;
                case "copy":
                    $cData = new CAdvBanner();
                    if (!$cData->Copy($ID)) {
                        $lAdmin->AddGroupError(GetMessage("MAIN_EDIT_ERROR") . $cData->LAST_ERROR, $ID);
                    }
                    break;
            }
        } else {
            $lAdmin->AddUpdateError(GetMessage("ADV_NO_RIGHTS_EDIT"), $ID);
        }
    }
}
$rsBanners = CAdvBanner::GetList($by, $order, $arFilter, $is_filtered);
$rsData = new CAdminResult($rsBanners, $sTableID);
$rsData->NavStart();
$lAdmin->NavText($rsData->GetNavPrint(GetMessage("AD_PAGES")));
$lAdmin->AddHeaders(array(array("id" => "ID", "content" => "ID", "sort" => "s_id", "default" => true, "align" => "right"), array("id" => "LAMP", "content" => GetMessage("AD_LAMP"), "sort" => "s_lamp", "default" => true, "align" => "center"), array("id" => "NAME", "content" => GetMessage("AD_NAME"), "sort" => "s_name", "default" => true), array("id" => "TYPE_SID", "content" => GetMessage("AD_TYPE"), "sort" => "s_type_sid", "default" => true), array("id" => "ACTIVE", "content" => GetMessage("AD_ACTIVE"), "sort" => "s_active", "default" => true), array("id" => "WEIGHT", "content" => GetMessage("AD_WEIGHT"), "sort" => "s_weight", "default" => true, "align" => "right"), array("id" => "GROUP_SID", "content" => GetMessage("AD_GROUP"), "sort" => "s_group_sid"), array("id" => "CONTRACT_ID", "content" => GetMessage("AD_CONTRACT"), "sort" => "s_contract_id"), array("id" => "SITE", "content" => GetMessage("AD_SITE"), "default" => true), array("id" => "STATUS_SID", "content" => GetMessage("AD_STATUS"), "sort" => "s_status_sid", "default" => true), array("id" => "DATE_CREATE", "content" => GetMessage("ad_list_created"), "title" => GetMessage("ad_list_created_title"), "sort" => "s_date_create"), array("id" => "DATE_MODIFY", "content" => GetMessage("ad_list_modified"), "title" => GetMessage("ad_list_modified_title"), "sort" => "s_date_modify"), array("id" => "VISITOR_COUNT", "content" => GetMessage("AD_VISITOR_COUNT"), "sort" => "s_visitor_count", "align" => "right"), array("id" => "MAX_VISITOR_COUNT", "content" => GetMessage("AD_VISITOR_COUNT_MAX"), "sort" => "s_max_visitor_count", "align" => "right"), array("id" => "SHOW_COUNT", "content" => GetMessage("AD_SHOW_COUNT"), "sort" => "s_show_count", "default" => true, "align" => "right"), array("id" => "MAX_SHOW_COUNT", "content" => GetMessage("AD_SHOW_COUNT_MAX"), "sort" => "s_max_show_count", "align" => "right"), array("id" => "SHOW_COUNT_LAST_SHOW", "content" => GetMessage("AD_DATE_LAST_SHOW"), "sort" => "s_date_last_show"), array("id" => "CLICK_COUNT", "content" => GetMessage("AD_CLICK_COUNT"), "sort" => "s_click_count", "align" => "right"), array("id" => "MAX_CLICK_COUNT", "content" => GetMessage("AD_CLICK_COUNT_MAX"), "sort" => "s_max_click_count", "align" => "right"), array("id" => "CLICK_COUNT_LAST_CLICK", "content" => GetMessage("AD_DATE_LAST_CLICK"), "sort" => "s_date_last_click"), array("id" => "CTR", "content" => "CTR (%)", "sort" => "s_ctr", "align" => "right"), array("id" => "FIRST_SHOW", "content" => GetMessage("AD_FIRST_SHOW_DATE"), "sort" => "s_firstd_c"), array("id" => "UNIFORM_COEF", "content" => GetMessage("AD_UNIFORM_COEF_VIEW"), "sort" => "s_uniform_c", "align" => "right")));
Пример #3
0
 function ClickAdv($BANNER_ID)
 {
     return CAdvBanner::Click($BANNER_ID);
 }
Пример #4
0
	public static function modifyMessageList (&$arMessages) {		
	
		if (method_exists("CModule", "IncludeModuleEx") && CModule::IncludeModuleEx(self::$module_id) != MODULE_INSTALLED) {
			$demo_mode = true;
		}
		
		if (!$demo_mode || $GLOBALS['USER']->IsAdmin()) {
				
			if (!is_array($arMessages) || !COption::GetOptionString(self::$module_id, "status")) {
				return true;
			}		
			if ($GLOBALS['USER']->IsAuthorized() && COption::GetOptionString(self::$module_id, "guests_only")) {
				return true;
			}
									
			$advert_code = COption::GetOptionString(self::$module_id, "advert_code");
			$message_positions = COption::GetOptionString(self::$module_id, "message_positions", "");
			$message_interval = COption::GetOptionString(self::$module_id, "message_interval", "4");
			$advert_forums = unserialize(COption::GetOptionString(self::$module_id, "advert_forums", ""));	
					
			if ($message_positions) { 
				$message_positions = explode(',', $message_positions); 
			}

			if(!is_array($advert_forums)) {
				return true;
			}
			
			$i_message = 0;
			$arNewMessages = array();
			$arBannerCache = array();
			foreach ($arMessages as $key=>$arMessage) {				
				$i_message++;
				$arNewMessages[] = $arMessage;

				if ($i_message > 0 && (is_array($message_positions) && in_array($i_message, $message_positions) || ($message_interval && $i_message%$message_interval === 0))) {
					
					if (in_array($arMessage['FORUM_ID'], $advert_forums)) {
						$id = $arMessage['ID']."advert"; 
						$css_id = 'beono_message'.$id;
						$current_post_message_text = '';
						
						// parsing bitrix banners
						if(preg_match_all('/#BXBANNER_([^#]+)#/', $advert_code, $matches)) {
							if (is_array($matches[1]) && !empty($matches[1]) && CModule::IncludeModule('advertising')) {
								$arBannerReplacements = array();
								foreach ($matches[1] as $banner_type) {
									
									if($banner_code = CAdvBanner::Show($banner_type)) {
										$arBannerCache[$banner_type] = $banner_code;
									}									
									$arBannerReplacements[] = $arBannerCache[$banner_type];																
								}
								if (count($arBannerReplacements) > 0) {
									$current_post_message_text = str_replace($matches[0], $arBannerReplacements, $advert_code);
								}					
							}
						} else {
							$current_post_message_text = $advert_code;
						}
						
						if ($current_post_message_text) {
						
							if ($demo_mode) {
								$current_post_message_text .= '<br/><br/><a style="font-weight: bold;" target="_blank" href="http://mp.1c-bitrix.ru/solutions/beono.forumadvert/">1 day demo. Buy full version</a>';
							}
							$current_post_message_text .= '<script type="text/javascript">
							var beono_forum_mess_id = document.getElementById("message_text_'.$id.'");
							if (beono_forum_mess_id) {
								beono_forum_mess_id.parentNode.parentNode.parentNode.parentNode.parentNode.setAttribute("id", "'.$css_id.'");
							}
							</script>
							';
							$current_post_message_text .= '<style type="text/css">#'.$css_id.' .forum-post-date, #'.$css_id.' .forum-cell-contact, #'.$css_id.' .forum-cell-actions, #'.$css_id.' .forum-user-moderate-info {display:none;}</style>';
												
							$arNewMessages[] = array("ID" => $id, "AUTHOR_NAME" => " ", "POST_MESSAGE_TEXT" => $current_post_message_text, "POST_DATE" => "&nbsp;", "APPROVED" => "Y");
						}
					}
				}
			}
			if (!empty($arNewMessages)) {
				$arMessages = $arNewMessages;
			}
		}
		return true;
	}
Пример #5
0
 public static function CleanUpDynamics()
 {
     set_time_limit(0);
     ignore_user_abort(true);
     $err_mess = CAdvBanner::err_mess() . "<br>Function: CleanUpDynamics<br>Line: ";
     global $DB;
     $DAYS = intval(COption::GetOptionString("advertising", "BANNER_DAYS"));
     $strSql = "DELETE FROM b_adv_banner_2_day WHERE to_days(now())-to_days(DATE_STAT)>={$DAYS}";
     $DB->Query($strSql, false, $err_mess . __LINE__);
     $strSql = "OPTIMIZE TABLE b_adv_banner_2_day";
     $DB->Query($strSql, false, $err_mess . __LINE__);
     return "CAdvBanner::CleanUpDynamics();";
 }
Пример #6
0
 protected function loadPreview()
 {
     global $APPLICATION;
     if ($banner = CAdvBanner::GetByID($this->arParams["BANNER_ID"])->Fetch()) {
         if ($banner["AD_TYPE"] == 'template') {
             $this->templateProps = unserialize($banner["TEMPLATE"]);
             $this->templateFiles = unserialize($banner["TEMPLATE_FILES"]);
             foreach ($this->templateProps['PROPS'] as $k => $v) {
                 ob_start();
                 $APPLICATION->IncludeComponent('bitrix:advertising.banner.view', $this->templateProps['NAME'], array('PROPS' => $v, 'FILES' => $this->templateFiles[$k], 'EXT_MODE' => $this->templateProps['MODE'], 'INDEX' => $this->bannerIndex, 'PREVIEW' => $this->arParams['PREVIEW'], 'CASUAL_PROPERTIES' => array('TYPE' => $banner['AD_TYPE'])), null, array('HIDE_ICONS' => 'Y'));
                 $strReturn = CAdvBanner::PrepareHTML(ob_get_contents(), $banner);
                 ob_end_clean();
                 $this->arResult["BANNERS"][] = $strReturn;
                 $this->bannerIndex++;
             }
             $this->arResult["BANNERS_PROPERTIES"][] = $banner;
         }
         $this->arResult['SIZE'] = $this->getBannerSize();
     } else {
         $this->arResult = array();
     }
 }
Пример #7
0
        }
    }
    echo SelectBoxFromArray("STATUS_SID", $arrStatus, $str_STATUS_SID, " ");
    ?>
</td>
		</tr>
	<?php 
} elseif ($ID > 0) {
    ?>
		<tr>
			<td><?php 
    echo GetMessage("AD_STATUS");
    ?>
</td>
			<td><?php 
    $arrStatus = CAdvBanner::GetStatusList();
    $key = array_search($str_STATUS_SID, $arrStatus["reference_id"]);
    if ($key !== false) {
        echo $arrStatus["reference"][$key];
    }
    ?>
</td>
		</tr>
	<?php 
}
?>

	<?php 
if ($isAdmin || $isDemo && !$isOwner || $isManager) {
    ?>
		<tr valign="top">
Пример #8
0
    $arParams["CACHE_TIME"] = 0;
}
//Result
$arResult = array("BANNER" => "", "BANNER_PROPERTIES" => array());
$obCache = new CPHPCache();
$cache_id = SITE_ID . "|advertising.banner|" . serialize($arParams) . "|" . $USER->GetGroups();
$cache_path = "/" . SITE_ID . $this->GetRelativePath();
if ($obCache->StartDataCache($arParams["CACHE_TIME"], $cache_id, $cache_path)) {
    if (!CModule::IncludeModule("advertising")) {
        return;
    }
    $arBanner = CAdvBanner::GetRandom($arParams["TYPE"]);
    $strReturn = CAdvBanner::GetHTML($arBanner, $arParams["NOINDEX"] == "Y");
    $arResult["BANNER"] = $strReturn;
    $arResult["BANNER_PROPERTIES"] = $arBanner;
    if (strlen($arResult["BANNER"]) > 0) {
        CAdvBanner::FixShow($arBanner);
    }
    $this->IncludeComponentTemplate();
    $templateCachedData = $this->GetTemplateCachedData();
    $obCache->EndDataCache(array("arResult" => $arResult, "templateCachedData" => $templateCachedData));
} else {
    $arVars = $obCache->GetVars();
    $arResult = $arVars["arResult"];
    $this->SetTemplateCachedData($arVars["templateCachedData"]);
}
if ($USER->IsAuthorized() && $APPLICATION->GetShowIncludeAreas()) {
    if (($arIcons = CAdvBanner::GetEditIcons($arResult["BANNER_PROPERTIES"], $arParams["TYPE"])) !== false) {
        $this->AddIncludeAreaIcons($arIcons);
    }
}
	<?php 
if ($ID > 0) {
    ?>
	<tr valign="top">
		<td><?php 
    echo GetMessage("AD_BANNER_COUNT");
    ?>
</td>
		<td>
			<table cellspacing=1 cellpadding=0 border=0>
				<?php 
    while (list($key, $status_sid) = each($arrStatus["reference_id"])) {
        $count = 0;
        $arFilter = array("CONTRACT_ID" => $ID, "CONTRACT_EXACT_MATCH" => "Y", "STATUS_SID" => $status_sid);
        if ($rsBanners = CAdvBanner::GetList($v1, $v2, $arFilter, $v3)) {
            $rsBanners->NavStart();
            $count = $rsBanners->SelectedRowsCount();
        }
        ?>
				<tr>
					<td width="30%"><?php 
        echo $arrStatus["reference"][$key];
        ?>
:&nbsp;</td>
					<td><a href="/bitrix/admin/adv_banner_list.php?find_contract_id[]=<?php 
        echo $ID;
        ?>
&find_status_sid[]=<?php 
        echo $status_sid;
        ?>
Пример #10
0
define("ADMIN_SECTION", false);
if (!empty($_REQUEST['site_id']) && preg_match('/^[a-z0-9_]{2}$/i', $_REQUEST['site_id'])) {
    define('SITE_ID', $_REQUEST['site_id']);
}
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php";
global $APPLICATION;
if (CModule::IncludeModule("statistic")) {
    if (strlen($_REQUEST["site_id"]) <= 0) {
        $site_id = false;
        $referer_url = strlen($_SERVER["HTTP_REFERER"]) <= 0 ? $_SESSION["SESS_HTTP_REFERER"] : $_SERVER["HTTP_REFERER"];
        if (strlen($referer_url)) {
            $url = @parse_url($referer_url);
            if ($url) {
                $rs = CSite::GetList($v1 = "LENDIR", $v2 = "DESC", array("ACTIVE" => "Y", "DOMAIN" => "%" . $url["host"], "IN_DIR" => $url["path"]));
                if ($arr = $rs->Fetch()) {
                    $site_id = $arr["ID"];
                }
            }
        }
    } else {
        $site_id = $_REQUEST["site_id"];
    }
    $goto = preg_replace("/#EVENT_GID#/i", urlencode(CStatEvent::GetGID($site_id)), $_REQUEST["goto"]);
    CStatEvent::AddCurrent($_REQUEST["event1"], $_REQUEST["event2"], $_REQUEST["event3"], $_REQUEST["money"], $_REQUEST["currency"], $goto, $_REQUEST["chargeback"], $site_id);
} else {
    $goto = preg_replace("/#EVENT_GID#/i", "", $_REQUEST["goto"]);
}
if (intval($id) > 0 && CModule::IncludeModule("advertising")) {
    CAdvBanner::Click($id);
}
LocalRedirect($goto);
Пример #11
0
}
if (!CModule::IncludeModule('advertising')) {
    return;
}
$dbResult = CAdvContract::GetByID(1);
if (!$dbResult->Fetch()) {
    return;
}
//Types
$arTypes = array(array("SID" => "100x100_ONE", "ACTIVE" => "Y", "SORT" => 1, "NAME" => GetMessage("PORTAL_ADV_100_100_ONE"), "DESCRIPTION" => ""), array("SID" => "100x100_TWO", "ACTIVE" => "Y", "SORT" => 2, "NAME" => GetMessage("PORTAL_ADV_100_100_TWO"), "DESCRIPTION" => ""), array("SID" => "468x60_TOP", "ACTIVE" => "Y", "SORT" => 3, "NAME" => GetMessage("PORTAL_ADV_468_60_TOP"), "DESCRIPTION" => ""), array("SID" => "468x60_BOTTOM", "ACTIVE" => "Y", "SORT" => 4, "NAME" => GetMessage("PORTAL_ADV_468_60_BOTTOM"), "DESCRIPTION" => ""), array("SID" => "INFO", "ACTIVE" => "Y", "NAME" => GetMessage("PORTAL_ADV_INFO"), "SORT" => "5", "DESCRIPTION" => ""));
foreach ($arTypes as $arFields) {
    $dbResult = CAdvType::GetByID($arTypes["SID"], $CHECK_RIGHTS = "N");
    if ($dbResult && $dbResult->Fetch()) {
        continue;
    }
    CAdvType::Set($arFields, "", $CHECK_RIGHTS = "N");
}
//Matrix
$arWeekday = array("SUNDAY" => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23), "MONDAY" => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23), "TUESDAY" => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23), "WEDNESDAY" => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23), "THURSDAY" => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23), "FRIDAY" => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23), "SATURDAY" => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23));
$pathToBanner = WIZARD_SERVICE_ABSOLUTE_PATH . "/banners/" . LANGUAGE_ID;
$arBanners = array(array("CONTRACT_ID" => 1, "TYPE_SID" => "468x60_BOTTOM", "STATUS_SID" => "PUBLISHED", "NAME" => GetMessage("PORTAL_ADV_468_60_BOTTOM_NAME"), "ACTIVE" => "Y", "arrSITE" => array(WIZARD_SITE_ID), "WEIGHT" => 100, "FIX_SHOW" => "N", "FIX_CLICK" => "N", "AD_TYPE" => "image", "arrIMAGE_ID" => array("name" => "banner_468x60.gif", "type" => "image/gif", "tmp_name" => $pathToBanner . "/banner_468x60.gif", "error" => "0", "size" => @filesize($pathToBanner . "/banner_468x60.gif"), "MODULE_ID" => "advertising"), "IMAGE_ALT" => GetMessage("PORTAL_ADV_468_60_BOTTOM_NAME"), "URL" => "/company/novice.php", "URL_TARGET" => "_blank", "STAT_EVENT_1" => "banner", "STAT_EVENT_2" => "click", "arrWEEKDAY" => $arWeekday, "COMMENTS" => "banner_468x60.gif"), array("CONTRACT_ID" => 1, "TYPE_SID" => "100x100_ONE", "STATUS_SID" => "PUBLISHED", "NAME" => GetMessage("PORTAL_ADV_100_100_ONE_NAME"), "ACTIVE" => "Y", "FIX_SHOW" => "N", "FIX_CLICK" => "N", "arrSITE" => array(WIZARD_SITE_ID), "WEIGHT" => 100, "AD_TYPE" => "image", "arrIMAGE_ID" => array("name" => "banner_100x100.gif", "type" => "image/gif", "tmp_name" => $pathToBanner . "/banner_100x100.gif", "error" => "0", "size" => @filesize($pathToBanner . "/banner_100x100.gif"), "MODULE_ID" => "advertising"), "IMAGE_ALT" => GetMessage("PORTAL_ADV_100_100_ONE_NAME"), "URL" => "/company/novice.php", "URL_TARGET" => "_blank", "STAT_EVENT_1" => "banner", "STAT_EVENT_2" => "click", "arrWEEKDAY" => $arWeekday, "COMMENTS" => "banner_100x100.gif"), array("CONTRACT_ID" => 1, "TYPE_SID" => "INFO", "STATUS_SID" => "PUBLISHED", "NAME" => GetMessage("PORTAL_ADV_100_100_ONE_NAME"), "ACTIVE" => "Y", "FIX_SHOW" => "Y", "FIX_CLICK" => "N", "arrSITE" => array(WIZARD_SITE_ID), "WEIGHT" => 100, "AD_TYPE" => "image", "arrIMAGE_ID" => array("name" => "new.jpg", "type" => "image/jpeg", "tmp_name" => $_SERVER["DOCUMENT_ROOT"] . "/images/" . LANGUAGE_ID . "/company/about/new.jpg", "error" => "0", "size" => @filesize($_SERVER["DOCUMENT_ROOT"] . "/images/" . LANGUAGE_ID . "/company/about/new.jpg"), "MODULE_ID" => "advertising"), "IMAGE_ALT" => GetMessage("PORTAL_ADV_100_100_ONE_NAME"), "URL" => "/company/novice.php", "URL_TARGET" => "_blank", "STAT_EVENT_1" => "banner", "STAT_EVENT_2" => "click", "arrWEEKDAY" => $arWeekday, "COMMENTS" => "new.jpg", "SHOWS_FOR_VISITOR" => 10), array("CONTRACT_ID" => 1, "TYPE_SID" => "INFO", "STATUS_SID" => "PUBLISHED", "NAME" => GetMessage("PORTAL_ADV_dashboard"), "ACTIVE" => "Y", "arrSITE" => array(WIZARD_SITE_ID), "WEIGHT" => 100, "FIX_SHOW" => "N", "FIX_CLICK" => "N", "AD_TYPE" => "image", "arrIMAGE_ID" => array("name" => "dashboard.gif", "type" => "image/gif", "tmp_name" => $pathToBanner . "/dashboard.gif", "error" => "0", "size" => @filesize($pathToBanner . "/dashboard.gif"), "MODULE_ID" => "advertising"), "IMAGE_ALT" => GetMessage("PORTAL_ADV_dashboard"), "URL" => "/desktop.php", "URL_TARGET" => "_blank", "STAT_EVENT_1" => "banner", "STAT_EVENT_2" => "click", "arrWEEKDAY" => $arWeekday, "COMMENTS" => "dashboard.gif"), array("CONTRACT_ID" => 1, "TYPE_SID" => "468x60_BOTTOM", "STATUS_SID" => "PUBLISHED", "NAME" => GetMessage("PORTAL_ADV_01_absence"), "ACTIVE" => "Y", "arrSITE" => array(WIZARD_SITE_ID), "WEIGHT" => 100, "FIX_SHOW" => "N", "FIX_CLICK" => "N", "AD_TYPE" => "image", "arrIMAGE_ID" => array("name" => "01_absence_02.jpg", "type" => "image/jpeg", "tmp_name" => $pathToBanner . "/01_absence_02.jpg", "error" => "0", "size" => @filesize($pathToBanner . "/01_absence_02.jpg"), "MODULE_ID" => "advertising"), "IMAGE_ALT" => GetMessage("PORTAL_ADV_01_absence"), "URL" => GetMessage("PORTAL_ADV_01_absence_url"), "URL_TARGET" => "_blank", "STAT_EVENT_1" => "banner", "STAT_EVENT_2" => "click", "arrWEEKDAY" => $arWeekday, "COMMENTS" => "01_absence_02.jpg"), array("CONTRACT_ID" => 1, "TYPE_SID" => "100x100_ONE", "STATUS_SID" => "PUBLISHED", "NAME" => GetMessage("PORTAL_ADV_01_absence"), "ACTIVE" => "Y", "arrSITE" => array(WIZARD_SITE_ID), "WEIGHT" => 100, "FIX_SHOW" => "N", "FIX_CLICK" => "N", "AD_TYPE" => "image", "arrIMAGE_ID" => array("name" => "01_absence_01.jpg", "type" => "image/jpeg", "tmp_name" => $pathToBanner . "/01_absence_01.jpg", "error" => "0", "size" => @filesize($pathToBanner . "/01_absence_01.jpg"), "MODULE_ID" => "advertising"), "IMAGE_ALT" => GetMessage("PORTAL_ADV_01_absence"), "URL" => GetMessage("PORTAL_ADV_01_absence_url"), "URL_TARGET" => "_blank", "STAT_EVENT_1" => "banner", "STAT_EVENT_2" => "click", "arrWEEKDAY" => $arWeekday, "COMMENTS" => "01_absence_01.jpg"), array("CONTRACT_ID" => 1, "TYPE_SID" => "468x60_BOTTOM", "STATUS_SID" => "PUBLISHED", "NAME" => GetMessage("PORTAL_ADV_03_outlook"), "ACTIVE" => "Y", "arrSITE" => array(WIZARD_SITE_ID), "WEIGHT" => 100, "FIX_SHOW" => "N", "FIX_CLICK" => "N", "AD_TYPE" => "image", "arrIMAGE_ID" => array("name" => "02_outlook_02.jpg", "type" => "image/jpeg", "tmp_name" => $pathToBanner . "/02_outlook_02.jpg", "error" => "0", "size" => @filesize($pathToBanner . "/02_outlook_02.jpg"), "MODULE_ID" => "advertising"), "IMAGE_ALT" => GetMessage("PORTAL_ADV_03_outlook"), "URL" => GetMessage("PORTAL_ADV_03_outlook_url"), "URL_TARGET" => "_blank", "STAT_EVENT_1" => "banner", "STAT_EVENT_2" => "click", "arrWEEKDAY" => $arWeekday, "COMMENTS" => "02_outlook_02.jpg"), array("CONTRACT_ID" => 1, "TYPE_SID" => "100x100_ONE", "STATUS_SID" => "PUBLISHED", "NAME" => GetMessage("PORTAL_ADV_03_outlook"), "ACTIVE" => "Y", "arrSITE" => array(WIZARD_SITE_ID), "WEIGHT" => 100, "FIX_SHOW" => "N", "FIX_CLICK" => "N", "AD_TYPE" => "image", "arrIMAGE_ID" => array("name" => "02_outlook_02.jpg", "type" => "image/jpeg", "tmp_name" => $pathToBanner . "/02_outlook_02.jpg", "error" => "0", "size" => @filesize($pathToBanner . "/02_outlook_02.jpg"), "MODULE_ID" => "advertising"), "IMAGE_ALT" => GetMessage("PORTAL_ADV_03_outlook"), "URL" => GetMessage("PORTAL_ADV_03_outlook_url"), "URL_TARGET" => "_blank", "STAT_EVENT_1" => "banner", "STAT_EVENT_2" => "click", "arrWEEKDAY" => $arWeekday, "COMMENTS" => "02_outlook_02.jpg"), array("CONTRACT_ID" => 1, "TYPE_SID" => "468x60_BOTTOM", "STATUS_SID" => "PUBLISHED", "NAME" => GetMessage("PORTAL_ADV_05_xmpp"), "ACTIVE" => "Y", "arrSITE" => array(WIZARD_SITE_ID), "WEIGHT" => 100, "FIX_SHOW" => "Y", "FIX_CLICK" => "N", "AD_TYPE" => "image", "arrIMAGE_ID" => array("name" => "03_xmpp_02.jpg", "type" => "image/jpeg", "tmp_name" => $pathToBanner . "/03_xmpp_02.jpg", "error" => "0", "size" => @filesize($pathToBanner . "/03_xmpp_02.jpg"), "MODULE_ID" => "advertising"), "IMAGE_ALT" => GetMessage("PORTAL_ADV_05_xmpp"), "URL" => GetMessage("PORTAL_ADV_05_xmpp_url"), "URL_TARGET" => "_blank", "STAT_EVENT_1" => "banner", "STAT_EVENT_2" => "click", "arrWEEKDAY" => $arWeekday, "COMMENTS" => "03_xmpp_02.jpg"), array("CONTRACT_ID" => 1, "TYPE_SID" => "100x100_ONE", "STATUS_SID" => "PUBLISHED", "NAME" => GetMessage("PORTAL_ADV_05_xmpp"), "ACTIVE" => "Y", "arrSITE" => array(WIZARD_SITE_ID), "WEIGHT" => 100, "FIX_SHOW" => "N", "FIX_CLICK" => "N", "AD_TYPE" => "image", "arrIMAGE_ID" => array("name" => "03_xmpp_01.jpg", "type" => "image/jpeg", "tmp_name" => $pathToBanner . "/03_xmpp_01.jpg", "error" => "0", "size" => @filesize($pathToBanner . "/03_xmpp_01.jpg"), "MODULE_ID" => "advertising"), "IMAGE_ALT" => GetMessage("PORTAL_ADV_05_xmpp"), "URL" => GetMessage("PORTAL_ADV_05_xmpp_url"), "URL_TARGET" => "_blank", "STAT_EVENT_1" => "banner", "STAT_EVENT_2" => "click", "arrWEEKDAY" => $arWeekday, "COMMENTS" => "03_xmpp_01.jpg"), array("CONTRACT_ID" => 1, "TYPE_SID" => "468x60_BOTTOM", "STATUS_SID" => "PUBLISHED", "NAME" => GetMessage("PORTAL_ADV_05_xmpp"), "ACTIVE" => "Y", "arrSITE" => array(WIZARD_SITE_ID), "WEIGHT" => 100, "FIX_SHOW" => "N", "FIX_CLICK" => "N", "AD_TYPE" => "image", "arrIMAGE_ID" => array("name" => "03_xmpp_02_01.jpg", "type" => "image/jpeg", "tmp_name" => $pathToBanner . "/03_xmpp_02_01.jpg", "error" => "0", "size" => @filesize($pathToBanner . "/03_xmpp_02_01.jpg"), "MODULE_ID" => "advertising"), "IMAGE_ALT" => GetMessage("PORTAL_ADV_05_xmpp"), "URL" => GetMessage("PORTAL_ADV_05_xmpp_url"), "URL_TARGET" => "_blank", "STAT_EVENT_1" => "banner", "STAT_EVENT_2" => "click", "arrWEEKDAY" => $arWeekday, "COMMENTS" => "03_xmpp_02_01.jpg"), array("CONTRACT_ID" => 1, "TYPE_SID" => "100x100_ONE", "STATUS_SID" => "PUBLISHED", "NAME" => GetMessage("PORTAL_ADV_05_xmpp"), "ACTIVE" => "Y", "arrSITE" => array(WIZARD_SITE_ID), "WEIGHT" => 100, "FIX_SHOW" => "N", "FIX_CLICK" => "N", "AD_TYPE" => "image", "arrIMAGE_ID" => array("name" => "03_xmpp_02_02.jpg", "type" => "image/jpeg", "tmp_name" => $pathToBanner . "/03_xmpp_02_02.jpg", "error" => "0", "size" => @filesize($pathToBanner . "/03_xmpp_02_02.jpg"), "MODULE_ID" => "advertising"), "IMAGE_ALT" => GetMessage("PORTAL_ADV_05_xmpp"), "URL" => GetMessage("PORTAL_ADV_05_xmpp_url"), "URL_TARGET" => "_blank", "STAT_EVENT_1" => "banner", "STAT_EVENT_2" => "click", "arrWEEKDAY" => $arWeekday, "COMMENTS" => "03_xmpp_02_02.jpg"));
foreach ($arBanners as $arFields) {
    $dbResult = CAdvBanner::GetList($by, $order, array("COMMENTS" => $arFields["COMMENTS"], "COMMENTS_EXACT_MATCH" => "Y"), $is_filtered, "N");
    if ($dbResult && $dbResult->Fetch()) {
        continue;
    }
    CAdvBanner::Set($arFields, "", $CHECK_RIGHTS = "N");
}
if (!WIZARD_IS_RERUN) {
    $APPLICATION->SetGroupRight("advertising", WIZARD_PORTAL_ADMINISTRATION_GROUP, "W");
}
Пример #12
0
// создаем изображение
$ImageHandle = CreateImageHandle($width, $height);
$arrX = array();
// массив точек графика по X
$arrY = array();
// массив точек графика по Y
$arrayX = array();
// массив точек на оси X (делени¤)
$arrayY = array();
// массив точек на оси Y (делени¤)
/******************************************************
				—обираем точки графика
*******************************************************/
$arFilter = array("DATE_1" => $find_date1, "DATE_2" => $find_date2, "CONTRACT_ID" => $find_contract_id, "CONTRACT_SUMMA" => $find_contract_summa, "GROUP_SID" => $find_group_sid, "GROUP_SUMMA" => $find_group_summa, "BANNER_ID" => $find_banner_id, "BANNER_SUMMA" => $find_banner_summa, "WHAT_SHOW" => $find_what_show);
$arShow = $find_what_show;
$arrDays = CAdvBanner::GetDynamicList($arFilter, $arrLegend, $is_filtered);
reset($arrDays);
while (list($keyD, $arD) = each($arrDays)) {
    $date = mktime(0, 0, 0, $arD["M"], $arD["D"], $arD["Y"]);
    $date_tmp = 0;
    // если даты пропущены (идут не по пор¤дку) то
    $next_date = AddTime($prev_date, 1, "D");
    if ($date > $next_date && intval($prev_date) > 0) {
        // заполн¤ем пропущенные даты
        $date_tmp = $next_date;
        while ($date_tmp < $date) {
            $arrX[] = $date_tmp;
            reset($arrLegend);
            while (list($keyL, $arrS) = each($arrLegend)) {
                if (in_array("ctr", $arShow)) {
                    $arrY_ctr[$keyL][] = 0;
Пример #13
0
 $bComponentCache = COption::GetOptionString("main", "component_cache_on", "Y") == "Y";
 $bHTMLCache = CHTMLPagesCache::IsOn();
 $bExtraModule = false;
 $arModulesInstalled = array();
 $arModules = array("main", "iblock", "search", "fileman", "compression", "perfmon", "seo");
 $rsModules = CModule::GetDropDownList();
 while ($arModule = $rsModules->Fetch()) {
     if (!in_array($arModule["REFERENCE_ID"], $arModules)) {
         $bExtraModule = true;
     }
     $arModulesInstalled[] = $arModule["REFERENCE_ID"];
 }
 $statistic_path = IsModuleInstalled('statistic') && COption::GetOptionString("statistic", "SAVE_PATH_DATA") == "Y";
 $search_is_ok = IsModuleInstalled('search') && COption::GetOptionString("search", "use_stemming") == "Y" && COption::GetOptionString("search", "use_tf_cache") == "Y";
 if (CModule::IncludeModule('advertising') && COption::GetOptionString('advertising', 'DONT_FIX_BANNER_SHOWS') !== "Y") {
     $rsBanners = CAdvBanner::GetList($by, $order, array("FIX_SHOW" => "Y"), $is_filtered, "N");
     if ($rsBanners->Fetch()) {
         $adv_banners_fix_shows = true;
     } else {
         $adv_banners_fix_shows = false;
     }
 } else {
     $adv_banners_fix_shows = false;
 }
 $arConstants = array("CACHED_b_forum_filter", "CACHED_b_forum2site", "CACHED_b_forum_perms", "CACHED_b_forum_smile", "CACHED_b_forum_user", "CACHED_b_forum_group", "CACHED_b_forum", "CACHED_b_iblock_property_enum", "CACHED_b_iblock_type", "CACHED_b_iblock", "CACHED_b_lang", "CACHED_b_option", "CACHED_b_lang_domain", "CACHED_b_site_template", "CACHED_b_event", "CACHED_b_agent", "CACHED_b_user_field", "CACHED_b_task", "CACHED_b_task_operation", "CACHED_b_search_tags", "CACHED_b_search_tags_len", "CACHED_b_sec_iprule", "CACHED_b_sec_filter_mask", "CACHED_b_sec_redirect_url", "CACHED_b_sonet_group_subjects", "CACHED_b_vote_question");
 foreach ($arConstants as $i => $constant) {
     if (!defined($constant)) {
         unset($arConstants[$i]);
     } elseif (constant($constant) !== false) {
         unset($arConstants[$i]);
     }
Пример #14
0
if (count($find_banner_id) < 2) {
    $find_banner_summa = 'Y';
}
$arrDays = CAdvBanner::GetDynamicList($arFilter, $arrLegend, $is_filtered);
$arShow = $find_what_show;
$filter_selected = 0;
if (is_array($find_banner_id) && count($find_banner_id) > 0) {
    $filter_selected++;
}
if (is_array($find_group_sid) && count($find_group_sid) > 0) {
    $filter_selected++;
}
if ($filter_selected > 0) {
    $is_filtered = true;
}
$arrStat = CAdvBanner::GetStatList($by, $order, $arFilter);
$rsData = new CAdminResult($arrStat, $sTableID);
//var_dump($arrStat);
$rsData->NavStart();
$lAdmin->NavText($rsData->GetNavPrint(GetMessage('ADV_DATE_TABLE_TITLE')));
$arHeaders = array();
$arHeaders[] = array("id" => "DATE", "content" => GetMessage('ADV_DATE'), "sort" => "s_date", "align" => "right", "default" => true);
if ($find_banner_summa == "N") {
    $arHeaders[] = array("id" => "BANNER_ID", "content" => GetMessage('ADV_BANNER_ID'), "sort" => "s_id", "align" => "right", "default" => false);
    $arHeaders[] = array("id" => "BANNER_NAME", "content" => GetMessage('ADV_BANNER'), "sort" => false, "align" => "left", "default" => true);
}
$arHeaders[] = array("id" => "VISITORS", "content" => GetMessage('AD_VISITOR'), "sort" => "s_visitors", "align" => "right", "default" => true);
$arHeaders[] = array("id" => "CLICKS", "content" => GetMessage('AD_CLICK_GRAPH'), "sort" => "s_clicks", "align" => "right", "default" => true);
$arHeaders[] = array("id" => "CTR", "content" => GetMessage('AD_CTR'), "sort" => "s_ctr", "align" => "right", "default" => true);
$arHeaders[] = array("id" => "SHOWS", "content" => GetMessage('AD_SHOW'), "sort" => "s_show", "align" => "right", "default" => true);
$lAdmin->AddHeaders($arHeaders);