Hmm - well, I sort mine by type. The favorite order might be tricky, though... When you query, just use something like this.. Mine has it on line 88.
PHP Code:
$query = "SELECT * FROM ".$prefix."owned_adoptables WHERE owner='$loggedinname' ORDER BY type, totalclicks DESC";
I hope that I helped.