#!/usr/bin/perl use lib '../cgi-bin'; use strict vars; use English; use Time::Local; use File::Basename; require 'urlencoding.pm'; require 'toolbox.pm'; require 'db_wrapper.pm'; #--------------------------------------------------------------------------------------------------------- #-- #-- A n z e i g e m o d u l #-- #-- #-- Mit diesem Script werden WML-Verweise aus einer Datenquelle sortiert ausgegeben. #-- Die Ausgabe kann WML oder HTML sein. #-- #-- #-- sm.cgi #-- #-- 03.05.2000 SK Logging eingebaut #-- 11.04.2000 SK Überschriften verbessert #-- 21.03.2000 SK Profile in den Security-Bereich verschoben #-- 11.03.2000 SK Unterkategorien eingebaut #-- 06.02.2000 SK Suche nach Sprache des WAP-Angebots eingebaut, EMail-Dienst #-- 24.01.2000 SK An Pflege-CGIs angepasst verbessert #-- 10.01.2000 SK HTML-Ausgabe verbessert #-- 09.01.2000 SK Rohgerüst erstellt #-- #--------------------------------------------------------------------------------------------------------- #--------------------------------------------------------------------------------------------------------- # Allgemeine Variablen #--------------------------------------------------------------------------------------------------------- my $zeile = ""; my $scripting = "WML"; my $br = ""; my $htmlbr = ""; my $grth = ""; my $i = 0; my $count = 0; my $maxcount = 10; my $anz_kat = 63; my $ausgabe = ""; my $ausgabecount = 0; my $sprache = 0; # 0=Deutsch, 1=Englisch my $sprachetyp = "de"; my $angebotssprache = ""; my $suchtyp = ""; my $sorttyp = ""; my $anzeigetyp = ""; my $aufruf = ""; my $suchbegriff = ""; my $sterne = "****"; my $kn = ""; # Kategorienummer my $kn_suche = ""; my $kat_name = ""; my $vonpos = 0; #--------------------------------------------------------------------------------------------------------- # Dateipfade und Basisverzeichnisse #--------------------------------------------------------------------------------------------------------- if ($scripting eq "WML") {$i=3;} else {$i=7;} # /wap/ bzw. /cgi-bin/ my $CGIPATH = dirname($PROGRAM_NAME,""); my $ROOTPATH = substr($CGIPATH,0,length($CGIPATH)-$i); my $StatistikDatei = $ROOTPATH."security/statistik.txt"; my $DBDatei = $ROOTPATH."security/urls.csv"; # bzw. mySQL-DB #--------------------------------------------------------------------------------------------------------- my %CGI_Input = (); #--------------------------------------------------------------------------------------------------------- # DB-Felder #--------------------------------------------------------------------------------------------------------- my $urlid = ""; my $userid = ""; my $html = ""; my $wml = ""; my $sprachecontent = ""; my $schluesselworte = ""; my $kategorie = ""; my $top10 = ""; my $bemerkung = ""; my $titel = ""; my $klickrate = ""; my $erstellungsdatum = ""; my $aenderungsdatum = ""; my $zweck = ""; my $land = ""; my $beschreibung = ""; my $device = ""; my $qs_flag = ""; my $zielgruppe = ""; #--------------------------------------------------------------------------------------------------------- # eindimensionale Arrays #--------------------------------------------------------------------------------------------------------- #--------------------------------------------------------------------------------------------------------- # mehrdimensionale Arrays #--------------------------------------------------------------------------------------------------------- #--------------------------------------------------------------------------------------------------------- # Ausgabetexte #--------------------------------------------------------------------------------------------------------- my @c_title1 = ("WubscH","WubscH"); my @c_title2 = ("Suchmodul WAP-Angebote","Search module WAP-Sites"); # HTML-Fenstertitel my @c_title3 = ("Dienste","Services"); my @c_title4 = ("Hilfe","Help"); my @c_title5 = ("Fehler","Error"); my @c_title6 = ("Kategorien","Categories"); my @c_title7 = ("EMail senden","Send an EMail"); my @s_title1 = ("Sprache","Language"); my @s_title2 = ("Ausgabe","Output"); my @s_title3 = ("Sortierung","Sorting"); my @s_title4 = ("Angebotssprache","Item language"); my @i_title1 = ("Suchbegriff","Search item"); my @i_title2 = ("Ergebnisse","Results"); my @i_title3 = ("Anzeigen","Show"); my @i_title4 = ("Senden","Send"); my @fehler_text1 = ("Unbekannte Spracheinstellung","Language unknown"); my @fehler_text2 = ("Öffnen der Datenbank ist fehlgeschlagen","Cannot open database"); my @fehler_text3 = ("Unbekannter Suchtyp","Unknown search type"); my @fehler_text4 = ("Unbekannter Anzeigetyp","Unknown output type"); my @fehler_text5 = ("Kann Statistikfile nicht finden","Statistikfile not found"); my @fehler_text6 = ("Unbekanntes Scripting","Scripting unknown"); my @fehler_text7 = ("Unbekanntes WAP-Angebotssprache","Unknown language for WAP-Sites"); my @text2 = ("Suchbegriff","Searchitem"); my @text3 = ("nicht gefunden bei Selektion","not found for selection"); my @text4 = ("Bitte Option Nummernauswahl waehlen","Please choose Use Number option"); my @text5 = ("Suchbegriff Auflistung","Search-text listing"); my @text6 = ("Anzahl Ergebnisse","Number of results"); my @text7 = ("Sprache Suchmodul","Language of searchmodule"); my @text8 = ("Ausgabeformat","Output format"); my @text9 = ("Auflistung nach","Listing"); my @text10 = ("Sprache WAP-Angebot","Language of WAP-Site"); my @text11 = ("für Sprache","for language"); my @text12 = ("An","To"); my @text13 = ("Von","From"); my @text14 = ("Betreff","Subject"); my @text15 = ("Nachricht","Message"); my @href1 = ("Waehlen","Dial"); my @href2 = ("--> Suchen","--> Search"); my @href3 = ("Dienste","Services"); my @href4 = ("Hilfe","Help"); my @href5 = ("--> Weitere Treffer","--> More hits"); my @href6 = ("Kategorien","Categories"); my @href7 = ("Konfiguration","Configuration"); my @href8 = ("Eurotaschenrechner","Euro-Calculator"); my @option11 = ("Deutsch","German"); my @option12 = ("Englisch","English"); my @option21 = ("Link auf ","Link to "); my @option22 = ("-Angebot","-Site"); my @option23 = ("mit Datum","with date"); my @option24 = ("mit Klickrate","with clickrate"); my @option24 = ("Link auf Beschreibung","Link to description"); my @option31 = ("Datum","Date"); my @option32 = ("TOP10","TOP10"); my @option33 = ("A-Z","A-Z"); my @option34 = ("Kategorie","Categorie"); my @option35 = ("Schluesselwort","Keyword"); my @option36 = ("Klickrate","Clickrate"); my @option38 = ("Index","Index"); my @option39 = ("Kategorien","Categories"); my @option41 = ("Jede","Every"); my @option42 = ("Deutsch","German"); my @option43 = ("Englisch","English"); my @label1 = ("Zurück","Back"); #--------------------------------------------------------------------------------------------------------- # Hashes #--------------------------------------------------------------------------------------------------------- my %selected_anzeigetyp; my %selected_suchtyp; my %selected_sprache; my %selected_angebotssprache; my %sorthash; my %anzeigemodul = ("WML"=>"sm2.cgi","HTML"=>"sm.cgi"); ########################################################################################################## if ($scripting eq "HTML") { &httpHeader(); } else { &wtpHeader(); } # open (TEST, "> /tmp/suchen.txt") || die; %CGI_Input = &ParseInput(); &Input_aufbereiten(\%CGI_Input); # Adresse wird übergeben # Spracheinstellung vornehmen if (($CGI_Input{SP} eq "de") || ($CGI_Input{SP} eq "")) { # default $sprache = 0; $sprachetyp = "de"; } elsif ($CGI_Input{SP} eq "en") { $sprache = 1; $sprachetyp = "en"; } else { if ($scripting eq "HTML") { HTML_Fehlermeldung("$c_title5[0]", "$fehler_text1[0]"); # deutsche Meldung } else { WML_Fehlermeldung("$c_title5[0]", "$fehler_text1[0]"); # deutsche Meldung } exit 0; # habe fertig! } if ($scripting eq "HTML") { # Formularauswahl $selected_sprache{$sprachetyp} = "selected"; } else { $selected_sprache{$sprachetyp} = ""; } # Scripting überprüfen if (($scripting ne $CGI_Input{SC}) && ($CGI_Input{SC} ne "")) { if ($scripting eq "HTML") { HTML_Fehlermeldung("$c_title5[0]", "$fehler_text6[$sprache]"); } else { WML_Fehlermeldung("$c_title5[0]", "$fehler_text6[$sprache]"); } exit 0; # habe fertig! } # Scriptspezifika definieren if ($scripting eq "HTML") { $br = "
"; $htmlbr = "
"; $grth = ">"; } else { $br = "
"; $htmlbr = ""; $grth = "/>"; } # Sprache WAP-Angebots if (($CGI_Input{AS} eq "") || ($CGI_Input{AS} eq "*") || ($CGI_Input{AS} eq "de") || ($CGI_Input{AS} eq "en")) { if ($CGI_Input{AS} eq "") { $angebotssprache = "*"; # default } else { $angebotssprache = $CGI_Input{AS}; } if ($scripting eq "HTML") { $selected_angebotssprache{$angebotssprache} = "selected"; # Formularauswahl } else { $selected_angebotssprache{$angebotssprache} = ""; } } else { if ($scripting eq "HTML") { HTML_Fehlermeldung("$c_title5[$sprache]", "$fehler_text7[$sprache]"); } else { WML_Fehlermeldung("$c_title5[$sprache]", "$fehler_text7[$sprache]"); } exit 0; # habe fertig! } # Einstellung des Suchtyps if (($CGI_Input{ST} eq "") || ($CGI_Input{ST} eq "Datum") || ($CGI_Input{ST} eq "TOP10") || ($CGI_Input{ST} eq "A-Z") || ($CGI_Input{ST} eq "Index") || # ($CGI_Input{ST} eq "Klickrate") || ($CGI_Input{ST} eq "sw")) { if ($CGI_Input{ST} eq "") { $suchtyp = "Index"; # default } else { $suchtyp = $CGI_Input{ST}; } if ($scripting eq "HTML") { $selected_suchtyp{$suchtyp} = "selected"; # Formularauswahl } else { $selected_suchtyp{$suchtyp} = ""; } } else { if ($scripting eq "HTML") { HTML_Fehlermeldung("$c_title5[$sprache]", "$fehler_text3[$sprache]"); } else { WML_Fehlermeldung("$c_title5[$sprache]", "$fehler_text3[$sprache]"); } exit 0; # habe fertig! } # Einstellung des Suchbegriffs $suchbegriff = $CGI_Input{SB}; # Einstellung der Kategorie-Nummer $kn = $CGI_Input{KN}; if ($kn eq "") { $kn = "0000"; } $kat_name = db_wrapper::get_kat_info($kn,1); # Einstellung der Ausgabeposition if ($CGI_Input{AB} eq "") { $vonpos = 0; } else { $vonpos = $CGI_Input{AB}; } # Einstellung des Ausgabeformates if (($CGI_Input{AT} eq "") || ($CGI_Input{AT} eq "st") || # ($CGI_Input{AT} eq "Klickrate") || ($CGI_Input{AT} eq "be") || ($CGI_Input{AT} eq "da") ) { if ($CGI_Input{AT} eq "") { $anzeigetyp = "st"; # default } else { $anzeigetyp = $CGI_Input{AT}; } if ($scripting eq "HTML") { $selected_anzeigetyp{$anzeigetyp} = "selected"; # Formularauswahl } else { $selected_anzeigetyp{$anzeigetyp} = ""; } } else { if ($scripting eq "HTML") { HTML_Fehlermeldung("$c_title5[$sprache]", "$fehler_text4[$sprache]"); } else { WML_Fehlermeldung("$c_title5[$sprache]", "$fehler_text4[$sprache]"); } exit 0; # habe fertig! } # Umkopieren von Parametern if ($CGI_Input{ER} ne "") { $maxcount = $CGI_Input{ER}; } # Logging if ($suchbegriff ne "") { toolbox::Logging("I",basename($PROGRAM_NAME,""),"main","SB=$suchbegriff,ER=$maxcount,SP=$sprachetyp,KN=$kn,ST=$suchtyp,AT=$anzeigetyp,AS=$angebotssprache"); } # Statistik öffnen if (!open (STATISTIKFILE, "< $StatistikDatei")) { if ($scripting eq "HTML") { HTML_Fehlermeldung("$c_title5[$sprache]", "$fehler_text5[$sprache]:".$StatistikDatei); } else { WML_Fehlermeldung("$c_title5[$sprache]", "$fehler_text5[$sprache]:".$StatistikDatei); } exit 0; # habe fertig! } $zeile = ; # Statistik ergänzen ??? # Datenbank öffnen if (!open (DBFILE, "< $DBDatei")) { if ($scripting eq "HTML") { HTML_Fehlermeldung("$c_title5[$sprache]", "$fehler_text2[$sprache]"); } else { WML_Fehlermeldung("$c_title5[$sprache]", "$fehler_text2[$sprache]"); } exit 0; # habe fertig! } # Ergebnisliste aufbauen $count = 0; if ($suchtyp eq "Index") { # Auswertung der Kategorien if ($suchbegriff eq "") { # Anfangskategorien ausgeben for ($i=0; $i<=$anz_kat; $i++) { if (db_wrapper::get_kat_info($i,4) eq $kn) { $ausgabe = substr($sterne,0,db_wrapper::get_kat_info($i,3)).db_wrapper::get_kat_info($i,$sprache+1); if (db_wrapper::get_kat_info($i,5) > 0) { # Anzahl anhängen $ausgabe = $ausgabe.":".db_wrapper::get_kat_info($i,5); } $kn_suche = db_wrapper::get_kat_info($i,0); if ($scripting eq "HTML") { # deutschen Suchbegriff angeben $zeile = "$ausgabe\n"; } else { $zeile = "$ausgabe\n"; } $sorthash{$ausgabe} = $zeile; $count++; } } } else { for ($i=0; $i<=$anz_kat; $i++) { if (db_wrapper::get_kat_info($i,$sprache+1) =~ /$suchbegriff/i) { # Suche in der richtigen Sprache $ausgabe = substr($sterne,0,db_wrapper::get_kat_info($i,3)).db_wrapper::get_kat_info($i,$sprache+1); if (db_wrapper::get_kat_info($i,5) > 0) { # Anzahl anhängen $ausgabe = $ausgabe.":".db_wrapper::get_kat_info($i,5); } $kn_suche = db_wrapper::get_kat_info($i,0); if ($scripting eq "HTML") { # deutschen Suchbegriff angeben $zeile = "$ausgabe\n"; } else { $zeile = "$ausgabe\n"; } $sorthash{$ausgabe} = $zeile; $count++; } } } } # Auswertung der DB $zeile = ; # erste Zeile überlesen while ($zeile = ) { ($urlid,$userid,$erstellungsdatum,$aenderungsdatum,$titel,$schluesselworte,$kategorie,$beschreibung,$wml,$html,$zweck,$sprachecontent,$land,$bemerkung,$qs_flag,$top10,$zielgruppe,$klickrate,$device) = split /;/,$zeile; if (($angebotssprache eq "*") || ($sprachecontent =~ /$angebotssprache/i)) { if (($suchtyp eq "TOP10") && ($top10 ne "") && ($top10 >= $suchbegriff)) { # richtige Sortiertupel anlegen #print "$titel,$erstellungsdatum$br"; if (&ErzeugeAusgabe() == 1) { $sorthash{$top10} = $ausgabe; } } elsif (($suchtyp eq "Index") && ($suchbegriff ne "") && (($beschreibung =~ /$suchbegriff/i) || ($titel =~ /$suchbegriff/i) || ($schluesselworte =~ /$suchbegriff/i))) { if (&ErzeugeAusgabe() == 1) { $sorthash{$titel} = $ausgabe; }; } elsif (($suchtyp eq "Index") && ($suchbegriff eq "") && ($kategorie =~ /$kn/i)) { if (&ErzeugeAusgabe() == 1) { $sorthash{$titel} = $ausgabe; } } elsif (($suchtyp eq "A-Z") && (uc($titel) ge uc($suchbegriff))) { if (&ErzeugeAusgabe() == 1) { $sorthash{$titel} = $ausgabe; } } elsif (($suchtyp eq "Datum")) { if (&ErzeugeAusgabe() == 1) { $sorthash{$aenderungsdatum} = $ausgabe; } } elsif (($suchtyp eq "sw") && ($schluesselworte =~ /$suchbegriff/i)) { if (&ErzeugeAusgabe() == 1) { $sorthash{$titel} = $ausgabe; }; # } elsif (($suchtyp eq "Klickrate")) { # if (&ErzeugeAusgabe() == 1) { $sorthash{$klickrate} = $ausgabe; } } } } # Bestimmung des Titels if ($suchtyp eq "Index") { if ($suchbegriff eq "") { $ausgabe = db_wrapper::get_kat_info($kn,$sprache+1); } else { $ausgabe = "Index"; } } elsif ($suchtyp eq "A-Z") { $ausgabe = "A-Z"; } elsif ($suchtyp eq "Datum") { $ausgabe = $option31[$sprache]; } elsif ($suchtyp eq "TOP10") { $ausgabe = "TOP10"; } elsif ($suchtyp eq "sw") { $ausgabe = substr($option35[$sprache],0,4); } if ($vonpos == 0) { $ausgabe = $ausgabe." (".$count.") "; } else { $ausgabe = $ausgabe." (".$vonpos.":".$count.") "; } # Start der Seite if ($scripting eq "HTML") { &HTML_Start($c_title2[$sprache]); print "\n"; print "

"; print ""; print "

$ausgabe
"; } else { &WML_Start; print "\n"; print "\n"; print "

"; } # Anzeige Ergebnis if ($count eq 0) { # keine Treffer print "$text2[$sprache] \"$suchbegriff\" $text3[$sprache] $suchtyp $text11[$sprache] $angebotssprache\n"; } else { # mind. ein Treffer # Sortierung über hash, Problem bei gleichen Schlüsselwerten ??? # foreach $i (sort { $sorthash{$b} cmp $sorthash{$a} } keys %sorthash) { $ausgabecount = 0; if ($suchtyp eq "Datum") { # neuestes Datum zuerst foreach $i (sort { $b cmp $a } keys %sorthash) { if ($ausgabecount == $vonpos) { # erstes
weglassen print $sorthash{$i}; } else { if (($vonpos < $ausgabecount) && ($ausgabecount < $vonpos+$maxcount)) { print $br.$sorthash{$i}; } } $ausgabecount++; } } else { # normale Sortierung über Schlüssel foreach $i (sort { uc($a) cmp uc($b) } keys %sorthash) { # Groß/Kleinschreibung ignorieren if ($ausgabecount == $vonpos) { # erstes
weglassen print $sorthash{$i}; } else { if (($vonpos < $ausgabecount) && ($ausgabecount < $vonpos+$maxcount)) { print $br.$sorthash{$i}; } } $ausgabecount++; } } if ($vonpos+$maxcount < $count) { # zu viele Treffer $vonpos = $vonpos+$maxcount; # weiterschalten if ($scripting eq "HTML") { print "

\n"; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print "\n"; print "
\n"; } else { $aufruf = "$anzeigemodul{$scripting}?SB=$suchbegriff&AB=$vonpos&ER=$maxcount&SP=$sprachetyp&AT=$anzeigetyp&ST=$suchtyp&AS=$angebotssprache&KN=$kn"; print "$br$href5[$sprache]$br\n"; # weitere Treffer anzeigen } } } if ($scripting eq "HTML") { print "
\n"; print "
Suchoptionen
\n"; print ""; } else { # weitere Card ausgeben print "$brSuchoptionen\n"; print "$br© 2002, WubscH

\n"; print "\n"; print "\n"; print " \n"; print "\n"; print "

\n"; } # Suchbegriff Auflistung print "$text5[$sprache]\n"; if ($scripting eq "HTML") { print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; # print "\n"; print "\n"; # Anzahl Ergebnisse print "$htmlbr$text6[$sprache]\n"; if ($scripting eq "HTML") { print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; # Sprache Suchmodul print "$htmlbr$text7[$sprache]\n"; print "\n"; # Ausgabeformat print "$htmlbr$text8[$sprache]\n"; print "\n"; # Submit if ($scripting eq "HTML") { print "$br\n"; } else { } if ($scripting eq "HTML") { print "

\n"; } if ($scripting eq "HTML") { print "
"; print "(C) 2002, WubscH\n"; } print "

\n"; if ($scripting eq "WML") { print "\n"; } if ($scripting eq "HTML") { &HTML_Abschluss(); } else { &WML_Abschluss(); } close (DBFILE); close (STATISTIKFILE); # close (TEST); exit 0; # habe fertig! #-------------------------------------------------------------------------------------------------------- #-- #-- Eingabe analysieren #-- #-------------------------------------------------------------------------------------------------------- sub ParseInput { my $in; # print TEST "ParseInput: "; if ($ENV{'REQUEST_METHOD'} eq "GET") { $in = $ENV{'QUERY_STRING'}; } elsif ($ENV{'REQUEST_METHOD'} eq "POST") { read(STDIN,$in,$ENV{'CONTENT_LENGTH'}); } # print TEST "$in\n"; $in =~ s/required(.*?)={1}/$1=/g; # print TEST "Input: "; # print TEST "$in\n"; return URLEncoding::parse_cgi($in); } #-------------------------------------------------------------------------------------------------------- #-- #-- CGI_Input aufbereiten #-- #-------------------------------------------------------------------------------------------------------- sub Input_aufbereiten { my ($input) = @_; my $key; foreach $key (keys %$input) { $$input{$key} =~ s/\0/,/g; # maskierte '\0' in ',' aendern } } #-------------------------------------------------------------------------------------------------------- #-- Sortierfunktionen #-------------------------------------------------------------------------------------------------------- sub sort_strings {$a cmp $b;} # Sortierung von Strings mit Beachtung der Groß/Kleinschreibung sub sort_lc_strings {lc($a) cmp lc($b);} # Sortierung von Strings ohne Beachtung der Groß/Kleinschreibung sub sort_numbers {$a <=> $b;} # Sortierung von Zahlen #-------------------------------------------------------------------------------------------------------- #-- ErzeugeAusgabe #-------------------------------------------------------------------------------------------------------- sub ErzeugeAusgabe { my $outputflag = 1; # bei fehlerhafter Ausgabe auf 0 setzen my $date; my $verweis; my $titel_conv; if (($qs_flag ne "ok") && ($qs_flag ne "nein")) { # auf QS hinweisen $titel = $titel."#"; } if ($scripting eq "HTML") { if ($html ne "") { $verweis = $html.'" target="WAP-Angebot" class="nav'; if ($anzeigetyp eq "st") { $ausgabe = "$titel\n"; } elsif ($anzeigetyp eq "be") { if ($beschreibung ne "") { $ausgabe = "$titel\n"; } else { $ausgabe = ""."$titel"."\n"; } } elsif ($anzeigetyp eq "da") { $date = substr($aenderungsdatum,0,10); $ausgabe = "$titel:$date\n"; } elsif ($anzeigetyp eq "Klickrate") { if ($klickrate eq "") { $ausgabe = "$titel:- Clicks\n"; } else { $ausgabe = "$titel:$klickrate Clicks\n"; } } } else { # keine HTML-Verweis $verweis = ''.$titel.''; if ($anzeigetyp eq "st") { $ausgabe = "$verweis\n"; } elsif ($anzeigetyp eq "be") { if ($beschreibung ne "") { $ausgabe = "$verweis\n"; } else { $ausgabe = ""."$titel"."\n"; } } elsif ($anzeigetyp eq "da") { $date = substr($aenderungsdatum,0,10); $ausgabe = "$titel:$date\n"; } elsif ($anzeigetyp eq "Klickrate") { if ($klickrate eq "") { $ausgabe = "$titel:- Clicks\n"; } else { $ausgabe = "$titel:$klickrate Clicks\n"; } } } } else { # WML-Ausgabe $titel_conv = $titel; if ($titel_conv =~ /[@"<>äüöÄÜÖß&]/) { # Sonderzeichen konvertieren $titel_conv =~ s/&/&/g; $titel_conv =~ s/"/"/g; $titel_conv =~ s//>/g; $titel_conv =~ s/@/@/g; $titel_conv =~ s/Ö/Ö/g; $titel_conv =~ s/Ü/Ü/g; $titel_conv =~ s/Ä/Ä/g; $titel_conv =~ s/ö/ö/g; $titel_conv =~ s/ü/ü/g; $titel_conv =~ s/ä/ä/g; $titel_conv =~ s/ß/ß/g; } $verweis = $wml; $verweis =~ s/&/&/g; if ($wml ne "") { if ($anzeigetyp eq "st") { $ausgabe = "$titel_conv\n"; } elsif ($anzeigetyp eq "be") { if ($beschreibung ne "") { $ausgabe = "$titel_conv\n"; # Worauf in WML verweisen ??? } else { $ausgabe = "$titel_conv\n"; } } elsif ($anzeigetyp eq "da") { $date = substr($aenderungsdatum,0,10); $ausgabe = "$titel_conv:$date\n"; } elsif ($anzeigetyp eq "Klickrate") { if ($klickrate eq "") { $ausgabe = "$titel_conv:- Clicks\n"; } else { $ausgabe = "$titel_conv:$klickrate Clicks\n"; } } } else { # dieser Fall dürfte nie auftreten $ausgabe = "$titel_conv\n"; } } $count++; return $outputflag; } #-------------------------------------------------------------------------------------------------------- #-- http-Header #-------------------------------------------------------------------------------------------------------- sub httpHeader { print "Pragma: no-cache\n"; print "Expires: now\n"; print "Content-type: text/html\n\n"; } #-------------------------------------------------------------------------------------------------------- #-- wtp-Header #-------------------------------------------------------------------------------------------------------- sub wtpHeader { print "Pragma: no-cache\n"; print "Expires: now\n"; print "Content-type: text/vnd.wap.wml\n\n"; } #-------------------------------------------------------------------------------------------------------- #-- HTML-Start #-------------------------------------------------------------------------------------------------------- sub HTML_Start { my ($title) = @_; print "\n"; print "\n"; print "$title\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\"\"\n"; } #-------------------------------------------------------------------------------------------------------- #-- HTML-Abschluss #-------------------------------------------------------------------------------------------------------- sub HTML_Abschluss { print "\n"; print "\n"; } #-------------------------------------------------------------------------------------------------------- #-- WML-Start #-------------------------------------------------------------------------------------------------------- sub WML_Start { print "\n"; print "\n"; print "\n"; } #-------------------------------------------------------------------------------------------------------- #-- WML-Abschluss #-------------------------------------------------------------------------------------------------------- sub WML_Abschluss { print "\n"; } #-------------------------------------------------------------------------------------------------------- #-- HTML-Fehlermeldung #-------------------------------------------------------------------------------------------------------- sub HTML_Fehlermeldung { my ($titel, $meldung) = @_; &HTML_Start($titel); print "$meldung\n"; &HTML_Abschluss(); } #-------------------------------------------------------------------------------------------------------- #-- WML-Fehlermeldung #-------------------------------------------------------------------------------------------------------- sub WML_Fehlermeldung { my ($titel, $meldung) = @_; &WML_Start; print "\n"; print "

\n"; print "$meldung\n"; print "

\n"; print "
\n"; &WML_Abschluss(); }