Example #1
0
    }
}
// ok, ausgabe ...
$rs = sql_slave('SELECT SQL_BUFFER_RESULT `txtcontent`.`cache_id` `cacheid`, `txtcontent`.`longitude` `longitude`, `txtcontent`.`latitude` `latitude`, `caches`.`wp_oc` `waypoint`, `caches`.`date_hidden` `date_hidden`, `caches`.`name` `name`, `caches`.`country` `country`, `caches`.`terrain` `terrain`, `caches`.`difficulty` `difficulty`, `caches`.`desc_languages` `desc_languages`, `cache_size`.`de` `size`, `cache_type`.`de` `type`, `cache_status`.`de` `status`, `user`.`username` `username`, `cache_desc`.`desc` `desc`, `cache_desc`.`short_desc` `short_desc`, `cache_desc`.`hint` `hint`, `cache_desc`.`desc_html` `html` FROM `txtcontent`, `caches`, `user`, `cache_desc`, `cache_type`, `cache_status`, `cache_size` WHERE `txtcontent`.`cache_id`=`caches`.`cache_id` AND `caches`.`cache_id`=`cache_desc`.`cache_id` AND `caches`.`default_desclang`=`cache_desc`.`language` AND `txtcontent`.`user_id`=`user`.`user_id` AND `caches`.`type`=`cache_type`.`id` AND `caches`.`status`=`cache_status`.`id` AND `caches`.`size`=`cache_size`.`id`');
while ($r = sql_fetch_array($rs)) {
    $thisline = $txtLine;
    $lat = sprintf('%01.5f', $r['latitude']);
    $thisline = mb_ereg_replace('{lat}', help_latToDegreeStr($lat), $thisline);
    $lon = sprintf('%01.5f', $r['longitude']);
    $thisline = mb_ereg_replace('{lon}', help_lonToDegreeStr($lon), $thisline);
    $time = date('d.m.Y', strtotime($r['date_hidden']));
    $thisline = mb_ereg_replace('{time}', $time, $thisline);
    $thisline = mb_ereg_replace('{waypoint}', $r['waypoint'], $thisline);
    $thisline = mb_ereg_replace('{cacheid}', $r['cacheid'], $thisline);
    $thisline = mb_ereg_replace('{cachename}', $r['name'], $thisline);
    $thisline = mb_ereg_replace('{country}', db_CountryFromShort($r['country']), $thisline);
    if ($r['hint'] == '') {
        $thisline = mb_ereg_replace('{hints}', '', $thisline);
    } else {
        $thisline = mb_ereg_replace('{hints}', str_rot13_html(strip_tags($r['hint'])), $thisline);
    }
    $thisline = mb_ereg_replace('{shortdesc}', $r['short_desc'], $thisline);
    if ($r['html'] == 0) {
        $thisline = mb_ereg_replace('{htmlwarn}', '', $thisline);
        $thisline = mb_ereg_replace('{desc}', strip_tags($r['desc']), $thisline);
    } else {
        $thisline = mb_ereg_replace('{htmlwarn}', ' (Vorsicht, aus HTML konvertiert)', $thisline);
        $thisline = mb_ereg_replace('{desc}', html2txt($r['desc']), $thisline);
    }
    $thisline = mb_ereg_replace('{type}', $r['type'], $thisline);
    $thisline = mb_ereg_replace('{container}', $r['size'], $thisline);
Example #2
0
     tpl_set_var('hidetime_end', '');
     if ($cache_record['search_time'] == null || $cache_record['search_time'] == 0) {
         tpl_set_var('search_time', 'b.d.');
     } else {
         $time_hours = floor($cache_record['search_time']);
         $time_min = ($cache_record['search_time'] - $time_hours) * 60;
         $time_min = sprintf('%02d', round($time_min, 1));
         tpl_set_var('search_time', $time_hours . ':' . $time_min . ' h');
     }
     if ($cache_record['way_length'] == null || $cache_record['way_length'] == 0) {
         tpl_set_var('way_length', 'b.d.');
     } else {
         tpl_set_var('way_length', sprintf('%01.2f km', $cache_record['way_length']));
     }
 }
 tpl_set_var('country', htmlspecialchars(db_CountryFromShort($cache_record['country']), ENT_COMPAT, 'UTF-8'));
 tpl_set_var('cache_log_pw', $cache_record['logpw'] == NULL || $cache_record['logpw'] == '' ? '' : $cache_log_pw);
 tpl_set_var('nocrypt', $no_crypt);
 $hidden_date = strtotime($cache_record['date_hidden']);
 tpl_set_var('hidden_date', fixPlMonth(htmlspecialchars(strftime("%d %B %Y", $hidden_date), ENT_COMPAT, 'UTF-8')));
 $listed_on = array();
 if ($usr !== false && $usr['userFounds'] >= $config['otherSites_minfinds']) {
     if ($cache_record['wp_ge'] != '' && $config['otherSites_gpsgames_org'] == 1) {
         $listed_on[] = '<a href="http://geocaching.gpsgames.org/cgi-bin/ge.pl?wp=' . $cache_record['wp_ge'] . '" target="_blank">GPSgames.org (' . $cache_record['wp_ge'] . ')</a>';
     }
     if ($cache_record['wp_tc'] != '' && $config['otherSites_terracaching_com'] == 1) {
         $listed_on[] = '<a href="http://www.terracaching.com/Cache/' . $cache_record['wp_tc'] . '" target="_blank">Terracaching.com (' . $cache_record['wp_tc'] . ')</a>';
     }
     if ($cache_record['wp_qc'] != '' && $config['otherSites_qualitycaching_com'] == 1) {
         $listed_on[] = '<a href="http://www.qualitycaching.com/QCView.aspx?cid=' . $cache_record['wp_qc'] . '" target="_blank">Qualitycaching.com. (' . $cache_record['wp_qc'] . ')</a>';
     }
Example #3
0
                     $db->multiVariableQuery($sql, (int) $usr['userid']);
                 } else {
                     // close previous entry
                     $sql = "update user_nick_history set date_to = NOW() where date_to is null and user_id = :1";
                     $db->multiVariableQuery($sql, (int) $usr['userid']);
                 }
                 // update and save current nick
                 $sql = "update user set username = :1 where user_id = :2";
                 $db->multiVariableQuery($sql, $username, (int) $usr['userid']);
                 $sql = "insert into user_nick_history (user_id, date_from, username) select user_id, now(), username from user where user_id = :1";
                 $db->multiVariableQuery($sql, (int) $usr['userid']);
                 $db->commit();
                 $usr['username'] = $username;
             }
             $tplname = 'myprofile';
             tpl_set_var('country', htmlspecialchars(db_CountryFromShort($country), ENT_COMPAT, 'UTF-8'));
             tpl_set_var('coords', htmlspecialchars(help_latToDegreeStr($latitude), ENT_COMPAT, 'UTF-8') . '<br />' . htmlspecialchars(help_lonToDegreeStr($longitude), ENT_COMPAT, 'UTF-8'));
             if ($radius + 0 > 0) {
                 tpl_set_var('notify', mb_ereg_replace('{radius}', $radius + 0, $notify_radius_message));
             } else {
                 tpl_set_var('notify', $no_notify_message);
             }
         }
     }
 } else {
     // display form
     if ($record['guru'] == 1 || $guide == 1) {
         tpl_set_var('guides_start', '');
         tpl_set_var('guides_end', '');
     } else {
         tpl_set_var('guides_start', '<!--');
Example #4
0
 $email_content = mb_ereg_replace('{registermail04}', tr('registermail04'), $email_content);
 $email_content = mb_ereg_replace('{registermail05}', tr('registermail05'), $email_content);
 $email_content = mb_ereg_replace('{registermail06}', tr('registermail06'), $email_content);
 $email_content = mb_ereg_replace('{registermail07}', tr('registermail07'), $email_content);
 $email_content = mb_ereg_replace('{registermail08}', tr('registermail08'), $email_content);
 $email_content = mb_ereg_replace('{registermail09}', tr('registermail09'), $email_content);
 $email_content = mb_ereg_replace('{registermail10}', tr('registermail10'), $email_content);
 $email_content = mb_ereg_replace('{registermail11}', tr('registermail11'), $email_content);
 $email_content = mb_ereg_replace('{registermail12}', tr('registermail12'), $email_content);
 $email_content = mb_ereg_replace('{registermail13}', tr('registermail13'), $email_content);
 $email_content = mb_ereg_replace('{registermail14}', tr('registermail14'), $email_content);
 $email_content = mb_ereg_replace('{registermail15}', tr('registermail15'), $email_content);
 $email_content = mb_ereg_replace('{registermail16}', tr('registermail16'), $email_content);
 $email_content = mb_ereg_replace('{user}', $username, $email_content);
 $email_content = mb_ereg_replace('{email}', $email, $email_content);
 $country_name = db_CountryFromShort($country);
 $email_content = mb_ereg_replace('{country}', $country_name, $email_content);
 $email_content = mb_ereg_replace('{code}', $activationcode, $email_content);
 $email_content = mb_ereg_replace('{octeamEmailsSignature}', $octeamEmailsSignature, $email_content);
 $uuid = create_uuid();
 if (strtotime("2008-11-01 00:00:00") <= strtotime(date("Y-m-d h:i:s"))) {
     $rules_conf_req = 1;
 } else {
     $rules_conf_req = 0;
 }
 //insert the user
 sql("INSERT INTO `user` ( `user_id`, `username`, `password`, `email`, `latitude`,\n                                          `longitude`, `last_modified`, `login_faults`, `login_id`, `is_active_flag`,\n                                          `was_loggedin`, `country`, `date_created`,\n                                          `uuid`, `activation_code`, `node`, `rules_confirmed`\n                                        ) VALUES ('', '&1', '&2', '&3', NULL, NULL, NOW(), '0', '0', '0', '0', '&4', NOW(), '&5', '&6', '&7', &8)", $username, hash('sha512', md5($password)), $email, $country, $uuid, $activationcode, $oc_nodeid, $rules_conf_req);
 mb_send_mail($email, $register_email_subject, $email_content, $emailheaders);
 //display confirmationpage
 $tplname = 'register_confirm';
 tpl_set_var('country', htmlspecialchars($country_name, ENT_COMPAT, 'UTF-8'));