show_errors(); $query1 = $wpdb->query("SHOW COLUMNS FROM $wpdb->terms LIKE 'term_order'"); if ($query1 == 0) { $wpdb->query("ALTER TABLE $wpdb->terms ADD `term_order` INT( 4 ) NULL DEFAULT '0'"); } if($mode == "act_OrderCategories") { $idString = $_GET['idString']; $catIDs = explode(",", $idString); $result = count($catIDs); for($i = 0; $i < $result; $i++) { $wpdb->query("UPDATE $wpdb->terms SET term_order = '$i' WHERE term_id ='$catIDs[$i]'"); } $success = '

'. __('Categories updated successfully.', 'ceo').'

'; } $subCatStr = ''; if ($parentID == $startingID) { $results=$wpdb->get_results("SELECT t.term_id, t.name FROM $wpdb->term_taxonomy tt, $wpdb->terms t, $wpdb->term_taxonomy tt2 WHERE tt.parent = $startingID AND tt.taxonomy = 'category' AND t.term_id = tt.term_id AND tt2.parent = tt.term_id GROUP BY t.term_id, t.name HAVING COUNT(*) > 0 ORDER BY t.term_order ASC"); foreach($results as $row) { $subCatStr = $subCatStr.""; } } ?>

$orderby, 'order' => $order, 'show_last_updated' => $show_last_updated, 'show_count' => $show_count, 'hide_empty' => 1, 'child_of' => $startingID, 'hierarchical' => 1); $infocats = get_categories($cat_args); // var_dump($infocats); if ($parentID != $startingID) { $parentsParent = $wpdb->get_row("SELECT parent FROM $wpdb->term_taxonomy WHERE term_id = $parentID ", ARRAY_N); echo "".__('Return to book ordering.','ceo').""; } if($subCatStr != "") { ?>   get_results("SELECT * FROM $wpdb->terms t inner join $wpdb->term_taxonomy tt on t.term_id = tt.term_id WHERE taxonomy = 'category' and parent = $parentID ORDER BY term_order ASC"); ?>