#!/usr/bin/perl ############################################## # MeySoft Banner Manager - Version 2.60 # Revised: 25-OCT-2000 # Copyright (c) 2000 MeySoft # Author: Jeffrey L. Meyer # WebMaster@MeySoft.com # # THIS HEADER MUST REMAIN INTACT ########################################################################## # If you make ANY changes, other than the perl path, MeySoft cannot accept # responsibilty for any adverse affects, and do not expect MeySoft to fix # it for you. If you make any modifications at all below the perl line # above, you are in violation of the license agreement and forfeit any # and all rights under the license agreement, and you will lose the right # to technical support. Do not expect our help nor any refund if you # violate the license agreement. ########################################################################## require "bm260fn.cgi"; &load_vars; require "flush.pl"; require "bm260_sql.lib"; alarm(600); @CTRL=(); @ACCT=(); @BAN=(); @slist=split(/,/,$CFG{'slist'}); $data=$ENV{'QUERY_STRING'}; $data=~ s/\&\;/\&/g; @fields = split(/&/,$data); foreach $fields(@fields){ ($field_name,$field_val)=split(/=/,$fields); $field_val=~ s/\+/ /g; $field_val=~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg; $field_val=~ s/\,/./g; $field_val=~ s/\&//g; $field_val=~ s/\"//g; $field_val=~ s/\'//g; $field_val=~ s/\`//g; $field_val=~ s/\*//g; $field_val=~ s/\\//g; $field_val=~ s/ //g; $field_val=~ s///g; $field_val=~ s/<([^>]|\n)*>//g; $DATA{$field_name}=$field_val; } if(!($DATA{'a'})){ &end; }else{ $acct_num="$DATA{'a'}"; } #if($acct_num =~ /0p/){$acct_num="1p1";} if($acct_num =~ /p/){ ($acct_num,$page)=split(/p/,$acct_num); if(("$page" eq "")||($page <1)||($page > $CFG{'multi_page_limit'})){ $page=1; } }else{ $page=1; } if(!($DATA{'s'})){ &end; }else{ $style="$DATA{'s'}"; } &sql_connect; $dbp="$CFG{'acct_dir'}/$style"; &get_date; &sql_getCTRLData("$style"); $si=&style_index("$style"); if(($acct_num <1)||($acct_num>$CTRL[2])){$acct_num="1";} $aid="$acct_num-$si"; &sql_getAccountInfo("$aid"); if($ACCT[18] <=0){ $ACCT[18]=0; } $ACCT[18]++; if($ACCT[16] <= 0){$ACCT[16]=0; } if($page >= 1){ $pg_url="$ENV{'HTTP_REFERER'}"; &sql_getPageInfo("$aid","$page"); $PAGE[3]++; $PAGE[5]++; $PAGE[7]++; &sql_updatePageInfo("$aid","$page"); } $rid="$ENV{'REMOTE_ADDR'}"; if((length($rid) > 16)||(length($rid)<1)){ $rid="_blank_"; $ENV{'REMOTE_ADDR'}="_blank_"; } $click_id="C_" . "$acct_num" . "_$page" . "_$rid"; $ct=&sql_getClickPTR("$style","$click_id"); if($ct==-1){ $ct=$ACCT[9]; } &sql_updateAccountInfo("$aid"); if($CLICK[2] <1){$CLICK[2]="1";} $bid="$CLICK[2]" . "-" . "$si"; &sql_getXStats("$style"); &sql_updateXStats("AddCLK","$style"); &sql_getBannerInfo("$bid"); $BAN[7]++; $didx=($wday * 2) + 25; $BAN[$didx]++; ############################## #CREDIT CHECK - AUTO EXPIRE CHECK if($BAN[12] eq 'click'){ $BAN[16]--; if($BAN[16] <=0){ $BAN[16]=0; if(($BAN[4] ne 'N/A')&&($BAN[4] ne 'na')&&($BAN[4] ne '')){ $BAN[12]="$BAN[4]"; }}} &sql_updateBannerInfo("$bid"); if($BAN[8] ne ''){ print "Location: $BAN[8]\n\n";}else{ &end;} &end;