I want to sort the following output by the column “cat_order”. I’m a PHP/SQL newb, i’m sure this will take one of you five seconds. Thanks.
function Vz_subcategories($str = '')
{
global $TMPL, $DB;
$group_id = $TMPL->fetch_param('id');
$results = $DB->query("SELECT cat_id FROM exp_categories WHERE group_id = '".$group_id."'");
if ($results->num_rows > 0)
{
foreach ($results->result as $row)
{
$cats[] = $row['cat_id'];
}
}
$this->return_data = implode('|', $cats);
}Btw, This is my mod of this plugin to make it accept a category group instead of parent category.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.