Commit | Line | Data |
---|---|---|
ecfebb09 PM |
1 | <?PHP |
2 | $title = 'MEPS - Invite Links'; | |
3 | include_once('header.php'); | |
dcc88684 | 4 | slack_general('Share Links Loaded ('.$_COOKIE['invite'].')','md-petition'); |
ecfebb09 PM |
5 | $q = "select * from website_text where id = '8'"; |
6 | $r = $petition->query($q); | |
7 | $d = mysqli_fetch_array($r); | |
8 | ?> | |
9 | <script>document.title = "<?PHP echo $title;?>";</script> | |
10 | <div class='col-sm-12' style='height:100px; text-align:center;'><h2><?PHP echo $d['text_title'];?></h2><p><?PHP echo $d['text_block'];?></p></div> | |
99b2fc7f | 11 | |
2970e405 PM |
12 | |
13 | <div id="fb-root"></div> | |
14 | <script>(function(d, s, id) { | |
15 | var js, fjs = d.getElementsByTagName(s)[0]; | |
16 | if (d.getElementById(id)) return; | |
17 | js = d.createElement(s); js.id = id; | |
18 | js.src = "https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v3.0"; | |
19 | fjs.parentNode.insertBefore(js, fjs); | |
20 | }(document, 'script', 'facebook-jssdk'));</script> | |
21 | ||
3f7387f4 PM |
22 | |
23 | ||
24 | <script>window.twttr = (function(d, s, id) { | |
25 | var js, fjs = d.getElementsByTagName(s)[0], | |
26 | t = window.twttr || {}; | |
27 | if (d.getElementById(id)) return t; | |
28 | js = d.createElement(s); | |
29 | js.id = id; | |
30 | js.src = "https://platform.twitter.com/widgets.js"; | |
31 | fjs.parentNode.insertBefore(js, fjs); | |
32 | ||
33 | t._e = []; | |
34 | t.ready = function(f) { | |
35 | t._e.push(f); | |
36 | }; | |
37 | ||
38 | return t; | |
39 | }(document, "script", "twitter-wjs"));</script> | |
40 | ||
41 | ||
42 | ||
43 | ||
99b2fc7f PM |
44 | <script> |
45 | function myFunction(short_code) { | |
46 | /* Get the text field */ | |
47 | var copyText = document.getElementById(short_code); | |
2970e405 | 48 | |
99b2fc7f PM |
49 | /* Select the text field */ |
50 | copyText.select(); | |
51 | copyText.setSelectionRange(0, 99999); /*For mobile devices*/ | |
2970e405 | 52 | |
99b2fc7f PM |
53 | /* Copy the text inside the text field */ |
54 | document.execCommand("copy"); | |
2970e405 | 55 | |
99b2fc7f PM |
56 | /* Alert the copied text */ |
57 | alert("Copied the Link: " + copyText.value); | |
58 | } | |
59 | </script> | |
1f263eba | 60 | <center> |
2970e405 PM |
61 | <table border="1" cellpadding="2" cellspacing="0"> |
62 | <?PHP | |
8031cbb9 | 63 | $q2 = "SELECT * FROM petitions where admin_status = 'approved'"; |
2970e405 PM |
64 | $r2 = $petition->query($q2); |
65 | while($d2 = mysqli_fetch_array($r2)){ | |
0d84931f PM |
66 | $link = "?invite=$d2[web_short_name]"; |
67 | if ($d2['landing_page'] != ''){ | |
68 | $link = $d2['landing_page']; | |
69 | } | |
99b2fc7f PM |
70 | echo "<tr> |
71 | <td align='center'><small>$d2[petition_name]<small></td> | |
72 | <td><div class=\"fb-share-button\" | |
4c1f43b6 | 73 | data-href=\"https://www.md-petition.com/$link\" |
783af2bf | 74 | data-layout=\"button\" data-size=\"large\"> |
99b2fc7f | 75 | </div></td> |
3f7387f4 PM |
76 | <td> |
77 | <a class=\"twitter-share-button\" | |
e0ce057f PM |
78 | href=\"https://twitter.com/intent/tweet\" |
79 | data-size=\"large\" | |
80 | data-text=\"Can you spare a minute to sign $d2[petition_name]\" | |
81 | data-url=\"https://www.md-petition.com/$link\"> | |
3f7387f4 PM |
82 | Tweet</a> |
83 | </td> | |
4c1f43b6 | 84 | <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> |
99b2fc7f | 85 | </tr>"; |
2970e405 PM |
86 | } |
87 | ?> | |
88 | </table> | |
1f263eba | 89 | </center> |
99b2fc7f | 90 | <?PHP include_once('footer.php'); |