o: ActiveSupport::Cache::Entry :@compressedF:@value"1"1
| DirectLink.php | ||
|---|---|---|
| 11 | 11 |
|
| 12 | 12 |
// Clear variables |
| 13 | 13 |
unset($Redirect); |
| 14 |
unset($RedirectUpper); |
|
| 14 | 15 |
unset($RedirectToPage); |
| 15 | 16 |
unset($Lang); |
| 16 | 17 |
|
| ... | ... | |
| 20 | 21 |
// Do all upcase |
| 21 | 22 |
foreach($Redirect as $Key => $Value) |
| 22 | 23 |
{
|
| 23 |
$RedirectNew[strtoupper($Key)]=$Value;
|
|
| 24 |
$RedirectUpper[strtoupper($Key)]=$Value;
|
|
| 24 | 25 |
} |
| 25 |
$Redirect=$RedirectNew; |
|
| 26 |
unset($RedirectNew); |
|
| 27 | 26 |
|
| 28 | 27 |
// Process language |
| 29 | 28 |
$Lang=$_SERVER[SCRIPT_FILENAME]; |
| ... | ... | |
| 31 | 30 |
if ($Lang==$_SERVER[SCRIPT_FILENAME]) $Lang=""; |
| 32 | 31 |
|
| 33 | 32 |
// Find redirect |
| 34 |
$RedirectToPage=$Redirect[strtoupper(urldecode($_SERVER[QUERY_STRING]))]; |
|
| 33 |
$RedirectToPage=$RedirectUpper[strtoupper(urldecode($_SERVER[QUERY_STRING]))];
|
|
| 35 | 34 |
|
| 36 | 35 |
// If not found -> list all posibilities |
| 37 | 36 |
if ($RedirectToPage=="") |
| 38 | 37 |
{
|
| 39 |
$RedirectToPage="/"; // DOPSAT |
|
| 40 |
// VYPIS a KONEC |
|
| 38 |
// File Name |
|
| 39 |
if ($Lang=="") |
|
| 40 |
$Lang="en"; |
|
| 41 |
$FileName="DirectLink.$Lang.tmpl"; |
|
| 42 |
// Read Template |
|
| 43 |
$Template=@file($FileName); |
|
| 44 |
// Trim Lines |
|
| 45 |
if ($Template<>FALSE) |
|
| 46 |
{
|
|
| 47 |
foreach($Template as $Key => $Line) |
|
| 48 |
{
|
|
| 49 |
$Template[$Key]=rtrim($Line); |
|
| 50 |
} |
|
| 51 |
$Template=implode("\n",$Template);
|
|
| 52 |
} |
|
| 53 |
// Generate List |
|
| 54 |
$Table =""; |
|
| 55 |
$Table.="<table>\n"; |
|
| 56 |
$Table.=" <tr>\n"; |
|
| 57 |
$Table.=" <th> Direct Link </th>\n"; |
|
| 58 |
$Table.=" <th> Redirected to </th>\n"; |
|
| 59 |
$Table.=" </tr>\n"; |
|
| 60 |
foreach($Redirect as $Key => $Value) |
|
| 61 |
{
|
|
| 62 |
$Table.=" <tr>\n"; |
|
| 63 |
$Table.=" <td> $Key </td>\n"; |
|
| 64 |
$Table.=" <td> $Value </td>\n"; |
|
| 65 |
$Table.=" </tr>\n"; |
|
| 66 |
} |
|
| 67 |
$Table.="<table>\n"; |
|
| 68 |
// Put it into Template |
|
| 69 |
if ($Template<>"") |
|
| 70 |
print str_ireplace("<<Table>>", $Table, $Template);
|
|
| 71 |
else |
|
| 72 |
print $Table; |
|
| 73 |
// Finished |
|
| 74 |
return 0; |
|
| 41 | 75 |
} |
| 42 | 76 |
else |
| 43 | 77 |
{
|
| 44 |
if ($Lang<>"")
|
|
| 45 |
if (file_exists($RedirectToPage.".".$Lang.".html")) |
|
| 78 |
if ($Lang<>"") |
|
| 79 |
if (file_exists($_SERVER["DOCUMENT_ROOT"].$RedirectToPage.".".$Lang.".html"))
|
|
| 46 | 80 |
$RedirectToPage.=".".$Lang.".html"; |
| 47 |
// DOPSAT - zkusit ENG/CZE verzi |
|
| 48 | 81 |
} |
| 49 | 82 |
|
| 50 | 83 |
// Redirect page |