Not Reviewed
Show More
Add another comment
| @@ -0,0 +1,1 | |||
|
|
1 | ErrorDocument 404 /strips/notfound.php | |
|
|
1 | NO CONTENT: new file 100644 |
| @@ -0,0 +1,27 | |||
|
|
1 | <?php | |
|
|
2 | ||
|
|
3 | require_once('../frontend.inc.php'); | |
|
|
4 | require_once('../admin/include/admin.inc.php'); | |
|
|
5 | ||
|
|
6 | /* Provide clean data */ | |
|
|
7 | if( !preg_match('/(\d{4})\.(\w{3})$/', $_SERVER['REQUEST_URI'], $request) ) | |
|
|
8 | term('404 Not Found'); | |
|
|
9 | ||
|
|
10 | $stripnumber = (int) $strip[0]; | |
|
|
11 | $extention = mysql_real_escape_string($request[2]); | |
|
|
12 | ||
|
|
13 | /* Determine if the requested strip exists and is published */ | |
|
|
14 | $qr = mysqli_query($link, "SELECT strip.id AS id, media_t.extension AS ext | |
|
|
15 | FROM strip JOIN media_t ON strip.media = media_t.id | |
|
|
16 | WHERE strip.id = $stripnumber AND media_t.extension = '$extension' AND strip.published < NOW()"); | |
|
|
17 | if(!( $strip = mysqli_fetch_array($qr) )) | |
|
|
18 | term('404 Not Found'); | |
|
|
19 | ||
|
|
20 | if( @rename(sprintf('restricted/%04d.%s', $strip[0], $strip[1]), sprintf('%04d.%s', $strip[0], $strip[1])) ) { | |
|
|
21 | /* We are the first one to get here, post to Twitter */ | |
|
|
22 | twitterpost( urlencode("Comic ".$strip[0]." posted: ".SITE_HOST.SITE_PATH."/strip/".$strip[0]) ); | |
|
|
23 | } | |
|
|
24 | ||
|
|
25 | header("Location: $_SERVER[REQUEST_URI]"); | |
|
|
26 | ||
|
|
27 | ?> | |
Comments 0
You need to be logged in to leave comments.
Login now
