Merge "Infra 2381 - change eclipse membership agreement link"
diff --git a/promo/promos.php b/promo/promos.php
index f4e4c1e..41fd394 100644
--- a/promo/promos.php
+++ b/promo/promos.php
@@ -55,23 +55,6 @@
 }
 
 
-function buildGoogleAd() {
-  $ad_preamble  = '<div style="width:200px;" align="center">';
-  $ad_postamble = '<br><img width="200" height="1" src="/membership/promo/images/200spacer.gif"></div>';
-  $retVal       = $ad_preamble . '<script type="text/javascript"><!--
-      google_ad_client = "pub-6797025590085056";
-      /* 200x200, created 2/22/08 */
-      google_ad_slot = "2659366666";
-      google_ad_width = 200;
-      google_ad_height = 200;
-      //-->
-      </script>
-      <script type="text/javascript"
-      src="//pagead2.googlesyndication.com/pagead/show_ads.js">
-      </script>' . $ad_postamble;
-  return $retVal;
-}
-
 function buildDonateAd() {
   $ad_preamble  = '<div width="200" align="center">';
   $ad_postamble = '<br><img src="/membership/promo/images/200spacer.gif"></div>';
@@ -209,7 +192,7 @@
 
   // Internal ads
   $current_time = time();
-  $ec_weight = 10;
+  $ec_weight = 20;
   // F4G2018 ad
   if ($current_time >= strtotime("2018/02/26") && $current_time < strtotime("2018/03/08")) {
     $retVal[] = array(
@@ -286,14 +269,6 @@
     );
   }
 
-  $retVal[] = array(
-    'memberName' => "Jakarta",
-    'type' => 'strat_ad',
-    'weight' => 10,
-    'imageurl' => "/membership/promo/images/TakeJakartaeeSurvey_ad.png",
-    'url' => "PROMO_JAKARTA",
-  );
-
   return $retVal;
 }
 
@@ -322,9 +297,6 @@
       else
         return buildStrategic($selectedAd);
       break;
-    case 'google_ad':
-      return buildGoogleAd($selectedAd);
-      break;
     case 'donate_ad':
       return buildDonateAd($selectedAd);
       break;
diff --git a/showMemberLogos.php b/showMemberLogos.php
index 9fd03c6..4652d2f 100644
--- a/showMemberLogos.php
+++ b/showMemberLogos.php
@@ -6,38 +6,92 @@
  * 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/system/app.class.php");
-require_once ("./scripts/lookup_exceptions.php");
-
 $App = new App();
-$Theme = $App->getThemeClass();
 
-$pageTitle = "Eclipse Member Logos";
-$Theme->setPageTitle($pageTitle);
-$Theme->setPageKeywords("eclipse membership, become a member, membership faq, membership expire");
-$Theme->setPageAuthor("Christopher Guindon");
+$_ORDER = $App->getHTTPParameter('order');
+$types = $App->getHTTPParameter('type');
+
+$valid = array(
+  "SD",
+  "SC",
+  "AP",
+  "AS",
+  "ENTRP"
+);
+$_TYPE = array();
+foreach (explode(',', $types) as $type) {
+  if (in_array($type, $valid)) {
+    $_TYPE[] = "'$type'";
+  }
+}
+
+$_NUMCOLS = 8;
+if (isset($_GET['numcols'])) {
+  $count = (int) $_GET['numcols'];
+  $_NUMCOLS = max(4, min(64, $count));
+}
+
+switch ($_ORDER) {
+  case "type":
+    $order_by = "ORG.member_type desc, ORG.name1";
+    break;
+  case "complete":
+    $order_by = "COMPLETE, ORG.name1";
+    break;
+  default:
+    $order_by = "ORG.name1";
+}
+
+if ($_TYPE)
+  $where_clause = "WHERE ORG.member_type in (" . implode(',', $_TYPE) . ")";
+else
+  $where_clause = "WHERE ORG.member_type in ('SD', 'SC', 'AP', 'AS', 'ENTRP')";
 
 // WTB: Modified to exclude organizations that have not provided a small logo.
 $selectall = "SELECT ORGI.OrganizationID, ORG.name1, ORGI.short_description, ORG.member_type, ORGI.company_url IS NULL AS COMPLETE

-  from OrganizationInformation as ORGI

-  RIGHT JOIN organizations as ORG on ORGI.OrganizationID = ORG.organization_id

-  WHERE ORG.member_type in ('SD', 'SC', 'AP', 'AS', 'ENTRP') and ORGI.small_logo is not NULL

-  ORDER BY ORG.name1";
+	from OrganizationInformation as ORGI

+	RIGHT JOIN organizations as ORG on ORGI.OrganizationID = ORG.organization_id

+	" . $where_clause . " and ORGI.small_logo is not null

+	ORDER BY

+	" . $order_by;
 
+// echo "SQL: " . $selectall;
 $result = $App->eclipse_sql($selectall);
+$LIST = '<table><tr>';
+$count = 1;
+while ($a = mysql_fetch_array($result)) {
+  $org_id = $a[0];
+  $org_name = $a[1];
+  $org_short_desc = $a[2];
+  $org_type = $a[3];
 
-$html = '<h1>' . $pageTitle . '</h1><div class="row padding-top-20">';
-while ($org = mysql_fetch_array($result)) {
-  $html .= '<div class="col-md-3 col-sm-6 col-xs-8 margin-bottom-20" style="height:120px;"><img class="img-responsive" src="./scripts/get_image.php?id=' . $org[0] . '&size=small" title="' . $org[1] . '" alt="' . $org[1] . '"></div>';
+  $LIST .= '<td><img src="./scripts/get_image.php?id=' . $org_id . '&size=small" style="padding:1px;" alt="' . $org_name . '"></td>';
+  if (($count++ % $_NUMCOLS) == 0) {
+    $LIST .= '</tr><tr>';
+  }
 }
-$html .= '</div>';

-$Theme->setHtml($html);
 
-// Generate the web page
-$Theme->generatePage();
\ No newline at end of file
+$LIST .= '</tr></table>';
+?>

+<html>

+<head>

+<title>Eclipse Member Company Logos</title>

+<style>

+img {

+	max-width: 120px;

+	max-height: 120px

+}

+

+td {

+	text-align: center;

+	vertical-align: middle;

+}

+</style>

+</head>

+<body>

+<?php echo $LIST; ?>

+</body>

+</html>