Add files via upload
[clinton/MarylandElectronicPetitionSignature.git] / share.php
index e13034a..c652e3e 100644 (file)
--- a/share.php
+++ b/share.php
@@ -19,6 +19,28 @@ $d = mysqli_fetch_array($r);
     fjs.parentNode.insertBefore(js, fjs);
   }(document, 'script', 'facebook-jssdk'));</script>
 
+
+
+<script>window.twttr = (function(d, s, id) {
+  var js, fjs = d.getElementsByTagName(s)[0],
+    t = window.twttr || {};
+  if (d.getElementById(id)) return t;
+  js = d.createElement(s);
+  js.id = id;
+  js.src = "https://platform.twitter.com/widgets.js";
+  fjs.parentNode.insertBefore(js, fjs);
+
+  t._e = [];
+  t.ready = function(f) {
+    t._e.push(f);
+  };
+
+  return t;
+}(document, "script", "twitter-wjs"));</script>
+
+
+
+
 <script>
   function myFunction(short_code) {
   /* Get the text field */
@@ -35,22 +57,35 @@ $d = mysqli_fetch_array($r);
   alert("Copied the Link: " + copyText.value);
 }
 </script>
-
+<center>
  <table border="1" cellpadding="2" cellspacing="0">
  <?PHP
- $q2 = "SELECT * FROM petitions";
+ $q2 = "SELECT * FROM petitions where admin_status = 'approved'";
  $r2 = $petition->query($q2);
  while($d2 = mysqli_fetch_array($r2)){
+   $link = "?invite=$d2[web_short_name]";
+   if ($d2['landing_page'] != ''){
+    $link = $d2['landing_page']; 
+   }
   echo "<tr>
-  <td align='center'><small>$d2[petition_name]<small></td>
+  <td align='center'><small>$d2[petition_name]<small><br> Constituents of $d2[eligibleVoterListField] $d2[eligibleVoterListEquals]</td>
   <td><div class=\"fb-share-button\" 
-     data-href=\"http://md-petition.com/index.php?invite=$d2[web_short_name]\" 
-     data-layout=\"button_count\">
+     data-href=\"https://www.md-petition.com/$link\" 
+     data-layout=\"button\" data-size=\"large\">
    </div></td>
-   <td><input type='text' size='35' value='http://md-petition.com/?invite=$d2[web_short_name]' id='$d2[web_short_name]'><button onclick='myFunction(\"$d2[web_short_name]\")'>Copy Link</button></td>
+   <td>
+   <a class=\"twitter-share-button\"
+  href=\"https://twitter.com/intent/tweet\"
+  data-size=\"large\"
+  data-text=\"Can you spare a minute to sign $d2[petition_name]\"
+  data-url=\"https://www.md-petition.com/$link\">
+Tweet</a>
+   </td>
+   <td><input type='text' size='50' value='https://www.md-petition.com/$link' id='$d2[web_short_name]'><button onclick='myFunction(\"$d2[web_short_name]\")'>Copy Link</button></td>
+   <td><a href='printable_qr_code.php?short=$d2[web_short_name]'><img src='https://www.md-petition.com/qrcode.php?s=qrl&d=https://www.md-petition.com/$link'></a></td>
    </tr>";
  }
   ?>
  </table>
-
+</center>
 <?PHP include_once('footer.php');