<?php
$section  = ff_getParam('ff_param_section', 0);
$category = ff_getParam('ff_param_category', 0);
$rows = ff_select(
    "select id, title from #__categories ".
    "where section='$section' and published=1"
);
$list = '';
$sel = 1;
if (!is_null($rows)) {
    foreach ($rows as $row) {
        if ($row->id==$category) {
            $list .= "1;$row->title;$row->id\r\n";
            $sel = 0;
        } else
            $list .= "0;$row->title;$row->id\r\n";
    } // foreach
} // if
return $sel.";Select Category;''\r\n".$list;
?>