o: ActiveSupport::Cache::Entry :@compressedF:@value"Cœ"=œ
| Web/DirectLink.inc | ||
|---|---|---|
| 1 | 1 |
<?php |
| 2 | 2 |
|
| 3 |
// Define redirect links |
|
| 3 |
// Define redirect links in correct order |
|
| 4 |
|
|
| 4 | 5 |
$Redirect["forth"]="/Articles/Forth/WordList"; |
| 5 | 6 |
$Redirect["amforth"]="/Articles/Forth/WordList"; |
| 6 | 7 |
$Redirect["hftramp"]="/Designs/HF_TRAMP/DOC/HTML/HF_TRAMP"; |
| 7 | 8 |
|
| 8 |
?> |
|
| 9 |
?> |
|
| Web/DirectLink.en.tmpl | ||
|---|---|---|
| 2 | 2 |
<html> |
| 3 | 3 |
<head> |
| 4 | 4 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 5 |
<title> MLAB Page Template </title>
|
|
| 6 |
<meta name="keywords" content="MLAB Universal Electronic Modules and Articles Processors Electronics"> |
|
| 7 |
<meta name="description" content="MLAB Project, Page Template">
|
|
| 5 |
<title> MLAB Direct Links </title>
|
|
| 6 |
<meta name="keywords" content="MLAB Direct Links Universal Electronic Modules and Articles Processors Electronics">
|
|
| 7 |
<meta name="description" content="MLAB Project, Direct Links">
|
|
| 8 | 8 |
<!-- AUTOINCLUDE START "Page/Head.en.ihtml" DO NOT REMOVE --> |
| 9 | 9 |
<link rel="StyleSheet" href="../../Web/CSS/MLAB.css" type="text/css" title="MLAB Basic Style"> |
| 10 | 10 |
<link rel="StyleSheet" href="../../Web/CSS/MLAB_Print.css" type="text/css" media="print"> |
| ... | ... | |
| 48 | 48 |
<!-- ============== TEXT ============== --> |
| 49 | 49 |
<div class="Text"> |
| 50 | 50 |
<p class="Title"> |
| 51 |
Page Title
|
|
| 51 |
Direct Links
|
|
| 52 | 52 |
</p> |
| 53 |
<p class=Autor> |
|
| 54 |
Authors name |
|
| 55 |
</p> |
|
| 56 | 53 |
<p class=Subtitle> |
| 57 | 54 |
You have entered unknown link so we have prepared for you list of |
| 58 | 55 |
all defined Direct Links. |
| 59 | 56 |
</p> |
| 60 |
<p> |
|
| 61 |
<<DIRECTLINK Direct Link>> |
|
| 62 |
<<REDIRECT Redirected to>> |
|
| 63 |
<<TABLE>> |
|
| 64 |
</p> |
|
| 57 |
<<DIRECTLINK Direct Link>> |
|
| 58 |
<<REDIRECTION Redirected to>> |
|
| 59 |
<<TABLE>> |
|
| 65 | 60 |
</div> |
| 66 | 61 |
|
| 67 | 62 |
<!-- AUTOINCLUDE START "Page/Footer.en.ihtml" DO NOT REMOVE --> |
| Web/DirectLink.php | ||
|---|---|---|
| 1 | 1 |
<?php |
| 2 | 2 |
|
| 3 |
// Process supplied parameters as direct link (link to some deep place |
|
| 4 |
// in the web structure). |
|
| 3 |
// Direct Link is technology used for permanent link into deep place of the web. |
|
| 4 |
// This script is opened when mod_rewrite gets url with no page but with some |
|
| 5 |
// parameter (query string, separated by ?). The web is trying to find |
|
| 6 |
// script with the best language (for example DirectLink.en.php). Those scripts |
|
| 7 |
// are wrappers only. We can then look which language was used and generate |
|
| 8 |
// the right language version of link or selection. |
|
| 5 | 9 |
// |
| 6 |
// This script is usualy called via mod_rewrite when user enter |
|
| 7 |
// no page with some parameter. |
|
| 10 |
// For example www.mlab.cz?xxx |
|
| 8 | 11 |
// |
| 9 |
// (c)miho2007 / www.mlab.cz |
|
| 12 |
// If there is invalid keyword (xxx in the example above) the script generates |
|
| 13 |
// selecteion HTML page (with table of posibilities). If the keyword is valid |
|
| 14 |
// (found in a list) then the page is automatically redirected to the right |
|
| 15 |
// place. We try to use user's prefered language. |
|
| 16 |
// |
|
| 17 |
// In the file DirectLink.inc there is list of keywords and links to go. |
|
| 18 |
// |
|
| 19 |
// Written by (c)miho2007 for www.mlab.cz |
|
| 10 | 20 |
|
| 11 | 21 |
|
| 12 | 22 |
// Clear variables |
| ... | ... | |
| 18 | 28 |
// Include redirect definitions (as an array) |
| 19 | 29 |
include_once("DirectLink.inc");
|
| 20 | 30 |
|
| 21 |
// Do all upcase
|
|
| 31 |
// Make all keywords upcase
|
|
| 22 | 32 |
foreach($Redirect as $Key => $Value) |
| 23 | 33 |
{
|
| 24 |
$RedirectUpper[strtoupper($Key)]=$Value;
|
|
| 34 |
$RedirectUpper[strtoupper($Key)]=$Value; |
|
| 25 | 35 |
} |
| 26 | 36 |
|
| 27 |
// Process language |
|
| 37 |
// Process language (extract lang from the name of the script)
|
|
| 28 | 38 |
$Lang=$_SERVER[SCRIPT_FILENAME]; |
| 29 | 39 |
$Lang=preg_replace("/(?:.+)\.(.+)\.(.*)/i","$1",$Lang);
|
| 30 | 40 |
if ($Lang==$_SERVER[SCRIPT_FILENAME]) $Lang=""; |
| ... | ... | |
| 33 | 43 |
$RedirectToPage=$RedirectUpper[strtoupper(urldecode($_SERVER[QUERY_STRING]))]; |
| 34 | 44 |
|
| 35 | 45 |
// If not found -> list all posibilities |
| 36 |
if ($RedirectToPage=="")
|
|
| 37 |
{
|
|
| 38 |
// File Name
|
|
| 39 |
if ($Lang=="")
|
|
| 40 |
$Lang="en";
|
|
| 46 |
if ($RedirectToPage=="") |
|
| 47 |
{
|
|
| 48 |
// Template File Name
|
|
| 49 |
if ($Lang=="")
|
|
| 50 |
$Lang="en"; |
|
| 41 | 51 |
$FileName="DirectLink.$Lang.tmpl"; |
| 52 |
|
|
| 42 | 53 |
// Read Template |
| 43 | 54 |
$Template=@file($FileName); |
| 44 |
// Trim Lines |
|
| 55 |
|
|
| 56 |
// Trim Lines |
|
| 45 | 57 |
if ($Template<>FALSE) |
| 46 | 58 |
{
|
| 47 | 59 |
foreach($Template as $Key => $Line) |
| 48 | 60 |
{
|
| 49 |
$Template[$Key]=rtrim($Line);
|
|
| 61 |
$Template[$Key]=rtrim($Line);
|
|
| 50 | 62 |
} |
| 51 | 63 |
$Template=implode("\n",$Template);
|
| 52 | 64 |
} |
| 53 |
// Generate List |
|
| 65 |
|
|
| 66 |
// Read parametrs from Template |
|
| 67 |
|
|
| 68 |
// Dodělat tuto část včetně odsazení tabulky |
|
| 69 |
// <<DIRECTLINK Rychlý odkaz>> |
|
| 70 |
// <<REDIRECTION Přesměrování>> |
|
| 71 |
$Template=preg_replace("/.*<<DIRECTLINK +(.*)>>/im","",$Template);
|
|
| 72 |
$Template=preg_replace("/.*<<REDIRECTION +(.*)>>/im","",$Template);
|
|
| 73 |
|
|
| 74 |
// Generate List (table) |
|
| 54 | 75 |
$Table =""; |
| 55 | 76 |
$Table.="<table>\n"; |
| 56 | 77 |
$Table.=" <tr>\n"; |
| ... | ... | |
| 65 | 86 |
$Table.=" </tr>\n"; |
| 66 | 87 |
} |
| 67 | 88 |
$Table.="<table>\n"; |
| 89 |
|
|
| 68 | 90 |
// Put it into Template |
| 69 | 91 |
if ($Template<>"") |
| 70 |
print str_ireplace("<<Table>>", $Table, $Template);
|
|
| 92 |
print str_ireplace("<<TABLE>>", $Table, $Template);
|
|
| 71 | 93 |
else |
| 72 |
print $Table; |
|
| 94 |
print $Table; // We have No Template |
|
| 95 |
|
|
| 73 | 96 |
// Finished |
| 74 | 97 |
return 0; |
| 75 |
}
|
|
| 98 |
} |
|
| 76 | 99 |
else |
| 77 |
{
|
|
| 100 |
{
|
|
| 101 |
// We have redirection |
|
| 78 | 102 |
if ($Lang<>"") |
| 79 | 103 |
if (file_exists($_SERVER["DOCUMENT_ROOT"].$RedirectToPage.".".$Lang.".html")) |
| 80 | 104 |
$RedirectToPage.=".".$Lang.".html"; |
| 81 |
}
|
|
| 105 |
} |
|
| 82 | 106 |
|
| 83 | 107 |
// Redirect page |
| 84 | 108 |
header("HTTP/1.1 301 Moved Permanently");
|
| 85 | 109 |
header("Location: ".$RedirectToPage);
|
| 86 | 110 |
header("Connection: close");
|
| 87 | 111 |
|
| 88 |
?> |
|
| 112 |
?> |
|
| Web/DirectLink.en.php | ||
|---|---|---|
| 1 | 1 |
<?php |
| 2 |
// This is only wrapper and it is used to identify which language to use |
|
| 2 | 3 |
include_once("DirectLink.php");
|
| 3 |
?> |
|
| 4 |
?> |
|
| Web/DirectLink.cs.php | ||
|---|---|---|
| 1 | 1 |
<?php |
| 2 |
// Toto je jen obálka a slouží jen pro identifikaci jazyka, který se má použít |
|
| 2 | 3 |
include_once("DirectLink.php");
|
| 3 |
?> |
|
| 4 |
?> |
|
| Web/DirectLink.cs.tmpl | ||
|---|---|---|
| 2 | 2 |
<html> |
| 3 | 3 |
<head> |
| 4 | 4 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 5 |
<title> MLAB Rychle odkazy </title>
|
|
| 6 |
<meta name="keywords" content="stavebnice MLAB univerzální moduly">
|
|
| 7 |
<meta name="description" content="Projekt MLAB, Rychle odkazy">
|
|
| 5 |
<title> MLAB Rychlé odkazy </title>
|
|
| 6 |
<meta name="keywords" content="stavebnice MLAB rychlé přímé odkazy ">
|
|
| 7 |
<meta name="description" content="Projekt MLAB, Rychlé odkazy">
|
|
| 8 | 8 |
<!-- AUTOINCLUDE START "Page/Head.cs.ihtml" DO NOT REMOVE --> |
| 9 | 9 |
<link rel="StyleSheet" href="../../Web/CSS/MLAB.css" type="text/css" title="MLAB základní styl"> |
| 10 | 10 |
<link rel="StyleSheet" href="../../Web/CSS/MLAB_Print.css" type="text/css" media="print"> |
| ... | ... | |
| 48 | 48 |
<!-- ============== TEXT ============== --> |
| 49 | 49 |
<div class="Text"> |
| 50 | 50 |
<p class="Title"> |
| 51 |
NázRychle odkazy
|
|
| 51 |
Rychlé odkazy
|
|
| 52 | 52 |
</p> |
| 53 | 53 |
<p class="Subtitle"> |
| 54 |
Protoze jste zadali odkaz, ktery neni definovan pripravili jsme
|
|
| 55 |
pro Vas seznam definovanych rychlych odkazu.
|
|
| 54 |
Protože jste zadali odkaz, který není definován připravili jsme
|
|
| 55 |
pro Vás seznam definovanych rychlých odkazů.
|
|
| 56 | 56 |
</p> |
| 57 |
<p> |
|
| 58 |
<<DIRECTLINK Rychly odkaz>> |
|
| 59 |
<<REDIRECTION Presmerovani>> |
|
| 60 |
<<TABLE>> |
|
| 61 |
</p> |
|
| 57 |
<<DIRECTLINK Rychlý odkaz>> |
|
| 58 |
<<REDIRECTION Přesměrování>> |
|
| 59 |
<<TABLE>> |
|
| 62 | 60 |
</div> |
| 63 | 61 |
|
| 64 | 62 |
<!-- AUTOINCLUDE START "Page/Footer.cs.ihtml" DO NOT REMOVE --> |
| Web/JS/MLAB_Menu.js | ||
|---|---|---|
| 8 | 8 |
// Doplněno generování značky <a id="_Up"> pro odkaz Up v patičce |
| 9 | 9 |
// Doplněn skript pro sledování návštěvnosti stránek |
| 10 | 10 |
// Korekce zobrazení data modifikace stránky pro český jazyk |
| 11 |
// Doplněn do patičky odkaz na HTML validator |
|
| 11 |
// Doplněn do patičky odkaz na HTML validator + změna na přímý odkaz
|
|
| 12 | 12 |
|
| 13 | 13 |
var RelPath=""; // Proměnná pro uložení relativní cesty k rootu webu |
| 14 | 14 |
// Všechny cesty v tomto skriptu pak mají být cestami od |
| ... | ... | |
| 184 | 184 |
{
|
| 185 | 185 |
Content+='<a href= "http://validator.w3.org/check?uri=' |
| 186 | 186 |
+document.location.href |
| 187 |
+'">HTML Validator</a> ';
|
|
| 187 |
+'">HTML Validator</a> ';
|
|
| 188 | 188 |
} |
| 189 | 189 |
Time=document.lastModified; |
| 190 | 190 |
if (DocLang()=="cs") |