<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#!/usr/bin/perl -w
# vim: set sw=4 ts=4 si et:
# Copyright: GPL, Written by: Guido Socher &lt;guido.socher at linuxfocus.org&gt;
my $ver="1.5";
#
# This program is executed from a serverside include to insert automatically
# links to the different languages an articel is availabe in.
# The link is inserted if the file exists in that language and the
# size is bigger than 2Kb.
#
my @languages=('English','Castellano','ChineseGB','Deutsch',
               'Francais','Italiano','Nederlands','Portugues','Indonesian',
               'Russian','Turkce','Korean','Arabic','Polish','Serbian');
#
my %text=('Deutsch'=&gt;'Dieses Dokument ist verf&amp;uuml;bar auf:',
'Nederlands'=&gt;'Dit document is beschikbaar in:',
'English'=&gt;'This document is available in:',
'Francais'=&gt;'Ce document est disponible en:',
'Italiano'=&gt;'Questo documento &amp;egrave; disponibile in:',
'Turkce'=&gt;'Bu makalenin farklЩ dillerde bulunduПu adresler:',
'Russian'=&gt;'эта страница доступна на следующих языках:',
'Portugues'=&gt;'Este artigo est&amp;aacute; dispon&amp;iacute;vel em:',
'Castellano'=&gt;'Este documento est&amp;aacute; disponible en los siguientes idiomas:',
'Polish'=&gt;'Ten dokument jest dostЙpny w nastЙpuj╠cych jЙzykach:'
);
my ($k,$s,$availtxt,$file,$origlang);
#
if ($ENV{'DOCUMENT_URI'}){
    print "&lt;!-- addedByLfdynahead ver $ver --&gt;";
    # DOCUMENT_URI is somthing like: /English/July2001/article207.shtml
    my @pcomp=split(/\//,$ENV{'DOCUMENT_URI'});
    exit 0 if ($#pcomp &lt; 2);
    print "&lt;TABLE ALIGN=\"right\" border=0&gt;&lt;TR&gt;&lt;TD ALIGN=\"right\"&gt;&lt;FONT SIZE=\"-1\" FACE=\"Arial,Helvetica\"&gt;";
    my $month_and_sfile=$pcomp[$#pcomp-1] . "/" . $pcomp[$#pcomp];
    $origlang=$pcomp[$#pcomp-2];
    if ($text{$origlang}){
        $availtxt=$text{$origlang};
    }else{
        $availtxt=$text{'English'};
    }
    my $month_and_file=$month_and_sfile;
    $month_and_file=~s/\.shtml$/.html/;
    #
    $file="$origlang/$month_and_sfile";
    foreach $k (@languages){
        # test if the file exists and if it is larger than 2K
        foreach $file ("$k/$month_and_sfile", "$k/$month_and_file"){
            if ( -f "$file"){
                $s=(stat("$file"))[7];
                if ($s &gt; 2100){
                    if ($availtxt){
                        print "$availtxt ";
                        $availtxt=0;
                    }
                    print "&lt;A href=\"../../$file\"&gt;".$k."&lt;/a&gt; &amp;nbsp;";
                    # take either shtml or html but not both:
                    last; 
                }
            }
        }
    }
    print "&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TABLE&gt;&lt;br&gt;\n";
}else{
    print "&lt;!-- Lfdynahead error: DOCUMENT_URI not defined --&gt;\n";
}
__END__ 

</pre></body></html>