Line 61... |
Line 61... |
61 |
$Template[$Key]=rtrim($Line); |
61 |
$Template[$Key]=rtrim($Line); |
62 |
} |
62 |
} |
63 |
$Template=implode("\n",$Template); |
63 |
$Template=implode("\n",$Template); |
64 |
} |
64 |
} |
65 |
|
65 |
|
66 |
// Read parametrs from Template |
66 |
// Read parameters from Template |
67 |
|
- |
|
68 |
// Dodělat tuto část včetně odsazení tabulky |
- |
|
69 |
// <<DIRECTLINK Rychlý odkaz>> |
67 |
// <<DIRECTLINK Rychlý odkaz>> |
- |
|
68 |
$TextDL=""; |
- |
|
69 |
if (preg_match("/.*<<DIRECTLINK +(.*)>>/i",$Template,$Matches)) |
- |
|
70 |
{ |
- |
|
71 |
$TextDL=$Matches[1]; |
- |
|
72 |
unset($Matches); |
- |
|
73 |
} |
- |
|
74 |
$Template=preg_replace("/.*<<DIRECTLINK +.*>>.*\n/im","",$Template); |
- |
|
75 |
|
70 |
// <<REDIRECTION Přesměrování>> |
76 |
// <<REDIRECTION Přesměrování>> |
- |
|
77 |
$TextREDIR=""; |
71 |
$Template=preg_replace("/.*<<DIRECTLINK +(.*)>>/im","",$Template); |
78 |
if (preg_match("/.*<<REDIRECTION +(.*)>>/i",$Template,$Matches)) |
- |
|
79 |
{ |
- |
|
80 |
$TextREDIR=$Matches[1]; |
- |
|
81 |
unset($Matches); |
- |
|
82 |
} |
72 |
$Template=preg_replace("/.*<<REDIRECTION +(.*)>>/im","",$Template); |
83 |
$Template=preg_replace("/.*<<REDIRECTION +.*>>.*\n/im","",$Template); |
- |
|
84 |
|
- |
|
85 |
// Find <<TABLE>> |
- |
|
86 |
$Indent=""; |
- |
|
87 |
if (preg_match("/( *)(<<TABLE>>)/i",$Template,$Matches)) |
- |
|
88 |
{ |
- |
|
89 |
$Indent=$Matches[1]; |
- |
|
90 |
unset($Matches); |
- |
|
91 |
} |
73 |
|
92 |
|
74 |
// Generate List (table) |
93 |
// Generate List (table) |
75 |
$Table =""; |
- |
|
76 |
$Table.="<table>\n"; |
94 |
$Table = "<table>\n"; |
77 |
$Table.=" <tr>\n"; |
95 |
$Table.=$Indent." <tr>\n"; |
78 |
$Table.=" <th> Direct Link </th>\n"; |
96 |
$Table.=$Indent." <th> $TextDR </th>\n"; |
79 |
$Table.=" <th> Redirected to </th>\n"; |
97 |
$Table.=$Indent." <th> $TextREDIR </th>\n"; |
80 |
$Table.=" </tr>\n"; |
98 |
$Table.=$Indent." </tr>\n"; |
81 |
foreach($Redirect as $Key => $Value) |
99 |
foreach($Redirect as $Key => $Value) |
82 |
{ |
100 |
{ |
83 |
$Table.=" <tr>\n"; |
101 |
$Table.=$Indent." <tr>\n"; |
84 |
$Table.=" <td> $Key </td>\n"; |
102 |
$Table.=$Indent." <td> <a href=\"$Value\">$Key</a></td>\n"; |
85 |
$Table.=" <td> $Value </td>\n"; |
103 |
$Table.=$Indent." <td> $Value </td>\n"; |
86 |
$Table.=" </tr>\n"; |
104 |
$Table.=$Indent." </tr>\n"; |
87 |
} |
105 |
} |
88 |
$Table.="<table>\n"; |
106 |
$Table.=$Indent."</table>\n"; |
89 |
|
107 |
|
90 |
// Put it into Template |
108 |
// Put it into Template |
91 |
if ($Template<>"") |
109 |
if ($Template<>"") |
92 |
print str_ireplace("<<TABLE>>", $Table, $Template); |
110 |
print str_ireplace("<<TABLE>>", $Table, $Template); |
93 |
else |
111 |
else |