-
Notifications
You must be signed in to change notification settings - Fork 0
/
share.php
54 lines (48 loc) · 1.78 KB
/
share.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
51
52
53
54
<?php
function share_buttons_checkbot() {
$crawlers = [
'facebookexternalhit/1.1',
'facebookexternalhit/1.1 (+https://www.facebook.com/externalhit_uatext.php)',
'Facebot',
'Twitterbot',
];
$user_agent = $_SERVER['HTTP_USER_AGENT'];
foreach( $crawlers as $bot ) {
if ( strpos( $user_agent, $bot ) !== false ) {
return true;
}
}
if ( isset( $_GET['get'] ) ) {
return true;
}
return false;
}
if ( ! isset( $_GET['c'] ) || ! share_buttons_checkbot() ) {
header("Location: https://knowyofro.com");
exit();
}
?>
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>KnowYoFro.com Play Now!</title>
<meta name="description" content="I Knew <?php echo intval( $_GET['c'] ); ?> out of 13 FROs!" />
<meta property="fb:app_id" content="356480544721988" />
<meta property="og:title" content="Do You KnowYoFro?" />
<meta property="og:url" content="https://knowyofro.com/share.php?c=<?php echo intval( $_GET['c'] ); ?>" />
<meta property="og:description" content="I Knew <?php echo intval( $_GET['c'] ); ?> out of 13 FROs!" />
<meta property="og:type" content="website" />
<meta property="og:image" content="https://knowyofro.com/assets/<?php echo intval( $_GET['c'] ); ?>.jpg" />
<meta property="og:image:width" content="477" />
<meta property="og:image:height" content="249" />
<link rel="img_src" href="https://knowyofro.com/assets/<?php echo intval( $_GET['c'] ); ?>.jpg" />
</head>
<body>
<div id="wrapper">
<h1>Do You KnowYoFro?</h1>
<img src="https://knowyofro.com/assets/<?php echo intval( $_GET['c'] ); ?>.jpg" alt="I Knew <?php echo intval( $_GET['c'] ); ?> out of 13 FROs!" />
<a href="https://knowyofro.com/share.php?c=<?php echo intval( $_GET['c'] ); ?>" title="KnowYoFro.com Play Now!">I Knew <?php echo intval( $_GET['c'] ); ?> out of 13 FROs!</a>
</div>
</body>
</html>