Skip to content

Instantly share code, notes, and snippets.

@jmdeldin
Created June 17, 2009 02:58
Show Gist options
  • Save jmdeldin/131052 to your computer and use it in GitHub Desktop.
Save jmdeldin/131052 to your computer and use it in GitHub Desktop.
<txp:php>
// <?
// build a list of file categories
$rs = safe_query('select distinct category
from ' . safe_pfx('txp_file') . '
order by category asc', 1);
if ($rs)
{
while ($row = mysql_fetch_array($rs, MYSQL_NUM))
{
$cat = $row[0];
echo "<h2>$cat</h2>",
file_download_list(array('category' => $cat,
'break' => '',
'limit' => 999));
}
}
</txp:php>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment