GetList
record set CAdvBanner::GetList( varchar &by, varchar &order, array arFilter = array(), boolean &is_filtered );
The method returns a list of banners. Non-static method.
Method parameters
Parameters | Description |
---|---|
by | Identifier specifying the name of the field that is to be used for
sorting. This can be one of the following fields:
|
order | Sort order. The following values are possible:
|
arFilter | Optional additional filter by fields in the form of Array("Filtering
field"=>"Value", ...). The Filtering field can be
one of the following:
|
is_filtered | Reference to a variable that contains true on the method return if a list of banners has been filtered, or false otherwise. |
CHECK_RIGHTS | The parameter checks level of access permissions to the advertising module (ad admin, advertiser and etc). If parameter is "N", then the current user has administrative access permissions to advertising module. If the parameter is skipped or specified as "Y", the function checks level of access permissions to the module. Optional parameter. |
Example
<? $FilterArr = Array( "find_id", "find_id_exact_match", "find_lamp", "find_lang", "find_show_count_1", "find_show_count_2", "find_click_count_1", "find_click_count_2", "find_ctr_1", "find_ctr_2", "find_contract_id", "find_contract", "find_contract_exact_match", "find_group", "find_group_exact_match", "find_status_sid", "find_type_sid", "find_type", "find_type_exact_match", "find_name", "find_name_exact_match", "find_code", "find_code_exact_match", "find_comments", "find_comments_exact_match" ); if (strlen($set_filter)>0) InitFilterEx($FilterArr,"ADV_BANNER_LIST","set"); else InitFilterEx($FilterArr,"ADV_BANNER_LIST","get"); if (strlen($del_filter)>0) DelFilterEx($FilterArr,"ADV_BANNER_LIST"); InitBVar($find_id_exact_match); InitBVar($find_status_exact_match); InitBVar($find_group_exact_match); InitBVar($find_contract_exact_match); InitBVar($find_type_exact_match); InitBVar($find_name_exact_match); InitBVar($find_code_exact_match); InitBVar($find_comments_exact_match); $arFilter = Array( "ID" => $find_id, "ID_EXACT_MATCH" => $find_id_exact_match, "LAMP" => $find_lamp, "LANG" => $find_lang, "SHOW_COUNT_1" => $find_show_count_1, "SHOW_COUNT_2" => $find_show_count_2, "CLICK_COUNT_1" => $find_click_count_1, "CLICK_COUNT_2" => $find_click_count_2, "CTR_1" => $find_ctr_1, "CTR_2" => $find_ctr_2, "GROUP" => $find_group, "GROUP_EXACT_MATCH" => $find_group_exact_match, "STATUS_SID" => $find_status_sid, "CONTRACT_ID" => $find_contract_id, "CONTRACT" => $find_contract, "CONTRACT_EXACT_MATCH" => $find_contract_exact_match, "TYPE_SID" => $find_type_sid, "TYPE" => $find_type, "TYPE_EXACT_MATCH" => $find_type_exact_match, "NAME" => $find_name, "NAME_EXACT_MATCH" => $find_name_exact_match, "CODE" => $find_code, "CODE_EXACT_MATCH" => $find_code_exact_match, "COMMENTS" => $find_comments, "COMMENTS_EXACT_MATCH" => $find_comments_exact_match ); $rsBanners = CAdvBanner::GetList($by, $order, $arFilter, $is_filtered); $rsBanners->NavStart(20); $rsBanners->NavPrint("Banners"); while($arBanner = $rsBanners->NavNext(true, "f_")) { echo "<pre>"; print_r($arBanner); echo "</pre>"; } ?>
The following is an example of array returned by a call to the Fetch method of one of the returned objects:
<?
Array
(
[LAMP] => green
[ID] => 88
[CONTRACT_ID] => 1
[TYPE_SID] => TOP
[GROUP_SID] =>
[STATUS_SID] => PUBLISHED
[STATUS_COMMENTS] =>
[NAME] =>
[ACTIVE] => Y
[LID] =>
[WEIGHT] => 100
[MAX_SHOW_COUNT] => 300
[MAX_CLICK_COUNT] => 100
[SHOW_COUNT] => 102
[CLICK_COUNT] => 4
[IMAGE_ID] => 1032
[IMAGE_ALT] =>
[URL] => http://www.bitrixsoft.com?banner_param=#EVENT_GID#
[URL_TARGET] => _parent
[STAT_EVENT_1] =>
[STAT_EVENT_2] =>
[STAT_EVENT_3] =>
[FOR_NEW_GUEST] =>
[COMMENTS] =>
[CREATED_BY] => 2
[MODIFIED_BY] => 2
[CTR] => 3.92
[DATE_LAST_SHOW] => 24.06.2004 17:39:50
[DATE_LAST_CLICK] => 24.06.2004 14:47:53
[DATE_SHOW_FROM] => 10.06.2004
[DATE_SHOW_TO] => 07.07.2007
[DATE_CREATE] => 10.06.2004 11:25:59
[DATE_MODIFY] => 24.06.2004 14:33:56
[CONTRACT_NAME] => Default
[TYPE_NAME] => Top banner
[CODE_TYPE] => html
[CODE] => <TABLE class=smalltext cellSpacing=0 cellPadding=0 width=145>
<TR>
<TD></TD>
<TD>
<DIV align=center>
<A class=righthead
href="/en/partners/partnership.php">partnership Program</A>
</DIV></TD></TR>
<TR>
<TD></TD>
<TD height=8></TD></TR>
<TR>
<TD width=5></TD>
<TD vAlign=bottom>
<DIV align=center>
<A href="/en/partners/partnership.php">
<IMG height=95 src="/images/advert/free.gif"
width=100 border=0></A></DIV></TD></TR>
<TR>
<TD></TD>
<TD height=5></TD></TR>
<TR>
<TD></TD>
<TD>Developers and integrators obtain:<BR>
<B><FONT class=smalltext>
<IMG height=8 src="/images/list_bullet.gif" width=8>
</FONT></B>
<FONT color=#ff5a31>50% discounts</FONT>
<BR><B><FONT class=smalltext>
<IMG height=8 src="/images/list_bullet.gif" width=8>
</FONT></B>
<FONT color=#ff5a31>free license</FONT></TD></TR>
<TR>
<TD></TD>
<TD height=5></TD></TR>
<TR>
<TD></TD>
<TD>
<DIV align=right>
<A class=bottomlinks
href="/en/partners/partnership.php">more info</A>
<IMG height=7 src="/images/main_button_more_3.gif" width=7>
</DIV></TD></TR></TABLE>
[CODE_TYPE] => html
[STAT_EVENT_1] =>
[STAT_EVENT_2] =>
[STAT_EVENT_3] =>
[FOR_NEW_GUEST] =>
[COMMENTS] =>
[CREATED_BY] => 2
[MODIFIED_BY] => 2
[CTR] => 3.92
[DATE_LAST_SHOW] => 24.06.2004 17:39:50
[DATE_LAST_CLICK] => 24.06.2004 14:47:53
[DATE_SHOW_FROM] => 10.06.2004
[DATE_SHOW_TO] => 07.07.2007
[DATE_CREATE] => 10.06.2004 11:25:59
[DATE_MODIFY] => 24.06.2004 14:33:56
[CONTRACT_NAME] => Default
[TYPE_NAME] => Top banner
)
?>
© «Bitrix24», 2001-2024