<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -22,80 +22,8 @@ require_once 'debug.php'; # for getmicrotime()
 # Global
 $crosssell_voting_areas = array();
 
-// Choose appropriate advert and display it.
-// $this_site is to stop a site advertising itself.
-function crosssell_display_advert($this_site, $email = '', $name = '', $postcode = '', $adverts = array()) {
-
-    # Always try and display a HearFromYourCouncillor Cheltenham advert if possible
-    if ($this_site != 'hfyc')
-        if ($ad = crosssell_display_hfyc_cheltenham_advert($email, $name, $postcode))
-            return $ad;
-
-    # If we've been sent an array of adverts, pick one at random to display
-    while (count($adverts)) {
-        $rand = rand(0, count($adverts)-1);
-        list ($advert_site, $advert_text) = $adverts[$rand];
-	if ($this_site == 'twfy' &amp;&amp; $advert_site == 'twfy_alerts')
-		return 'other-twfy-alert-type';
-        if (call_user_func('crosssell_display_random_' . $advert_site . '_advert', $email, $name, $postcode, $advert_text, $this_site))
-            return $advert_site . $rand;
-        # Failed to show an advert for $advert_site, remove all other $advert_site adverts from the selection
-        $new_adverts = array();
-        foreach ($adverts as $advert) {
-            if ($advert_site != $advert[0])
-                $new_adverts[] = $advert;
-        }
-        $adverts = $new_adverts;
-    }
-
-    if ($this_site != 'hfymp') 
-        if (crosssell_display_hfymp_advert($email, $name, $postcode))
-            return 'hfymp';
-    if ($this_site != 'twfy') {
-        if (crosssell_display_twfy_alerts_advert($this_site, $email, $postcode))
-            return 'twfy';
-    } else {
-        return 'other-twfy-alert-type';
-    }
-    if ($this_site != 'pb') {
-        crosssell_display_pb_advert();
-        return 'pb';
-    }
-    return '';
-}
-
 /* Random adverts, text supplied by caller */
 
-/* This advert will always display if picked */
-function crosssell_display_random_fms_advert($email, $name, $postcode, $text, $this_site) {
-    echo '&lt;div id=&quot;advert_thin&quot; style=&quot;text-align:center; font-size:150%&quot;&gt;',
-        $text, '&lt;/div&gt;';
-    return true;
-}
-
-/* This advert will always display if picked */
-function crosssell_display_random_gny_advert($email, $name, $postcode, $text, $this_site) {
-    echo '&lt;div id=&quot;advert_thin&quot;&gt;', $text, '&lt;/div&gt;';
-    return true;
-}
-
-function crosssell_display_random_hfymp_advert($email, $name, $postcode, $text, $this_site) {
-    $auth_signature = crosssell_check_hfymp($email);
-    if (!$auth_signature) return false;
-
-    $text = str_replace('[form]', '
-&lt;form action=&quot;http://www.hearfromyourmp.com/&quot; method=&quot;post&quot;&gt;
-&lt;input type=&quot;hidden&quot; name=&quot;name&quot; value=&quot;' . htmlspecialchars($name) . '&quot;&gt;
-&lt;input type=&quot;hidden&quot; name=&quot;email&quot; value=&quot;' . htmlspecialchars($email) . '&quot;&gt;
-&lt;input type=&quot;hidden&quot; name=&quot;postcode&quot; value=&quot;' . htmlspecialchars($postcode) . '&quot;&gt;
-&lt;input type=&quot;hidden&quot; name=&quot;sign&quot; value=&quot;' . htmlspecialchars($auth_signature) . '&quot;&gt;
-&lt;h2&gt;&lt;input style=&quot;font-size:100%&quot; type=&quot;submit&quot; value=&quot;', $text);
-    $text = str_replace('[/form]', '&quot;&gt;&lt;/h2&gt;', $text);
-
-    echo '&lt;div style=&quot;text-align:center&quot;&gt;', $text, '&lt;/div&gt;';
-    return true;
-}
-
 function crosssell_display_random_twfy_alerts_advert($email, $name, $postcode, $text, $this_site) {
     $check = crosssell_check_twfy($email, $postcode);
     if (is_bool($check)) return false;
@@ -125,74 +53,6 @@ function crosssell_display_random_twfy_alerts_advert($email, $name, $postcode, $
 
 /* Okay, now the static adverts, not being shown at random */
 
-function crosssell_display_hfymp_advert($email, $name, $postcode) {
-    $auth_signature = crosssell_check_hfymp($email);
-    if (!$auth_signature) return false;
-
-?&gt;
-&lt;form action=&quot;http://www.hearfromyourmp.com/&quot; method=&quot;post&quot;&gt;
-&lt;input type=&quot;hidden&quot; name=&quot;name&quot; value=&quot;&lt;?=htmlspecialchars($name)?&gt;&quot;&gt;
-&lt;input type=&quot;hidden&quot; name=&quot;email&quot; value=&quot;&lt;?=htmlspecialchars($email)?&gt;&quot;&gt;
-&lt;input type=&quot;hidden&quot; name=&quot;postcode&quot; value=&quot;&lt;?=htmlspecialchars($postcode)?&gt;&quot;&gt;
-&lt;input type=&quot;hidden&quot; name=&quot;sign&quot; value=&quot;&lt;?=htmlspecialchars($auth_signature)?&gt;&quot;&gt;
-&lt;h2 style=&quot;padding: 1em; font-size: 200%&quot; align=&quot;center&quot;&gt;
-Meanwhile...&lt;br&gt;
-&lt;input style=&quot;font-size:100%&quot; type=&quot;submit&quot; value=&quot;Start a long term relationship&quot;&gt;&lt;br&gt; with your MP
-&lt;/h2&gt;
-&lt;?
-    return true;
-}
-
-function crosssell_display_hfyc_cheltenham_advert($email, $name, $postcode) {
-    if (!defined('OPTION_AUTH_SHARED_SECRET') || !$postcode)
-        return false;
-
-    global $crosssell_voting_areas;
-    if (!$crosssell_voting_areas)
-        $crosssell_voting_areas = mapit_get_voting_areas($postcode);
-    if (!isset($crosssell_voting_areas['DIS']) || $crosssell_voting_areas['DIS'] != 2326)
-        return false;
-
-    $auth_signature = auth_sign_with_shared_secret($email, OPTION_AUTH_SHARED_SECRET);
-
-    // See if already signed up
-    $already_signed = crosssell_fetch_page('cheltenham.hearfromyourcouncillor.com', '/authed?email='.urlencode($email).&quot;&amp;sign=&quot;.urlencode($auth_signature));
-    if ($already_signed != 'not signed') 
-        return false;
-
-    // If not, display one of two adverts
-    $rand = rand(0, 1);
-?&gt;
-&lt;form action=&quot;http://cheltenham.hearfromyourcouncillor.com/&quot; method=&quot;post&quot;&gt;
-&lt;input type=&quot;hidden&quot; name=&quot;name&quot; value=&quot;&lt;?=htmlspecialchars($name)?&gt;&quot;&gt;
-&lt;input type=&quot;hidden&quot; name=&quot;email&quot; value=&quot;&lt;?=htmlspecialchars($email)?&gt;&quot;&gt;
-&lt;input type=&quot;hidden&quot; name=&quot;postcode&quot; value=&quot;&lt;?=htmlspecialchars($postcode)?&gt;&quot;&gt;
-&lt;input type=&quot;hidden&quot; name=&quot;sign&quot; value=&quot;&lt;?=htmlspecialchars($auth_signature)?&gt;&quot;&gt;
-
-&lt;div id=&quot;advert_thin&quot;&gt;
-&lt;?
-
-    if ($rand == 0) {
-        echo &quot;&lt;h2&gt;Cool! You live in Cheltenham!&lt;/h2&gt; &lt;p&gt;We've got an exciting new free
-        service that works exclusively for people in Cheltenham. Please sign
-        up to help the charity that runs WriteToThem, and to get a sneak
-        preview of our new service.&lt;/p&gt;&quot;;
-    } else {
-        echo &quot;&lt;h2&gt;Get to know your councillors.&lt;/h2&gt;
-        &lt;p&gt;Local councillors are really important, but hardly anyone knows them.
-        Use our new free service to build a low-effort, long term relationship
-        with your councillor.&lt;/p&gt;&quot;;
-    }
-    ?&gt;
-&lt;p align=&quot;center&quot;&gt;
-&lt;input type=&quot;submit&quot; value=&quot;Sign up to HearFromYourCouncillor&quot;&gt;
-&lt;/p&gt;
-&lt;/div&gt;
-&lt;/form&gt;
-&lt;?
-    return &quot;cheltenhamhfyc$rand&quot;;
-}
-
 # XXX: Needs to say &quot;Lord&quot; when the WTT message was to a Lord!
 function crosssell_display_twfy_alerts_advert($this_site, $email, $postcode) {
     $check = crosssell_check_twfy($email, $postcode);
@@ -218,29 +78,8 @@ can unsubscribe at any time.
     return true;
 }
 
-function crosssell_display_pb_advert() {
-?&gt;
-&lt;h2 style=&quot;padding: 1em; font-size: 200%&quot; align=&quot;center&quot;&gt;
-Have you ever wanted to &lt;a href=&quot;http://www.pledgebank.com&quot;&gt;change the world&lt;/a&gt; but stopped short because no-one would help?&lt;/h2&gt;
-&lt;?
-}
-
 /* Checking functions for sites, to see if you're already signed up or whatever */
 
-function crosssell_check_hfymp($email) {
-    if (!defined('OPTION_AUTH_SHARED_SECRET'))
-        return false;
-
-    $auth_signature = auth_sign_with_shared_secret($email, OPTION_AUTH_SHARED_SECRET);
-
-    // See if already signed up
-    $already_signed = crosssell_fetch_page('www.hearfromyourmp.com', '/authed?email='.urlencode($email).'&amp;sign='.urlencode($auth_signature));
-    if ($already_signed != 'not signed') 
-        return false;
-
-    return $auth_signature;
-}
-
 function crosssell_check_twfy($email, $postcode) {
     if (!defined('OPTION_AUTH_SHARED_SECRET') || !$postcode)
         return false;</diff>
      <filename>crosssell.php</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>44b4b73ff7015e2c53fe4f3dd7312c2e81f3c5c3</id>
    </parent>
  </parents>
  <author>
    <name>Matthew Landauer</name>
    <email>matthew@openaustralia.org</email>
  </author>
  <url>http://github.com/mlandauer/phplib/commit/e6e1b37ab1e31b8dbc5573248051b21caf6f2dbb</url>
  <id>e6e1b37ab1e31b8dbc5573248051b21caf6f2dbb</id>
  <committed-date>2008-04-24T22:39:01-07:00</committed-date>
  <authored-date>2008-04-24T22:39:01-07:00</authored-date>
  <message>Removed the bulk of the cross-selling adverts as we only have one site right now. :-)</message>
  <tree>a44684495b99a20e3c8c17e31e557f71b81b6f53</tree>
  <committer>
    <name>Matthew Landauer</name>
    <email>matthew@openaustralia.org</email>
  </committer>
</commit>
