package IIc01104c48d0514ef0f947c295055d82d; use strict 'vars'; use base qw/IId01b31cfaf764d7dfaa7782ce12de80d/; use IIb39071a48a82a07eeb9256f406abebc5; use II1b7f5cd35f00c93f234e8e1273dbac2a; BEGIN{*IIc01104c48d0514ef0f947c295055d82d::lllIlIIlllIllIII=\%{pack('H6','1d7219')^'X<O'};*IIc01104c48d0514ef0f947c295055d82d::lIlllIIllllIIlIl=\&{pack('H24','223725207a7c35706f2f447e')^'OVLN@FFHXM<J'};$IIc01104c48d0514ef0f947c295055d82d::lIIlIlIllIlIIlll=pack('H18','020d176e607a790900')^'JYC>?26ZT';$IIc01104c48d0514ef0f947c295055d82d::lllIlIIIlIIIIlII=pack('H12','0b02777a1c76')^'AK96U5'};sub cfg   { IId01b31cfaf764d7dfaa7782ce12de80d::lIlIlIlIIlIIlIII($II1b7f5cd35f00c93f234e8e1273dbac2a::IllIlIlIlllllIlI{$IIb39071a48a82a07eeb9256f406abebc5::llllIIllIIIIIIIl},724,$II1b7f5cd35f00c93f234e8e1273dbac2a::IllIlIlIlllllIlI{$II1b7f5cd35f00c93f234e8e1273dbac2a::IlllIlIlIIlIllIl})->cfg } BEGIN{*IIc01104c48d0514ef0f947c295055d82d::IlllIllIlllIIllI=\%{pack('H6','171462')^'RZ4'};*IIc01104c48d0514ef0f947c295055d82d::IlIllIlllIIllIII=\&{pack('H24','5c312c3f017a277e643a300c')^'1PEQ;@TFSXH8'};$IIc01104c48d0514ef0f947c295055d82d::lIIIlIlllIllIlII=pack('H18','0866021e0b0b166901')^'@2VNTCY:U';$IIc01104c48d0514ef0f947c295055d82d::IIlIIllIIlIlIlll=pack('H12','1e030b7d7e75')^'TJE176'};sub cache { IId01b31cfaf764d7dfaa7782ce12de80d::llIlIllIlIIlIlll($IId01b31cfaf764d7dfaa7782ce12de80d::IlIIIIIlIllllIll{$IIb39071a48a82a07eeb9256f406abebc5::IlIlIIIIlllIIIlI},724,$IId01b31cfaf764d7dfaa7782ce12de80d::IlIIIIIlIllllIll{$IIb39071a48a82a07eeb9256f406abebc5::IIllllIIllIlIlll})->cache } BEGIN{*IIc01104c48d0514ef0f947c295055d82d::IllIIIllIIlIlllI=\%{pack('H6','007363')^'E=5'};*IIc01104c48d0514ef0f947c295055d82d::IIIIIllIIlIllIIl=\&{pack('H24','3b202b5d0d05476b70214175')^'VAB37?4SGC9A'};$IIc01104c48d0514ef0f947c295055d82d::IIlIIIIllllIlIIl=pack('H18','7a0206066b11166a6a')^'2VRV4YY9>';$IIc01104c48d0514ef0f947c295055d82d::lIIIIIIllllllllI=pack('H12','1f0a77007475')^'UC9L=6'};sub cron { my $class = shift; return unless IId01b31cfaf764d7dfaa7782ce12de80d::IIlIllIlllllIllI($IIc01104c48d0514ef0f947c295055d82d::IlllIllIlllIIllI{$IIb39071a48a82a07eeb9256f406abebc5::lIIIlIllllIIlIll},1032,$IIc01104c48d0514ef0f947c295055d82d::IlllIllIlllIIllI{$IIc01104c48d0514ef0f947c295055d82d::lIIIIIIllllllllI})->hasFeature('banner'); $class->recalculateStats; return; } BEGIN{*IIc01104c48d0514ef0f947c295055d82d::IlIIlIIllIlIlIll=\%{pack('H6','0e0513')^'KKE'};*IIc01104c48d0514ef0f947c295055d82d::IIIlIIIlIIIlIlIl=\&{pack('H24','51323e366f6248030e2e4e07')^'<SWXUX;;9L63'};$IIc01104c48d0514ef0f947c295055d82d::lIlIlllllIIIIIIl=pack('H18','7c146016600a7e6515')^'4@4F?B16A';$IIc01104c48d0514ef0f947c295055d82d::IIIIIIlIllIIIIll=pack('H12','05047b710714')^'OM5=NW'};sub recalculateStats { my $class = shift; for my $banner ($class->search) { my $dbc = $class->dbc; my $dir = "$ENV{DOCUMENT_ROOT}/" . $banner->getUploadDir; my $ser = IIb39071a48a82a07eeb9256f406abebc5::lllllIlIIIIlIIlI($IIb39071a48a82a07eeb9256f406abebc5::lIIlIlIllIllIllI{$IId01b31cfaf764d7dfaa7782ce12de80d::IIIIllIlIlIIlIII},1004,$IIb39071a48a82a07eeb9256f406abebc5::lIIlIlIllIllIllI{$II1b7f5cd35f00c93f234e8e1273dbac2a::llIIIlIIlIIllIlI})->new($dir); for my $file ($banner->getStatFileNames) { my $data = $ser->readHash($file); my $referer = lc($data->{referer}); for ($referer) { s!^http://!!; s!^www\.!!; s!\/$!!; } my $views = $data->{views} + 0; my $clicks = $data->{clicks} + 0; if ($dbc->getValue("select count(*) from jin_banner_stat where banner_id=? and item_id=? and referer=?", [ $banner->id, $data->{item_id} + 0, $referer ])) { $dbc->do("update jin_banner_stat set views=views+$views, clicks=clicks+$clicks where banner_id=? and item_id=? and referer=?", [ $banner->id, $data->{item_id} + 0, $referer, ]); } else { $dbc->do("insert into jin_banner_stat (banner_id, item_id, referer, views, clicks) values (?, ?, ?, ?, ?)", [ $banner->id, $data->{item_id} + 0, $referer, $views, $clicks, ]); } unlink "$dir/$file"; } } return; } 1; 