1 (edited by 2004-10-20 09:37:16)

Topic: Sorting news alphabetically

Add this between

}else{ $count_all = count($all_news); }

and

$i = 0;

at line 349 of ./inc/shows.inc.php:

// Sort News v1.0 - End addblock
if (isset($sortby)) {
    if (!function_exists('sortcmp')) {
  function sortcmp($a, $b) {
      global $all_news, $sortby;

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

      return strnatcasecmp($news_a[$sortby], $news_b[$sortby]);
  }
    }
    uksort($all_news, 'sortcmp');
    unset($sortby);
}
// Sort News v1.0 - End addblock

To specify sorting, put the following in your include code:

$sortby = X;


Where X is a number from 0-6, which mean the following:
0 = sory by time
1 = sory by author
2 = sory by title
3 = sory by short story
4 = sory by long story
5 = sory by avatar
6 = sory by category

hack by StealthEye