Rename directory to better suit the moving time.
Kind of also fix the apache conf, but not quite.
This commit is contained in:
25
old-projects/algo/pages/links.php
Normal file
25
old-projects/algo/pages/links.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
include('indexes.php'); // Get the indexes
|
||||
|
||||
$title = $_GET['title'];
|
||||
$type = $_GET['type'];
|
||||
$page = $u[$title];
|
||||
|
||||
if ($type == 'png') {
|
||||
header('Content-type: image/png');
|
||||
$spl = explode('.', $page);
|
||||
$page = 'icons/' . substr($page, 0, strlen($page) - strlen($spl[sizeof($spl) - 1]) - 1) . '.png';
|
||||
if (!is_file($page)) $page = 'icons/default.png';
|
||||
|
||||
$filename = $page;
|
||||
$handle = fopen($filename, "rb"); // Open the icon
|
||||
$contents = fread($handle, filesize($filename));
|
||||
fclose($handle);
|
||||
echo $contents; // Print the icon
|
||||
}
|
||||
else {
|
||||
header('Content-type: text/html; charset=utf-8');
|
||||
if (!is_file($page)) $page = 'error.htm';
|
||||
include($page); // Print the page
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user