Пример #1
0
     }
 }
 //Store that the mail has been send before it is send:
 //Worst case: An e-mail is lorst, but we don't risk sending an e-mail
 //that and not storing that it has been send, resulting in spamming the user.
 array_unshift($send, $lib->getTimeAdjusted());
 $datafil->setLine(67, implode("::", $send));
 $datafil->gemFil();
 //Create the statsite
 require_once "lib/StatSite.php";
 require_once "lib/LegacyMapper.php";
 require_once "lib/SiteContext.php";
 require_once "lib/Localizer.php";
 //Maps old to new parameters
 $statSiteMapper = new StatSiteLegacyMapper();
 $mappedInd = $statSiteMapper->applyMapping(array_merge($varsForStatSite, $ind));
 //Creates a new site context for the stat site.
 $siteContext = new SiteContext($lib, $stier, $mappedInd, 'da');
 //Creates the statsite
 $statSite = new StatSite($siteContext, 'text');
 $statSite->setShowStatselector(0);
 $statSite->setSendByMail(true);
 $statSite->setMaxStatsToShow(-1);
 //Disable bandwidth limitation
 //Generates the html for the statsite.
 $side = $statSite->generateSite();
 @mail($datafil->getLine(2), "Statistikker fra ZIP Stat", $side, "From: zipstat_mailstats@zip.dk\nReply-to: zipstat_mailstats@zip.dk\nX-abuse: postmaster@zip.dk\nX-Mailer: ZIP Stat mailstats\nContent-Type: text/plain");
 //Stat site end
 //Log the sending of the mail
 $fp = fopen("mailsSend.txt", "a");
 fwrite($fp, "Mail send " . date('r') . " " . $ind['brugernavn'] . ", adress: " . $datafil->getLine(2) . "\n");