Example #1
0
 private function sendEmail($step, $cacheid)
 {
     $octeamEmailAddress = $this->ocConfig->getOcteamEmailAddress();
     $siteName = $this->ocConfig->getSiteName();
     $cache = new \lib\Objects\GeoCache\GeoCache(array('cacheId' => (int) $cacheid));
     switch ($step) {
         case $this->step["START"]:
             $email_content = read_file($this->stylepath . '/email/arch1.email');
             break;
         case $this->step["AFTER_FIRST_MAIL_SENT"]:
             $email_content = read_file($this->stylepath . '/email/arch2.email');
             break;
         case $this->step["AFTER_SECOND_MAIL_SENT"]:
             $email_content = read_file($this->stylepath . '/email/arch3.email');
             break;
     }
     $email_content = mb_ereg_replace('{server}', $this->ocConfig->getAbsolute_server_URI(), $email_content);
     $email_content = mb_ereg_replace('{autoArchive_01}', tr('autoArchive_01'), $email_content);
     $email_content = mb_ereg_replace('{autoArchive_02}', tr('autoArchive_02'), $email_content);
     $email_content = mb_ereg_replace('{autoArchive_03}', tr('autoArchive_03'), $email_content);
     $email_content = mb_ereg_replace('{autoArchive_04}', tr('autoArchive_04'), $email_content);
     $email_content = mb_ereg_replace('{autoArchive_05}', tr('autoArchive_05'), $email_content);
     $email_content = mb_ereg_replace('{autoArchive_06}', tr('autoArchive_06'), $email_content);
     $email_content = mb_ereg_replace('{autoArchive_07}', tr('autoArchive_07'), $email_content);
     $email_content = mb_ereg_replace('{autoArchive_08}', tr('autoArchive_08'), $email_content);
     $email_content = mb_ereg_replace('{autoArchive_09}', tr('autoArchive_09'), $email_content);
     $email_content = mb_ereg_replace('{autoArchive_10}', tr('autoArchive_10'), $email_content);
     $email_content = mb_ereg_replace('{cachename}', $cache->getCacheName(), $email_content);
     $email_content = mb_ereg_replace('{cache_wp}', $cache->getWaypointId(), $email_content);
     $email_content = mb_ereg_replace('{cacheid}', $cacheid, $email_content);
     $email_content = mb_ereg_replace('{octeamEmailsSignature}', $this->ocConfig->getOcteamEmailsSignature(), $email_content);
     $emailheaders = "Content-Type: text/plain; charset=utf-8\r\n";
     $emailheaders .= "From: {$siteName} <{$octeamEmailAddress}>\r\n";
     $emailheaders .= "Reply-To: {$siteName} <{$octeamEmailAddress}>";
     $status = mb_send_mail($cache->getOwner()->getEmail(), tr('autoArchive_11'), $email_content, $emailheaders);
     logentry('autoarchive', 6, $cache->getOwner()->getUserId(), $cache->getCacheId(), 0, 'Sending mail to ' . $cache->getOwner()->getEmail(), array('status' => $status));
 }
Example #2
0
                    $email_content = mb_ereg_replace('{rrActivateCache_05}', tr('rrActivateCache_05'), $email_content);
                    $email_content = mb_ereg_replace('{rrActivateCache_06}', tr('rrActivateCache_06'), $email_content);
                    $email_content = mb_ereg_replace('{username}', $usr['username'], $email_content);
                    $email_content = mb_ereg_replace('{cachename}', $name, $email_content);
                    $email_content = mb_ereg_replace('{cacheid}', $cache_id, $email_content);
                    $email_content = mb_ereg_replace('{octeamEmailsSignature}', $octeamEmailsSignature, $email_content);
                    $email_headers = "Content-Type: text/plain; charset=utf-8\r\n";
                    $email_headers .= "From: {$site_name} <{$octeam_email}>\r\n";
                    $email_headers .= "Reply-To: {$octeam_email}\r\n";
                    $octeam_email = $octeam_email;
                    //send email to octeam
                    mb_send_mail($octeam_email, tr('rrActivateCache_07') . ": " . $name, $email_content, $email_headers);
                    sql("UPDATE sysconfig SET value = value + 1 WHERE name = 'hidden_for_approval'");
                }
                /* add cache altitude altitude */
                $geoCache = new \lib\Objects\GeoCache\GeoCache(array('cacheId' => $cache_id));
                $geoCache->getAltitude()->pickAndStoreAltitude($altitude);
                // redirection
                tpl_redirect('mycaches.php?status=' . urlencode($sel_status));
            } else {
                tpl_set_var('general_message', $error_general);
            }
        }
    }
}
tpl_set_var('is_disabled_size', '');
tpl_set_var('language4js', $lang);
if ($no_tpl_build == false) {
    //make the template and send it out
    tpl_BuildTemplate();
}
Example #3
0
function buildGeocacheHtml(lib\Objects\GeoCache\GeoCache $geocache, $html)
{
    $ocConfig = \lib\Objects\OcConfig\OcConfig::instance();
    $html = mb_ereg_replace('{cacheimage}', '<img src="' . $geocache->getCacheIcon() . '" width="16" />', $html);
    $html = mb_ereg_replace('{cachestatus}', htmlspecialchars(tr($geocache->getStatusTranslationIdentifier()), ENT_COMPAT, 'UTF-8'), $html);
    $html = mb_ereg_replace('{cacheid}', htmlspecialchars(urlencode($geocache->getCacheId()), ENT_COMPAT, 'UTF-8'), $html);
    if ($geocache->getDateActivate() === null) {
        $html = mb_ereg_replace('{date}', tr('no_time_indicated'), $html);
    } else {
        $html = mb_ereg_replace('{date}', $geocache->getDateActivate()->format($ocConfig->getDateFormat()), $html);
    }
    $html = mb_ereg_replace('{cachename}', htmlspecialchars($geocache->getCacheName(), ENT_COMPAT, 'UTF-8'), $html);
    $html = mb_ereg_replace('{wpname}', htmlspecialchars($geocache->getWaypointId(), ENT_COMPAT, 'UTF-8'), $html);
    return $html;
}
Example #4
0
//prepare the templates and include all neccessary
require_once './lib/common.inc.php';
//Preprocessing
if ($error == false) {
    //user logged in?
    if ($usr == false) {
        $target = urlencode(tpl_get_current_page());
        tpl_redirect('login.php?target=' . $target);
    } else {
        // check for old-style parameters
        if (isset($_REQUEST['cacheid'])) {
            $cache_id = (int) $_REQUEST['cacheid'];
        } else {
            $cache_id = 0;
        }
        $geoCache = new \lib\Objects\GeoCache\GeoCache(array('cacheId' => $cache_id));
        $tplname = 'cache_stats';
        $content = "";
        $cachename = $geoCache->getCacheName();
        tpl_set_var('cachename', $cachename);
        $cachetime = $geoCache->getDatePlaced()->format('Y');
        $db = OcDb::instance();
        $rsGeneralStatQuery = 'SELECT count(*) count FROM `cache_logs` WHERE cache_logs.deleted=0 AND (type=1 OR type=2) AND cache_id=:1 ';
        $dbResult = $db->multiVariableQueryValue($rsGeneralStatQuery, 0, $cache_id);
        if ($dbResult == 0) {
            $content .= '<p>&nbsp;</p><p style="background-color: #FFFFFF; margin: 0px; padding: 0px; color: rgb(88,144,168); font-weight: bold; font-size: 14px;">' . $cachename . '<br /> <br />nie ma jeszcze statystyki</b></p>';
        } else {
            $content .= '<center><p style="background-color: #FFFFFF; margin: 0px; padding: 0px; color: rgb(88,144,168); font-weight: bold; font-size: 14px;">' . tr("stat_geocache") . ': ' . $cachename . '<br /></p>';
            $content .= '<p style="background-color: #FFFFFF; "><img src="graphs/PieGraphcstat.php?cacheid=' . $cache_id . '"  border="0" alt="Statystyka skrzynki" width="400" height="200" /><br /><br />';
            $year = date("Y");
            $content .= '<img src="graphs/BarGraphcstatM.php?cacheid=' . $cache_id . '&amp;t=csm' . $year . '"  border="0" alt="" width="400" height="200" /><br /><br />';
//prepare the templates and include all neccessary
require_once './lib/common.inc.php';
//Preprocessing
if ($error == false) {
    //user logged in?
    if ($usr == false) {
        $target = urlencode(tpl_get_current_page());
        tpl_redirect('login.php?target=' . $target);
    } else {
        // check for old-style parameters
        if (isset($_REQUEST['cacheid'])) {
            $cache_id = (int) $_REQUEST['cacheid'];
        } else {
            $cache_id = 0;
        }
        $geoCache = new \lib\Objects\GeoCache\GeoCache(array('cacheId' => $cache_id));
        $tplname = 'cache_stats';
        $content = "";
        $cachename = $geoCache->getCacheName();
        tpl_set_var('cachename', $cachename);
        $cachetime = date('Y', $geoCache->getDatePlaced());
        $db = \lib\Database\DataBaseSingleton::Instance();
        $rsGeneralStatQuery = 'SELECT count(*) count FROM `cache_logs` WHERE cache_logs.deleted=0 AND (type=1 OR type=2) AND cache_id=:1 ';
        $dbResult = $db->multiVariableQueryValue($rsGeneralStatQuery, 0, $cache_id);
        if ($dbResult == 0) {
            $content .= '<p>&nbsp;</p><p style="background-color: #FFFFFF; margin: 0px; padding: 0px; color: rgb(88,144,168); font-weight: bold; font-size: 14px;">' . $cachename . '<br /> <br />nie ma jeszcze statystyki</b></p>';
        } else {
            $content .= '<center><p style="background-color: #FFFFFF; margin: 0px; padding: 0px; color: rgb(88,144,168); font-weight: bold; font-size: 14px;">' . tr("stat_geocache") . ': ' . $cachename . '<br /></p>';
            $content .= '<p style="background-color: #FFFFFF; "><img src="graphs/PieGraphcstat.php?cacheid=' . $cache_id . '"  border="0" alt="Statystyka skrzynki" width="400" height="200" /><br /><br />';
            $year = date("Y");
            $content .= '<img src="graphs/BarGraphcstatM.php?cacheid=' . $cache_id . '&amp;t=csm' . $year . '"  border="0" alt="" width="400" height="200" /><br /><br />';