| <?php |
| /** |
| * Copyright (c) 2014, 2015, 2018 Eclipse Foundation and others. |
| * |
| * This program and the accompanying materials are made |
| * available under the terms of the Eclipse Public License 2.0 |
| * which is available at https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * Contributors: |
| * Christopher Guindon (Eclipse Foundation) - initial API and implementation |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| */ |
| |
| require_once ($_SERVER['DOCUMENT_ROOT'] . "/membership/promo/promos.php"); |
| ?> |
| |
| <p>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.</p> |
| |
| <?php |
| $promos = allPromos(); |
| $count = count($promos); |
| |
| $totalWeight = 0; |
| foreach ($promos as $v) { |
| $totalWeight += $v['weight']; |
| } |
| |
| print '<br>TOTAL WEIGHT OF ALL ADS: ' . $totalWeight; |
| |
| for ($i=0; $i < $count; $i++) { |
| print '<br><br><a href="http://www.eclipse.org/home/index.php?ad_id=' . $i . '">Ad number: ' . $i . '</a> Prob:' . round($promos[$i]['weight'] / $totalWeight * 100, 2) . '%'; |
| switch ($promos[$i]['type']) { |
| case 'paid' : |
| case 'strat_ad' : |
| print buildStrategicAd($promos[$i]); |
| break; |
| case 'strategic' : |
| print buildStrategic($promos[$i]); |
| break; |
| case 'donate_ad' : |
| print buildDonateAd($promos[$i]); |
| break; |
| case 'custom' : |
| print buildCustomHtmlAd($promos[$i]); |
| break; |
| } |
| } |