05-16-2008, 03:47 AM
This post is just for reference (and a fix if you experience this problem):
Problem: Affiliate rotation sometimes will spit out blank affiliates.
Cause: Array of affiliates starts indexing at 0 but the minimum number being passed to rand() does not start at 0.
Solution: You will need to edit the script /includes/classes/template.php.
If this file is unedited, it should be on line 273 and currently should look like:
This needs to be changed to
Problem: Affiliate rotation sometimes will spit out blank affiliates.
Cause: Array of affiliates starts indexing at 0 but the minimum number being passed to rand() does not start at 0.
Solution: You will need to edit the script /includes/classes/template.php.
If this file is unedited, it should be on line 273 and currently should look like:
Code:
$randnum = rand(1, $number_affiliates);This needs to be changed to
Code:
$randnum = rand(0, $number_affiliates-1);