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


Enable Hack Manually - Negative Categories v1.0

Installation notes:

This addon will add the ability to specify which categories should not be displayed.

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

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

Replace this:

			if($requested_cats and $requested_cats[$news_arr[6]] == TRUE){ $count_all ++; }

With:

// Negative Categories v1.0 - changeblock - Old
  // 			if($requested_cats and $requested_cats[$news_arr[6]] == TRUE){ $count_all ++; }
// Negative Categories v1.0 - changeblock - New
			$is_requested = ($requested_cats and $requested_cats[$news_arr[6]]);
			if ($negativeCategories != $is_requested) {
				$count_all++;
			}
// Negative Categories v1.0 - End changeblock

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

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

Replace this:

		if($category and $requested_cats[$news_arr[6]] != TRUE){ continue; }

With:

// Negative Categories v1.0 - changeblock - Old
  // 		if($category and $requested_cats[$news_arr[6]] != TRUE){ continue; }
// Negative Categories v1.0 - changeblock - New
			$is_requested = ($requested_cats and $requested_cats[$news_arr[6]]);
			if ($category and ($negativeCategories == $is_requested)) {
				continue;
			}
// Negative Categories v1.0 - End changeblock

Add block in "./show_news.php":

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

Add this:

// Negative Categories v1.0 - addblock
$negativeCategories = false;
if ($category[0] == '!' or
		$category[0] == '-') {
	$negativeCategories = true;
	$category = substr($category, 1);
}
// Negative Categories v1.0 - End addblock

Between:

}

And:

$category = preg_replace("/ /", "", $category);

End installation notes:

Now you can use one of the following codes in your templates:
$category = '-1,2';
$category = '!1,2';
There is no diffrence in the working of the two codes. The normal categories will also work, and there you can still use the same syntax:
$category = '1,2';

Powered by CuteNews v1.3.1 © 2003 CutePHP.