Пример #1
0
         $varsForStatSite[$keyVal[0]] = $keyVal[1];
     }
 }
 //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");
Пример #2
0
<?php

/*----Import libs----*/
require "Html.php";
require "Stier.php";
require "lib/SiteContext.php";
require "lib/StatSite.php";
require "lib/Localizer.php";
include "lib/LegacyMapper.php";
/*----Init vars----*/
//Stier og options
$stier = new Stier();
//Henter variable udefra
$ind = Html::setPostOrGetVars($HTTP_POST_VARS, $HTTP_GET_VARS);
//Maps old to new parameters
$statSiteMapper = new StatSiteLegacyMapper();
//$ind = $statSiteMapper->applyMapping(array_merge($varsForStatSite, $ind));
if (!isset($ind['brugernavn'])) {
    require_once "lib/SiteGenerator/SiteGenerator.php";
    require_once "lib/StatGenerator.php";
    //The 2nd parameter is only needed to trick PHP into thinking it gets
    //a 2nd parameter that can be passed as reference.
    $lib = new Html($ind, $ind);
    $siteContext = new SiteContext($lib, $stier, $ind, 'da');
    $lib->setSiteContext($siteContext);
    $lib->setStier($stier);
    //Give the site context to the legasy mapper (which will give itself to
    //the site context.
    $statSiteMapper->setSiteContext($siteContext);
    $sg = SiteGenerator::getGenerator($ind['type'], $siteContext);
    $headline = $sg->newElement("headline");