scratch – Diff between revs 103 and 104
?pathlinks?
Rev 103 | Rev 104 | |||
---|---|---|---|---|
Line 62... | Line 62... | |||
62 | if (!file_exists($userPath)) { |
62 | if (!file_exists($userPath)) { |
|
63 | http_response_code(404); |
63 | http_response_code(404); |
|
64 | die('File not found.'); |
64 | die('File not found.'); |
|
65 | } |
65 | } |
|
Line -... | Line 66... | |||
- | 66 | |
||
66 | |
67 | $CANON_URL = $config['URL_PATH'].$_GET['hash']; |
|
67 | $URL = $config['URL_PATH'].'og/'.$_GET['hash']; |
68 | $GRAPH_URL = $config['URL_PATH'].'og/'.$_GET['hash']; |
|
Line 68... | Line 69... | |||
68 | $VIDEO_URL = $config['URL_PATH'].'file.php?hash='.$_GET['hash']; |
69 | $VIDEO_URL = $config['URL_PATH'].'file.php?hash='.$_GET['hash']; |
|
69 | |
70 | |
|
70 | switch(strtoupper($fileExtension)) { |
71 | switch(strtoupper($fileExtension)) { |
|
71 | case 'GIF': |
72 | case 'GIF': |
|
72 | list($width, $height) = getimagesize($userPath); |
73 | list($width, $height) = getimagesize($userPath); |
|
73 | echo <<<END |
74 | echo <<<END |
|
74 | <html> |
75 | <html> |
|
75 | <head> |
76 | <head> |
|
76 | <meta property="og:site_name" content="Scratch Copy"> |
77 | <meta property="og:site_name" content="Scratch Copy"> |
|
77 | <meta property="og:url" content="$URL"> |
78 | <meta property="og:url" content="$GRAPH_URL"> |
|
78 | <meta property="og:title" content="Scratch Copy"> |
79 | <meta property="og:title" content="Scratch Copy"> |
|
79 | <meta property="og:type" content="video.other"> |
80 | <meta property="og:type" content="video.other"> |
|
80 | <meta property="og:image" content="$VIDEO_URL"> |
81 | <meta property="og:image" content="$CANON_URL"> |
|
81 | <meta property="og:image:width" content="$width"> |
82 | <meta property="og:image:width" content="$width"> |
|
Line 82... | Line 83... | |||
82 | <meta property="og:image:height" content="$height"> |
83 | <meta property="og:image:height" content="$height"> |
|
Line 98... | Line 99... | |||
98 | <!-- These two aren't necessary for embedding. --> |
99 | <!-- These two aren't necessary for embedding. --> |
|
99 | <meta property="og:site_name" content="Scratch Copy"> |
100 | <meta property="og:site_name" content="Scratch Copy"> |
|
100 | <meta property="og:title" content="Scratch Copy"> |
101 | <meta property="og:title" content="Scratch Copy"> |
|
101 | <meta property="og:type" content="video.other"> |
102 | <meta property="og:type" content="video.other"> |
|
102 | <meta property="og:description" content="Scratch Copy"> |
103 | <meta property="og:description" content="Scratch Copy"> |
|
103 | <meta property="og:url" content="$URL"> |
104 | <meta property="og:url" content="$GRAPH_URL"> |
|
104 | <meta property="og:image" content="https://scratch.grimore.org/img/blueprint.png"> |
105 | <meta property="og:image" content="https://scratch.grimore.org/img/blueprint.png"> |
|
105 | <meta property="og:video" content='https://scratch.grimore.org/flowplayer/flowplayer.swf?config={"clip":{"url":"$VIDEO_URL"}}'> |
106 | <meta property="og:video" content='https://scratch.grimore.org/flowplayer/flowplayer.swf?config={"clip":{"url":"$CANON_URL"}}'> |
|
106 | <meta property="og:video:secure_url" content='https://scratch.grimore.org/flowplayer/flowplayer.swf?config={"clip":{"url":"$VIDEO_URL"}}'> |
107 | <meta property="og:video:secure_url" content='https://scratch.grimore.org/flowplayer/flowplayer.swf?config={"clip":{"url":"$CANON_URL"}}'> |
|
107 | <meta property="og:video:type" content="application/x-shockwave-flash"> |
108 | <meta property="og:video:type" content="application/x-shockwave-flash"> |
|
108 | <meta property="og:video:height" content="254"> |
109 | <meta property="og:video:height" content="254"> |
|
109 | <meta property="og:video:width" content="650"> |
110 | <meta property="og:video:width" content="650"> |
|
110 | </head> |
111 | </head> |
|
Line 111... | Line 112... | |||
111 | |
112 | |
|
112 | <body> |
113 | <body> |
|
113 | <p> |
114 | <p> |
|
114 | <object width="425" height="300" id="Scratch Copy" name="Scratch Copy" data="https://scratch.grimore.org/flowplayer/flowplayer.swf" type="application/x-shockwave-flash"><param name="movie" value="https://scratch.grimore.org/flowplayer/flowplayer.swf" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="flashvars" value='config={"clip":{"url":"$VIDEO_URL"}}' /></object> |
115 | <object width="425" height="300" id="Scratch Copy" name="Scratch Copy" data="https://scratch.grimore.org/flowplayer/flowplayer.swf" type="application/x-shockwave-flash"><param name="movie" value="https://scratch.grimore.org/flowplayer/flowplayer.swf" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="flashvars" value='config={"clip":{"url":"$CANON_URL"}}' /></object> |
|
115 | </p> |
116 | </p> |
|
Line 116... | Line 117... | |||
116 | </body> |
117 | </body> |
|
117 | |
118 | |