Bitrix Site Manager

CStopList::GetList

CDBResult
CStopList::GetList(
 string &by = "s_id",
 string &order = "desc",
 array filter = array(),
 bool &is_filtered
)

The method GetList returns a list of the stop list records.

Parameters

Parameter Description
by Sorting field; possible values:
  • s_id - the record ID;
  • s_date_start - date and time of record activation;
  • s_date_end - date and time of record deactivation;
  • s_site_id - the ID of the site for which the record is effective;
  • s_active - active state flag of the record;
  • s_save_statistic - flag: whether to keep statistics of the visitor added to the stop list [Y/N];
  • s_ip - the visitor IP address;
  • s_mask - the visitor IP address mask;
  • s_url_to - the target page URL;
  • s_url_from - the referring page URL.
order Sort order; the following values are possible:
  • asc - ascending;
  • desc - descending.
filter Array used to filter the resulting list. The following keys can be used in the array:
  • ID* - the session ID;
  • ID_EXACT_MATCH - if "N", entry in the ID is sufficient (loose match);
  • DATE_START_1 - the earliest date when the required records became active;
  • DATE_START_2 - the latest date when the required records became active;
  • DATE_END_1 - the earliest date when the required records became inactive;
  • DATE_END_2 - the latest date when the required records became inactive;
  • ACTIVE - active state flag of the record; possible values:
    • Y - record is active;
    • N - record is inactive.
  • SAVE_STATISTIC - flag: whether to keep statistics of the visitor added to the stop list [Y/N];
  • IP_1* - the octet 1 of the IP address;
  • IP_1_EXACT_MATCH - if "N", entry in the IP_1 is sufficient (loose match);
  • IP_2* - the octet 2 of the IP address;
  • IP_2_EXACT_MATCH - if "N", entry in the IP_2 is sufficient (loose match);
  • IP_3* - the octet 3 of the IP address;
  • IP_3_EXACT_MATCH - if "N", entry in the IP_3 is sufficient (loose match);
  • IP_4* - the octet 4 of the IP address;
  • IP_4_EXACT_MATCH - if "N", entry in the IP_4 is sufficient (loose match);
  • URL_FROM* - the referring page URL;
  • URL_FROM_EXACT_MATCH - if "Y", the URL_FROM must match exactly (strict match);
  • USER_AGENT* - the visitor UserAgent;
  • USER_AGENT_EXACT_MATCH - if "Y", the USER_AGENT must match exactly (strict match);
  • MESSAGE* - text of the message which will be displayed to the site visitor if they match this stop list record;
  • MESSAGE_EXACT_MATCH - if "Y", the MESSAGE must match exactly (strict match);
  • COMMENTS* - administrator's comment; commonly used to explain reasons for creating the record;
  • COMMENTS_EXACT_MATCH - if "Y", the COMMENTS must match exactly (strict match);
  • URL_TO* - the target page url(or its part);
  • URL_TO_EXACT_MATCH - if "Y", the URL_TO must match exactly (strict match);
  • URL_REDIRECT* - the page to which the visitor is to be redirected after it have been found in the stop list;
  • URL_REDIRECT_EXACT_MATCH - if "Y", the URL_REDIRECT must match exactly (strict match);
  • SITE_ID* - the ID of the site for which the record is effective; if not specified, the record is effective for all sites;
  • SITE_ID_EXACT_MATCH - if "N", entry in the SITE_ID is sufficient (loose match).
* - complex logic allowed.
is_filtered If this flag contains "true" on return, the resulting list is filtered.

Structure of the returned record

Array
(
    [DATE_START] => date and time of record activation
    [DATE_END] => date and time of record deactivation
    [ACTIVE] => "Y" - record is active; "N" - record is inactive
    [SAVE_STATISTIC] => "Y" - keep statistics of the visitor
                        added to the stop list;
                        "N" - don't keep
    [IP_1] => the octet 1 of the IP address
    [IP_2] => the octet 2 of the IP address
    [IP_3] => the octet 3 of the IP address
    [IP_4] => the octet 4 of the IP address
    [MASK_1] => the octet 1 mask of the IP address
    [MASK_2] => the octet 2 mask of the IP address
    [MASK_3] => the octet 3 mask of the IP address
    [MASK_4] => the octet 4 mask of the IP address
    [USER_AGENT] => the visitor UserAgent
    [USER_AGENT_IS_NULL] => "Y" - the visitor UserAgent is not specified (empty);
                            "N" - specified (default)
    [URL_TO] => the target page url(or its part)
    [URL_FROM] => the referring page url(or its part)
    [MESSAGE] => text of the message which will
                 be displayed to the site visitor
                 if they match this stop list record
    [MESSAGE_LID] => language of the message in the field [MESSAGE]
    [URL_REDIRECT] => the page to which the visitor is to be
                      redirected after it have been found in the stop list
    [COMMENTS] => administrator's comment;
                  commonly used to explain reasons for creating the record
    [TEST] => "Y" - this is a test record;
              "N" - this is not a test record
              (see also: CStopList::Check)
    [SITE_ID] => the ID of the site for which the record is effective;
                 if not specified, the record is effective for all sites
    [LAMP] => "green" - the record is active and effective;
              "red" - the record is inactive (expired or became inactive)
)

See Also

Example



<?
// select stop list records with IP addresses 192.168.0.xxx
$arFilter = array(
    "IP_1" => 192,
    "IP_2" => 168,
    "IP_3" => 0
    );

// obtain the list of records
$rs = CStopList::GetList(
    ($by = "s_id"), 
    ($order = "desc"), 
    $arFilter, 
    $is_filtered
    );

// print all records
while ($ar = $rs->Fetch())
{
    echo "<pre>"; print_r($ar); echo "</pre>";    
}
?>