#!/usr/bin/perl -T use warnings; use diagnostics; use strict; use CGI; use CGI qw(:standard escapeHTML); use CGI::Carp qw(carpout fatalsToBrowser warningsToBrowser); open (LOG, ">>./admin/errorlog.txt") && carpout(*LOG); print "P3P: CP=\"NOI ADM DEV PSAi COM NAV OUR OTR STP IND DEM\"\n"; print "Expires: Wed, 11 Nov 1998 11:11:11 GMT\n"; my $requestmethod = $ENV{'REQUEST_METHOD'} if (defined $ENV{'REQUEST_METHOD'}); my $useragent = $ENV{'HTTP_USER_AGENT'} if (defined $ENV{'HTTP_USER_AGENT'}); our ($dbpfad, $cgipfad, $httppfad); require "./admin/pfade.txt"; our ($tag, $mday, $monat, $mon, $hour, $min, $sec, $year, $wday, $yday, $isdst); datum_zeit(); our ($modus, $kurzwahl, $keywords, $subkeyword, $preis, $lebensdauer, $smsueberleitung, $smspose, $smsmp3, $autosperre); require "$dbpfad/db/smseinstellungen.db"; our ($begruessung, $begruessungsekunden, $begruessungmp3, $begruessungpose, $begruessung2, $begruessung2sekunden, $begruessungmp32, $begruessung2pose, $begruessung3, $begruessung3sekunden, $begruessungmp33, $begruessung3pose, $namefrage, $namefragesekunden, $namefragemp3, $namefragepose, $vorstellung, $vorstellungsekunden, $vorstellungmp3, $vorstellungpose, $keininfo, $keintipp, $keintippsekunden, $keintippmp3, $keintipppose, $keintippurl, $keintipptarget, $keintippurlsekunden); require "$dbpfad/db/grundeinstellungen.db"; our $input; my $userstatus = ""; $userstatus=escapeHTML(cookie("xuserstatus")) if (defined cookie("xuserstatus")); $userstatus=~s/[^a-z]//g; if (((defined $requestmethod) && ($requestmethod ne "GET")) || (!defined $useragent)) { print "Content-Type: text/plain; charset=ISO-8859-1\r\n\r\n"; exit(); } else { if (defined param("ssl")) { $cgipfad=~s/http\:/https\:/i; $httppfad=~s/http\:/https\:/i; } if (defined param("input")) { $input = param("input"); $input =~ s///g; $input =~ s/<.*?>//g; $input =~ s/[\<\>\n\r\t\f\|\0\;\`\^\$\{\}\[\]\~\#\"\\]/ /g; $input =~ s/^\s+//; $input =~ s/\s+$//; $input = escapeHTML("$input"); if (!$input) { print "Content-Type: text/plain; charset=ISO-8859-1\r\n\r\n"; exit(); } else { checkbeleidigung(); } } elsif (defined param("leerlauf")) { leerlauf(); } elsif (defined param("mute")) { mute(); } elsif (defined param("klopfen")) { my $text=""; my $animation="klopfen.swf"; output ($text, $animation); } elsif (defined param("tipp")) { name(); } elsif (defined param("begruessung")) { begruessung(); } else { gui(); } } sub gui { my $scname = "spezialgruppe"; my $spezial = ""; $spezial = escapeHTML(param("spezial")) if (defined param("spezial")); $spezial=~s/[^0-9]//g; my $scinhalt="$spezial"; setcookie($scname, $scinhalt); my $format=0; if (defined param("format")) { $format=escapeHTML(param("format")); if ((param("format") ne "admin") && (param("format") ne "gadget")) { $format=~s/[^0-9]//g; } } $format=1 if (!$format); open (FORMATE, "<$dbpfad/db/formate.db"); flock(FORMATE, 1); my @formate = ; close (FORMATE); my ($height, $width, $bgcolor, $fvars); foreach my $formatline (@formate) { my @formatdata=split(/\|/, $formatline); if ($formatdata[0] eq $format) { $width=$formatdata[2]; $height=$formatdata[3]; $bgcolor=$formatdata[14]; $fvars="frageworttxt=$formatdata[4]&fragewortfarbe=$formatdata[5]&buttonfarbe=$formatdata[6]&buttontextfarbe=$formatdata[7]&textsize=$formatdata[8]&textfarbe=$formatdata[9]&linkfarbe=$formatdata[10]&textrahmenfarbe=$formatdata[11]&texthintergrundfarbe=$formatdata[12]&hintergrundbild=$formatdata[13]&avatarposx=$formatdata[15]&avatarposy=$formatdata[16]&antwortposx=$formatdata[17]&antwortposy=$formatdata[18]&antwortbreite=$formatdata[19]&antworthoehe=$formatdata[20]&io=$formatdata[21]&frageposx=$formatdata[22]&frageposy=$formatdata[23]&fragebreite=$formatdata[24]"; } } my $smsmodus="$modus"; $smsmodus="off" if ((!$kurzwahl) || (!$keywords) || (!$subkeyword) || (!$preis)); my $flashpfad.="$httppfad/Xandra.swf?smsmodus=$smsmodus"; $flashpfad.="&spezial=$spezial" if ($spezial); if (defined param("sid")) { my $sid = escapeHTML(param("sid")); $sid=~s/[^a-zA-Z0-9]//g; my $scname="sid"; my $scinhalt="$sid"; setcookie($scname, $scinhalt); $flashpfad.="&sid=$sid"; } my $anzahlbeleidugungen = ""; $anzahlbeleidugungen=escapeHTML(cookie("xandrabeleidigungen")) if (defined cookie("xandrabeleidigungen")); $anzahlbeleidugungen=~s/[^0-9]//; if (($anzahlbeleidugungen) && ($anzahlbeleidugungen > 2)) { $flashpfad.="&beleidigung=1"; } if ((defined param("menu")) && (param("menu") eq "off")) { $flashpfad.="&menu=off"; } elsif ((defined param("cr")) && (param("cr") eq "off")) { $flashpfad.="&cr=off"; } else { open (PID, "<$dbpfad/db/pid.db"); my $pid=; close (PID); $pid="demo" if (!$pid); $flashpfad.="&cr=on&pid=$pid"; } opendir(DIRHANDLE, "$dbpfad/animationen/leerlauf"); my @allfiles = readdir(DIRHANDLE); closedir DIRHANDLE; my $bruegge=0; foreach my $file (@allfiles) { chomp($file); if ($file=~/bruecke.swf/i) { $flashpfad.="&bruecke=1"; } } $flashpfad.="&baseurl=$cgipfad/&httpurl=$httppfad/&$fvars"; print "Content-Type: text/html; charset=ISO-8859-1\r\n\r\n"; cr(); print "\n", "document.write('", "", "", "", "", "", "", "", "", "", "", "')\n"; exit(); } sub begruessung { if (!$userstatus) { my $scname="xuserstatus"; my $scinhalt="zaehlen"; my $scdauer="90"; setcookie($scname, $scinhalt, $scdauer); } elsif ($userstatus eq "zaehlen") { open (US, "<$dbpfad/db/userstats.db"); flock(US, 1); my $xuser = ; close(US); if ($xuser) { $xuser=$xuser+1; open (US, ">$dbpfad/db/userstats.db"); flock(US, 2); print US "$xuser"; close(US); } my $scname="xuserstatus"; my $scinhalt="gezaehlt"; my $scdauer="90"; setcookie($scname, $scinhalt, $scdauer); } elsif ($userstatus eq "gezaehlt") { open (AS, "<$dbpfad/db/aufrufestats.db"); flock(AS, 1); my $xaufrufe = ; close(AS); if ($xaufrufe) { $xaufrufe=$xaufrufe+1; open (AS, ">$dbpfad/db/aufrufestats.db"); flock(AS, 2); print AS "$xaufrufe"; close(AS); } } my $lastmeeting=""; $lastmeeting=escapeHTML(cookie("xandrameeting")) if (defined cookie("xandrameeting")); $lastmeeting=~s/[^0-9]//g; my $scname="xandrameeting"; my $scinhalt="$^T"; my $scdauer="90"; setcookie($scname, $scinhalt, $scdauer); my ($gruppenpose, $gruppenurl, $gruppentarget, $gruppenbegruessung, $gruppensekunden, $gruppenmp3); if (defined param("spezial")) { my $spezial=param("spezial"); $spezial=~s/[^0-9]//gi; open (GRUPPEN, "<$dbpfad/db/gruppen.db"); flock(GRUPPEN, 1); my @gruppenlines = ; close(GRUPPEN); foreach my $line (@gruppenlines) { chomp($line); my @gruppe=split(/\|/, $line); if (($gruppe[0] eq $spezial) && ($gruppe[2]) && ($gruppe[7])) { $gruppenpose="$gruppe[2]" if ($gruppe[2]); $gruppenurl="$gruppe[3]" if ($gruppe[3]); $gruppentarget="$gruppe[4]" if ($gruppe[4]); $gruppenbegruessung="$gruppe[7]" if ($gruppe[7]); $gruppensekunden="$gruppe[8]" if ($gruppe[8]); $gruppenmp3="$gruppe[9]" if ($gruppe[9]); last; } } } else { my $spezial=""; } my $sid; if (defined param("sid")) { $sid=param("sid"); $sid=~s/[^a-zA-Z0-9]//g; $sid=~s/undefined//gi; } else { $sid=""; } $scname="sid"; $scinhalt="$sid"; setcookie($scname, $scinhalt); if ($gruppenbegruessung) { my $text="$gruppenbegruessung" if ($gruppenbegruessung); my $sekunden="$gruppensekunden" if ($gruppensekunden); my $mp3="$gruppenmp3" if ($gruppenmp3); my ($animation, $url, $target, $urlsekunden); if ($gruppenpose) { $animation="$gruppenpose.swf"; } else { $animation="winken.swf"; } if ($gruppenurl) { $url="$gruppenurl"; $target="$gruppentarget" if ($gruppentarget); $urlsekunden="auto"; } output ($text, $animation, $sekunden, $mp3, $url, $target, $urlsekunden); } else { our ($text, $sekunden, $mp3, $animation, $url, $target, $urlsekunden); if (($lastmeeting) && ($lastmeeting > $^T-3600)) { name(); } elsif (($lastmeeting) && ($lastmeeting > $^T-172800)) { $text="$begruessung2"; $sekunden="$begruessung2sekunden"; $mp3="$begruessungmp32"; if ($begruessung2pose) { $animation="$begruessung2pose.swf"; } else { $animation="zustimmend.swf"; } output ($text, $animation, $sekunden, $mp3); } elsif (($lastmeeting) && ($lastmeeting < $^T-172800)) { $text="$begruessung3"; $sekunden="$begruessung3sekunden"; $mp3="$begruessungmp33"; if ($begruessung3pose) { $animation="$begruessung3pose.swf"; } else { $animation="winken.swf"; } output ($text, $animation, $sekunden, $mp3); } else { $text="$begruessung"; $sekunden="$begruessungsekunden" if ($begruessungsekunden); $mp3="$begruessungmp3" if ($begruessungmp3); if ($begruessungpose) { $animation="$begruessungpose.swf"; } else { $animation="winken.swf"; } output ($text, $animation, $sekunden, $mp3); } } } sub checkbeleidigung { our ($beleidigung, $treffer, $beleidigungsmodus, $beleidigungstext1, $beleidigungsekunden1, $beleidigungmp31, $beleidigungpose1, $beleidigungstext2, $beleidigungsekunden2, $beleidigungmp32, $beleidigungpose2, $beleidigungstext3, $beleidigungsekunden3, $beleidigungmp33, $beleidigungpose3, $beleidigungurl3, $beleidigungtarget3, $beleidigungurlsekunden3); my $anzahlbeleidugungen=0; $anzahlbeleidugungen=escapeHTML(cookie("xandrabeleidigungen")) if (defined cookie("xandrabeleidigungen")); $anzahlbeleidugungen=~s/[^0-9]//; require "$dbpfad/db/beleidigt.db"; if ($beleidigungsmodus ne "off") { if (($anzahlbeleidugungen) && ($anzahlbeleidugungen > 2)) { print "Content-Type: text/html; charset=ISO-8859-1\r\n\r\n"; print "animation=
&outtxt=&beleidigung=1&sekunden=1"; } else { $treffer=0; open (BELEIDIGUNGEN, "<$dbpfad/db/beleidigungen.db"); flock(BELEIDIGUNGEN, 1); my @beleidigungen = ; close(BELEIDIGUNGEN); foreach my $beleidigungentest (@beleidigungen) { chomp($beleidigungentest); if ($input =~/$beleidigungentest/i) { $treffer=$treffer+1; $beleidigung="$beleidigungentest"; last; } } use locale; $beleidigung="\u$beleidigung"; if ($treffer > 0) { $anzahlbeleidugungen=$anzahlbeleidugungen+1; my $scname="xandrabeleidigungen"; my $scinhalt="$anzahlbeleidugungen"; setcookie($scname, $scinhalt); if ($anzahlbeleidugungen > 3) { print "Content-Type: text/html; charset=ISO-8859-1\r\n\r\n"; print "animation=&output=&beleidigung=1"; } elsif ($anzahlbeleidugungen == 3) { my $text="$beleidigungstext3"; if ($text=~/:INPUT:/) { $text=~s/:INPUT:/$beleidigung/gi; } my $sekunden=""; $sekunden="$beleidigungsekunden3" if ($beleidigungsekunden3); my $mp3=""; $mp3="$beleidigungmp33" if ($beleidigungmp33); my $animation=""; if ($beleidigungpose3) { $animation="$beleidigungpose3.swf"; } else { $animation="abweisend.swf"; } my $url=""; $url="$beleidigungurl3" if ($beleidigungurl3); my $target=""; $target="$beleidigungtarget3" if (($beleidigungurl3) && ($beleidigungtarget3)); my $urlsekunden=""; $urlsekunden="$beleidigungurlsekunden3" if (($beleidigungurl3) && ($beleidigungurlsekunden3)); output ($text, $animation, $sekunden, $mp3, $url, $target, $urlsekunden); } elsif ($anzahlbeleidugungen == 2) { my $text="$beleidigungstext2"; if ($text=~/:INPUT:/) { $text=~s/:INPUT:/$beleidigung/gi; } my $sekunden=""; $sekunden="$beleidigungsekunden2" if ($beleidigungsekunden2); my $mp3=""; $mp3="$beleidigungmp32" if ($beleidigungmp32); my $animation=""; if ($beleidigungpose2) { $animation="$beleidigungpose2.swf"; } else { $animation="verneinend.swf"; } output ($text, $animation, $sekunden, $mp3); } elsif ($anzahlbeleidugungen == 1) { my $text="$beleidigungstext1"; if ($text=~/:INPUT:/) { $text=~s/:INPUT:/$beleidigung/gi; } my $sekunden=""; $sekunden="$beleidigungsekunden1" if ($beleidigungsekunden1); my $mp3=""; $mp3="$beleidigungmp31" if ($beleidigungmp31); my $animation=""; if ($beleidigungpose1) { $animation="$beleidigungpose1.swf"; } else { $animation="aufgepasst.swf"; } output ($text, $animation, $sekunden, $mp3); } } elsif (($treffer > 0) && ($beleidigungsmodus eq "ignorieren")) { tippplugins(); } elsif ($anzahlbeleidugungen < 3) { preplugins(); } } } else { preplugins(); } } sub preplugins { open (PRE, "<$dbpfad/db/pre_plugins.db"); flock(PRE, 1); my @prelines =
;
	close(PRE);

	if (@prelines > 0)
		{
		require LWP::UserAgent;

		my $sid = "";
		$sid = escapeHTML(param("sid")) if (defined param("sid"));
		$sid =~s/[^a-zA-Z0-9]//g;

		my $spezial = "";
		$spezial = escapeHTML(param("spezial")) if (defined param("spezial"));
		$spezial =~s/[^0-9]//g;

		my $text="";
		my $animation="";
		my $sekunden="";
		my $mp3="";
		my $url="";
		my $target="";
		my $urlsekunden="";
		my $scname="";
		my $scinhalt="";
		my $scdauer="";

		my $domain=$ENV{'HTTP_HOST'};
		$domain=~s/www.//gi;

		my $preplugincount=0;

		foreach my $preline (@prelines)
			{
			if ($preplugincount < 1)
				{
				chomp($preline);

				my ($plugin, $pluginname)=split(/\|/, $preline);

				my @pluginurl=split(/\//, $plugin, 4);
				my $pluginadresse="$pluginurl[2]";
				$pluginadresse=~s/www.//gi;

				if ($pluginadresse eq $domain)
					{
					my$ua = new LWP::UserAgent;

					$ua->timeout(5);
					$ua->agent('Xandra');
					my $req = new HTTP::Request GET => "$plugin?input=$input&sid=$sid&spezial=$spezial";
					my $res = $ua->request($req);

					my @echo=split(/\n/, $res->content);

					foreach my $zeile (@echo)
						{
						my ($var, $val)=split(/\|/, $zeile);

						$text="$val" if (($var eq "text") && (defined $val));
						$animation="$val" if (($var eq "animation") && (defined $val));
						$sekunden="$val" if (($var eq "sekunden") && (defined $val));
						$mp3="$val" if (($var eq "mp3") && (defined $val));
						$url="$val" if (($var eq "url") && (defined $val));
						$target="$val" if (($var eq "target") && (defined $val));
						$urlsekunden="$val" if (($var eq "urlsekunden") && (defined $val));
						$scname="$val" if (($var eq "scname") && (defined $val));
						$scinhalt="$val" if (($var eq "scinhalt") && (defined $val));
						$scdauer="$val" if (($var eq "scdauer") && (defined $val));
						}

					if (($text) && ($animation))
						{
						$preplugincount=$preplugincount+1;
						}
					}
				else
					{
					last;
					}
				}
			}

		if (($text) && ($animation))
			{
			if (($scname) && ($scinhalt))
				{
				setcookie($scname, $scinhalt, $scdauer);
				}

			open (POSITIV, ">>$dbpfad/db/positiv.db");
			flock(POSITIV, 2);
			print POSITIV "$^T|$mday.$mon. $hour:$min|$input|extern|$ENV{'REMOTE_ADDR'}|$text|1000|\n";
			close(POSITIV);

			if ($userstatus eq "gezaehlt")
				{
				open (PS, "<$dbpfad/db/positivstats.db");
				flock(PS, 1);
				my $positivstats=;
				close(PS);

				if ($positivstats)
					{
					$positivstats=$positivstats+1;
					open (PS, ">$dbpfad/db/positivstats.db");
					flock(PS, 2);
					print PS "$positivstats";
					close(PS);
					}
				}

			output ($text, $animation, $sekunden, $mp3, $url, $target, $urlsekunden);
			}
		else
			{
			checkname();
			}
		}
	else
		{
		checkname();
		}
	}
sub rechnen
	{
	my $rechinput="$input";
	$rechinput=~s/pi/3.14159265/gi;
	$rechinput=~s/,/./gi;
	$rechinput=~s/[^0-9\+\-\*\/\(\)\.]//gi;
	$rechinput=~s/^[^0-9\(\)\-]//;
	$rechinput=~s/[^0-9\(\)]$//;

	my $treffer=0;

	if (($rechinput=~/[\+\*\/\-]/) && ($rechinput=~/[0-9]/))
		{
		if($rechinput =~ /([0-9\+\*\/\-\(\)\.]+)/)
			{
			$rechinput = $1;
			my $ergebnis = eval($rechinput);

			my $text="$rechinput=$ergebnis";
			my @zAni=("zeigend.swf", "praesentieren.swf");
			my $anzahl=@zAni;
			my $zufall=int(rand($anzahl));
			my $animation="$zAni[$zufall]";
			my $sekunden=15;

			open (POSITIV, ">>$dbpfad/db/positiv.db");
			flock(POSITIV, 2);
			print POSITIV "$^T|$mday.$mon. $hour:$min|$rechinput|extern|$ENV{'REMOTE_ADDR'}|$text|100|\n";
			close(POSITIV);

			if ($userstatus eq "gezaehlt")
				{
				open (PS, "<$dbpfad/db/positivstats.db");
				flock(PS, 1);
				my $positivstats=;
				close(PS);

				if ($positivstats)
					{
					$positivstats=$positivstats+1;
					open (PS, ">$dbpfad/db/positivstats.db");
					flock(PS, 2);
					print PS "$positivstats";
					close(PS);
					}
				}
			output ($text, $animation, $sekunden);

			$treffer=$treffer+1;
			}
		}
	if ($treffer < 1)
		{
		main();
		}
	}
sub checkname
	{
	open (NAMEN, "<$dbpfad/db/namen.db");
	flock(NAMEN, 1);
	my @namensliste=;
	close(NAMEN);

	my $treffer=0;
	my $jobinput="$input";
	$jobinput=~s/[^A-Za-z闹茕鳇遌/ /gi;

	if (($jobinput !~/nicht/i) && (($jobinput=~/nenn mich/i) || ($jobinput=~/bin ich/i) || ($jobinput=~/hei遝 ich/i) || ($jobinput=~/heisse ich/i) || ($jobinput=~/heise ich/i) || ($jobinput=~/mein name/i) || ($jobinput=~/ich bin/i) || ($jobinput=~/ich heisse/i) || ($jobinput=~/ich hei遝/i) || ($jobinput=~/ich heise/i) || ($jobinput=~/mein name/i)))
		{
		my (@nameSchluessel);

		my @suchText = split(/\x20/, $jobinput);

		foreach my $test (@suchText)
			{
			chomp($test);
			$test=~tr/[A-Z周腯/[a-z鳇鋆/;

			if (($test=~/\S{2,}/) && ($test ne "das") && ($test ne "bin") && ($test ne "ich") && ($test ne "heisse") && ($test ne "hei遝") && ($test ne "mein") && ($test ne "name") && ($test ne "ist"))
				{
				push @nameSchluessel, $test;
				}
			}

		foreach my $name (@namensliste)
			{
			chomp($name);
			$name=~s/^\s//i;
			$name=~s/\s$//i;

			my $matchname=$name;
			$matchname=~tr/[A-Z周腯/[a-z鳇鋆/;

			foreach my $nametest (@nameSchluessel)
				{
				chomp($nametest);

				if ($matchname eq $nametest)
					{
					my $scname="xandraname";
					my $scinhalt="$name";
					my $scdauer="90";
					setcookie($scname, $scinhalt, $scdauer);

					my $text="$vorstellung";
					$text=~s/:NAME:/$name/gi;
					my $sekunden=$vorstellungsekunden;
					my $mp3=$vorstellungmp3;
					my $animation="";

					if ($vorstellungpose)
						{
						$animation="$vorstellungpose.swf";
						}
					else
						{
						my @zAni=("zustimmend.swf", "gruss.swf", "winken.swf", "tipp.swf");
						my $anzahl=@zAni;
						my $zufall=int(rand($anzahl));
						$animation="$zAni[$zufall]";
						}

					open (POSITIV, ">>$dbpfad/db/positiv.db");
					flock(POSITIV, 2);
					print POSITIV "$^T|$mday.$mon. $hour:$min|$input|extern|$ENV{'REMOTE_ADDR'}|$text|100|\n";
					close(POSITIV);

					if ($userstatus eq "gezaehlt")
						{
						open (PS, "<$dbpfad/db/positivstats.db");
						flock(PS, 1);
						my $positivstats=;
						close(PS);

						if ($positivstats)
							{
							$positivstats=$positivstats+1;
							open (PS, ">$dbpfad/db/positivstats.db");
							flock(PS, 2);
							print PS "$positivstats";
							close(PS);
							}
						}

					output ($text, $animation, $sekunden, $mp3);

					$treffer++;

					last;
					}
				}
			}
		}
	else
		{
		my $fragenachnamen = "0";
		$fragenachnamen=escapeHTML(cookie("xandranamefrage")) if (defined cookie("xandranamefrage"));
		$fragenachnamen=~s/[^0-9]//g;

		if ($fragenachnamen > $^T - 60)
			{
			foreach my $name (@namensliste)
				{
				chomp($name);
				$name=~s/^\s//i;
				$name=~s/\s$//i;

				my $matchname=$name;
				$matchname=~tr/[A-Z周腯/[a-z鳇鋆/;

				$jobinput=~tr/[A-Z周腯/[a-z鳇鋆/;

				if ($jobinput eq $matchname)
					{
					my $scname="xandraname";
					my $scinhalt="$name";
					my $scdauer="90";
					setcookie($scname, $scinhalt, $scdauer);

					my $text="$vorstellung";
					my @zAni=("zustimmend.swf", "gruss.swf", "winken.swf", "tipp.swf");
					my $anzahl=@zAni;
					my $zufall=int(rand($anzahl));
					my $animation="$zAni[$zufall]";
					my $sekunden=$vorstellungsekunden;
					my $mp3=$vorstellungmp3;

					$text=~s/:NAME:/$name/gi;

					open (POSITIV, ">>$dbpfad/db/positiv.db");
					flock(POSITIV, 2);
					print POSITIV "$^T|$mday.$mon. $hour:$min|$input|extern|$ENV{'REMOTE_ADDR'}|$text|100|\n";
					close(POSITIV);

					if ($userstatus eq "gezaehlt")
						{
						open (PS, "<$dbpfad/db/positivstats.db");
						flock(PS, 1);
						my $positivstats=;
						close(PS);

						if ($positivstats)
							{
							$positivstats=$positivstats+1;
							open (PS, ">$dbpfad/db/positivstats.db");
							flock(PS, 2);
							print PS "$positivstats";
							close(PS);
							}
						}

					output ($text, $animation, $sekunden, $mp3);

					$treffer++;
					last;
					}
				}
			}
		}

	if ($treffer < 1)
		{
		if (($input=~/[0-9]/) && (($input=~/\+/) || ($input=~/\-/) || ($input=~/\*/) || ($input=~/\//)))
			{
			rechnen();
			}
		else
			{
			main();
			}
		}
	}
sub main
	{
	$input=~s/\(/%%ka%%/gi;
	$input=~s/\)/%%kz%%/gi;

	open (KEYWORDS, "<$dbpfad/db/keywords.db");
	flock(KEYWORDS, 1);
	my @keywordlines = ;
	close(KEYWORDS);

	open (GRUPPEN, "<$dbpfad/db/gruppen.db");
	flock(GRUPPEN, 1);
	my @gruppenlines = ;
	close(GRUPPEN);

	my $spezial="";
	$spezial=escapeHTML(param("spezial")) if (defined param("spezial"));
	$spezial=~s/[^0-9]//g;

	my $treffer=0;
	my $zeile=0;

	my @tmp;

	foreach my $line (@keywordlines)
		{
		$zeile=$zeile+1;
		chomp($line);

		my @keywords=split(/\|/, $line);

		if (($keywords[7] ne 2) && (((defined $spezial) && ($spezial eq $keywords[7])) || ((!$spezial) && (!$keywords[8])) || (!$keywords[8])))
			{
			my $w=0;

			my @words=split(/,/, $keywords[1]);

			foreach my $test (@words)
				{
				$w=$w+1;

				chomp($test);
				$test=~s/^\s//g;
				$test=~s/\s$//g;
				$test=~s/\(/%%ka%%/gi;
				$test=~s/\)/%%kz%%/gi;
				$test=~s/[\+\*]/ /g;
				$test=~s/  / /g;
				$test=~tr/[A-Z周腯/[a-z鳇鋆/;

				my @multibel=split(/%%%/, $test);

				my $testlaenge=length($test);
				$testlaenge=$testlaenge-3 if ($test=~/%%%/i);

				my $prozent;

				if ($testlaenge < length($input))
					{
					$prozent=$testlaenge*100/length($input);
					}
				elsif ($testlaenge == length($input))
					{
					$prozent=100;
					}
				else
					{
					$prozent=length($input)*100/length($test);
					}

				$prozent=sprintf("%.0f", $prozent);

				my $ist=0;
				my $soll=@multibel;

				foreach my $multi (@multibel)
					{
					chomp($multi);
					$multi=~s/^\s//g;
					$multi=~s/\s$//g;

					if ($input=~/$multi/i)
						{
						$ist=$ist+1;
						}
					}

				if ((($ist == $soll) && ($prozent > 24)) || (($ist == $soll) && ($keywords[2]=~/:INPUT:/i) && ($prozent > 0)))
					{
					push @tmp, "$zeile|$prozent|$test|";

					$treffer=$treffer+1;
					}
				}
			}
		}

	if ($treffer > 0)
		{
		my @sortiert = map $_->[0],sort {$b->[1] <=> $a->[1]}map [$_, (split /\|/)[1]], @tmp;

		my ($bestline, $genauigkeit, $test);

		my $first=0;

		foreach my $best (@sortiert)
			{
			$first=$first+1;

			if ($first == 1)
				{
				chomp ($best);
				($bestline,$genauigkeit,$test)=split(/\|/, $best);
				last;
				}
			}

		my ($text, $url, $target, $urlsekunden, $animation, $keywordsid, $sekunden, $mp3);

		my $nummer=0;

		foreach my $line (@keywordlines)
			{
			$nummer=$nummer+1;

			if ($nummer == $bestline)
				{
				chomp($line);

				my @keywords=split(/\|/, $line);

				my @mp3s = split(/, /, $keywords[10]) if (defined $keywords[10]);
				$mp3=$mp3s[0];

				if ($keywords[2] =~/%%%/)
					{
					my @antwort = split/%%%/,$keywords[2];
					my $anzahl=@antwort;
					my $zufall=int(rand($anzahl));

					$keywords[2]=$antwort[$zufall];

					$mp3=$mp3s[$zufall];
					}

				if ($keywords[2]=~/:INPUT:/)
					{
					use locale;
					$test="\u$test";
					$keywords[2]=~s/:INPUT:/$test/gi;
					}

				$text=$keywords[2];
				$text=~s/%%%/ /gi;

				if ($keywords[4])
					{
					$url="$keywords[4]";
					$url=~s/:INPUT:/$test/gi;
					$target="$keywords[5]";

					$urlsekunden="$keywords[9]" if ($keywords[9]);
					}

				$animation="$keywords[3].swf";

				$keywordsid="$keywords[0]";
				$sekunden=$keywords[6];

				last;
				}
			}

		positiv ($keywordsid, $text, $animation, $sekunden, $mp3, $url, $target, $urlsekunden, $genauigkeit);
		}
	else
		{
		postplugins();
		}
	}
sub postplugins
	{
	open (POST, "<$dbpfad/db/post_plugins.db");
	flock(POST, 1);
	my @postlines = ;
	close(POST);

	if (@postlines > 0)
		{
		require LWP::UserAgent;

		my $sid = "";
		$sid = escapeHTML(param("sid")) if (defined param("sid"));
		$sid =~s/[^a-zA-Z0-9]//g;

		my $spezial = "";
		$spezial = escapeHTML(param("spezial")) if (defined param("spezial"));
		$spezial =~s/[^0-9]//g;

		my $text="";
		my $animation="";
		my $sekunden="";
		my $mp3="";
		my $url="";
		my $target="";
		my $urlsekunden="";
		my $scname="";
		my $scinhalt="";
		my $scdauer="";

		my $domain=$ENV{'HTTP_HOST'};
		$domain=~s/www.//gi;

		my $postplugincount=0;

		foreach my $postline (@postlines)
			{
			if ($postplugincount < 1)
				{
				chomp($postline);

				my ($plugin, $pluginname)=split(/\|/, $postline);

				my @pluginurl=split(/\//, $plugin, 4);
				my $pluginadresse="$pluginurl[2]";
				$pluginadresse=~s/www.//gi;

				if ($pluginadresse eq $domain)
					{
					my $ua = new LWP::UserAgent;

					$ua->timeout(5);
					$ua->agent('Xandra');
					my $req = new HTTP::Request GET => "$plugin?input=$input&sid=$sid&spezial=spezial";
					my $res = $ua->request($req);

					my @echo=split(/\n/, $res->content);

					foreach my $zeile (@echo)
						{
						my ($var, $val)=split(/\|/, $zeile);

						$text="$val" if (($var eq "text") && (defined $val));
						$animation="$val" if (($var eq "animation") && (defined $val));
						$sekunden="$val" if (($var eq "sekunden") && (defined $val));
						$mp3="$val" if (($var eq "mp3") && (defined $val));
						$url="$val" if (($var eq "url") && (defined $val));
						$target="$val" if (($var eq "target") && (defined $val));
						$urlsekunden="$val" if (($var eq "urlsekunden") && (defined $val));
						$scname="$val" if (($var eq "scname") && (defined $val));
						$scinhalt="$val" if (($var eq "scinhalt") && (defined $val));
						$scdauer="$val" if (($var eq "scdauer") && (defined $val));
						}

					if (($text) && ($animation))
						{
						$postplugincount++;
						}
					}
				}
			else
				{
				last;
				}
			}

		if (($text) && ($animation))
			{
			if (($scname) && ($scinhalt))
				{
				setcookie($scname, $scinhalt, $scdauer);
				}

			my $dbinput="$input";

			open (POSITIV, ">>$dbpfad/db/positiv.db");
			flock(POSITIV, 2);
			print POSITIV "$^T|$mday.$mon. $hour:$min|$dbinput|extern|$ENV{'REMOTE_ADDR'}|$text|1000|\n";
			close(POSITIV);

			if ($userstatus eq "gezaehlt")
				{
				open (PS, "<$dbpfad/db/positivstats.db");
				flock(PS, 1);
				my $positivstats=;
				close(PS);

				if ($positivstats)
					{
					$positivstats=$positivstats+1;
					open (PS, ">$dbpfad/db/positivstats.db");
					flock(PS, 2);
					print PS "$positivstats";
					close(PS);
					}
				}

			output ($text, $animation, $sekunden, $mp3, $url, $target, $urlsekunden);
			}
		else
			{
			negativ();
			}
		}
	else
		{
		negativ();
		}
	}
sub positiv
	{
	my ($keywordsid, $text, $animation, $sekunden, $mp3, $url, $target, $urlsekunden, $genauigkeit)=@_;

	my $username = "";
	$username=escapeHTML(cookie("xandraname")) if (defined cookie("xandraname"));
	$username=~s/[^a-zA-Z ]//g;

	$text=~s/:NAME:/$username/gi;
	$text=~s/:WOCHENTAG:/$tag/gi;
	$text=~s/:MONATSTAG:/$mday./gi;
	$text=~s/:MONATSNAME:/$monat/gi;
	$text=~s/:MONAT:/$mon./gi;
	$text=~s/:STUNDE:/$hour/gi;
	$text=~s/:MINUTE:/$min/gi;

	my $dbmp3="";
	$dbmp3="$mp3" if (defined $mp3);
	my $dburl="";
	$dburl="$url" if (defined $url);

	open (POSITIV, ">>$dbpfad/db/positiv.db");
	flock(POSITIV, 2);
	print POSITIV "$^T|$mday.$mon. $hour:$min|$input|$keywordsid|$ENV{'REMOTE_ADDR'}|$text|$genauigkeit|$dburl|$dbmp3|\n";
	close(POSITIV);

	if ($userstatus eq "gezaehlt")
		{
		open (PS, "<$dbpfad/db/positivstats.db");
		flock(PS, 1);
		my $positivstats=;
		close(PS);

		if ($positivstats)
			{
			$positivstats=$positivstats+1;
			open (PS, ">$dbpfad/db/positivstats.db");
			flock(PS, 2);
			print PS "$positivstats";
			close(PS);
			}
		}

	output ($text, $animation, $sekunden, $mp3, $url, $target, $urlsekunden);
	}
sub negativ
	{
	my $spezial = "";
	$spezial=escapeHTML(param("spezial")) if (defined param("spezial"));
	$spezial=~s/[^0-9]//g;

	my $gruppenname="";

	if ($spezial)
		{
		open (GRUPPEN, "<$dbpfad/db/gruppen.db");
		flock(GRUPPEN, 1);
		my @gruppenlines = ;
		close(GRUPPEN);

		foreach my $gruppenline (@gruppenlines)
			{
			chomp($gruppenline);

			my @gruppe=split(/\|/, $gruppenline);

			if ($spezial == $gruppe[0])
				{
				$gruppenname="$gruppe[1]";
				last;
				}
			}
		}

	open (NEGATIV, ">>$dbpfad/db/negativ.db");
	flock(NEGATIV, 2);
	print NEGATIV "$^T|$mday.$mon. $hour:$min|$input|$gruppenname|$ENV{'REMOTE_ADDR'}|\n";
	close(NEGATIV);

	if ($userstatus eq "gezaehlt")
		{
		open (NS, "<$dbpfad/db/negativstats.db");
		flock(NS, 1);
		my $negativstats=;
		close(NS);

		if ($negativstats)
			{
			$negativstats=$negativstats+1;
			open (NS, ">$dbpfad/db/negativstats.db");
			flock(NS, 2);
			print NS "$negativstats";
			close(NS);
			}
		}

	my $i2=0;

	if ($keininfo)
		{
		my $spezialgruppe="";

		if ($spezial)
			{
			$spezialgruppe="$spezial";
			}

		open (TIPPS, "<$dbpfad/db/tipps.db");
		flock(TIPPS, 1);
		my @tipps = ;
		close (TIPPS);

		my $zeilen=0;

		my @gueltigetipps;

		foreach my $tippsline (@tipps)
			{
			chomp($tippsline);

			my @tipp=split(/\|/, $tippsline);

			if (($tipp[6] ne 2) && ((($spezialgruppe) && ($spezialgruppe eq $tipp[6])) || ((!$spezialgruppe) && (!$tipp[7])) || (!$tipp[7])))
				{
				push @gueltigetipps, $tippsline;
				$zeilen=$zeilen+1;
				}
			}

		my $random=int(rand($zeilen));

		my $i1=0;

		foreach my $line (@gueltigetipps)
			{
			chomp($line);

			my ($tippid, $tipp, $pose, $url, $target, $urlsekunden, $gruppe, $spezial, $sekunden, $mp3)=split(/\|/ , $line);

			if (($tippid) && ($i1 == $random))
				{
				$i2=$i2+1;

				if (length($input) > 30)
					{
					$input=substr ($input, 0, 30);
					$input="$input...";
					}

				if ($keininfo=~/:INPUT:/)
					{
					use locale;
					$input="\u$input";
					$keininfo=~s/:INPUT:/$input/gi;
					}

				if ($keininfo=~/%%%/i)
					{
					my @antwort = split(/%%%/,$keininfo);
					my $anzahl=@antwort;
					my $zufall=int(rand($anzahl));

					$keininfo=$antwort[$zufall];
					}

				my $text="$keininfo $tipp";
				my $animation="$pose.swf";
				my $url=~s/:INPUT:/$input/gi if ($url);

				output ($text, $animation, $sekunden, $mp3, $url, $target, $urlsekunden);
				last;
				}
			$i1++;
			}
		}

	if ($i2 < 1)
		{
		if (length($input) > 30)
			{
			$input=substr ($input, 0, 30);
			$input="$input...";
			}

		if ($keintipp=~/:INPUT:/)
			{
			use locale;
			$input="\u$input";
			$keintipp=~s/:INPUT:/$input/gi;
			}

		my @mp3s = split(/, /, $keintippmp3);
		my $mp3=$mp3s[0];

		if ($keintipp=~/%%%/i)
			{
			my @antwort = split(/%%%/,$keintipp);
			my $anzahl=@antwort;
			my $zufall=int(rand($anzahl));

			$keintipp=$antwort[$zufall];
			$mp3=$mp3s[$zufall];
			}

		my $text="$keintipp";
		my $sekunden=$keintippsekunden;
		my $animation="";

		if ($keintipppose)
			{
			$animation="$keintipppose.swf";
			}
		else
			{
			$animation="ratlos.swf";
			}

		my $url="";
		my $target="";
		my $urlsekunden="";

		if ($keintippurl)
			{
			$url="$keintippurl";
			$url=~s/:INPUT:/$input/gi;
			$target="$keintipptarget";
			$urlsekunden="$keintippurlsekunden";
			}
		output ($text, $animation, $sekunden, $mp3, $url, $target, $urlsekunden);
		}
	}
sub name
	{
	my $username = "";
	$username=escapeHTML(cookie("xandraname")) if (defined cookie("xandraname"));
	$username=~s/[^a-zA-Z ]//g;

	my $lastmeeting = "";
	$lastmeeting=escapeHTML(cookie("xandrameeting")) if (defined cookie("xandrameeting"));
	$lastmeeting=~s/[^0-9]//g;

	my $fragenachnamen = "";
	$fragenachnamen=escapeHTML(cookie("xandranamefrage")) if (defined cookie("xandranamefrage"));
	$fragenachnamen=~s/[^0-9]//g;

	if (($namefrage) && ($lastmeeting) && (!$username) && ((!$fragenachnamen) || ($fragenachnamen < $^T-300)))
		{
		my $scname="xandranamefrage";
		my $scinhalt="$^T";
		setcookie($scname, $scinhalt);

		my $text="$namefrage";
		my $sekunden=$namefragesekunden;
		my $mp3=$namefragemp3;
		my $animation="gruss.swf";

		$animation="$namefragepose.swf" if ($namefragepose);

		output ($text, $animation, $sekunden, $mp3);
		}
	else
		{
		sms();
		}
	}
sub sms
	{
	if ($modus eq "on")
		{
		my $lastsms="";
		$lastsms=escapeHTML(cookie("xandralastsms")) if (defined cookie("xandralastsms"));
		$lastsms=~s/[^0-9]//g;

		my $lebenszeit=$lebensdauer*60;

		my $smsanzahl=0;
		my $del=0;

		open (SMS, "<$dbpfad/db/sms.db");
		flock (SMS, 1);
		my @lines = ;
		close (SMS);

		open (SMS, ">$dbpfad/db/sms.db");
		flock (SMS, 2);

		my @smsliste;

		foreach my $line (@lines)
			{
			chomp($line);

			my @data_set=split(/\|/, $line);

			if ($data_set[2] < $^T-$lebenszeit)
				{
				$del=$del+1;
				}
			else
				{
				print SMS "$line\n";

				if ($lastsms ne $data_set[2])
					{
					push @smsliste, $line;
					$smsanzahl=$smsanzahl+1;
					}
				}
			}
		close (SMS);

		if ($smsanzahl > 0)
			{
			my $smsrandom=int(rand($smsanzahl));

			my $i=0;

			foreach my $smsline (@smsliste)
				{
				my ($smstext, $absender, $zeitstempel)=split(/\|/ , $smsline);

				if (($i == $smsrandom) && ($lastsms ne $zeitstempel))
					{
					my ($text, $animation);
					if ($smsueberleitung)
						{
						$text="$smsueberleitung $smstext";
						}
					else
						{
						$text="Wow, eine SMS an mich! Der Absender schreibt:
$smstext"; } if ($smspose) { $animation="$smspose.swf"; } else { $animation="handy.swf"; } my $mp3=$smsmp3; my $scname="xandralastsms"; my $scinhalt="$zeitstempel"; setcookie($scname, $scinhalt); my $sekunden=0; output ($text, $animation, $sekunden, $mp3); last; } $i=$i+1; } } else { tippplugins(); } } else { tippplugins(); } } sub tippplugins { open (TIPP, "<$dbpfad/db/tipp_plugins.db"); flock(TIPP, 1); my @tipplines = ; close(TIPP); if (@tipplines > 0) { require LWP::UserAgent; my $zufall=int(rand(@tipplines)); my $sid = ""; $sid=escapeHTML(cookie("sid")) if (defined cookie("sid")); $sid=~s/[^a-zA-Z0-9]//g; my $spezial = ""; $spezial=escapeHTML(cookie("spezialgruppe")) if (defined cookie("spezialgruppe")); $spezial=~s/[^0-9]//g; my $text=""; my $animation=""; my $sekunden=""; my $mp3=""; my $url=""; my $target=""; my $urlsekunden=""; my $scname=""; my $scinhalt=""; my $scdauer=""; my $domain=$ENV{'HTTP_HOST'}; $domain=~s/www.//gi; my $tippplugincount=0; foreach my $tippline (@tipplines) { $tippplugincount=$tippplugincount+1; if ($tippplugincount == $zufall) { chomp($tippline); my ($plugin, $pluginname)=split(/\|/, $tippline); my @pluginurl=split(/\//, $plugin, 4); my $pluginadresse="$pluginurl[2]"; $pluginadresse=~s/www.//gi; if ($pluginadresse eq $domain) { my $ua = new LWP::UserAgent; $ua->timeout(5); $ua->agent('Xandra'); my $req = new HTTP::Request GET => "$plugin?sid=$sid&spezial=$spezial"; my $res = $ua->request($req); my @echo=split(/\n/, $res->content); foreach my $zeile (@echo) { my ($var, $val)=split(/\|/, $zeile); $text="$val" if (($var eq "text") && (defined $val)); $animation="$val" if (($var eq "animation") && (defined $val)); $sekunden="$val" if (($var eq "sekunden") && (defined $val)); $mp3="$val" if (($var eq "mp3") && (defined $val)); $url="$val" if (($var eq "url") && (defined $val)); $target="$val" if (($var eq "target") && (defined $val)); $urlsekunden="$val" if (($var eq "urlsekunden") && (defined $val)); $scname="$val" if (($var eq "scname") && (defined $val)); $scinhalt="$val" if (($var eq "scinhalt") && (defined $val)); $scdauer="$val" if (($var eq "scdauer") && (defined $val)); } } } } if (($text) && ($animation)) { if (($scname) && ($scinhalt)) { setcookie($scname, $scinhalt, $scdauer); } output ($text, $animation, $sekunden, $mp3, $url, $target, $urlsekunden); } else { tipp(); } } else { tipp(); } } sub tipp { open (TIPPS, "<$dbpfad/db/tipps.db"); flock(TIPPS, 1); my @tipps = ; close (TIPPS); our (@gueltigetipps, $tippsline); if (@tipps > 0) { my $lasttipp=""; $lasttipp=escapeHTML(cookie("xandralasttipp")) if (defined cookie("xandralasttipp")); $lasttipp=~s/[^0-9]//g; my $spezial=""; $spezial=escapeHTML(cookie("spezialgruppe")) if (defined cookie("spezialgruppe")); $spezial=~s/[^0-9]//g; my $passt=0; foreach $tippsline (@tipps) { chomp($tippsline); my @tipp=split(/\|/, $tippsline); if (((!$lasttipp) || ($tipp[0] ne $lasttipp)) && ($tipp[6] ne 2) && (((!$spezial) && (!$tipp[7])) || (($spezial) && ($spezial eq $tipp[6])))) { $passt=$passt+1; push @gueltigetipps, $tippsline; } } if ($passt < 1) { foreach $tippsline (@tipps) { chomp($tippsline); my @tipp=split(/\|/, $tippsline); if (($tipp[0] ne $lasttipp) && ($tipp[6] ne 2) && (!$tipp[7])) { push @gueltigetipps, $tippsline; } } } my $zeilen=@gueltigetipps; my $random=int(rand($zeilen)); my $i1=0; my $treffer=0; foreach my $line (@gueltigetipps) { chomp($line); my @tipp=split(/\|/ , $line); if (($tipp[0]) && ($i1 == $random)) { $treffer=$treffer+1; my $scname="xandralasttipp"; my $scinhalt="$tipp[0]"; setcookie($scname, $scinhalt); my $text="$tipp[1]"; my $animation="$tipp[2].swf"; my $sekunden=$tipp[8]; my $mp3=$tipp[9]; my $url="$tipp[3]" if ($tipp[3]); my $target="$tipp[4]" if ($tipp[3]); my $urlsekunden="$tipp[5]" if ($tipp[3]); output ($text, $animation, $sekunden, $mp3, $url, $target, $urlsekunden); last; } $i1=$i1+1; } if ($treffer < 1) { leerlauf(); } } else { leerlauf(); } } sub leerlauf { opendir(DIRHANDLE, "$dbpfad/animationen/leerlauf"); my @allfiles = readdir(DIRHANDLE); closedir DIRHANDLE; my $anzahl=0; foreach my $file (@allfiles) { chomp($file); if (($file=~/swf/i) && ($file !~/bruecke/i)) { $anzahl=$anzahl+1; } } my $random=int(rand($anzahl)); my $i=0; foreach my $file1 (@allfiles) { chomp($file1); if (($file1=~/swf/i) && ($file1 !~/bruecke/i)) { if ($i == $random) { my $text = ""; my $animation = "leerlauf/$file1"; output ($text, $animation); last; } $i=$i+1; } } } sub output { my ($text, $animation, $sekunden, $mp3, $url, $target, $urlsekunden)=@_; my $username = ""; $username=escapeHTML(cookie("xandraname")) if (defined cookie("xandraname")); $username=~s/[^a-zA-Z ]//g; my $sid = ""; $sid=escapeHTML(cookie("sid")) if (defined cookie("sid")); $sid=~s/[^a-zA-Z0-9]//g; my $sound = ""; $sound=escapeHTML(cookie("sound")) if (defined cookie("sound")); $sound=~s/[^a-z]//g; if (defined $text) { $text=~s/:NAME:/$username/gi; $text=~s/:SID:/$sid/gi; $text=~s/:WOCHENTAG:/$tag/gi; $text=~s/:MONATSTAG:/$mday./gi; $text=~s/:MONATSNAME:/$monat/gi; $text=~s/:MONAT:/$mon./gi; $text=~s/:STUNDE:/$hour/gi; $text=~s/:MINUTE:/$min/gi; $text=~s/\\<\/b\>//gi; $text=~s/ / /gi; $text=~s/ \,/\,/gi; $text=~s/ \./\./gi; $text=~s/ \!/\!/gi; $text=~s/ \?/\?/gi; $text=~s/([^a-zA-Z0-9_.-])/uc sprintf("%%%02x",ord($1))/eg; $sekunden=sprintf("%.0f", length($text)*0.1) if ((!$sekunden) || ($sekunden < 1)); } $sekunden=5 if ((!$sekunden) || ($sekunden < 5)); my $output.="animation=
"; if ($text) { $output.="&outtxt=$text&sekunden=$sekunden"; } else { $output.="&outtxt=&sekunden="; } if (($mp3) && ($sound ne "off")) { my $mp3datei="$httppfad/multimedia/$mp3"; $output.="&mp3=$mp3datei"; } else { $output.="&mp3="; } if (defined $url) { $urlsekunden=$sekunden-1 if ((!$urlsekunden) || ($urlsekunden eq "auto") || ($urlsekunden >= $sekunden) || ($urlsekunden < 1)); $url=~s/:SID:/$sid/gi; $url=~s/([^a-zA-Z0-9_.-])/uc sprintf("%%%02x",ord($1))/eg; $target="" if (!$target); $output.="&url=$url&target=$target&urlsekunden=$urlsekunden"; } else { $output.="&url=&target=&urlsekunden="; } print "Content-Type: text/plain; charset=ISO-8859-1\r\n\r\n"; print "$output"; if (($userstatus eq "gezaehlt") && ($url)) { open (LS, "<$dbpfad/db/linkstats.db"); flock(LS, 1); my $linkstats=; close(LS); if ($linkstats) { $linkstats=$linkstats+1; open (LS, ">$dbpfad/db/linkstats.db"); flock(LS, 2); print LS "$linkstats"; close(LS); } } exit(); } sub mute { my $sound = ""; $sound=escapeHTML(cookie("sound")) if (defined cookie("sound")); $sound=~s/[^a-z]//g; my $scname="sound"; my ($scinhalt, $animation); if ($sound eq "off") { $scinhalt="on"; $animation="tipp.swf"; } else { $scinhalt="off"; $animation="ratlos.swf"; } my $scdauer="90"; setcookie($scname, $scinhalt, $scdauer); my $text="Sound $scinhalt"; output ($text, $animation); } sub setcookie { my ($scname, $scinhalt, $scdauer)=@_; if ($scdauer) { my $gmt=gmtime(time()+$scdauer*24*3600)." GMT"; print "Set-Cookie: $scname=$scinhalt; expires=$gmt; path=/;\n"; } else { print "Set-Cookie: $scname=$scinhalt; path=/;\n"; } } sub cr { my $word=pack ("C*", 47, 47, 32, 87, 101, 110, 110, 32, 83, 105, 101, 32, 100, 105, 101, 115, 32, 104, 105, 101, 114, 32, 108, 101, 115, 101, 110, 32, 107, 111, 101, 110, 110, 101, 110, 44, 32, 104, 97, 98, 101, 110, 32, 83, 105, 101, 32, 100, 101, 110, 32, 88, 97, 110, 100, 114, 97, 45, 67, 104, 97, 116, 66, 111, 116, 60, 98, 114, 62, 10, 47, 47, 32, 100, 105, 114, 101, 107, 116, 32, 97, 117, 102, 103, 101, 114, 117, 102, 101, 110, 32, 117, 110, 100, 32, 115, 111, 108, 108, 116, 101, 110, 32, 105, 104, 110, 32, 117, 110, 116, 101, 114, 32, 100, 105, 101, 115, 101, 109, 32, 84, 101, 120, 116, 32, 115, 101, 104, 101, 110, 32, 107, 111, 101, 110, 110, 101, 110, 46, 60, 98, 114, 62, 10, 47, 47, 32, 83, 105, 101, 32, 107, 111, 101, 110, 110, 101, 110, 32, 110, 117, 110, 32, 101, 105, 110, 101, 110, 32, 67, 111, 100, 101, 32, 122, 117, 109, 32, 69, 105, 110, 98, 105, 110, 100, 101, 110, 32, 105, 110, 32, 73, 104, 114, 101, 32, 72, 111, 109, 101, 112, 97, 103, 101, 32, 97, 98, 114, 117, 102, 101, 110, 44, 60, 98, 114, 62, 10, 47, 47, 32, 119, 101, 108, 99, 104, 101, 114, 32, 105, 110, 32, 100, 101, 114, 32, 65, 100, 109, 105, 110, 105, 115, 116, 114, 97, 116, 105, 111, 110, 32, 117, 110, 116, 101, 114, 32, 34, 60, 98, 62, 69, 105, 110, 115, 116, 101, 108, 108, 117, 110, 103, 101, 110, 45, 62, 88, 97, 110, 100, 114, 97, 32, 101, 105, 110, 98, 105, 110, 100, 101, 110, 60, 47, 98, 62, 34, 60, 98, 114, 62, 10, 47, 47, 32, 103, 101, 110, 101, 114, 105, 101, 114, 116, 32, 119, 105, 114, 100, 33, 60, 98, 114, 62, 60, 98, 114, 62, 10, 47, 47, 32, 83, 111, 108, 108, 116, 101, 32, 101, 115, 32, 80, 114, 111, 98, 108, 101, 109, 101, 32, 103, 101, 98, 101, 110, 44, 32, 107, 111, 101, 110, 110, 101, 110, 32, 83, 105, 101, 32, 74, 101, 100, 101, 114, 122, 101, 105, 116, 32, 117, 110, 115, 101, 114, 101, 110, 32, 107, 111, 115, 116, 101, 110, 108, 111, 115, 101, 110, 60, 98, 114, 62, 10, 47, 47, 32, 83, 117, 112, 112, 111, 114, 116, 32, 110, 117, 116, 122, 101, 110, 44, 32, 117, 110, 115, 101, 114, 101, 32, 97, 107, 116, 117, 101, 108, 108, 101, 110, 32, 75, 111, 110, 116, 97, 107, 116, 100, 97, 116, 101, 110, 32, 102, 105, 110, 100, 101, 110, 32, 83, 105, 101, 32, 117, 110, 116, 101, 114, 58, 60, 98, 114, 62, 10, 47, 47, 32, 60, 98, 62, 60, 97, 32, 104, 114, 101, 102, 61, 34, 104, 116, 116, 112, 58, 47, 47, 119, 119, 119, 46, 120, 97, 110, 100, 114, 97, 45, 99, 104, 97, 116, 98, 111, 116, 46, 100, 101, 34, 32, 116, 97, 114, 103, 101, 116, 61, 34, 95, 98, 108, 97, 110, 107, 34, 62, 119, 119, 119, 46, 120, 97, 110, 100, 114, 97, 45, 99, 104, 97, 116, 98, 111, 116, 46, 100, 101, 60, 47, 97, 62, 60, 47, 98, 62, 60, 98, 114, 62, 10); print "$word"; } sub datum_zeit { ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); $mon=$mon+1; $year=1900+$year; $monat="Januar" if ($mon==1); $monat="Februar" if ($mon==2); $monat="M鋜z" if ($mon==3); $monat="April" if ($mon==4); $monat="Mai" if ($mon==5); $monat="Juni" if ($mon==6); $monat="Juli" if ($mon==7); $monat="August" if ($mon==8); $monat="September" if ($mon==9); $monat="Oktober" if ($mon==10); $monat="November" if ($mon==11); $monat="Dezember" if ($mon==12); $tag="Sonntag" if ($wday==0); $tag="Montag" if ($wday==1); $tag="Dienstag" if ($wday==2); $tag="Mittwoch" if ($wday==3); $tag="Donnerstag" if ($wday==4); $tag="Freitag" if ($wday==5); $tag="Samstag" if ($wday==6); $min="0$min" if ($min < 10); $hour="0$hour" if ($hour < 10); $mon="0$mon" if ($mon < 10); $mday="0$mday" if ($mday < 10); }