Bitrix Site Manager

CAdvBanner::Show

text
CAdvBanner::Show(
 varchar(255) TYPE_SID
);

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.

Parameters

ParameterDescription
TYPE_SID Symbolic type identifier.

Return Value

HTML code of the banner which can be used without additional preparations.

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;
?>