Name: Sort News By (CuteNews Panel)
Author: DooSHek
Updated By: Damoor
CuteNews Compatibility: 1.3.6 - * (no incompatibility reported yet)
Description: This hack will give you ability to sort news in Edit News panel by: Title, Category, Date and Author ascending and descending + a little fix for number of displayed news
Instructions:

open inc/editnews.mdu

find:

if(!empty($all_db)){

add below:

if (!isset($sortby)) { $sortby="0"; } if (!isset($sortad)) { $sortad="d"; }
if (isset($sortby)) {
$every_news = $all_db;    
if (!function_exists('sortcmp')) {
function sortcmp($a, $b) {
global $every_news, $sortby;

$news_a = explode('|', $every_news[$a]);
$news_b = explode('|', $every_news[$b]);

return strnatcasecmp($news_a[$sortby], $news_b[$sortby]);
}
}
uksort($all_db, 'sortcmp');
if ($sortad=="d") { $all_db = array_reverse($all_db); }
unset($sortby, $sortad);
}

find:

             $entries .= " <td height=18 bgcolor=$bg nowrap>";

replace with:

             $entries .= " <td height=18 bgcolor=$bg nowrap>";

find:

        <td width=347>
        Title
        <td width=65>
        Comments

        <td width=65>
        ï¿½Category

        <td width=58>
        ï¿½Date

        <td width=78>
        Author

        <td width=21 align=center> <input style=\"border: 0px; background:transparent;\" type=checkbox name=master_box title=\"Check All\" onclick=\"java script:ckeck_uncheck_all()\"> </a> ";

replace with:

        <td>
        Title [[url=PHP_SELF?mod=editnews&action=list&category=$category&author=$author&source=$source&sortby=2&sortad=a&news_per_page=$news_per_page title=ascending>a</a>|[url=P]d[/url]]
        <td width=65>
        Comments

        <td width=90>
        Category [[url=P]a[/url]|[url=P]d[/url]]

        <td width=70>
        Date [[url=P]a[/url]|[url=P]d[/url]]

        <td width=80>
        Author [[url=P]a[/url]|[url=P]d[/url]]

        <td align=center> <input style=\] [/url] ";

find:

        $npp_nav .= "[url=]<< Previous[/url]";

replace with:

        $npp_nav .= "[url=]<< Previous[/url]";

find:

        $npp_nav .= "[url=]Next $how_next >>[/url]";

replace with:

        $npp_nav .= "[url=]Next $how_next >>[/url]";