$YaBBChatplver = '1.9beta for YaBB Gold SP1';
sub chatadmin {
&is_admin;
$yytitle = "$chadmtxt{'6'}";
require "$vardir/chatlevel.dat";
$yymain .=qq~
~;
&template;
exit;
}
sub updatechat {
&is_admin;
$l1 = $FORM{'level1'};
$l2 = $FORM{'level2'};
$l3 = $FORM{'level3'};
$l4 = $FORM{'level4'};
$l5 = $FORM{'level5'};
$l6 = $FORM{'level6'};
fopen(FILE, ">$vardir/chatlevel.dat");
print FILE "\$level1 = \"$l1\"\;\n";
print FILE "\$level2 = \"$l2\"\;\n";
print FILE "\$level3 = \"$l3\"\;\n";
print FILE "\$level4 = \"$l4\"\;\n";
print FILE "\$level5 = \"$l5\"\;\n";
print FILE "\$level6 = \"$l6\"\;\n";
fclose(FILE);
&chatadmin;
}
1;
sub mainscript {
require "$vardir/chatlevel.dat";
########### load cookie ###################
foreach (split(/; /,$ENV{'HTTP_COOKIE'})) {
$_ =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
($cookie,$value) = split(/=/);
$yyCookies{$cookie} = $value;
}
if( $yyCookies{$cookiepassword} ) {
$password = $yyCookies{$cookiepassword};
$username = $yyCookies{$cookieusername} || 'Guest';
} else {
$passwordcook = '';
$username = 'Guest';
}
##################max edit#####################
fopen(FILE, "$memberdir/$username.dat");
@settings = ;
fclose(FILE);
$position = $settings[7];
$position =~ s/\n//g;
if ($username ne 'Guest'){
$userdisplayname = $settings[1];
$userdisplayname =~ s/\n//g;
$username =~ s/\n//g;
} else {
$userdisplayname = 'Guest';
}
$spassword = $settings[0];
$spassword =~ s/\n//g;
if ($enable_guestposting == 1){
}
else {
if ($password eq "") {
# print "Guests not allowed in chat!
";
# print "Please register for an account!";
exit;
}
}
$userlevel =1;
if ($level1 eq $position) {
$userlevel = 1;
}
if ($level2 eq $position) {
$userlevel = 2;
}
if ($level3 eq $position) {
$userlevel = 3;
}
if ($level4 eq $position) {
$userlevel = 4;
}
if ($level5 eq $position) {
$userlevel = 5;
}
if ($level6 eq $position) {
$userlevel = 6;
}
##############################
$cgiurl = "$boardurl/YaBB.$yyext?board=&action=chatnow";
$logouturl = "$imagesdir/close.htm";
$kickouturl = "$imagesdir/close.htm";
$onlinefile = "$vardir/online.txt";
$messfile = "$vardir/says.txt";
$wordcolorfile = "$vardir/ecolor.txt";
$addsaysfile = "$vardir/eaddsays.txt";
$imagefile = "$vardir/eimage.txt";
$txt{'img1'} = "
$chadmtxt{'60'}";
$txt{'img2'} = "
$chadmtxt{'31'}";
$txt{'img3'} = "
$chadmtxt{'55'}";
$txt{'img4'} = "
$chadmtxt{'56'}";
$txt{'img5'} = "
$chadmtxt{'57'}";
$txt{'img6'} = "
$chadmtxt{'58'}";
$img1 = "$imagesdir/chatreload.gif";
$img2 = "$imagesdir/chatonlinelist.gif";
$img3 = "$imagesdir/chathelp.gif";
$img4 = "$imagesdir/chatclearscreen.gif";
$img5 = "$imagesdir/chatkick.gif";
$img6 = "$imagesdir/chatquit.gif";
$saysback = $color{'chatsaysback'};
$saysword = $color{'chatsaysword'};
$loginword = $color{'chatloginword'};
$logoutword = $color{'chatlogoutword'};
$onlineback = $color{'chatonlineback'};
$onlineword = $color{'chatonlineword'};
$typeback = $color{'chattypeback'};
$typeword = $color{'chattypeword'};
$funcback = $color{'chatfuncback'};
$funcword = $color{'chatfuncword'};
$fastback = $color{'chatfastback'};
$sysmess = $color{'chatsysmess'};
$reload = 14;
$kicktime = 300;
$image_size = 3;
$allow_mess = 30;
$time_miss = +0;
$super_proxy = 0;
$level_towho = 1;
$level_cls = 4;
$level_html = 3;
$level_kick = 5;
$level_seelevel = 3;
$level_seeprivate= 6;
$super[0] = "hornet6∥password∥6";
$super[1] = "hornet5∥password∥5";
$super[2] = "hornet4∥password∥4";
$super[3] = "hornet3∥password∥3";
$super[4] = "hornet2∥password∥2";
$super[5] = "hornet1∥password∥1";
#####################################################
$title = "$mbname $chadmtxt{'59'} $infos[7]";
print "Content-type: text/html;CHARSET=win\n";
print "Pragma:no-cache\n\n";
$kicked = 0;
$kickoutway ="level1";
$exist="no";
$|=1;
&get_data;
&set_var;
# &proxy if ($super_proxy eq 1);
#if ($ENV{'HTTP_REFERER'} ne
#"$boardurl/YaBB.$yyext") {
# print "Content-type:text/html\n\n";
# print "You need to access chatroom only from board link
";
# print "$ENV{'HTTP_REFERER'}";
# print "$ENV{'REMOTE_ADDR'}";
# exit;
#}
if ($job eq "login") {
&write_online(online);
&write_mess(login) if ($exist eq "no");
&return_whole;
}
elsif ($job eq "logout") {
&write_online(outline);
&write_mess(logout) if ($exist ne "no");
&return_logout;
}
elsif ($job eq "setfunc") {
&return_func;
}
elsif ($job eq "settype") {
&write_online(online);
&return_type;
}
elsif ($job eq "look") {
&write_online(online);
&return_mess;
}
elsif ($job eq "setup") {
&return_up;
}
elsif ($job eq "tell") {
&return_tell;
}
elsif ($job eq "says") {
&write_online(online);
if ($kicked!=1) {
&write_mess(says);
}
&return_mess;
}
elsif ($job eq "online") {
&write_online(online);
&return_online(online);
}
elsif ($job eq "setkick") {
if ($userlevel>=$level_kick) {
&write_online(online);
&return_online(kickout);
}
else {&error("No User Right");}
}
elsif ($job eq "kickout") {
if ($userlevel>=$level_kick) {
if ($kickoutuser) {
&write_online(kickout);
}
&return_mess;
}
else {&error("No User Right");}
}
elsif ($job eq "typecls") {
&return_cls;
&write_mess(setcls);
&return_mess;
}
###########
sub write_mess {
$write_mess_subject=$_[0];
fopen(MESS,"$messfile") || die $!;
@mess = ;
fclose(MESS);
fopen(MESS,">$messfile") || die $!;
$total_mess1=0;
$total_mess2=0;
if ($write_mess_subject eq "says") {
print MESS "says∥$userip∥$userdisplayname∥$userlevel∥$usersex∥$towhoway∥$towho∥$wordcolor∥$addsays∥$says∥$addimage∥$normal_time∥end∥\n";
if (($towhoway eq "private") && ($towho ne "toall∥toall∥toall")) {$total_mess2++;}
else {$total_mess1++;}
}
elsif ($write_mess_subject eq "login") {
print MESS "login∥$userip∥$userdisplayname∥$userlevel∥$usersex∥∥∥∥∥∥∥∥∥$normal_time∥end∥\n";
$total_mess1++;}
elsif ($write_mess_subject eq "logout") {
print MESS "logout∥$userip∥$userdisplayname∥$userlevel∥$usersex∥∥∥∥∥∥∥∥∥$normal_time∥end∥\n";
$total_mess1++;}
elsif ($write_mess_subject eq "setcls") {
print MESS "setcls∥$userip∥$userdisplayname∥$userlevel∥$usersex∥∥∥∥∥∥∥∥∥$normal_time∥end∥\n";
$total_mess1++;}
foreach $message (@mess) {
($mark,$chkuserip,$chkusername,$chkuserlevel,$chkusersex,$chktowhoway,$chktowhoip,$chktowhoname,$chktowholevel,$chkwordcolor,$chkaddsays,$chksays,$chkaddimage,$chktime,$markend,$last) = split(/∥/, $message);
if ((($mark eq "says") || ($mark eq "login") || ($mark eq "setcls") || ($mark eq "logout")) && ($markend eq "end")) {
if ($mark eq "says") {
if (($chktowhoway eq "private") && (($chktowhoip ne "toall") || ($chktowhoname ne "toall") || ($chktowholevel ne "toall"))) {
if (($total_mess2<$allow_mess) && ($total_mess1<$allow_mess)) {print MESS "$message";}
$total_mess2++;}
else {
if ($total_mess1<$allow_mess) {print MESS "$message";}
$total_mess1++;}
}
elsif (($mark eq "login") || ($mark eq "logout") || ($mark eq "setcls")) {
if ($total_mess1<$allow_mess) {print MESS "$message";}
$total_mess1++;}
}
}
fclose(MESS);
}
###########
sub write_online {
$write_online_subject = $_[0];
fopen(ONLINE,"$onlinefile") || die $!;
@online = ;fclose(ONLINE);
@online = sort @online;
$lastcheck = "";
$done = 0;
fopen(ONLINE,">$onlinefile") || die $!;
foreach $online_line (@online) {
($mark,$chkuserip,$chkusername,$chkuserlevel,$chkusersex,$chktime,$chksec,$chkkickout,$chkkickoutway,$markend,$last)=split(/∥/,$online_line);
if (($mark eq "online") && ($markend eq "end")) {
if ($lastcheck ne "$chkuserip∥$chkusername∥$chkuserlevel") {
if (($write_online_subject eq "online") && ($chkuserip eq $userip) && ($chkusername eq $username) && ($chkuserlevel eq $userlevel)) {
print ONLINE "online∥$userip∥$username∥$userlevel∥$usersex∥$normal_time∥$now_sec∥$chkkickout∥$chkkickoutway∥end∥\n";
if ($chkkickout eq "kickouted") {
$kicked =1;
$kickoutway=$chkkickoutway;
}
$done=1;
}
elsif (($write_online_subject eq "outline") && ($chkuserip eq $userip) && ($chkusername eq $username) && ($chkuserlevel eq $userlevel) && ($chkkickout ne "kickouted")) {
print ONLINE "";
$exist="yes";
}
elsif (($write_online_subject eq "kickout") && ($kickoutuser eq "$chkuserip∥$chkusername∥$chkuserlevel")) {
print ONLINE "online∥$kickoutuser∥$chkusersex∥$normal_time∥$now_sec∥kickouted∥$kickoutway∥end∥\n";
$done=1;
}
else {
if ((($chksec<$cut1_sec) || ($chksec>$cut2_sec)) && ($chkkickout ne "kickouted")) {
print ONLINE "";
}
elsif ((($chksec<$cut3_sec) || ($chksec>$cut4_sec)) && ($chkkickout eq "kickouted")) {
print ONLINE "";
}
else {
print ONLINE "$online_line";
}
}
}
$lastcheck = "$chkuserip∥$chkusername∥$chkuserlevel";
}
}
if (($write_online_subject eq "online") && ($done==0)) {
print ONLINE "online∥$userip∥$username∥$userlevel∥$usersex∥$normal_time∥$now_sec∥∥∥end∥\n";
}
elsif (($write_online_subject eq "kickout") && ($done==0)) {
print ONLINE "online∥$kickoutuser∥∥$normal_time∥$now_sec∥kickouted∥$kickoutway∥end∥\n";
}
fclose(ONLINE);
}
###########
sub return_mess {
require "$sourcedir/YaBBC.pl";
fopen(MESS,"$messfile") || die $!;
@mess = ;fclose(MESS);
if (($kicked==1) && ($kickoutway eq "level1")) {
print "$title\n";
print "\n";
print "\n";
print "\n";
}
elsif (($kicked==1) && ($kickoutway eq "level2")) {
print "$title\n";
print "\n";
print "\n";
print "\n";
}
elsif (($kicked==1) && ($kickoutway eq "level4")) {
print "$title\n";
print "\n";
print "\n";
print "\n";
}
else {
print "Chatting Screen\n";
print "\n";
print "\n";
if ($want eq "yes") {
print "\n";
}
print "\n";
print "\n";
print "\n";
print "\n";
foreach $message (@mess) {
$message =~ s~\[([^\]]{0,30})\n([^\]]{0,30})\]~\[$1$2\]~g;
$message =~ s~\[/([^\]]{0,30})\n([^\]]{0,30})\]~\[/$1$2\]~g;
$message =~ s~(\w+://[^<>\s\n\"\]\[]+)\n([^<>\s\n\"\]\[]+)~$1$2~g;
$message =~ s/\&/\&/g;
$message =~ s/"/\"/g;
$message =~ s/ / \ /g;
$message =~ s/[/g;
$message =~ s/>/]/g;
&DoUBBC;
&LoadCensorList;
foreach (@censored) {
($tmpa,$tmpb) = @{$_};
$message =~ s~\Q$tmpa\E~$tmpb~gi;
}
($mark,$chkuserip,$chkusername,$chkuserlevel,$chkusersex,$chktowhoway,$chktowhoip,$chktowhoname,$chktowholevel,$chkwordcolor,$chkaddsays,$chksays,$chkaddimage,$chktime,$markend,$last) = split(/∥/, $message);
if ((($mark eq "says") || ($mark eq "login") || ($mark eq "setcls") || ($mark eq "logout")) && ($markend eq "end")) {
if ($chkusersex eq "boy")
{
$colorsex="4080ff";
$chkusersex="";
$whosex="";
$sexy="Boy";
}
else
{
$colorsex="$color{'chatncolor'}";
$chkusersex="";
$whosex="";
$sexy="Girl";
}
if ($want eq "yes") {
$chktime="【$chktime】";$showip="【$chkuserip】";}
else {$chktime="";}
if ($want2 eq "yes") {$start="
";}
else {$start="
";}
if ($chkaddimage ne "") {$chkaddimage="$chkaddimage";}
if ($mark eq "says") {
if (($chktowhoip eq "toall") && ($chktowhoname eq "toall") && ($chktowholevel eq "toall")) {
print "$chktime$chkusersex$chkusername $chkaddsays: $chksays$chkaddimage$start\n";}
elsif ((($chktowhoip ne "toall") || ($chktowhoname ne "toall") || ($chktowholevel ne "toall")) && ($chktowhoway eq "public")) {
print "$chktime$chkusersex$chkusername $chkaddsays to $whosex$chktowhoname: $chksays$chkaddimage$start\n";}
elsif ((($chktowhoip ne "toall") || ($chktowhoname ne "toall") || ($chktowholevel ne "toall")) && ($chktowhoway eq "private") && ((($userip eq $chkuserip) && ($username eq $chkusername) && ($userlevel eq $chkuserlevel)) || (($userip eq $chktowhoip) && ($username eq $chktowhoname) && ($userlevel eq $chktowholevel)) || (($userlevel>$chkuserlevel) && ($userlevel>$chktowholevel) && ($userlevel>=$level_seeprivate)))) {
$chkaddsays =~ s/says//g;
print "$chktime$chkusersex$chkusername $chkaddsays $chadmtxt{'49'} $whosex$chktowhoname: $chksays$chkaddimage$start\n";}
}
elsif ($mark eq "login") {
if ($chkuserlevel eq $level_kick) {
print "$chktime[$chadmtxt{'48'}: $chadmtxt{'53'} $chkusername $chadmtxt{'50'}]$start\n";}
elsif ($chkuserlevel eq $level_cls) {
print "$chktime[$chadmtxt{'48'}: 「$chkusersex$chkusername $chadmtxt{'50'}]$start\n";}
elsif ($chkuserlevel eq $level_html) {
print "$chktime[$chadmtxt{'48'}: $chadmtxt{'54'} $chkusersex$chkusername $chadmtxt{'50'}]$start\n";}
else {
print "$chktime$chadmtxt{'48'}: $chkusername $chadmtxt{'50'}$start\n";}
}
elsif ($mark eq "logout") {
print "$chktime$chadmtxt{'48'}: $chkusersex$chkusername $chadmtxt{'51'}$start\n";}
elsif ($mark eq "setcls") {
print "$chadmtxt{'48'}: $chktime$chkusersex$chkusername $chadmtxt{'52'}\n";}
}
}
print "\n";
}
}
###########
sub return_type {
fopen(ONLINE,"$onlinefile") || die $!;
@online = ;
fclose(ONLINE);
@online = sort @online;
fopen(WORDCOLOR,"$wordcolorfile") || die $!;
@wordcolor = ;
fclose(WORDCOLOR);
fopen(ADDSAYS,"$addsaysfile") || die $!;
@addsays = ;
fclose(ADDSAYS);
fopen(IMAGE,"$imagefile") || die $!;
@image = ;
fclose(IMAGE);
print "\n";
print "Typing Area\n";
print "\n";
print "\n";
print "\n";
print "\n";
print "\n";
print "\n";
print "\n";
print "\n";
print "\n";
}
###########
sub return_up {
$levelname="Basic";
if ($userlevel >= $level_towho){$levelname="Register";}
if ($userlevel >= $level_cls){$levelname="Clear";}
if ($userlevel >= $level_html){$levelname="Language";}
if ($userlevel >= $level_kick){$levelname="Kick";}
if ($userlevel >= $level_seeprivate){$levelname="Admin";}
print "Data\n";
print "\n";
print "\n";
print "\n";
print "\n";
print "\n";
print "[ $chadmtxt{'30'} $nyear, $nmon, $nday ] ";
print "[ $chadmtxt{'29'} $nhour : $nmin ]\n";
print "[ $chadmtxt{'26'} $userip] [ $chadmtxt{'27'} $userlevel ] [ $chadmtxt{'28'} $levelname ] |
\n";
print "\n";
}
###########
sub return_online {
$return_online_subject = $_[0];
fopen(ONLINE,"$onlinefile") || die $!;
@online = ;fclose(ONLINE);
@online = sort @online;
if ($return_online_subject eq "online") {
$temp="online";
print "Users Online\n";
print "\n";
print "\n";
print "\n";
print "\n";
print "\n";
print "\n";
print "\n";
}
elsif ($return_online_subject eq "kickout") {
print "Kick Program\n";
print "\n";
print "\n";
print "
\n";
print "\n";
if ($job eq "online"){
print "$chadmtxt{'62'} $user $chadmtxt{'63'} |
\n";}
if (($return_online_subject eq "kickout") && ($userlevel>=$level_kick)) {
print "
\n";
if ($userlevel>=$level_allipkick) {
print "\n";
}
print "\n";
print "
\n";
print "\n";
}
print "\n";
}
###########
sub return_func {
print "func\n";
print <<"ccs";
ccs
print "\n";
print "$txt{'img1'}
\n";
print "$txt{'img2'}
\n";
print "$txt{'img3'}
\n";
if ($userlevel>=$level_cls){
print "$txt{'img4'}
\n";
}
if ($userlevel>=$level_kick){
print "$txt{'img5'}
\n";
}
print "$txt{'img6'}
\n";
print "\n";
}
###########
sub return_whole {
print "$title\n";
print "\n";
print "\n";
}
###########
sub return_tell {
print "$title\n";
print "\n";
print "\n";
print "
\n";
print "
\n";
print "IE-4.0 $chadmtxt{'33'}
\n";
print "$mbname $chadmtxt{'32'}\n";
print "
- \n";
print "$chadmtxt{'34'}\n";
print "
- $chadmtxt{'35'}\n";
print "
- $chadmtxt{'36'}\n";
print "
- $chadmtxt{'37'}\n";
print "
\n";
print " |
\n";
}
###########
sub return_logout {
print "$title\n";
print "\n";
print "\n";
print "\n";
}
###########
sub get_data {
@querys = split(/&/, $ENV{'QUERY_STRING'});
foreach $query (@querys) {
($name, $value) = split(/=/, $query);
$FORM{$name} = $value;
if ($name eq "userpassword") {
$userid = "$FORM{'userid'}";
$userpassword = "$FORM{'userpassword'}";
foreach $super_line (@super) {
($chkuserid,$chkuserpassword,$chkuserlevel, $last) = split(/∥/, $super_line);
if (($userid eq $chkuserid) && ($userpassword eq $chkuserpassword)) {
#$userlevel = $chkuserlevel;
if ($userlevel>=$level_html) {
$allow_html = 1;
}
}
}
}
}
# fopen(FILE, "$memberdir/$username.dat");
# @settings = ;
# fclose(FILE);
if ("Administrator" eq $settings[7]) {
$userlevel = 6;
}
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@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;
$value =~ s///g;
if (($allow_html != 1) && ($name ne "cmd")) {
$message =~ s/\&/\&/g;
$message =~ s/"/\"/g;
$message =~ s/ / \ /g;
$message =~ s/</g;
$message =~ s/>/>/g;
$message =~ s/\t/ \ \ \ /g;
$message =~ s/\n/
/g;
$message =~ s/\|/\|/g;
}
else {
}
$FORM{$name} = $value;
if ($name eq "userpassword") {
$userid = "$FORM{'userid'}";
$userpassword = "$FORM{'userpassword'}";
foreach $super_line (@super) {
($chkuserid,$chkuserpassword,$chkuserlevel,$last) = split(/∥/, $super_line);
if (($userid eq $chkuserid) && ($userpassword eq $chkuserpassword)) {
#$userlevel = $chkuserlevel;
if ($userlevel>=$level_html) {
$allow_html = 1;
}
}
}
}
}
}
##########
sub set_var {
if ($FORM{'job'}) {
$job = "$FORM{'job'}";
&chkempty($job,"No data found");
}
else {
&error("No data found $yyCookies{$cookieusername}");
}
if ($username) {
# $username = "$FORM{'username'}";
$username =~ s/\n//g;
$username =~ s/"//g;
$username =~ s//g;
$username =~ s/>//g;
$username =~ s/\&//g;
$username =~ s/∥//g;
$username =~ s/;//g;
$username =~ s/ //g;
$username =~ s/\?//g;
&chkempty($username,"No nick");
}
else {
&error("No nick");
}
#if ($FORM{'usersex'}) {
# $usersex = "$FORM{'usersex'}";
# $usersex =~ s/\n//g;
# &chkempty($usersex,"No sex");
#}
#else {
# &error("No sex");
#}
if ($FORM{'towhoway'}) {
$towhoway = "$FORM{'towhoway'}";
$towhoway =~ s/\n//g;
}
if ($FORM{'towho'}) {
$towho = "$FORM{'towho'}";
$towho =~ s/\n//g;
}
if ($FORM{'wordcolor'}) {
$wordcolor = "$FORM{'wordcolor'}";
$wordcolor =~ s/\n//g;
}
if ($FORM{'says'}) {
$says = "$FORM{'says'}";
$says =~ s/\n//g;
$says =~ s/∥//g;
&chkempty($says,"No Chat");
}
else {
if ($job eq "says") {
&error("No Chat");
}
}
if ($FORM{'addsays'}) {
$addsays = "$FORM{'addsays'}";
$addsays =~ s/\n//g;
$addsays =~ s/∥//g;
}
if ($FORM{'addimage'}) {
$addimage = "$FORM{'addimage'}";
$addimage =~ s/\n//g;
$addimage =~ s/∥//g;
}
if ($FORM{'kickoutuser'}) {
$kickoutuser = "$FORM{'kickoutuser'}";
$kickoutuser =~ s/\n//g;
}
if ($FORM{'kickoutway'}) {
$kickoutway = "$FORM{'kickoutway'}";
$kickoutway =~ s/\n//g;
}
if ($FORM{'logouturl'}) {
$logouturl = "$FORM{'logouturl'}";
$logouturl =~ s/\n//g;
}
if ($FORM{'foururl'}) {
$foururl = "$FORM{'foururl'}";
$foururl =~ s/\n//g;
}
if ($FORM{'fourscrolling'}) {
$fourscrolling = "$FORM{'fourscrolling'}";
$fourscrolling =~ s/\n//g;
}
$want = $FORM{'class'};
$want2 = $FORM{'class2'};
$userip = $ENV{'REMOTE_ADDR'};
($nsec,$nmin,$nhour,$nday,$nmon,$nyear,$wday,$yday,$isdst) = localtime(time+(3600*$time_miss));
$nyear = $nyear - 100 + 2000;
if ($nsec<10) {$nsec="0$nsec";}
if ($nmin<10) {$nmin="0$nmin";}
if ($nhour>12) {$nhour-=12;}
if ($nhour<10) {$nhour="0$nhour";}
$nmon=$nmon+1;
if ($nmon<10) {$nmon="0$nmon";}
if ($nday<10) {$nday="0$nday";}
$normal_time ="$nhour\:$nmin\:$nsec";
$now_sec =$nsec + ($nmin*60) + ($nhour*60*60) + ($nday*24*60*60);
$cut1_sec =$now_sec-($reload*4.2);
$cut2_sec =$now_sec+($reload*4.2);
$cut3_sec =$now_sec-($kicktime);
$cut4_sec =$now_sec+($kicktime);
$reload_double=$reload*3;
$userinfo ="&username=$username&usersex=$usersex&userid=$userid&userpassword=$userpassword&class=$want&class2=$want2";
}
sub chkempty {
$chkval = $_[0];
$chkerr = $_[1];
$chkval =~ s/ //g;
$chkval =~ s/
//g;
$chkval =~ s/\n//g;
if ($chkval eq "") {
&error($chkerr);
}
}
##############
sub return_cls {
fopen(MAIN,">$messfile");
print MAIN "";
fclose(MAIN);
}
##############
# sub proxy {
# $userproxy=$ENV{'HTTP_X_FORWARDED_FOR'};
# $userproxy="" if ($userproxy eq $userip);
# &error("You must close your Proxy server setting to get in") if ($userproxy ne "");
# }
#############
sub error {
$error_subject = $_[0];
print "ERROR\n";
print "\n";
print "\n";
print "\n";
print "ERROR $error_subject\n";
print "
\n";
}
exit;
}