scratch – Diff between revs 90 and 103
?pathlinks?
Rev 90 | Rev 103 | |||
---|---|---|---|---|
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 66... | Line 66... | |||
66 | |
66 | |
|
- | 67 | $URL = $config['URL_PATH'].'og/'.$_GET['hash']; |
||
Line 67... | Line 68... | |||
67 | $URL = $config['URL_PATH'].$_GET['hash']; |
68 | $VIDEO_URL = $config['URL_PATH'].'file.php?hash='.$_GET['hash']; |
|
68 | |
69 | |
|
69 | switch(strtoupper($fileExtension)) { |
70 | switch(strtoupper($fileExtension)) { |
|
70 | case 'GIF': |
71 | case 'GIF': |
|
Line 74... | Line 75... | |||
74 | <head> |
75 | <head> |
|
75 | <meta property="og:site_name" content="Scratch Copy"> |
76 | <meta property="og:site_name" content="Scratch Copy"> |
|
76 | <meta property="og:url" content="$URL"> |
77 | <meta property="og:url" content="$URL"> |
|
77 | <meta property="og:title" content="Scratch Copy"> |
78 | <meta property="og:title" content="Scratch Copy"> |
|
78 | <meta property="og:type" content="video.other"> |
79 | <meta property="og:type" content="video.other"> |
|
79 | <meta property="og:image" content="$URL"> |
80 | <meta property="og:image" content="$VIDEO_URL"> |
|
80 | <meta property="og:image:width" content="$width"> |
81 | <meta property="og:image:width" content="$width"> |
|
81 | <meta property="og:image:height" content="$height"> |
82 | <meta property="og:image:height" content="$height"> |
|
82 | </head> |
83 | </head> |
|
Line 83... | Line 84... | |||
83 | |
84 | |
|
Line 88... | Line 89... | |||
88 | </body> |
89 | </body> |
|
Line 89... | Line 90... | |||
89 | |
90 | |
|
90 | </html> |
91 | </html> |
|
91 | END; |
92 | END; |
|
- | 93 | break; |
||
- | 94 | case 'MP4': |
||
- | 95 | echo <<<END |
||
- | 96 | <html> |
||
- | 97 | <head> |
||
- | 98 | <!-- These two aren't necessary for embedding. --> |
||
- | 99 | <meta property="og:site_name" content="Scratch Copy"> |
||
- | 100 | <meta property="og:title" content="Scratch Copy"> |
||
- | 101 | <meta property="og:type" content="video.other"> |
||
- | 102 | <meta property="og:description" content="Scratch Copy"> |
||
- | 103 | <meta property="og:url" content="$URL"> |
||
- | 104 | <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:secure_url" content='https://scratch.grimore.org/flowplayer/flowplayer.swf?config={"clip":{"url":"$VIDEO_URL"}}'> |
||
- | 107 | <meta property="og:video:type" content="application/x-shockwave-flash"> |
||
- | 108 | <meta property="og:video:height" content="254"> |
||
- | 109 | <meta property="og:video:width" content="650"> |
||
- | 110 | </head> |
||
- | 111 | |
||
- | 112 | <body> |
||
- | 113 | <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 | </p> |
||
- | 116 | </body> |
||
- | 117 | |
||
- | 118 | </html> |
||
- | 119 | END; |
||
92 | break; |
120 | break; |