-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
50 lines (44 loc) · 1.53 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<div id="fb-root"></div>
<script>
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/cs_CZ/all.js#xfbml=1&appId=330927440385257";
fjs.parentNode.insertBefore(js, fjs);
}
(document, 'script', 'facebook-jssdk')
);
</script>
<style type="text/css">
.bonus-box {
font-family: Tahoma;
background: #FFDB4D;
width: 300px;
padding: 20px;
}
.bonus-box p {
padding: 10px;
font-weight: 700;
}
</style>
<?php
include('src/facebook.php');
$config['appid' ] = "154817238062054";
$config['secret'] = "651640527c71851130c2e60c5bcbd138";
// Create our Application instance.
$facebook = new Facebook(array(
'appId' => $config['appid'],
'secret' => $config['secret'],
'cookie' => true
));
$signedRequest = $facebook->getSignedRequest();
if($signedRequest['page']['liked'] == 1) { //pokud je like na stranku -> zobrazi se kod
echo '<div class="bonus-box">
<h1>Váš bonusový kód</h1>
<p>OB64GKS7K9</p>
</div>';
} else { //pokud neni like na stranku -> zobrazi se likebox
echo '<div class="fb-like-box" data-href="https://www.facebook.com/pages/Med-nen%C3%AD-jed/649741231722878" data-width="The pixel width of the plugin" data-height="The pixel height of the plugin" data-colorscheme="light" data-show-faces="true" data-header="true" data-stream="false" data-show-border="true"></div>';
}
?>