<?php
$section = ff_getParam('ff_param_section', 0);
$rows = ff_select(
            "select id, title from #__sections ".
            "where published = 1 order by title"
        );
$flag = 0;
$list = '';
if (!is_null($rows))
    foreach ($rows as $row)
        if ($row->id==$section) {
            $flag = 1;
            $list .= "1;$row->title;$row->id\r\n";
        } else
            $list .= "0;$row->title;$row->id\r\n";

if ($flag) return $list; 
return "1;Select Section;''\r\n".$list;
?>