-
Notifications
You must be signed in to change notification settings - Fork 0
/
gotourn.php
49 lines (38 loc) · 2.05 KB
/
gotourn.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
<?php
// skal motta lenke, bilde, tittel
// dynamisk lage og-data
// så videresende til lenke
// params: 0: Tittel 1: Beskrivelse 2: enkeltpostlenke 3: bilde 4: Forfatter 5: ISBN
$param = stristr($_SERVER['REQUEST_URI'] , "params="); // fra og med "params="
if (stristr($param , "&")) {
$param = stristr($param , "&" , TRUE); // men bare fram til "&" hvis det finnes
}
$param = str_replace ("&" , "" , $param); // fjern &
$param = str_replace ("params=" , "" , $param); // fjern det andre
$param = urldecode(base64_decode($param));
$params = explode ("|x|", $param);
$bildeurl = $params[3];
list($width, $height, $type, $attr) = getimagesize($bildeurl);
?>
<html>
<head>
<title>Du blir straks sendt videre</title>
<meta name="twitter:card" content="photo" />
<meta name="twitter:site" content="@bibvenn" />
<meta name="twitter:title" content="<?php echo strip_tags(stripslashes($params[0]));?> (<?php echo utf8_decode(strip_tags(stripslashes($params[4])));?>)" />
<meta name="twitter:image" content="<?php echo urldecode($bildeurl);?>" />
<meta name="twitter:url" content="<?php echo strip_tags(stripslashes($params[2]));?>" />
<meta name="author" content="<?php echo utf8_decode(strip_tags(stripslashes($params[4])));?>" />
<meta property="og:type" content="book" />
<meta property="book:author" content="<?php echo urlencode(utf8_decode(strip_tags(stripslashes($params[4]))));?>">
<meta property="book:isbn" content="<?php echo strip_tags(stripslashes($params[5]));?>">
<meta property="og:description" content="<?php echo utf8_decode(strip_tags(stripslashes($params[1])));?>">
<meta property="og:title" content="<?php echo strip_tags(stripslashes($params[0]));?>">
<meta property="og:image" content="<?php echo urldecode($bildeurl);?>">
<meta property="og:image:type" content="image/jpeg">
<meta property="og:image:height" content="<?php echo $height;?>">
<meta property="og:image:width" content="<?php echo $width;?>">
<meta http-equiv="refresh" content="1;<?php echo strip_tags(stripslashes($params[2]));?>">
</head>
<body><!-- <img src="<?php echo $url; ?>" />--></body>
</html>