Show
text CAdvBanner::Show( varchar(255) TYPE_SID,
text HTML_BEFORE=false,
text HTML_AFTER=false,
);
The Show method selects a random banner of the specified type and returns a ready to use HTML code of the banner (used in the site template code). The banner is selected according to its priority relative to priorities of other banners. Non-static method.
Parameters
Parameters | Description | Available from version |
---|---|---|
TYPE_SID | Symbolic type identifier. | |
HTML_BEFORE | Optional parameter. | 4.0.0 |
HTML_AFTER | Optional parameter. | 4.0.0 |
Example
<!-- Sample code that can be used in the HTML code of a site template to display banners of the type TOP --> <? if (CModule::IncludeModule("advertising")) : $s = CAdvBanner::Show("TOP"); if (strlen($s)>0) : // display banner HTML ?> <table width="0%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align=center><?=$s?></td> </tr> </table> <? endif; endif; ?>
© «Bitrix24», 2001-2024