Yea it randomizes the entire database, but I think that is where the problem lies. It will random all news, but it will only display what you have assigned for your category. It's not randomizing within the category.
So it would appear if I had something like this setup:
- Code: Select all
<?PHP
$static['template'] = 'Music;
$static['number'] = 1;
$static['category'] = 5;
$random_single = true;
("cnr/show_news.php");
?>
<?PHP
$static['template'] = 'Movies;
$static['number'] = 1;
$static['category'] = 7;
$random_single = true;
("cnr/show_news.php");
?>
Using this script inside show.news.php
- Code: Select all
if($random_single){
$table_count = $sql->table_count('news');
$skip = rand(0, $table_count-1);
$random_single = false;
}
It seems as if it calculates the total number of news items for both categories 5 and 7 and randomizes a single ID. So if the ID the $random_single identifies in the Music category is actually a movie, it will display nothing at all.
OR it is Randomizing the Categories themselves and will only display the random item if it falls on the same category that was identified in the embed code.