Bitrix Site Manager

CSubcription::GetRubricArray

CSubcription::GetRubricArray(
    $ID
);

The method GetRubricArray returns an array of the ID's of subscriptions to which this e-mail address is subscribed.

Parameters

ParameterDescription
$ID The subscription ID.

Return Values

Array of integer subscription ID's.

Example



<?
//shows all subscription categories and checks subscribed one
$aSubscrRub = CSubscription::GetRubricArray($ID);
$rub = CRubric::GetList(
    array("LID"=>"ASC", "SORT"=>"ASC", "NAME"=>"ASC"), 
    array("ACTIVE"=>"Y", "LID"=>LANG)
);
while($rub->ExtractFields("r_")):
    $bChecked = in_array($r_ID, $aSubscrRub);
?>
<input 
 type="checkbox" 
 name="RUB_ID[]" 
 value="<?echo $r_ID?>"<?if($bChecked) echo " checked"?>>
<?echo $r_NAME?><br>
<?
endwhile;
?>