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