<?php | |
echo '<html> <head><title>AD LINKS TEST PAGE</title></head><body>'; | |
echo 'vN-1 This utility simply creates links to all possible ads on eclipse.org for testing purposes. Ensure the en_adTestTool.php file is | |
current with en_index.php to ensure tests are current. <br> PLEASE DO NOT CLICK THE ADS/LOGOS, please only click the links "Ad number" to bring you | |
to the home page showing the appropriate ad.'; | |
$documentRoot = $_SERVER['DOCUMENT_ROOT']; | |
require_once ($documentRoot . "/membership/promo/promos.php"); | |
$promos = allPromos(); | |
$count = count($promos); | |
$totalWeight = 0; | |
foreach ($promos as $v) { | |
$totalWeight += $v['weight']; | |
} | |
echo '<br>TOTAL WEIGHT OF ALL ADS: ' . $totalWeight; | |
for ($i=0; $i < $count; $i++) | |
{ | |
echo '<br><br><a href="http://www.eclipse.org/home/index.php?adNo=' . $i . '">Ad number: ' . $i . '</a> Prob:' . round($promos[$i]['weight'] / $totalWeight * 100, 2) . '%'; | |
switch ($promos[$i]['type']) | |
{ | |
case 'paid' : | |
case 'strat_ad' : | |
echo buildStrategicAd($promos[$i]); | |
break; | |
case 'strategic' : | |
echo buildStrategic($promos[$i]); | |
break; | |
case 'google_ad' : | |
echo buildGoogleAd($promos[$i]); | |
break; | |
case 'donate_ad' : | |
echo buildDonateAd($promos[$i]); | |
break; | |
} | |
// echo '<br>' . $keys[$i]; | |
} | |
echo '</body></html>'; | |
?> |