Home | Add News | Edit News | Options | Help/About | Logout


Enable Hack Manually - Sort by XField v1.0

Add block in "./inc/shows.inc.php":

Automatically Generated, be sure to be very precise on tabs and spaces.

Add this:

// Sort by XField v1.0 - addblock

if (isset($sortbyxfield)) {
	$xfieldsaction = 'noop';
	include_once($cutepath.'/inc/xfields.mdu');
	if (!function_exists("sortcmp")) {
		function sortcmp($a, $b) {
			global $all_news, $xfieldsdata, $sortbyxfield;

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

			$newsid_a = $news_a[0];
			$newsid_b = $news_b[0];

			return strnatcasecmp($xfieldsdata[$newsid_a][$sortbyxfield], $xfieldsdata[$newsid_b][$sortbyxfield]);
		}
	}
	$xfieldsdata = xfieldsdataload();
	uksort($all_news, 'sortcmp');
	unset($sortingorder);
}
// Sort by XField v1.0 - End addblock

Between:

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

And:

    $i = 0;

Add block in "./inc/xfields.mdu":

Automatically Generated, be sure to be very precise on tabs and spaces.

Add this:

// Sort by XField v1.0 - addblock
  case 'noop':
  	break;
// Sort by XField v1.0 - End addblock

Between:

    break;

And:

  default:

End installation notes:

You should now use
$sortbyxfield = 'XFIELDNAME';
in your include code.

Powered by CuteNews v1.3.1 © 2003 CutePHP.