#!/usr/bin/perl print ("Content-type: text/html\n\n"); eval { ($0 =~ m,(.*)/[^/]+,) && unshift (@INC, "$1"); # Get the script location: UNIX / or Windows / ($0 =~ m,(.*)\\[^\\]+,) && unshift (@INC, "$1"); # Get the script location: Windows \ #substitute all require files here for the file require "UltBB.setup"; require "Styles.file"; require "ubb_library.pl"; require "Date.pl"; }; if ($@) { print "Fehler beim Aufruf der Datei(en): $@\n"; print "Stellen Sie sicher, daß diese Datei(en) vorhanden ist/sind, die Zugriffsrechte und Systempfade korrekt eingestellt sind."; exit; } if ($BBStatus eq "OFF") { &StandardHTML($BBClosedMessage); exit; } &ReadParse; # if necessary set Random Number - for use in Banner Ads, etc. if ( ($Header ne "") || ($Footer ne "") ) { $RandomNumber = &MakeRandomNumber; $RandomNumber2 = $RandomNumber + 100074; if ($Header ne "") { $Header =~ s/UBBrandomX/$RandomNumber/isg; $Header =~ s/UBBrandomY/$RandomNumber2/isg; } if ($Footer ne "") { $Footer =~ s/UBBrandomX/$RandomNumber/isg; $Footer =~ s/UBBrandomY/$RandomNumber2/isg; } } # end if header or footer #adjust bgcolor variables if ($BGColor ne ""){ $BGColor = qq(bgcolor="$BGColor"); } if ($AltColumnColor1 ne ""){ $AltColumnColor1 = qq(bgcolor="$AltColumnColor1"); } if ($AltColumnColor2 ne ""){ $AltColumnColor2 = qq(bgcolor="$AltColumnColor2"); } if ($CategoryStripColor ne ""){ $CategoryStripColor = qq(bgcolor="$CategoryStripColor"); } if ($TableColorStrip ne ""){ $TableColorStrip = qq(bgcolor="$TableColorStrip"); } if ($PageBackground ne ""){ $PageBackground = qq(background="$NonCGIURL/$PageBackground"); } if ($TableBorderColor ne ""){ $TableWidth2 = "100%"; $BorderTop = qq(
); $BorderBottom = qq(
); } else { $TableWidth2 = $TableWidth; $BorderTop = ""; $BorderBottom = ""; } @forums = &OpenForumsFile; $SearchUser = $in{'SearchUser'}; $SearchUser = &decodeURL($SearchUser); $SearchUser = &UNHTMLIFY($SearchUser); $SearchUserCoded = $SearchUser; $SearchUserCoded = &HTMLIFY($SearchUserCoded); $SearchUserCoded =~ tr/ /+/; if ($in{'action'} eq "intro") { &Intro; } if ($in{'action'} eq "getdaily") { &GetDaily; } if ($in{'action'} eq "introprivate") { &IntroPrivate; } if ($in{'action'} eq "simplesearch") { if ($AllowSearch eq "FALSE") { &StandardHTML("Die Suchfunktion ist derzeit deaktiviert."); exit; } else { if ($IndexMethod eq "ONEFILE") { &SimpleSearch; } else { &SimpleSearch2; } } } if ($in{'action'} eq "simplesearchP") { if ($AllowSearch eq "FALSE") { &StandardHTML("Die Suchfunktion ist derzeit deaktiviert."); exit; } else { &SimpleSearchP; } } if ($in{'action'} eq "privateid") { &PrivateID; } sub GetDaily { &GetDateTime; if ($AllowSearch eq "FALSE") { $SearchOption = ""; } else { $SearchOption = qq(Erneut suchen! | ); } if (-e "$NonCGIPath/dailyindex-$LastLoginJulianDATE.file") { $Daily = "exists"; @daily2 = &OpenFile("$NonCGIPath/dailyindex-$LastLoginJulianDATE.file"); @daily = sort(@daily2); } else { $Daily = ""; @daily = @blank; } #eliminate duplicates foreach $check(@daily) { chomp($check); (@testit) = split(/\|/, $check); $testit = ("$testit[0]" . "$testit[1]"); $Duplicate = ""; for $dupcheck(@good) { @testit2 = split(/\|/, $dupcheck); $testit2 = ("$testit2[0]" . "$testit2[1]"); if ($testit eq "$testit2") { $Duplicate = "true"; } } if ($Duplicate ne "true") { push(@good, $check); } } $MatchTotal = @good; my $MaxDisplay = 40; #maximum number to view per screen if ($in{'StartPoint'} eq "") { $StartPoint = 1; if ($MatchTotal <= $MaxDisplay) { $EndPoint = $MatchTotal; $Done = "true"; } else { $Done = ""; $EndPoint = $MaxDisplay; } $EP = $EndPoint - 1; @daily = @good[0..$EP]; } else { $StartPoint = $in{'StartPoint'}; $EndPoint = $StartPoint + $MaxDisplay; $EndPoint = $EndPoint - 1; if ($MatchTotal <= $EndPoint) { $EndPoint = $MatchTotal; $Done = "true"; } else { $Done = ""; } } $SP = $StartPoint - 1; $EP = $EndPoint - 1; @daily = @good[$SP..$EP]; if ($Done ne "true") { $NextStart = $EndPoint + 1; $NextWording = qq([Weitere Treffer]); } else { $NextWording = ""; } if ($MatchTotal == 0) { $StartPoint = 0; } print< $BBName - Heute erstellte Beiträge $HeaderInsert $Header
Suche!
Heute erstellte Beiträge:

Angezeigt werden nur öffentliche Foren.
Zeige Themen $StartPoint bis $EndPoint ($MatchTotal total)      $NextWording $SearchOption Zurück zu den Foren
$BorderTop TOP for $eachone(@daily) { @goodline = split(/\|/, $eachone); chomp($goodline[5]); @GetForumName = &GetForumRecord("$goodline[0]"); $ForumName = "$GetForumName[1]"; $HyphenIt = "$goodline[3]"; ($ThisMo, $ThisDay, $ThisYear) = split(/-/, $HyphenIt); if ($DateFormat eq "US") { $TheDate = "$HyphenIt"; $DateSize = "2"; } elsif ($DateFormat eq "Euro") { $TheDate = "$ThisDay-$ThisMo-$ThisYear"; $DateSize = "2"; } elsif ($DateFormat eq "USX") { $TheDate = &DateFormat("$HyphenIt", "USExpanded"); $DateSize = "1"; } else { $TheDate = &DateFormat("$HyphenIt", "EuroExpanded"); $DateSize = "1"; } if (-e "$NonCGIPath/Forum$goodline[0]/HTML/$goodline[1].html") { print< ROW } } print< $BorderBottom

$NextWording

$YourCopyrightNotice



$infopopcopy
Ultimate Bulletin Board $Version

$Footer BOTTOM } #end GetDaily sub SimpleSearch { ##NEW! if (($in{'File'} ne "") && ($in{'File'} !~ /^temp/)) { &StandardHTML("Die Index-Datei zur Suche konnte nicht gefunden werden - bitte benutzen Sie die ZURÜCK-Funktion Ihres Browsers und versuchen Sie es erneut!"); exit; } #get current date in jul. format &GetDateTime; $CurrentJDay = $LastLoginJulianDATE; #delete old temporary search records &PruneTemps; #prepare search terms-- &decodeURL($in{'SearchTerms'}); chomp($in{'SearchTerms'}); $SearchWords = $in{'SearchTerms'}; $SearchTermsCoded = $SearchWords; $SearchTermsCoded =~ tr/ /+/; $SearchWords =~ s/\n//sg; $SearchWords =~ s/\r//sg; $SearchWords =~ s/\@/\\@/sg; if ($SearchWords =~ / /) { @SearchList = split(/ /, $SearchWords); } else { @SearchList = $SearchWords; } $SearchNumber = @SearchList; if ($in{'Total'} eq "") { $Total = 0; } else { $Total = $in{'Total'}; } #make sure search file is still valid unless (-e "$NonCGIPath/searchlogs/$in{'File'}") { $in{'File'} = ""; $FileName = ""; } $SkipSearch = ""; if (($in{'Continue'} eq "False") && ($in{'File'} ne "")) { if (-e "$NonCGIPath/searchlogs/$in{'File'}") { @good = &OpenFile("$NonCGIPath/searchlogs/$in{'File'}"); $SkipSearch = "true"; } } #end if temp file exists to draw on $ForumChoice = $in{'ForumChoice'}; if ($SkipSearch ne "true") { @index = @blank; #get forum/archive file @foruminfo = &OpenFile("$VariablesPath/forums.cgi"); $TotalForums = @foruminfo; @theindex = &OpenFile("$NonCGIPath/forumindex.cgi"); #search one forum or all? if ($ForumChoice ne "ALL") { if ($ForumChoice !~ /A/) { @thisforum = &GetForumRecord($ForumChoice); if ( ($thisforum[3] eq "On") && ($thisforum[6] ne "private") ) { @thisindex = grep(/$ForumChoice\|/, @theindex); } else { @thisindex = @blank; } } else { #get archive index ($Junk, $ArchNum) = split(/:/, $ForumChoice); @thisindex = &OpenFile("$NonCGIPath/Archives/archiveindex-$ArchNum.pl"); } } else { #if searching all forums/archives... @thisindex = &OpenFile("$NonCGIPath/forumindex.cgi"); } # end if searching all forums @index = sort(@thisindex); #determine start point if ($in{'StartAt'} ne "") { $StartAt = $in{'StartAt'}; $StartAt = $StartAt + 0; @index = @index[$StartAt..$#index]; } #now we have array to be searched... &CheckBadChars($in{'File'}); # Determine Current Good Array if ($in{'File'} =~ /^temp\S+\.cgi$/) { open(HOLDER, "$NonCGIPath/searchlogs/$in{'File'}"); @good = ; close(HOLDER); } else { @good = @blank; } &DoTheSearch; #places matches in @good #now we have all matches- write temp file if ($in{'File'} eq "") { &CreateTempSearchName; $FileName = "temp-$SearchFile.cgi"; } else { $FileName = "$in{'File'}"; } open(HOLD, ">$NonCGIPath/searchlogs/$FileName"); foreach $one(@good) { chomp($one); print HOLD "$one\n"; } close(HOLD); chmod(0666, "$NonCGIPath/searchlogs/$FileName"); } #end skip search check $MatchTotal = @good; my $MaxDisplay = 40; #maximum number to view per screen if ($in{'StartPoint'} eq "") { $StartPoint = 1; if ($MatchTotal <= $MaxDisplay) { $EndPoint = $MatchTotal; $Done = "true"; } else { $Done = ""; $EndPoint = $MaxDisplay; } $EP = $EndPoint - 1; @good = @good[0..$EP]; } else { $StartPoint = $in{'StartPoint'}; $EndPoint = $StartPoint + $MaxDisplay; $EndPoint = $EndPoint - 1; if ($MatchTotal <= $EndPoint) { $EndPoint = $MatchTotal; $Done = "true"; } else { $Done = ""; } } $SP = $StartPoint - 1; $EP = $EndPoint - 1; @good = @good[$SP..$EP]; if ($FileName eq "") { $FileName = "$in{'File'}"; } if ($Done ne "true") { $NextStart = $EndPoint + 1; $NextWording = qq([Weitere Treffer]); } else { $NextWording = ""; } if ($MatchTotal == 0) { $StartPoint = 0; } print< $BBName - Search Results $HeaderInsert $Header
Thema Letzter Beitrag am Forum
$goodline[4] $TheDate $ForumName
Suche!
Ergebnisse Ihrer Suche:
Zeige Treffer $StartPoint bis $EndPoint ($MatchTotal total)      $NextWording Neue Suche | Zurück zu den Foren
$BorderTop TOP for $eachone(@good) { @goodline = split(/\|/, $eachone); if ($goodline[1] =~ /-/) { #it is an archive @thisarchive = &OpenFile("$NonCGIPath/Archives/archives.pl"); foreach $uno(@thisarchive) { if ($uno =~ /^$goodline[0]/) { ($ThisNum, $ForumName, $junk) = split(/\|\#\|/, $uno); } } $TheURL = "$NonCGIURL/Archives/Archive-$goodline[0]/HTML/$goodline[1].html"; } else { #it is not an archive, but a forum @GetForumName = &GetForumRecord("$goodline[0]"); $ForumName = "$GetForumName[1]"; $TheURL = "$NonCGIURL/Forum$goodline[0]/HTML/$goodline[1].html"; } $HyphenIt = "$goodline[3]"; ($ThisMo, $ThisDay, $ThisYear) = split(/-/, $HyphenIt); $CheckThisYear = length($ThisYear); if ($CheckThisYear < 4) { if ($CheckThisYear == 2) { $ThisYear = ("19" . "$ThisYear"); } else { $ThisYear = $ThisYear - 100; $ThisYear = sprintf ("%2d", $ThisYear); $ThisYear =~tr/ /0/; $ThisYear = ("20" . "$ThisYear"); } $HyphenIt = "$ThisMo-$ThisDay-$ThisYear"; } if ($DateFormat eq "US") { $TheDate = "$HyphenIt"; $DateSize = "2"; } elsif ($DateFormat eq "Euro") { $TheDate = "$ThisDay.$ThisMo.$ThisYear"; $DateSize = "2"; } elsif ($DateFormat eq "USX") { $TheDate = &DateFormat("$HyphenIt", "USExpanded"); $DateSize = "1"; } else { $TheDate = &DateFormat("$HyphenIt", "EuroExpanded"); $DateSize = "1"; } print< ROW } print< $BorderBottom

$NextWording

$YourCopyrightNotice



$infopopcopy
Ultimate Bulletin Board $Version

$Footer BOTTOM } # end SimpleSearch sr sub Intro { if ($DisplayRegistration eq "NO") { $RegLinkHere = ""; } else { $RegLinkHere = qq(| Registrieren | Profil); } #check for default if ($in{'default'} ne "") { $DefaultSelect = $in{'default'}; } print< $BBName Suche $HeaderInsert $Header
Thema Name Datum Forum/Archiv
$goodline[4] $goodline[2] $TheDate $ForumName
Suche!
Zurück zu den Foren $RegLinkHere | Voreinstellungen

$BorderTop
Suchbegriff(e):
Alle Begriffe finden
Einen oder mehrere Begriffe finden

Trennen Sie die Wörter mit Leerzeichen, nicht mit Kommata.

Suchen im Forum/Archiv:
Suchen im:
Suchen nach Datum:
Suchen nach Benutzername:
nach exaktem Namen (Groß-/Kleinschreibung)
irgendeine Übereinstimmung
$BorderBottom
Hinweis: Wenn Sie in privaten Foren suchen möchten, klicken Sie bitte hier.

$YourCopyrightNotice



$infopopcopy
Ultimate Bulletin Board $Version

$Footer NEXT } # end sub Intro sub IntroPrivate { print< $BBName - Suchen in privaten Foren $HeaderInsert $Header

Suche!

Wollen Sie auch private Foren durchsuchen, müssen Sie sich erst identifizieren, damit wir ermitteln können, für welche Foren Sie eine Berechtigung haben. Ausschließlich Administratoren und Moderatoren können in allen privaten Foren suchen.

Benutzername:
Kennwort:
TheHTML &PageBottomHTML; } #end intro private sub PrivateID { #check permissions for user $NameFound = "no"; $ProfileNumber = &GetUserNumber($in{'UserName'}); if ($ProfileNumber ne "") { $NameFound = "yes"; } else { $NameFound = "no"; } if ($NameFound eq "yes") { @theprofile = &OpenProfile("$ProfileNumber.cgi"); if ($in{'Password'} eq "$theprofile[1]") { $Permission = "$theprofile[4]"; ($GenPerms, $SpecificPerms) = split(/\&/, $Permission); $Status = $theprofile[8]; &CheckTheStatus; &CheckPermissions; @accessarray = split(",", $SpecificPerms); } else { &StandardHTML("Das von Ihnen eingegebene Kennwort ist falsch - bitte benutzen Sie die ZURÜCK-Funktion Ihres Browsers und versuchen Sie es erneut!"); exit; } } else { &StandardHTML("Der von Ihnen angegebene Benutzername konnte nicht gefunden werden - bitte benutzen Sie die ZURÜCK-Funktion Ihres Browsers und versuchen Sie es erneut!"); exit; } $ArrayTotal = @accessarray; if (($AdminPermission ne "true") && ($ModStatus ne "true") && ($ArrayTotal == 0)) { &StandardHTML("Sie sind zur Suche in privaten Foren nicht autorisiert - bitte benutzen Sie die ZURÜCK-Funktion Ihres Browsers."); exit; } $UserNameCoded = &HTMLIFY($in{'UserName'}); $PasswordCoded = &HTMLIFY($in{'Password'}); if ($DisplayRegistration eq "NO") { $RegLinkHere = ""; } else { $RegLinkHere = qq(| register | Profil); } print< $BBName Suchen! $HeaderInsert $Header
Suche!
Zurück zu den Foren $RegLinkHere | Voreinstellungen

$BorderTop
Search Words:
alle Begriffe finden.
Einen oder mehrere Begriffe finden.

Trennen Sie Wörter mit Leerzeichen, nicht mit Kommata.

Suche im Forum:
Suchen im:
Suchen nach Datum:
Suchen nach Benutzername:
nach exaktem Namen (Groß-/Kleinschreibung)
irgendeine Übereinstimmung
$BorderBottom

$YourCopyrightNotice



$infopopcopy
Ultimate Bulletin Board $Version

$Footer NEXT } # end sub private id sub SimpleSearchP { if ($in{'ForumChoice'} eq "") { &StandardHTML("Sie haben kein Forum ausgewählt - bitte benutzen Sie die ZURÜCK-Funktion Ihres Browsers und versuchen Sie es erneut!"); exit; } #codify un and pw $UserNameIn = &UNHTMLIFY($in{'UserNameIn'}); $PasswordIn = &UNHTMLIFY($in{'PasswordIn'}); $UserNameInCoded = $UserNameIn; $UserNameInCoded =~ tr/ /+/; $UserNameIncCoded = &HTMLIFY($UserNameInCoded); $PasswordInCoded = $PasswordIn; $PasswordInCoded =~ tr/ /+/; $PasswordIncCoded = &HTMLIFY($PasswordInCoded); #re-confirm identity $NameFound = "no"; $ProfileNumber = &GetUserNumber($UserNameIn); if ($ProfileNumber ne "") { $NameFound = "yes"; } else { $NameFound = "no"; } if ($NameFound eq "yes") { @theprofile = &OpenProfile("$ProfileNumber.cgi"); if ($PasswordIn eq "$theprofile[1]") { $Permission = "$theprofile[4]"; ($GenPerms, $SpecificPerms) = split(/\&/, $Permission); $Status = $theprofile[8]; &CheckTheStatus; &CheckPermissions; @accessarray = split(",", $SpecificPerms); } else { &StandardHTML("Sie haben einen illegalen Zugriff auf unser System durchgeführt - der Zugriff wurde protokolliert und die Administration automatisch informiert."); exit; } } else { &StandardHTML("Sie haben einen illegalen Zugriff auf unser System durchgeführt - der Zugriff wurde protokolliert und die Administration automatisch informiert."); exit; } #make sure user has permission for THIS forum unless (($AdminPermission eq "true") || ($ModStatus eq "true")) { $ThisAllowed = ""; CHECKTHRU: foreach $iota(@accessarray) { chomp($iota); if ($iota eq "$in{'ForumChoice'}") { $ThisAllowed = "true"; last CHECKTHRU; } } } #end unless... $Proceed = ""; if (($AdminPermission eq "true") || ($ModStatus eq "true") || ($ThisAllowed eq "true")) { #get current date in jul. format ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime (time); $mon++; $year = (1900 + $year); $CurrentJDay = &jday($mon, $mday, $year); &decodeURL($in{'SearchTerms'}); chomp($in{'SearchTerms'}); $SearchWords = $in{'SearchTerms'}; $SearchTermsCoded = $SearchWords; $SearchTermsCoded =~ tr/ /+/; $SearchWords =~ s/\n//sg; $SearchWords =~ s/\r//sg; $SearchWords =~ s/\@/\\@/sg; if ($SearchWords =~ / /) { @SearchList = split(/ /, $SearchWords); } else { @SearchList = $SearchWords; } $SearchNumber = @SearchList; $ForumChoice = $in{'ForumChoice'}; open (INDEX, "$MembersPath/pindex/privateforumindex$ForumChoice.cgi"); @index = ; close (INDEX); #now we have the complete index... just need to search in it $Total = 0; SEARCHMATCHES: foreach $line(@index) { $Bad = "no"; @indie = split(/\|/, $line); # Username Search Routine--- if ($SearchUser ne "") { if ($in{'ExactName'} eq "no") { unless ($indie[2] =~ m/SearchUser/i) { $Bad = "yes"; } } else { unless ($indie[2] eq "$SearchUser") { $Bad = "yes"; } } } # Keyword Search Routine--- $Good = ""; if (($SearchWords ne "") && ($Bad ne "yes")) { foreach $word(@SearchList) { if ($in{'BooleanAND'} eq "YES") { if ($in{'SearchIn'} eq "SUBJECT") { unless ($indie[4] =~ m/$word/i) { $Bad = "yes"; } } else { unless (($indie[5] =~ m/$word/i) || ($indie[4] =~ m/$word/i)) { $Bad = "yes"; } } } else { if ($in{'SearchIn'} eq "SUBJECT") { if ($indie[4] =~ m/$word/i) { $Good = "yes"; } } else { if (($indie[4] =~ m/$word/i) || ($indie[5] =~ m/$word/i)) { $Good = "yes"; } } } } } if (($in{'BooleanAND'} eq "NO") && ($Good ne "yes")) { $Bad = "yes"; } # Date Search if (($in{'SearchDate'} ne "ALL") && ($Bad ne "yes")) { $PostDate = $indie[3]; chomp($PostDate); ($month, $day, $Year) = split(/-/, $PostDate); $CheckThisYear = length($Year); if ($CheckThisYear < 4) { if ($CheckThisYear == 2) { $Year = ("19" . "$Year"); } else { $Year = $Year - 100; $Year = sprintf ("%2d", $Year); $Year =~tr/ /0/; $Year = ("20" . "$Year"); } } $PostJDay = &jday($month, $day, $Year); #current jday is $CurrentJDay if ($in{'SearchDate'} eq "0") { $CutOff = ($CurrentJDay - 0); unless ($PostJDay >= $CutOff) { $Bad = "yes"; } } if ($in{'SearchDate'} eq "1") { $CutOff = ($CurrentJDay - 1); unless ($PostJDay >= $CutOff) { $Bad = "yes"; } } if ($in{'SearchDate'} eq "5") { $CutOff = ($CurrentJDay - 5); unless ($PostJDay >= $CutOff) { $Bad = "yes"; } } if ($in{'SearchDate'} eq "10") { $CutOff = ($CurrentJDay - 10); unless ($PostJDay >= $CutOff) { $Bad = "yes"; } } if ($in{'SearchDate'} eq "30") { $CutOff = ($CurrentJDay - 30); unless ($PostJDay >= $CutOff) { $Bad = "yes"; } } } if ($Bad ne "yes") { (@testit) = split(/\|/, $line); $testit = ("$testit[0]" . "$testit[1]"); $Duplicate = ""; for $dupcheck(@good) { (@testit2) = split(/\|/, $dupcheck); $testit2 = ("$testit2[0]" . "$testit2[1]"); if ($testit eq "$testit2") { $Duplicate = "true"; } } if ($Duplicate ne "true") { $Total++; push(@good, $line); if ($Total >= 200) { last SEARCHMATCHES; } } } #end if $Bad } #end foreach $line $MatchTotal = @good; my $MaxDisplay = 30; #maximum number to view per screen if ($in{'StartPoint'} eq "") { $StartPoint = 1; if ($MatchTotal <= $MaxDisplay) { $EndPoint = $MatchTotal; $Done = "true"; } else { $Done = ""; $EndPoint = $MaxDisplay; } $EP = $EndPoint - 1; @good = @good[0..$EP]; } else { $StartPoint = $in{'StartPoint'}; $EndPoint = $StartPoint + $MaxDisplay; $EndPoint = $EndPoint - 1; if ($MatchTotal <= $EndPoint) { $EndPoint = $MatchTotal; $Done = "true"; } else { $Done = ""; } } $SP = $StartPoint - 1; $EP = $EndPoint - 1; @good = @good[$SP..$EP]; if ($Done ne "true") { $NextStart = $EndPoint + 1; $NextWording = "[Weitere Treffer]"; } else { $NextWording = ""; } if ($MatchTotal == 0) { $StartPoint = 0; } print< $BBName - Ergebnisse $HeaderInsert $Header
Suche!
Ergebnisse Ihrer Suche:
Zeige Treffer $StartPoint bis $EndPoint ($MatchTotal total)      $NextWording New Open Search | New Private Search | Back to Forums
$BorderTop TOP for $eachone(@good) { @goodline = split(/\|/, $eachone); chomp($goodline[5]); @GetForumName = &GetForumRecord("$goodline[0]"); $ForumName = "$GetForumName[1]"; $PrivateMax = $GetForumName[13]; chomp($PrivateMax); if ($PrivateMax eq "yes") { $TheURL = "$CGIURL/forumdisplay.cgi?action=displayprivate&number=$goodline[0]&topic=$goodline[1]"; } else { $TheURL = "$NonCGIURL/Forum$goodline[0]/private-$GetForumName[7]/HTML/$goodline[1].html"; } print< ROW } print< $BorderBottom

$NextWording

$YourCopyrightNotice



$infopopcopy
Ultimate Bulletin Board $Version

$Footer BOTTOM } else { &StandardHTML("Sorry, but you do not have permission to search through this forum."); exit; } } # end SimpleSearchP sr sub DoTheSearch { $CountIt = 0; SEARCHMATCHES: foreach $line(@index) { $CountIt++; $Bad = "no"; @indie = split(/\|/, $line); # Username Search Routine--- if ($SearchUser ne "") { if ($in{'ExactName'} eq "no") { unless ($indie[2] =~ m/$SearchUser/i) { $Bad = "yes"; } } else { unless ($indie[2] eq "$SearchUser") { $Bad = "yes"; } } } # Keyword Search Routine--- $GoodOne = ""; if (($SearchWords ne "") && ($Bad ne "yes")) { foreach $word(@SearchList) { if ($in{'BooleanAND'} eq "YES") { if ($in{'SearchIn'} eq "SUBJECT") { unless ($indie[4] =~ m/$word/i) { $Bad = "yes"; } } else { unless (($indie[5] =~ m/$word/i) || ($indie[4] =~ m/$word/i)) { $Bad = "yes"; } } } else { if ($in{'SearchIn'} eq "SUBJECT") { if ($indie[4] =~ m/$word/i) { $GoodOne = "yes"; } } else { if (($indie[4] =~ m/$word/i) || ($indie[5] =~ m/$word/i)) { $GoodOne = "yes"; } } } } } if (($in{'BooleanAND'} eq "NO") && ($GoodOne ne "yes")) { $Bad = "yes"; } # Date Search if (($in{'SearchDate'} ne "ALL") && ($Bad ne "yes")) { $PostDate = $indie[3]; chomp($PostDate); ($month, $day, $theyear) = split(/-/, $PostDate); $CheckThisYear = length($theyear); if ($CheckThisYear < 4) { if ($CheckThisYear == 2) { $Year = ("19" . "$theyear"); } else { $Year = $theyear - 100; $Year = sprintf ("%2d", $Year); $Year =~tr/ /0/; $Year = ("20" . "$Year"); } } else { $Year = $theyear; } $PostJDay = &jday($month, $day, $Year); #current jday is $CurrentJDay if ($in{'SearchDate'} eq "0") { $CutOff = ($CurrentJDay - 0); unless ($PostJDay >= $CutOff) { $Bad = "yes"; } } if ($in{'SearchDate'} eq "1") { $CutOff = ($CurrentJDay - 1); unless ($PostJDay >= $CutOff) { $Bad = "yes"; } } if ($in{'SearchDate'} eq "5") { $CutOff = ($CurrentJDay - 5); unless ($PostJDay >= $CutOff) { $Bad = "yes"; } } if ($in{'SearchDate'} eq "10") { $CutOff = ($CurrentJDay - 10); unless ($PostJDay >= $CutOff) { $Bad = "yes"; } } if ($in{'SearchDate'} eq "30") { $CutOff = ($CurrentJDay - 30); unless ($PostJDay >= $CutOff) { $Bad = "yes"; } } } if ($Bad ne "yes") { (@testit) = split(/\|/, $line); $testit = ("$testit[0]" . "$testit[1]"); $Duplicate = ""; for $dupcheck(@good) { (@testit2) = split(/\|/, $dupcheck); $testit2 = ("$testit2[0]" . "$testit2[1]"); if ($testit eq "$testit2") { $Duplicate = "true"; } } if ($Duplicate ne "true") { $Total++; push(@good, $line); if ($Total >= 200) { $ProcessNext = "false"; $MaxSearch = "true"; } } } #end if $Bad if ($MaxSearch eq "true") { last SEARCHMATCHES; } if ($CountIt > 9999) { if ($in{'StartAt'} ne "") { $StartPoint = $in{'StartAt'} + $CountIt; $StartPoint--; } else { $StartPoint = $CountIt; } &ContinueSearch($StartPoint, $Total); exit; } } #end foreach $line } sub ContinueSearch { my $ArrayNum = shift; my $Total = shift; #check for search directory unless (-e "$NonCGIPath/searchlogs") { mkdir ("$NonCGIPath/searchlogs", 0777); chmod(0777, "$NonCGIPath/searchlogs"); } #create temp file to hold search results &CheckBadChars($in{'File'}); if ($in{'File'} eq "") { &CreateTempSearchName; $FileName = "temp-$SearchFile.cgi"; } else { $FileName = "$in{'File'}"; } open(HOLD, ">$NonCGIPath/searchlogs/$FileName"); foreach $one(@good) { chomp($one); print HOLD "$one\n"; } close(HOLD); chmod(0666, "$NonCGIPath/searchlogs/$FileName"); $Totalmatches = @good; &ForwardSearch("$CGIURL/search.cgi?action=simplesearch&SearchIn=$in{'SearchIn'}&ForumChoice=$in{'ForumChoice'}&SearchTerms=$SearchTermsCoded&BooleanAND=$in{'BooleanAND'}&SearchDate=$in{'SearchDate'}&SearchUser=$SearchUserCoded&ExactName=$in{'ExactName'}&File=$FileName&Total=$Total&StartAt=$ArrayNum", "Bitte warten ... Ihre Suchanfrage wird bearbeitet ...

Treffer bisher: $Totalmatches

Hinweis: Es werden maximal 200 Treffer angezeigt.

"); exit; } sub CreateTempSearchName { @digit = ("A", "B", "F", "G", "H", "I", "n", "p", "q", "r", "s", "t", "u", "v", "w", "y", "z", "2", "3", "4", "5", "6", "7", "8", "9"); srand(time); $num1 = rand(@digit); $num2 = rand(@digit); $num3 = rand(@digit); $num4 = rand(@digit); $Random4 = ("$digit[$num1]" . "$digit[$num2]" . "$digit[$num3]" . "$digit[$num4]"); $SearchFile = ("$SearchJulian" . "-$Random4"); } sub PruneTemps { opendir(PRUNE, "$NonCGIPath/searchlogs"); @alltemps = readdir(PRUNE); closedir(PRUNE); @temps = grep(/\.cgi/, @alltemps); foreach $temp(@temps) { ($junk, $JDate, $JTime, $junk) = split(/-/, $temp); $CompareDate = ($JDate + ($JTime * 0.000001)); $Diff = $LastLoginJulian - $CompareDate; if ($Diff > 0.015) { unlink("$NonCGIPath/searchlogs/$temp"); } } } sub ForwardSearch { my $ForwardURL = shift; my $ForwardText = shift; print< $BBName $HeaderInsert $Header

$BorderTop
Thema Name Datum Forum
$goodline[4] $goodline[2] $goodline[3] $ForumName
$ForwardText Bitte warten ...

Klicken Sie hier, wenn Sie nicht länger warten möchten oder Ihr Browser keine automatische Weiterleitung unterstützt.

$BorderBottom
$Footer ForwardHTML } #end Forward sr sub SimpleSearch2 { &CheckBadChars($in{'File'}); if (($in{'File'} ne "") && ($in{'File'} !~ /^temp/)) { &StandardHTML("Die Index-Datei zur Suche konnte nicht gefunden werden - bitte benutzen Sie die ZURÜCK-Funktion Ihres Browsers und versuchen Sie es erneut!"); exit; } #get current date in jul. format &GetDateTime; $CurrentJDay = $LastLoginJulianDATE; #delete old temporary search records &PruneTemps; #prepare search terms-- &decodeURL($in{'SearchTerms'}); chomp($in{'SearchTerms'}); $SearchWords = $in{'SearchTerms'}; $SearchTermsCoded = $SearchWords; $SearchTermsCoded =~ tr/ /+/; $SearchWords =~ s/\n//sg; $SearchWords =~ s/\r//sg; $SearchWords =~ s/\@/\\@/sg; if ($SearchWords =~ / /) { @SearchList = split(/ /, $SearchWords); } else { @SearchList = $SearchWords; } $SearchNumber = @SearchList; if ($in{'Total'} eq "") { $Total = 0; } else { $Total = $in{'Total'}; } #make sure search file is still valid unless (-e "$NonCGIPath/searchlogs/$in{'File'}") { $in{'File'} = ""; $FileName = ""; } $SkipSearch = ""; if (($in{'Continue'} eq "False") && ($in{'File'} ne "")) { if (-e "$NonCGIPath/searchlogs/$in{'File'}") { @good = &OpenFile("$NonCGIPath/searchlogs/$in{'File'}"); $SkipSearch = "true"; } } #end if temp file exists to draw on $ForumChoice = $in{'ForumChoice'}; if ($SkipSearch ne "true") { @index = @blank; #get forum/archive file @foruminfo = &OpenFile("$VariablesPath/forums.cgi"); $TotalForums = @foruminfo; @archives = &OpenFile("$NonCGIPath/Archives/archives.pl"); $TotalArchives = @archives; $TotalTotal = $TotalForums + $TotalArchives; #search one forum or all? if ($ForumChoice ne "ALL") { if ($ForumChoice !~ /A/) { GETFORUM: foreach $one(@foruminfo) { @thisforum = split(/\|/, $one); $thisnum = $thisforum[8]; if ($thisnum eq "$ForumChoice") { if ( ($thisforum[3] eq "On") && ($thisforum[6] ne "private") ) { @thisindex = &OpenFile("$NonCGIPath/forumindex$thisnum.cgi"); } else { @thisindex = @blank; } last GETFORUM; } } } else { #get archive index ($Junk, $ArchNum) = split(/:/, $ForumChoice); @thisindex = &OpenFile("$NonCGIPath/Archives/archiveindex-$ArchNum.pl"); } } else { #if searching all forums/archives... #assemble forum/archive number list @searchthru = @blank; foreach $thisone(@foruminfo) { @eachone = split(/\|/, $thisone); push(@searchthru, $eachone[8]); } foreach $thisuno(@archives) { @eacharch = split(/\|\#\|/, $thisuno); $ArchNum = "A:$eacharch[0]"; push(@searchthru, $ArchNum); } #determine starting point if ($in{'StartAt'} eq "") { $firstforum = $foruminfo[0]; @thisforum = split(/\|/, $firstforum); $thisnum = $thisforum[8]; if ( ($thisforum[3] eq "On") && ($thisforum[6] ne "private") ) { @thisindex = &OpenFile("$NonCGIPath/forumindex$thisnum.cgi"); } else { @thisindex = @blank; } if ($TotalTotal > 1) { $NextForum = "$searchthru[1]"; chomp($NextForum); $ProcessNext = "true"; } else { $ProcessNext = "false"; } } else { if ($in{'StartAt'} !~ /A/) { @thisforum = &GetForumRecord($in{'StartAt'}); if ( ($thisforum[3] eq "On") && ($thisforum[6] ne "private") ) { @thisindex = &OpenFile("$NonCGIPath/forumindex$thisforum[8].cgi"); } else { @thisindex = @blank; } } else { #if retrieving an archive... ($Junk, $ArchNum) = split(/:/, $in{'StartAt'}); @thisindex = &OpenFile("$NonCGIPath/Archives/archiveindex-$ArchNum.pl"); } #check for final array line $ArrayRow = 0; $TotalArray = $TotalTotal - 1; CHECKTHIS: foreach $checkfinish(@searchthru) { chomp($checkfinish); if ($checkfinish eq "$in{'StartAt'}") { $ArrayLine = $ArrayRow; if ($ArrayLine == $TotalArray) { $ProcessNext = "false"; } else { $ProcessNext = "true"; $BumpUp = $ArrayRow + 1; $NextForum = $searchthru[$BumpUp]; chomp($NextForum); } last CHECKTHIS; } $ArrayRow++; } } #end if/else StartAt } # end if searching all archives @index = sort(@thisindex); # Determine Current Good Array if ($in{'File'} =~ /temp\S+\.cgi/) { open(HOLDER, "$NonCGIPath/searchlogs/$in{'File'}"); @good = ; close(HOLDER); } else { @good = @blank; } &DoTheSearch2; #places matches in @good &CheckBadChars($in{'File'}); #now we have all matches- write temp file if ($in{'File'} eq "") { &CreateTempSearchName; $FileName = "temp-$SearchFile.cgi"; } else { $FileName = "$in{'File'}"; } open(HOLD, ">$NonCGIPath/searchlogs/$FileName"); foreach $one(@good) { chomp($one); print HOLD "$one\n"; } close(HOLD); chmod(0666, "$NonCGIPath/searchlogs/$FileName"); } #end skip search check $MatchTotal = @good; my $MaxDisplay = 40; #maximum number to view per screen if ($in{'StartPoint'} eq "") { $StartPoint = 1; if ($MatchTotal <= $MaxDisplay) { $EndPoint = $MatchTotal; $Done = "true"; } else { $Done = ""; $EndPoint = $MaxDisplay; } $EP = $EndPoint - 1; @good = @good[0..$EP]; } else { $StartPoint = $in{'StartPoint'}; $EndPoint = $StartPoint + $MaxDisplay; $EndPoint = $EndPoint - 1; if ($MatchTotal <= $EndPoint) { $EndPoint = $MatchTotal; $Done = "true"; } else { $Done = ""; } } $SP = $StartPoint - 1; $EP = $EndPoint - 1; @good = @good[$SP..$EP]; if ($FileName eq "") { $FileName = "$in{'File'}"; } if ($Done ne "true") { $NextStart = $EndPoint + 1; $NextWording = qq([Weitere Themen]); } else { $NextWording = ""; } if ($MatchTotal == 0) { $StartPoint = 0; } print< $BBName - Suche $HeaderInsert $Header
Suche!
Ergebnisse Ihrer Suche:
Zeige Treffer $StartPoint bis $EndPoint ($MatchTotal total)      $NextWording Neue Suche | Zurück zu den Foren
$BorderTop TOP for $eachone(@good) { @goodline = split(/\|/, $eachone); if ($goodline[1] =~ /-/) { #it is an archive @thisarchive = &OpenFile("$NonCGIPath/Archives/archives.pl"); foreach $uno(@thisarchive) { if ($uno =~ /^$goodline[0]/) { ($ThisNum, $ForumName, $junk) = split(/\|\#\|/, $uno); } } $TheURL = "$NonCGIURL/Archives/Archive-$goodline[0]/HTML/$goodline[1].html"; } else { #it is not an archive, but a forum @GetForumName = &GetForumRecord("$goodline[0]"); $ForumName = "$GetForumName[1]"; $TheURL = "$NonCGIURL/Forum$goodline[0]/HTML/$goodline[1].html"; } $HyphenIt = "$goodline[3]"; ($ThisMo, $ThisDay, $ThisYear) = split(/-/, $HyphenIt); $CheckThisYear = length($ThisYear); if ($CheckThisYear < 4) { if ($CheckThisYear == 2) { $ThisYear = ("19" . "$ThisYear"); } else { $ThisYear = $ThisYear - 100; $ThisYear = sprintf ("%2d", $ThisYear); $ThisYear =~tr/ /0/; $ThisYear = ("20" . "$ThisYear"); } $HyphenIt = "$ThisMo-$ThisDay-$ThisYear"; } if ($DateFormat eq "US") { $TheDate = "$HyphenIt"; $DateSize = "2"; } elsif ($DateFormat eq "Euro") { $TheDate = "$ThisDay.$ThisMo.$ThisYear"; $DateSize = "2"; } elsif ($DateFormat eq "USX") { $TheDate = &DateFormat("$HyphenIt", "USExpanded"); $DateSize = "1"; } else { $TheDate = &DateFormat("$HyphenIt", "EuroExpanded"); $DateSize = "1"; } print< ROW } print< $BorderBottom

$NextWording

$YourCopyrightNotice



$infopopcopy
Ultimate Bulletin Board $Version

$Footer BOTTOM } # end SimpleSearch sr sub DoTheSearch2 { SEARCHMATCHES: foreach $line(@index) { $Bad = "no"; @indie = split(/\|/, $line); # Username Search Routine--- if ($SearchUser ne "") { if ($in{'ExactName'} eq "no") { unless ($indie[2] =~ m/$SearchUser/i) { $Bad = "yes"; } } else { unless ($indie[2] eq "$SearchUser") { $Bad = "yes"; } } } # Keyword Search Routine--- $GoodOne = ""; if (($SearchWords ne "") && ($Bad ne "yes")) { foreach $word(@SearchList) { if ($in{'BooleanAND'} eq "YES") { if ($in{'SearchIn'} eq "SUBJECT") { unless ($indie[4] =~ m/$word/i) { $Bad = "yes"; } } else { unless (($indie[5] =~ m/$word/i) || ($indie[4] =~ m/$word/i)) { $Bad = "yes"; } } } else { if ($in{'SearchIn'} eq "SUBJECT") { if ($indie[4] =~ m/$word/i) { $GoodOne = "yes"; } } else { if (($indie[4] =~ m/$word/i) || ($indie[5] =~ m/$word/i)) { $GoodOne = "yes"; } } } } } if (($in{'BooleanAND'} eq "NO") && ($GoodOne ne "yes")) { $Bad = "yes"; } # Date Search if (($in{'SearchDate'} ne "ALL") && ($Bad ne "yes")) { $PostDate = $indie[3]; chomp($PostDate); ($month, $day, $theyear) = split(/-/, $PostDate); $CheckThisYear = length($theyear); if ($CheckThisYear < 4) { if ($CheckThisYear == 2) { $Year = ("19" . "$theyear"); } else { $Year = $theyear - 100; $Year = sprintf ("%2d", $Year); $Year =~tr/ /0/; $Year = ("20" . "$Year"); } } else { $Year = $theyear; } $PostJDay = &jday($month, $day, $Year); #current jday is $CurrentJDay if ($in{'SearchDate'} eq "0") { $CutOff = ($CurrentJDay - 0); unless ($PostJDay >= $CutOff) { $Bad = "yes"; } } if ($in{'SearchDate'} eq "1") { $CutOff = ($CurrentJDay - 1); unless ($PostJDay >= $CutOff) { $Bad = "yes"; } } if ($in{'SearchDate'} eq "5") { $CutOff = ($CurrentJDay - 5); unless ($PostJDay >= $CutOff) { $Bad = "yes"; } } if ($in{'SearchDate'} eq "10") { $CutOff = ($CurrentJDay - 10); unless ($PostJDay >= $CutOff) { $Bad = "yes"; } } if ($in{'SearchDate'} eq "30") { $CutOff = ($CurrentJDay - 30); unless ($PostJDay >= $CutOff) { $Bad = "yes"; } } } if ($Bad ne "yes") { (@testit) = split(/\|/, $line); $testit = ("$testit[0]" . "$testit[1]"); $Duplicate = ""; for $dupcheck(@good) { (@testit2) = split(/\|/, $dupcheck); $testit2 = ("$testit2[0]" . "$testit2[1]"); if ($testit eq "$testit2") { $Duplicate = "true"; } } if ($Duplicate ne "true") { $Total++; push(@good, $line); if ($Total >= 200) { $ProcessNext = "false"; $MaxSearch = "true"; } } } #end if $Bad if ($MaxSearch eq "true") { last SEARCHMATCHES; } } #end foreach $line if ($ProcessNext eq "true") { &ContinueSearch2($NextForum, $Total); exit; } } sub ContinueSearch2 { my $NextForum = shift; my $Total = shift; #check for search directory unless (-e "$NonCGIPath/searchlogs") { mkdir ("$NonCGIPath/searchlogs", 0777); chmod(0777, "$NonCGIPath/searchlogs"); } &CheckBadChars($in{'File'}); #create temp file to hold search results if ($in{'File'} eq "") { &CreateTempSearchName; $FileName = "temp-$SearchFile.cgi"; } else { $FileName = "$in{'File'}"; } open(HOLD, ">$NonCGIPath/searchlogs/$FileName"); foreach $one(@good) { chomp($one); print HOLD "$one\n"; } close(HOLD); chmod(0666, "$NonCGIPath/searchlogs/$FileName"); $Totalmatches = @good; if ($NextForum !~ /A/) { @getname = &GetForumRecord($NextForum); $ForumName = $getname[1]; $archiee = ""; } else { foreach $archie(@archives) { @archie = split(/\|\#\|/, $archie); if ($NextForum eq "A:$archie[0]") { $ForumName = "$archie[1]"; $archiee = "(Archiv)"; } } } &ForwardSearch("$CGIURL/search.cgi?action=simplesearch&SearchIn=$in{'SearchIn'}&ForumChoice=$in{'ForumChoice'}&SearchTerms=$SearchTermsCoded&BooleanAND=$in{'BooleanAND'}&SearchDate=$in{'SearchDate'}&SearchUser=$SearchUserCoded&ExactName=$in{'ExactName'}&File=$FileName&Total=$Total&StartAt=$NextForum", "Bitte warten Sie ... Ihre Suchanfrage wird bearbeitet ...

Treffer bisher: $Totalmatches

Durchsucht wird das Forum/Archiv: $ForumName $archiee

Hinweis: Es werden maximal 200 Treffer angezeigt.

"); exit; } exit(0); # comply with SafePerl

Thema Name Datum Forum/Archiv
$goodline[4] $goodline[2] $TheDate $ForumName