blob: 9a85a30aae6544d105c6931b518034b8719b28ff [file] [log] [blame]
<?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'] . "/eclipse.org-common/classes/ads/promotions.class.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 = Promotions::getPromos();
$count = count($promos);
$totalWeight = 0;
foreach ($promos as $v) {
$totalWeight += $v['weight'];
}
print '<br>TOTAL WEIGHT OF ALL ADS: ' . $totalWeight;
foreach ($promos as $key => $promo) {
print '<br><br><a href="http://www.eclipse.org/home/index.php?ad_id=' . $key . '">Ad number: ' . $key . '</a> Prob:' . round($promo['weight'] / $totalWeight * 100, 2) . '%';
if (!empty($promo['memberID'])) {
print '<div class="eclipsefnd-ad ad-strategic ad-strategic-frontpage"><a href="/membership/showMember.php?member_id=' . $promo['memberID'] . '" rel="nofollow" style="background-image: url(\'/membership/scripts/get_image.php?size=small&id=' . $promo['memberID'] . '\')"></div>';
}
else {
print '<div class="eclipsefnd-ad ad-strategic ad-strategic-default"><a href="/go/' . $promo['url'] . '" rel="nofollow" style="background-image: url(\'' . $promo['imageurl'] . '\')">' . $promo['memberName'] . '</a></div>';
}
}