/ rid.php
rid.php
 1  <?php
 2  
 3  $names = @file("files.txt");
 4  
 5  if (!$names) {
 6  	$arr = scandir(".");
 7  
 8  	foreach ($arr as $fi) {
 9  		if (preg_match("/\.(jpg|gif|png)$/", $fi)) {
10  			$names[] = $fi;
11  		}
12  	}
13  
14  	file_put_contents("files.txt", join($names, "\n"));
15  }
16  
17  $dir = dirname($_SERVER['REQUEST_URI']);
18  $dir = str_replace("dontblockthis/", "", $dir);
19  $dir = str_replace( '/image', '', $dir );
20  
21  $protocol = $_SERVER['SERVER_PORT'] == 443 ? "https" : "http";
22  
23  header("Location: ".$protocol."://s.4cdn.org/image" . $dir ."/" . $names[rand(0, count($names)-1)]);
24  
25  ?>