TutorialMS Community Forum

Full Version: BUG #17: Affiliate Rotation Showing Blanks [SOLVED]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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:

Code:
$randnum = rand(1, $number_affiliates);

This needs to be changed to

Code:
$randnum = rand(0, $number_affiliates-1);
thanks scott Smile

greetz
marcus
Reference URL's