another fix may be to try and maintain display order
PHP Code:
if ($table == 'smilie')
{
$items = $DB_site->query("SELECT * FROM " . TABLE_PREFIX . "smilie ORDER BY imagecategoryid, LENGTH(smilietext) DESC, displayorder");
}
else
{
$items = $DB_site->query("SELECT * FROM " . TABLE_PREFIX . "$table ORDER BY imagecategoryid, displayorder");
}
but i aint tested it so who knows :happysad: