#!/usr/bin/perl require "config/megatoplist.cfg"; $version="1.8 Freeware"; ################################################################################ #### Megatoplist #### #### Version 1.8 Freeware Date: 09.11.2001 #### #### Support: webmaster@topcgi.de #### #### Updates: http://www.topcgi.de #### #### Language: German - Deutsch #### #### for other language versions, vistit: http://www.topcgi.de #### #### #### #### Copyright notice: #### #### Dieses Programm ist Freeware und darf somit von jederman kostenlos #### #### verwendet werden. Weiter darf der Programmcode verÄndert werden. #### #### Es ist aber untersagt, den eingebauten Werbebanner #### #### sowie die Copyrighthinweise zu entfernen. Diese dienen zur #### #### finanziellen UnterstØtzung und Weiterentwicklung des Programms. #### #### #### #### This script is freeware. Feel free to modify the source-code. #### #### It is not allowed to remove the advertising banner or the copyright #### #### notices. #### ################################################################################ #### Programmablauf &get_action; #### Anfrage wird ausgelesen und aufbereitet sub get_action { $buffer = $ENV{'QUERY_STRING'}; @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $FORM{$name} = $value; } } if ($FORM{action} eq "new_member"){ &new_member_form;} elsif ($FORM{action} eq "click_out"){&checkip;} elsif ($FORM{action} eq "click_in"){&checkip;} elsif ($FORM{action} eq "edit_account"){ &edit_form;} elsif ($FORM{action} eq "vote"){ &vote_form;} elsif ($FORM{action} eq "vote_final"){&checkip;} elsif ($FORM{action} eq "show_vote"){ &show_vote;} elsif ($FORM{action} eq "lostpassform"){ &lost_pass_form;} elsif ($FORM{action} eq "regeln"){ ®eln;} elsif ($FORM{lost_password} eq "ja"){ &search_pass;} else { &check_update; print "Location: $no_cgi_url/$toplist_html\n\n"; exit; } #### ANTI-CHEAT mittels IP-LOG sub checkip { $userip = $ENV{REMOTE_ADDR}; $zeit = time; ##### Festlegung wie alt die IP-Adressen sein duerfen $minvotetime = ($minzeit_vote*60); $clickintime =($minzeit_clickin*60); $clickouttime=($minzeit_clickout*60); $maxiptime = ($max_log_alter*3600); ##### alte IP-Eintraege loeschen open (IP,"; foreach $line (@OLDIP) { @TIME = split(/\|/,$line); if (($TIME[1]+$maxiptime)>$zeit){push @NEWIP,"$line";} } close (IP); open (NEWIP,">config/log/ip.log"); print NEWIP @NEWIP; close (NEWIP); #### IPCheck Vote if ($FORM{action} eq "vote_final"){ $lastvote_time = "0"; $votegefunden = "0"; foreach $line (@NEWIP) { chomp ($line) if ($line =~ /\n/); @VOTEIP = split(/\|/,$line); if (($VOTEIP[0] eq $userip)&&($VOTEIP[2] eq $FORM{action})&&($VOTEIP[3] eq $FORM{account})) {$votegefunden++; $lastvote_time=$VOTEIP[1]; } } if (($votegefunden <=($maxvote_pro_account-1))&&( $zeit > ($lastvote_time+$minvotetime))){ open (VOTELOG,">>config/log/ip.log"); print VOTELOG "$userip|$zeit|$FORM{action}|$FORM{account}\n"; close(VOTELOG); &vote_final;&check_update; } if (($votegefunden <=($maxvote_pro_account-1))&&( $zeit < ($lastvote_time+$minvotetime))){ push @FEHLER , "

\n"; push @FEHLER , "Sie können diesen Account nur alle $minzeit_vote Minuten bewerten!

\n"; &error; } if ($votegefunden > ($maxvote_pro_account-1)) { push @FEHLER , "

\n"; push @FEHLER , "Sie können den \"$FORM{account}\" Account maximal $maxvote_pro_account mal pro Sitzung bewerten!

\n"; &error; } } #### IPCheck CLICK_IN if ($FORM{action} eq "click_in"){ $last_click_in_time=0; $click_in_gefunden=0; foreach $line (@NEWIP) { chomp ($line) if ($line =~ /\n/); @CLICK_IN_IP = split(/\|/,$line); if (($CLICK_IN_IP[0] eq $userip)&&($CLICK_IN_IP[2] eq $FORM{action})&&($CLICK_IN_IP[3] eq $FORM{account})) {$click_in_gefunden="1"; $last_click_in_time=$CLICK_IN_IP[1]; } } if (($click_in_gefunden eq "1")&&($zeit<($last_click_in_time+$clickintime))){ &check_update; print "Location: $no_cgi_url/$toplist_html\n\n"; } else { open (CLICK_IN_LOG,">>config/log/ip.log"); print CLICK_IN_LOG "$userip|$zeit|$FORM{action}|$FORM{account}\n"; close(CLICK_IN_LOG); &check_update; &log_click_in; print "Location: $no_cgi_url/$toplist_html\n\n"; exit; } } #### IPCheck CLICK_out if ($FORM{action} eq "click_out"){ $last_click_out_time=0; $click_out_gefunden=0; foreach $line (@NEWIP) { chomp ($line) if ($line =~ /\n/); @CLICK_out_IP = split(/\|/,$line); if (($CLICK_out_IP[0] eq $userip)&&($CLICK_out_IP[2] eq $FORM{action})&&($CLICK_out_IP[3] eq $FORM{account})) { $last_click_out_time=$CLICK_out_IP[1]; $click_out_gefunden=1; } } if (($click_out_gefunden eq "1")&&($zeit<($last_click_out_time+$clickouttime))){ &check_update; $datensatz=0; open (ALLEACCOUNTS, "<$userdatapath/user.dat"); if ($use_flock eq "1") {flock (ALLEACCOUNTS,1);} @ALLEACCOUNTS = ; foreach (@ALLEACCOUNTS){ @USER = split(/\|/, $ALLEACCOUNTS[$datensatz]); if ($USER[4] eq $FORM{account}) { $redirect = $USER[11]; } $datensatz++; } if ($use_flock eq "1") {flock (ALLEACCOUNTS,8);} close (ALLEACCOUNTS); print "Location: $redirect \n\n"; } else { open (CLICK_out_LOG,">>config/log/ip.log"); print CLICK_out_LOG "$userip|$zeit|$FORM{action}|$FORM{account}\n"; close(CLICK_out_LOG); &check_update; &log_click_out; exit; } } } #### Updatezeit wird ausgelesen sub check_update { $zeit = time(); if (!-e "$no_cgi_path/$toplist_html") { &create_new_toplist; } if (!-e "$cgi_root_path/config/reset.txt") { open (RESET, ">$cgi_root_path/config/reset.txt"); if ($use_flock eq "1") {flock (RESET,1);} print RESET $zeit; if ($use_flock eq "1") {flock (RESET,8);} close (RESET); } if (!-e "$cgi_root_path/config/reset_all.txt") { open (RESETALL, ">$cgi_root_path/config/reset_all.txt"); if ($use_flock eq "1") {flock (RESETALL,1);} print RESETALL $zeit; if ($use_flock eq "1") {flock (RESETALL,8);} close (RESETALL); } if (!-e "$cgi_root_path/config/update.txt") { open (UPDATE, ">$cgi_root_path/config/update.txt"); if ($use_flock eq "1") {flock (UPDATE,1);} print UPDATE $zeit; if ($use_flock eq "1") {flock (UPDATE,8);} close (UPDATE); } open (RESET, "<$cgi_root_path/config/reset.txt"); if ($use_flock eq "1") {flock (RESET,1);} $last_reset = ; if ($use_flock eq "1") {flock (RESET,8);} close (RESET); open (RESETALL,"<$cgi_root_path/config/reset_all.txt"); if ($use_flock eq "1") {flock (RESETALL,1);} $last_reset_all = ; if ($use_flock eq "1") {flock (RESETALL,8);} close (RESETALL); open (UPDATE,"<$cgi_root_path/config/update.txt"); if ($use_flock eq "1") {flock (UPDATE,1);} $last_update =; if ($use_flock eq "1") {flock (UPDATE,8);} close (UPDATE); if ($zeit > $last_reset+($reset_time*86400)) { open (RESET, ">$cgi_root_path/config/reset.txt"); if ($use_flock eq "1") {flock (RESET,1);} print RESET $zeit; if ($use_flock eq "1") {flock (RESET,8);} close (RESET); &reset_account; &create_new_toplist; } elsif ($zeit > $last_reset_all+($reset_all_time*86400)) { open (RESETALL, ">$cgi_root_path/config/reset_all.txt"); if ($use_flock eq "1") {flock (RESETALL,1);} print RESETALL $zeit; if ($use_flock eq "1") {flock (RESETALL,8);} close (RESETALL); &reset_all_accounts; &create_new_toplist; } elsif ($zeit > $last_update+($update_time*60)) { open (UPDATE, ">$cgi_root_path/config/update.txt"); if ($use_flock eq "1") {flock (UPDATE,1);} print UPDATE $zeit; if ($use_flock eq "1") {flock (UPDATE,8);} close (UPDATE); &update_account; &create_new_toplist; } } #### Neue Toplist wird generiert sub create_new_toplist { $time = time(); ### Zur berechnung der durschnittshits ##### Uhrzeit der aktuellen Liste wird berechnet (mit Serveroffset) $offsetzeit = time() + ($serveroffset * 3600); ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime ($offsetzeit); @months = ("space" , "Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"); $mon++;$year = $year + 1900;$monformat = sprintf ("%2d", $mon);$monformat =~tr/ /0/; $mdayformat = sprintf ("%2d", $mday);$mdayformat =~tr/ /0/;$USDate = "$monformat-$mdayformat-$year"; $EuroDate = "$mdayformat-$monformat-$year";$USDateerweitert = "$months[$mon] $mday, $year"; $EuroDateerweitert = "$mday $months[$mon] $year";$min = sprintf ("%2d", $min);$min =~tr/ /0/; $hour = sprintf ("%2d", $hour);$hour =~tr/ /0/;$EuroTime = "$hour:$min Uhr"; if ($hour < 12) {$ext = "AM";$USHour = "$hour";}if ($hour > 12) {$USHour = $hour - 12;$ext = "PM";} if ($hour == 12){$ext = "PM";$USHour = "12";}if ($hour == 0) {$USHour = "12";} $USHour = sprintf ("%2d", $USHour);$USHour =~tr/ /0/;$USTime = "$USHour:$min $ext"; if ($timeformat eq "12") {$aktzeit = $USTime;} else {$aktzeit = $EuroTime;} if ($dateformat eq "US") {$aktdate = "$USDate";}elsif ($dateformat eq "USXL") {$aktdate = "$USDateerweitert";} elsif ($dateformat eq "EU") {$aktdate = "$EuroDate";}else {$aktdate = "$EuroDateerweitert";} ##### Uhrzeit des naechsten Updates wird berechnet (mit Serveroffset) $updatezeit = time() + ($serveroffset * 3600) +($update_time * 60); ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime ($updatezeit); @months = ("space" , "Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"); $mon++;$year = $year + 1900;$monformat = sprintf ("%2d", $mon);$monformat =~tr/ /0/; $mdayformat = sprintf ("%2d", $mday);$mdayformat =~tr/ /0/; $USDate = "$monformat-$mdayformat-$year";$EuroDate = "$mdayformat-$monformat-$year"; $USDateerweitert = "$months[$mon] $mday, $year";$EuroDateerweitert = "$mday $months[$mon] $year"; $min = sprintf ("%2d", $min);$min =~tr/ /0/;$hour = sprintf ("%2d", $hour);$hour =~tr/ /0/; $EuroTime = "$hour:$min Uhr";if ($hour < 12) {$ext = "AM";$USHour = "$hour";}if ($hour > 12) {$USHour = $hour - 12;$ext = "PM";} if ($hour == 12){$ext = "PM";$USHour = "12";} if ($hour == 0) {$USHour = "12";} $USHour = sprintf ("%2d", $USHour);$USHour =~tr/ /0/;$USTime = "$USHour:$min $ext"; if ($timeformat eq "12") {$nextupdatetime = $USTime;}else {$nextupdatetime = $EuroTime;} if ($dateformat eq "US") {$nextupdatedate = "$USDate";}elsif ($dateformat eq "USXL") {$nextupdatedate = "$USDateerweitert";} elsif ($dateformat eq "EU") {$nextupdatedate = "$EuroDate";}else {$nextupdatedate = "$EuroDateerweitert";} ###### Uhrzeit das naechste Reset wird berechnet (mit Serveroffeset) $resetzeit = $last_reset + ($serveroffset * 3600) + ($reset_time*86400); ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime ($resetzeit); @months = ("space" , "Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"); $mon++;$year = $year + 1900;$monformat = sprintf ("%2d", $mon);$monformat =~tr/ /0/; $mdayformat = sprintf ("%2d", $mday);$mdayformat =~tr/ /0/; $USDate = "$monformat-$mdayformat-$year";$EuroDate = "$mdayformat-$monformat-$year"; $USDateerweitert = "$months[$mon] $mday, $year";$EuroDateerweitert = "$mday $months[$mon] $year"; $min = sprintf ("%2d", $min);$min =~tr/ /0/;$hour = sprintf ("%2d", $hour);$hour =~tr/ /0/; $EuroTime = "$hour:$min Uhr";if ($hour < 12) {$ext = "AM";$USHour = "$hour";}if ($hour > 12) {$USHour = $hour - 12;$ext = "PM";} if ($hour == 12){$ext = "PM";$USHour = "12";} if ($hour == 0) {$USHour = "12";} $USHour = sprintf ("%2d", $USHour);$USHour =~tr/ /0/;$USTime = "$USHour:$min $ext"; if ($timeformat eq "12") {$nextresettime = $USTime;}else {$nextresettime = $EuroTime;} if ($dateformat eq "US") {$nextresetdate = "$USDate";}elsif ($dateformat eq "USXL") {$nextresetdate = "$USDateerweitert";} elsif ($dateformat eq "EU") {$nextresetdate = "$EuroDate";}else {$nextresetdate = "$EuroDateerweitert";} open (ACCOUNT, "<$userdatapath/user.dat"); if ($use_flock eq "1") {flock (ACCOUNT,1);} @ALLEDATEN = ; if ($use_flock eq "1") {flock (ACCOUNT,8);} close (ACCOUNT); @ALLEDATEN = sort {$b <=> $a} @ALLEDATEN; $datensatz = "0"; $user_found = "0"; foreach (@ALLEDATEN) { @TEMPARRY = split (/\|/,$ALLEDATEN[$datensatz] ); if (($TEMPARRY[0] >=$min_click) && ($TEMPARRY[18] !="0") && ($user_found < $max_in_list)) { push (@TOPUSER, join ("\|", @TEMPARRY)); $user_found++; } $datensatz++; } ##### Berechnung wieviel User in der Datenbank sind! $eingetrageneuser = $datensatz++; $topliste .="$title\n"; if ($laufleiste) { $topliste .= ""; } open (DATEI,"<$cgi_root_path/config/insert/metatag.dat"); if ($use_flock eq "1") {flock (DATEI,1);} @DATEN =; if ($use_flock eq "1") {flock (DATEI,8);} close (DATEI); foreach $line (@DATEN) { $topliste .=$line; } $topliste .="\n\n\n"; open (DATEI,"<$cgi_root_path/config/insert/header.dat"); if ($use_flock eq "1") {flock (DATEI,1);} @DATEN =; if ($use_flock eq "1") {flock (DATEI,1);} close (DATEI); foreach $line (@DATEN) { $topliste .=$line; } $topliste .="
[Home] [Anmelden] [Userlogin]

"; if ($update_time > 1){$topliste .="Diese Liste wird alle $update_time Minuten aktualisiert. ";} else {$topliste .="Diese Liste wird alle 60 Sekunden aktualisiert. ";} if ($reset_time > 1){$topliste .="Ein Reset erfolgt alle $reset_time Tage.";} else {$topliste .="Ein Reset erfolgt jeden Tag. ";} $topliste .="
Nächtes Reset: $nextresetdate um $nextresettime.
\n"; $topliste .="
Eingetragene Mitglieder:$eingetrageneuser
\n"; $topliste .="
"; $datensatz = "0"; $platz = "1"; foreach (@TOPUSER) { @USER = split (/\|/, $TOPUSER[$datensatz]); $topliste .="
"; $tage = ($time - $USER[15]) / 86400; if ($tage < "1") {$tage = 1;} $dschnitt_in = int ( $USER[16] / $tage); $dschnitt_out = int ( $USER[17] / $tage); $topliste .=" "; if ($platz eq "1") {$topliste .="

Platz

Homepage des Tages

Rein
 
(gesamt)

Raus
 
(gesamt)

$platz

"; if ($platz <= $maximale_banneranzahl) { $topliste .="
$USER[9]

\n"; } else {$topliste .="
";} $topliste .="$USER[9] $USER[10]

$USER[0]

($USER[16])

$USER[1]

($USER[17])

"; if ($USER[19]<= 10) {$bild='5star.gif'; if ($USER[19]<= 9) {$bild='4star.gif';} if ($USER[19]<= 8) {$bild='3star.gif';} if ($USER[19]<= 7) {$bild='2star.gif';} if ($USER[19]<= 6) {$bild='1star.gif';} if ($USER[19]<= 5) {$bild='0star.gif';} } $topliste .="Bewertungsergebnisse"; $topliste .="

Bewerten: $USER[20]
\ Ø $dschnitt_in
Ø $dschnitt_out
";} if ($platz eq "1" && $user_found > 1 && $platz < $max_in_list) {$topliste .="
"; if ($werbung eq 1) { $topliste .="

\n"; $topliste .=" \n"; $topliste .="
\n"; } elsif ($werbung eq 2) { $topliste .="

\n"; $topliste .=" \n"; $topliste .="
\n"; } else { open (DATEI,"<$cgi_root_path/config/insert/insert_2-10.dat"); if ($use_flock eq "1") {flock (DATEI,1);} @DATEN =; if ($use_flock eq "1") {flock (DATEI,8);} close (DATEI); foreach $line (@DATEN) { $topliste .=$line; } } $topliste .=""; } if ($platz eq "10") {$topliste .="

Platz

TOP 2-10

Rein
 
(gesamt)

Raus
 
(gesamt)

";} if ($platz eq "10" && $user_found > 1 && $platz < $max_in_list) { $topliste .="

"; open (DATEI,"<$cgi_root_path/config/insert/insert_11-25.dat"); if ($use_flock eq "1") {flock (DATEI,1);} @DATEN =; if ($use_flock eq "1") {flock (DATEI,8);} close (DATEI); foreach $line (@DATEN) { $topliste .=$line; } $topliste .="

"; $topliste .="
"; } if ($platz eq "25") {$topliste .="

Platz

TOP 11-25

Rein
 
(gesamt)

Raus
 
(gesamt)

";} if ($platz eq "25" && $user_found > 1 && $platz < $max_in_list) { $topliste .="

"; open (DATEI,"<$cgi_root_path/config/insert/insert_26-50.dat"); if ($use_flock eq "1") {flock (DATEI,1);} @DATEN =; if ($use_flock eq "1") {flock (DATEI,8);} close (DATEI); foreach $line (@DATEN) { $topliste .=$line; } $topliste .="

"; $topliste .="
"; } if ($platz eq "50") {$topliste .="

Platz

TOP 26-50

Rein
 
(gesamt)

Raus
 
(gesamt)

";} if ($platz eq "50" && $user_found > 1 && $platz < $max_in_list) { $topliste .="

"; open (DATEI,"<$cgi_root_path/config/insert/insert_51-75.dat"); if ($use_flock eq "1") {flock (DATEI,1);} @DATEN =; if ($use_flock eq "1") {flock (DATEI,8);} close (DATEI); foreach $line (@DATEN) { $topliste .=$line; } $topliste .="

"; $topliste .="
"; } if ($platz eq "75") {$topliste .="

Platz

TOP 51-75

Rein
 
(gesamt)

Raus
 
(gesamt)

";} if ($platz eq "75" && $user_found > 1 && $platz < $max_in_list) { $topliste .="

"; open (DATEI,"<$cgi_root_path/config/insert/insert_76-100.dat"); if ($use_flock eq "1") {flock (DATEI,1);} @DATEN =; if ($use_flock eq "1") {flock (DATEI,8);} close (DATEI); foreach $line (@DATEN) { $topliste .=$line; } $topliste .="

"; $topliste .="
"; } if ($platz eq "100") {$topliste .="

Platz

TOP 76-100

Rein
 
(gesamt)

Raus
 
(gesamt)

";} if ($platz eq "100" && $user_found > 100 && $platz < $max_in_list) { $topliste .="

"; open (DATEI,"<$cgi_root_path/config/insert/insert_101-xxx.dat"); if ($use_flock eq "1") {flock (DATEI,1);} @DATEN =; if ($use_flock eq "1") {flock (DATEI,8);} close (DATEI); foreach $line (@DATEN) { $topliste .=$line; } $topliste .="

"; $topliste .="
"; } $platz++; $datensatz++; } $topliste .="

Platz

TOP 101-"; if ($user_found > $max_in_list) {$topliste .="$max_in_list";} else {$topliste .=" $user_found "; } $topliste .="

Rein
 
(gesamt)

Raus
 
(gesamt)

\n"; open (DATEI,"<$cgi_root_path/config/insert/footer.dat"); if ($use_flock eq "1") {flock (DATEI,1);} @DATEN =; if ($use_flock eq "1") {flock (DATEI,8);} close (DATEI); foreach $line (@DATEN) { $topliste .="$line"; } $topliste .="

Megatoplist V$version © byTopcgi
"; $topliste .=""; open (NEW,">$no_cgi_path/$toplist_html"); if ($use_flock eq "1") {flock (NEW,1);} print NEW $topliste; if ($use_flock eq "1") {flock (NEW,8);} close (NEW); } ### Klick aus der Topliste heraus wird protokolliert sub log_click_out { $datensatz=0; open (ALLEACCOUNTS, "+<$userdatapath/user.dat"); if ($use_flock eq "1") {flock (ALLEACCOUNTS,1);} @ALLEACCOUNTS = ; foreach (@ALLEACCOUNTS) { @USER = split(/\|/, $ALLEACCOUNTS[$datensatz]); if ($USER[4] eq $FORM{account}) { $USER[3]++; $USER[17]++; $redirect = $USER[11]; $ALLEACCOUNTS[$datensatz] = join ("\|",@USER); } $datensatz++; } seek (ALLEACCOUNTS, 0, 0); print ALLEACCOUNTS @ALLEACCOUNTS; if ($use_flock eq "1") {flock (ALLEACCOUNTS,8);} close (ALLEACCOUNTS); print "Location: $redirect \n\n"; } #### Externer Klick wird protokolliert, User wird an die Topliste weitergeleitet sub log_click_in { $datensatz=0; open (ALLEACCOUNTS, "+<$userdatapath/user.dat"); if ($use_flock eq "1") {flock (ALLEACCOUNTS,1);} @ALLEACCOUNTS = ; foreach (@ALLEACCOUNTS) { @USER = split(/\|/, $ALLEACCOUNTS[$datensatz]); if ($USER[4] eq $FORM{account}) { $USER[2]++; $USER[16]++; $ALLEACCOUNTS[$datensatz] = join ("\|",@USER); } $datensatz++; } seek (ALLEACCOUNTS, 0, 0); print ALLEACCOUNTS @ALLEACCOUNTS; if ($use_flock eq "1") {flock (ALLEACCOUNTS,8);} close (ALLEACCOUNTS); } sub update_account { $datensatz=0; open (ALLEACCOUNTS, "<$userdatapath/user.dat"); if ($use_flock eq "1") {flock (ALLEACCOUNTS,1);} @ALLEACCOUNTS = ; if ($use_flock eq "1") {flock (ALLEACCOUNTS,8);} close (ALLEACCOUNTS); foreach (@ALLEACCOUNTS) { @USER = split(/\|/, $ALLEACCOUNTS[$datensatz]); $USER[0] = $USER[0] + $USER[2]; $USER[1] = $USER[1] + $USER[3]; $USER[2] = 0; $USER[3] = 0; $v1 = $USER[21]* 10; $v2 = $USER[22]* 20; $v3 = $USER[23]* 30; $v4 = $USER[24]* 40; $v5 = $USER[25]* 50; $v6 = $USER[26]* 60; $v7 = $USER[27]* 70; $v8 = $USER[28]* 80; $v9 = $USER[29]* 90; $v10 = $USER[30]* 100; if ($USER[20] eq 0) {$stimmen = "1";} else {$stimmen = $USER[20];} $vote = (($v1+$v2+$v3+$v4+$v5+$v6+$v7+$v8+$v9+$v10) / $stimmen)/10; $USER[19] = $vote; $ALLEACCOUNTS[$datensatz] = join ("\|",@USER); $datensatz++; } open (ALLEACCOUNTS, ">$userdatapath/user.dat"); if ($use_flock eq "1") {flock (ALLEACCOUNTS,1);} print ALLEACCOUNTS @ALLEACCOUNTS; if ($use_flock eq "1") {flock (ALLEACCOUNTS,8);} close (ALLEACCOUNTS); } sub reset_account { $datensatz=0; open (ALLEACCOUNTS, "<$userdatapath/user.dat"); if ($use_flock eq "1") {flock (ALLEACCOUNTS,1);} @ALLEACCOUNTS = ; if ($use_flock eq "1") {flock (ALLEACCOUNTS,8);} close (ALLEACCOUNTS); foreach (@ALLEACCOUNTS) { @USER = split(/\|/, $ALLEACCOUNTS[$datensatz]); $USER[0] = 0; $USER[1] = 0; $USER[2] = 0; $USER[3] = 0; $ALLEACCOUNTS[$datensatz] = join ("\|",@USER); $datensatz++; } open (ALLEACCOUNTS, ">$userdatapath/user.dat"); if ($use_flock eq "1") {flock (ALLEACCOUNTS,1);} print ALLEACCOUNTS @ALLEACCOUNTS; if ($use_flock eq "1") {flock (ALLEACCOUNTS,8);} close (ALLEACCOUNTS); } sub reset_all_accounts { $datensatz=0; open (ALLEACCOUNTS, "<$userdatapath/user.dat"); if ($use_flock eq "1") {flock (ALLEACCOUNTS,1);} @ALLEACCOUNTS = ; if ($use_flock eq "1") {flock (ALLEACCOUNTS,8);} close (ALLEACCOUNTS); foreach (@ALLEACCOUNTS) { @USER = split(/\|/, $ALLEACCOUNTS[$datensatz]); $USER[0] = 0; $USER[1] = 0; $USER[2] = 0; $USER[3] = 0; $USER[15] = time(); $USER[16] = 0; $USER[17] = 0; $USER[19] = 0; $USER[20] = 0; $USER[21] = 0; $USER[22] = 0; $USER[23] = 0; $USER[24] = 0; $USER[25] = 0; $USER[26] = 0; $USER[27] = 0; $USER[28] = 0; $USER[29] = 0; $USER[30] = 0; $ALLEACCOUNTS[$datensatz] = join ("\|",@USER); $datensatz++; } open (ALLEACCOUNTS, ">$userdatapath/user.dat"); if ($use_flock eq "1") {flock (ALLEACCOUNTS,1);} print ALLEACCOUNTS @ALLEACCOUNTS; if ($use_flock eq "1") {flock (ALLEACCOUNTS,8);} close (ALLEACCOUNTS); } #### Bewertung eines Mitgliedes anzeigen sub show_vote { &header; $datensatz = "0"; open (ACCOUNT, "<$userdatapath/user.dat"); if ($use_flock eq "1") {flock (ACCOUNT,1);} @ALLEDATEN = ; if ($use_flock eq "1") {flock (ACCOUNT,8);} close (ACCOUNT); foreach (@ALLEDATEN) { @ACCOUNTDATEN = split (/\|/, $ALLEDATEN[$datensatz]); if ($ACCOUNTDATEN[4] eq $FORM{account}) {@ACCOUNT =@ACCOUNTDATEN; $voteanzahl = $ACCOUNT[20]; $v1 = $ACCOUNT[21]* 10; $v2 = $ACCOUNT[22]* 20; $v3 = $ACCOUNT[23]* 30; $v4 = $ACCOUNT[24]* 40; $v5 = $ACCOUNT[25]* 50; $v6 = $ACCOUNT[26]* 60; $v7 = $ACCOUNT[27]* 70; $v8 = $ACCOUNT[28]* 80; $v9 = $ACCOUNT[29]* 90; $v10 = $ACCOUNT[30]* 100; $stimmen = $voteanzahl; if ($voteanzahl eq 0) {$voteanzahl = 1;$stimmen=0;} $vote_percent = ($v1+$v2+$v3+$v4+$v5+$v6+$v7+$v8+$v9+$v10) / $voteanzahl; $vote_percent = int $vote_percent; } $datensatz++; } print "
\n"; print "
\n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print "
\n"; print "

Bewertung des " $FORM{account} "\n"; print " Accounts

\n"; print "

 \n"; print "

\n"; print " \n"; print "
\n"; print "
\n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print "
 10 Punkte \= $ACCOUNT[30] mal
 9 Punkte \= $ACCOUNT[29] mal
 8 Punkte \= $ACCOUNT[28] mal
 7 Punkte \= $ACCOUNT[27] mal
 6 Punkte \= $ACCOUNT[26] mal
 5 Punkte \= $ACCOUNT[25] mal
 4 Punkte \= $ACCOUNT[24] mal
 3 Punkte \= $ACCOUNT[23] mal
 2 Punkte \= $ACCOUNT[22] mal
 1 Punkt \= $ACCOUNT[21] mal
\n"; print "
\n"; print "
\n"; print " \n"; print "

Anzahl der Stimmen \= $stimmen "; print " \n"; print "

 Gesamtergebnis \ = \$vote_percent%"; print " \n"; print "

 

\n"; print "

\n"; print "
\n"; print "
\n"; &footer; } #### Html Header sub header { print "Content-type: text/html\n\n"; print "$title\n"; if ($laufleiste) { print ""; } open (DATEI,"<$cgi_root_path/config/insert/metatag.dat"); if ($use_flock eq "1") {flock (DATEI,1);} @DATEN =; if ($use_flock eq "1") {flock (DATEI,8);} close (DATEI); foreach $line (@DATEN) { print $line; } print "\n"; print "\n"; open (DATEI,"<$cgi_root_path/config/insert/header.dat"); if ($use_flock eq "1") {flock (DATEI,1);} @DATEN =; if ($use_flock eq "1") {flock (DATEI,8);} close (DATEI); foreach $line (@DATEN) { print $line; } } #### Html Footer sub footer { open (DATEI,"<$cgi_root_path/config/insert/footer.dat"); if ($use_flock eq "1") {flock (DATEI,1);} @DATEN =; if ($use_flock eq "1") {flock (DATEI,8);} close (DATEI); foreach $line (@DATEN) { print $line; } print "

Megatoplist V$version © byTopcgi
\n"; print "\n"; } #### Formular New Member sub new_member_form { &header; print "
\n"; print "
\n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print "
\n"; print "

Neuen Account erstellen

Account Name
Passwort
Wiederhohlung Passwort
Vorname
Nachname
Email
Seitenname
Beschreibung\n"; print "
Seiten-Url
Bannerurl
Bannerbreite (max. $user_banner_width Pixel)
Bannerhöhe (max. $user_banner_height Pixel)
Ich stimme den Regeln zu
 \ \  \n"; print "
\n"; print "
\n"; print "
\n"; &footer; } sub edit_form { &header; print "
\n"; print "
\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
\n"; print "

Login\: Account bearbeiten

Account Name
Passwort
\n"; print "

\n"; print "\n"; print "\n"; if ($email_on eq 1){ print "

Passwort vergessen\?\n"; } print "

\n"; print "
\n"; print "
\n"; print "
\n"; &footer; } sub vote_form { &header; print "

 

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

\"$FORM{account}\" -  Account bewerten

\n"; print "

 

\n"; print "

\n"; print "\"Userbanner

\n"; print "

 

\n"; print "

 

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

       

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

 

\n"; print "
\n"; print "
\n"; &footer; } sub vote_final { $datensatz = "0"; open (ACCOUNT, "<$userdatapath/user.dat"); if ($use_flock eq "1") {flock (ACCOUNT,1);} @ALLEDATEN = ; if ($use_flock eq "1") {flock (ACCOUNT,8);} close (ACCOUNT); foreach (@ALLEDATEN) { @ACCOUNTDATEN = split (/\|/, $ALLEDATEN[$datensatz]); if ($ACCOUNTDATEN[4] eq $FORM{account}) {$ACCOUNTDATEN[$FORM{bewertung}]++ ; $ACCOUNTDATEN[20]++ ; $vote_erfolgreich=1;} $ALLEDATEN[$datensatz] = join ("\|",@ACCOUNTDATEN); $datensatz++; } open (ACCOUNT, ">$userdatapath/user.dat"); if ($use_flock eq "1") {flock (ACCOUNT,1);} print ACCOUNT @ALLEDATEN; if ($use_flock eq "1") {flock (ACCOUNT,8);} close (ACCOUNT); &show_vote; } sub lost_pass_form { &header; print "
\n"; print "
\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
\n"; print "

Passwort vergessen \?

\n"; print "
Bitte geben Sie Ihren Accountnamen ein.
"; print "
Account Name
\n"; print "

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

\n"; print "
\n"; print "
\n"; print "
\n"; &footer; } sub search_pass { $datensatz = "0"; open (ACCOUNT, "<$userdatapath/user.dat"); if ($use_flock eq "1") {flock (ACCOUNT,1);} @ALLEDATEN = ; if ($use_flock eq "1") {flock (ACCOUNT,8);} close (ACCOUNT); foreach (@ALLEDATEN) { @ACCOUNTDATEN = split (/\|/, $ALLEDATEN[$datensatz]); if ($ACCOUNTDATEN[4] eq $FORM{account}) {$ACCOUNTDATEN[$FORM{bewertung}]++ ; $pass=$ACCOUNTDATEN[5]; $email=$ACCOUNTDATEN[8] ; $suche_erfolgreich=1;} $datensatz++; } if ($suche_erfolgreich eq 1){ @MAIL = split(/\@/, $email); open (MAIL,"|$mailpath -t"); print MAIL "To: $MAIL[0]\@$MAIL[1]\n"; print MAIL "From: $your_mail\n"; print MAIL "Subject: Ihre Passwort fuer die $title \n"; print MAIL "Sie haben Ihr Passwort bei uns angefordert.\n\n"; print MAIL "Folgende Zugangsdaten haben wir gefunden:\n\n"; print MAIL "Accountname: $FORM{account} \n"; print MAIL "Passwort: $pass\n\n"; print MAIL "Sie finden Ihren Eintrag unter:\n\n"; print MAIL "$cgi_root_url/toplist.pl\n\n"; print MAIL "Sollten Ihre Daten fehlerhaft sein koennen Sie diese hier aendern:\n\n"; print MAIL "$cgi_root_url/toplist.pl?action=edit_account\n\n"; close (MAIL); &header; print "
\n"; print "
\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
\n"; print "
Passwort wurde verschickt
\n"; print "


Ihr Passwort wurde soeben an folgende Email verschickt:

"; print "$email



\n"; print "

Zurück zur $title

\n"; print "
\n"; print "
\n"; &footer; } else { &header; print "
\n"; print "
\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
\n"; print "
Accountdaten nicht gefunden\!
\n"; print "


Leider haben wir Ihre Accountdaten nicht gefunden!
"; print "Bitte überprüfen Sie Ihre Eingabe\!



\n"; print "

Zurück

\n"; print "
\n"; print "
\n"; &footer; } } sub regeln { &header; print "
\n"; print "
\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
\n"; print "
Regeln für den Beitritt in die $title
\n"; print "\n"; open (DATEI,"<$cgi_root_path/config/insert/regeln.txt"); if ($use_flock eq "1") {flock (DATEI,1);} @DATEN =; if ($use_flock eq "1") {flock (DATEI,8);} close (DATEI); foreach $line (@DATEN) { print "$line" ; } print "\n"; print "

\n"; print "
\n"; print "
\n"; &footer; } #### Fehlermeldung wird erstellt sub error { &header; print "
\n"; print "
\n"; print "\n"; print "\n"; print "\n"; print "\n"; print ""; print "
\n"; print "

\nFolgende Fehler wurden gefunden

 

\n"; print "@FEHLER"; print "

 

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

\n"; print "
\n"; &footer; } 1;