function outputLocidSelectionForm($locSql, $options) { global $tpl; global $locline, $bgcolor1, $bgcolor2; require_once "lib2/logic/geodb.inc.php"; $urlparamString = prepareLocSelectionForm($options) . '&locid={locid}'; sql_temp_table_slave('locids'); sql_slave('CREATE TEMPORARY TABLE &locids ENGINE=MEMORY ' . $locSql); sql_slave('ALTER TABLE &locids ADD PRIMARY KEY (`loc_id`)'); $rs = sql_slave('SELECT `geodb_textdata`.`loc_id` `loc_id`, `geodb_textdata`.`text_val` `text_val` FROM `geodb_textdata`, &locids WHERE &locids.`loc_id`=`geodb_textdata`.`loc_id` AND `geodb_textdata`.`text_type`=500100000 ORDER BY `text_val`'); $nr = 1; $locations = ''; while ($r = sql_fetch_array($rs)) { $thislocation = $locline; // locationsdings zusammenbauen $locString = ''; $land = geodb_landFromLocid($r['loc_id']); if ($land != '') { $locString .= htmlspecialchars($land, ENT_COMPAT, 'UTF-8'); } $rb = geodb_regierungsbezirkFromLocid($r['loc_id']); if ($rb != '') { $locString .= ' > ' . htmlspecialchars($rb, ENT_COMPAT, 'UTF-8'); } $lk = geodb_landkreisFromLocid($r['loc_id']); if ($lk != '') { $locString .= ' > ' . htmlspecialchars($lk, ENT_COMPAT, 'UTF-8'); } $thislocation = mb_ereg_replace('{parentlocations}', $locString, $thislocation); // koordinaten ermitteln $r['loc_id'] = $r['loc_id'] + 0; $rsCoords = sql_slave('SELECT `lon`, `lat` FROM `geodb_coordinates` WHERE loc_id=' . $r['loc_id'] . ' LIMIT 1'); if ($rCoords = sql_fetch_array($rsCoords)) { $coordString = help_latToDegreeStr($rCoords['lat']) . ' ' . help_lonToDegreeStr($rCoords['lon']); } else { $coordString = '[' . $no_location_coords . ']'; } $thislocation = mb_ereg_replace('{coords}', htmlspecialchars($coordString, ENT_COMPAT, 'UTF-8'), $thislocation); $thislocation = mb_ereg_replace('{locationname}', htmlspecialchars($r['text_val'], ENT_COMPAT, 'UTF-8'), $thislocation); $thislocation = mb_ereg_replace('{urlparams}', $urlparamString, $thislocation); $thislocation = mb_ereg_replace('{locid}', urlencode($r['loc_id']), $thislocation); $thislocation = mb_ereg_replace('{nr}', $nr, $thislocation); $thislocation = mb_ereg_replace('{secondlocationname}', '', $thislocation); if ($nr % 2) { $thislocation = mb_ereg_replace('{bgcolor}', $bgcolor1, $thislocation); } else { $thislocation = mb_ereg_replace('{bgcolor}', $bgcolor2, $thislocation); } $nr++; $locations .= $thislocation . "\n"; } $tpl->assign('locations', $locations); $tpl->assign('resultscount', sql_num_rows($rs)); $tpl->assign('pages', ''); sql_free_result($rs); sql_drop_temp_table_slave('locids'); $tpl->display(); exit; }
function search_output() { global $opt, $translate, $txt_record; global $converted_from_html; global $phpzip, $bUseZip; $txtLine = $txt_record; $txtLogs = "<===================>\n{username} / {date} / {type}\n\n{text}\n"; $rs = sql_slave("SELECT SQL_BUFFER_RESULT\n &searchtmp.`cache_id` `cacheid`,\n &searchtmp.`longitude` `longitude`,\n &searchtmp.`latitude` `latitude`,\n `caches`.`wp_oc` `waypoint`,\n `caches`.`date_hidden` `date_hidden`,\n `caches`.`name` `name`,\n `caches`.`terrain` `terrain`,\n `caches`.`difficulty` `difficulty`,\n `caches`.`desc_languages` `desc_languages`,\n `caches`.`needs_maintenance`,\n `caches`.`listing_outdated`,\n IFNULL(`stt_country`.`text`,`countries`.`en`) AS `country`,\n IFNULL(`stt_size`.`text`,`cache_size`.`name`) `size`,\n IFNULL(`stt_type`.`text`,`cache_type`.`en`) `type`,\n IFNULL(`stt_status`.`text`,`cache_status`.`name`) `status`,\n `user`.`username` `username`,\n `cache_desc`.`desc` `desc`,\n `cache_desc`.`short_desc` `short_desc`,\n `cache_desc`.`language` `desc_language`,\n `cache_desc`.`hint` `hint`,\n `cache_desc`.`desc_html` `html`,\n `user`.`user_id`,\n `user`.`username`,\n `user`.`data_license`\n FROM\n &searchtmp\n INNER JOIN `caches` ON &searchtmp.`cache_id`=`caches`.`cache_id`\n INNER JOIN `cache_desc`\n ON `cache_desc`.`cache_id`=`caches`.`cache_id`\n AND `caches`.`default_desclang`=`cache_desc`.`language`\n INNER JOIN `cache_type` ON `cache_type`.`id`=`caches`.`type`\n INNER JOIN `cache_size` ON `cache_size`.`id`=`caches`.`size`\n INNER JOIN `cache_status` ON `cache_status`.`id`=`caches`.`status`\n INNER JOIN `user` ON `user`.`user_id`=`caches`.`user_id`\n LEFT JOIN `countries` ON `countries`.`short`=`caches`.`country`\n LEFT JOIN `sys_trans_text` `stt_type` ON `stt_type`.`trans_id`=`cache_type`.`trans_id` AND `stt_type`.`lang`='&1'\n LEFT JOIN `sys_trans_text` `stt_size` ON `stt_size`.`trans_id`=`cache_size`.`trans_id` AND `stt_size`.`lang`='&1'\n LEFT JOIN `sys_trans_text` `stt_status` ON `stt_status`.`trans_id`=`cache_status`.`trans_id` AND `stt_status`.`lang`='&1'\n LEFT JOIN `sys_trans_text` `stt_country` ON `stt_country`.`trans_id`=`countries`.`trans_id` AND `stt_country`.`lang`='&1'", $opt['template']['locale']); while ($r = sql_fetch_array($rs)) { if (strlen($r['desc_languages']) > 2) { $r = get_locale_desc($r); } $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}', $r['country'], $thisline); if ($r['hint'] == '') { $thisline = mb_ereg_replace('{hints}', '', $thisline); } else { $thisline = mb_ereg_replace('{hints}', str_rot13_gc(decodeEntities(strip_tags($r['hint']))), $thisline); } $thisline = mb_ereg_replace('{shortdesc}', $r['short_desc'], $thisline); $license = getLicenseDisclaimer($r['user_id'], $r['username'], $r['data_license'], $r['cacheid'], $opt['template']['locale'], true, false, true); if ($license != "") { $license = "\r\n\r\n{$license}"; } if ($r['html'] == 0) { $thisline = mb_ereg_replace('{htmlwarn}', '', $thisline); $thisline = mb_ereg_replace('{desc}', decodeEntities(strip_tags($r['desc'])) . $license, $thisline); } else { $thisline = mb_ereg_replace('{htmlwarn}', " ({$converted_from_html})", $thisline); $thisline = mb_ereg_replace('{desc}', html2txt($r['desc']) . $license, $thisline); } $thisline = mb_ereg_replace('{type}', $r['type'], $thisline); $thisline = mb_ereg_replace('{container}', $r['size'], $thisline); $thisline = mb_ereg_replace('{status}', $r['status'], $thisline); $difficulty = sprintf('%01.1f', $r['difficulty'] / 2); $thisline = mb_ereg_replace('{difficulty}', $difficulty, $thisline); $terrain = sprintf('%01.1f', $r['terrain'] / 2); $thisline = mb_ereg_replace('{terrain}', $terrain, $thisline); $thisline = mb_ereg_replace('{siteurl}', $opt['page']['default_absolute_url'], $thisline); $thisline = mb_ereg_replace('{owner}', $r['username'], $thisline); $flags = array(); if ($r['needs_maintenance'] > 0 || $r['listing_outdated']) { if ($r['needs_maintenance'] > 0) { $flags[] = 'geocache needs maintenance'; } if ($r['listing_outdated'] > 0) { $flags[] = 'description is outdated'; } } else { $flags[] = 'ok'; } foreach ($flags as &$flag) { $flag = $translate->t($flag, '', basename(__FILE__), __LINE__); } $thisline = mb_ereg_replace('{condition}', implode(', ', $flags), $thisline); // logs ermitteln $logentries = ''; $rsLogs = sql_slave("SELECT\n `cache_logs`.`id`,\n `cache_logs`.`text_html`,\n IFNULL(`stt`.`text`, `log_types`.`en`) `type`,\n `cache_logs`.`date`,\n `cache_logs`.`text`,\n `user`.`username`\n FROM `cache_logs`\n JOIN `user` ON `cache_logs`.`user_id`=`user`.`user_id`\n JOIN `log_types` ON `cache_logs`.`type`=`log_types`.`id`\n LEFT JOIN `sys_trans_text` `stt` ON `stt`.`trans_id`=`log_types`.`trans_id` AND `stt`.`lang`='&2'\n WHERE `cache_logs`.`cache_id`=&1\n ORDER BY\n `cache_logs`.`order_date` DESC,\n `cache_logs`.`date_created` DESC,\n `cache_logs`.`id` DESC\n LIMIT 20", $r['cacheid'], $opt['template']['locale']); while ($rLog = sql_fetch_array($rsLogs)) { $thislog = $txtLogs; $thislog = mb_ereg_replace('{id}', $rLog['id'], $thislog); $dateformat = "d.m.Y H:i"; if (substr($rLog['date'], 11) == "00:00:00") { $dateformat = "d.m.Y"; } $thislog = mb_ereg_replace('{date}', date($dateformat, strtotime($rLog['date'])), $thislog); $thislog = mb_ereg_replace('{username}', $rLog['username'], $thislog); $logtype = $rLog['type']; $thislog = mb_ereg_replace('{type}', $logtype, $thislog); if ($rLog['text_html'] == 0) { $thislog = mb_ereg_replace('{text}', decodeEntities(strip_tags($rLog['text'])), $thislog); } else { $thislog = mb_ereg_replace('{text}', html2txt($rLog['text']), $thislog); } $logentries .= $thislog . "\n"; } $thisline = mb_ereg_replace('{logs}', $logentries, $thisline); $thisline = lf2crlf($thisline); if (!$bUseZip) { echo $thisline; } else { $phpzip->add_data($r['waypoint'] . '.txt', $thisline); } } mysql_free_result($rs); }
if ($bUseZip == true) { header("content-type: application/zip"); header('Content-Disposition: attachment; filename=' . $sFilebasename . '.zip'); } else { header("Content-type: text/plain"); header("Content-Disposition: attachment; filename=" . $sFilebasename . ".txt"); } } // 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);
function outputLocidSelectionForm($locSql, $urlparams) { global $tplname, $locline, $stylepath, $bgcolor1, $bgcolor2; require_once $stylepath . '/selectlocid.inc.php'; unset($urlparams['queryid']); unset($urlparams['locid']); $urlparams['searchto'] = 'search' . $urlparams['searchtype']; unset($urlparams['searchtype']); $tplname = 'selectlocid'; // urlparams zusammenbauen $urlparamString = ''; foreach ($urlparams as $name => $param) { // workaround for attribs if (is_array($param)) { $pnew = ''; foreach ($param as $p) { if ($pnew != '') { $pnew .= ';' . $p; } else { $pnew .= $p; } } $param = $pnew; } if ($urlparamString != '') { $urlparamString .= '&' . $name . '=' . urlencode($param); } else { $urlparamString = $name . '=' . urlencode($param); } } $urlparamString .= '&locid={locid}'; sql('CREATE TEMPORARY TABLE `locids` ENGINE=MEMORY ' . $locSql); sql('ALTER TABLE `locids` ADD PRIMARY KEY (`loc_id`)'); $rs = sql('SELECT `geodb_textdata`.`loc_id` `loc_id`, `geodb_textdata`.`text_val` `text_val` FROM `geodb_textdata`, `locids` WHERE `locids`.`loc_id`=`geodb_textdata`.`loc_id` AND `geodb_textdata`.`text_type`=500100000 ORDER BY `text_val`'); $nr = 1; $locations = ''; while ($r = sql_fetch_array($rs)) { $thislocation = $locline; // locationsdings zusammenbauen $locString = ''; $land = landFromLocid($r['loc_id']); if ($land != '') { $locString .= htmlspecialchars($land, ENT_COMPAT, 'UTF-8'); } $rb = regierungsbezirkFromLocid($r['loc_id']); if ($rb != '') { $locString .= ' > ' . htmlspecialchars($rb, ENT_COMPAT, 'UTF-8'); } $lk = landkreisFromLocid($r['loc_id']); if ($lk != '') { $locString .= ' > ' . htmlspecialchars($lk, ENT_COMPAT, 'UTF-8'); } $thislocation = mb_ereg_replace('{parentlocations}', $locString, $thislocation); // koordinaten ermitteln $r['loc_id'] = $r['loc_id'] + 0; $rsCoords = sql('SELECT `lon`, `lat` FROM `geodb_coordinates` WHERE loc_id=' . $r['loc_id'] . ' LIMIT 1'); if ($rCoords = sql_fetch_array($rsCoords)) { $coordString = help_latToDegreeStr($rCoords['lat']) . ' ' . help_lonToDegreeStr($rCoords['lon']); } else { $coordString = '[keine Koordinaten vorhanden]'; } $thislocation = mb_ereg_replace('{coords}', htmlspecialchars($coordString, ENT_COMPAT, 'UTF-8'), $thislocation); $thislocation = mb_ereg_replace('{locationname}', htmlspecialchars($r['text_val'], ENT_COMPAT, 'UTF-8'), $thislocation); $thislocation = mb_ereg_replace('{urlparams}', $urlparamString, $thislocation); $thislocation = mb_ereg_replace('{locid}', urlencode($r['loc_id']), $thislocation); $thislocation = mb_ereg_replace('{nr}', $nr, $thislocation); $thislocation = mb_ereg_replace('{secondlocationname}', '', $thislocation); if ($nr % 2) { $thislocation = mb_ereg_replace('{bgcolor}', $bgcolor1, $thislocation); } else { $thislocation = mb_ereg_replace('{bgcolor}', $bgcolor2, $thislocation); } $nr++; $locations .= $thislocation . "\n"; } tpl_set_var('locations', $locations); tpl_set_var('resultscount', mysql_num_rows($rs)); tpl_set_var('pages', $first_img_inactive . ' ' . $prev_img_inactive . ' 1 ' . $next_img_inactive . ' ' . $last_img_inactive); tpl_BuildTemplate(); exit; }
$access_log = $_SESSION['CACHE_ACCESS_LOG_VC_' . $user_id]; } if (@$access_log[$cache_id] !== true) { $dbc->multiVariableQuery('INSERT INTO CACHE_ACCESS_LOGS (event_date, cache_id, user_id, source, event, ip_addr, user_agent, forwarded_for) VALUES (NOW(), :1, :2, \'B\', \'download_xml\', :3, :4, :5)', $cache_id, $user_id, $_SERVER['REMOTE_ADDR'], $_SERVER['HTTP_USER_AGENT'], $_SERVER['HTTP_X_FORWARDED_FOR']); $access_log[$cache_id] = true; $_SESSION['CACHE_ACCESS_LOG_VC_' . $user_id] = $access_log; } } $thisline = $xmlLine; $lat = sprintf('%01.5f', $r['latitude']); $thisline = str_replace('{lat}', help_latToDegreeStr($lat), $thisline); $lon = sprintf('%01.5f', $r['longitude']); $thisline = str_replace('{lon}', help_lonToDegreeStr($lon), $thisline); $time = date('d.m.Y', strtotime($r['date_hidden'])); $thisline = str_replace('{time}', $time, $thisline); $thisline = str_replace('{waypoint}', $r['waypoint'], $thisline); $thisline = str_replace('{cacheid}', $r['cacheid'], $thisline); //modified coords if ($r['cache_mod_cords_id'] > 0) { //check if we have user coords $thisline = str_replace('{mod_suffix}', '(F)', $thisline); } else { $thisline = str_replace('{mod_suffix}', '', $thisline); } $thisline = str_replace('{cachename}', filterevilchars($r['name']), $thisline); $thisline = str_replace('{country}', tr($r['country']), $thisline); if ($r['hint'] == '') { $thisline = str_replace('{hints}', '', $thisline);
function search_output() { global $db, $opt; global $distance_unit, $startat, $count, $sql, $sqlLimit; $encoding = 'UTF-8'; $xmlLine = "\t<cache>\n\t\t<name><![CDATA[{cachename}]]></name>\n\t\t<owner id=\"{ownerid}\"><![CDATA[{owner}]]></owner>\n\t\t<id>{cacheid}</id>\n\t\t<waypoint>{waypoint}</waypoint>\n\t\t<hidden>{time}</hidden>\n\t\t<status id=\"{statusid}\">{status}</status>\n\t\t<lon value=\"{lonvalue}\">{lon}</lon>\n\t\t<lat value=\"{latvalue}\">{lat}</lat>\n\t\t<distance unit=\"" . $distance_unit . "\">{distance}</distance>\n\t\t<type id=\"{typeid}\">{type}</type>\n\t\t<difficulty>{difficulty}</difficulty>\n\t\t<terrain>{terrain}</terrain>\n\t\t<size id=\"{sizeid}\">{container}</size>\n\t\t<country id=\"{countryid}\">{country}</country>\n\t\t<link><![CDATA[" . $opt['page']['default_absolute_url'] . "viewcache.php?wp={waypoint}]]></link>\n\t\t<desc><![CDATA[{shortdesc}]]></desc>\n\t\t<hints><![CDATA[{hints}]]></hints>\n\t</cache>\n"; // create temporary table sql_temp_table_slave('searchtmp'); sql_slave('CREATE TEMPORARY TABLE &searchtmp SELECT SQL_BUFFER_RESULT SQL_CALC_FOUND_ROWS ' . $sql . $sqlLimit); $resultcount = sql_value_slave('SELECT FOUND_ROWS()', 0); $rsCount = sql_slave('SELECT COUNT(*) `count` FROM &searchtmp'); $rCount = sql_fetch_array($rsCount); mysql_free_result($rsCount); // start output if (!$db['debug']) { header("Content-type: application/xml; charset=" . $encoding); //header("Content-Disposition: attachment; filename=" . $sFilebasename . ".txt"); echo "<?xml version=\"1.0\" encoding=\"" . $encoding . "\"?>\n"; echo "<result>\n"; echo "\t<docinfo>\n"; echo "\t\t<results>" . $rCount['count'] . "</results>\n"; echo "\t\t<startat>" . $startat . "</startat>\n"; echo "\t\t<perpage>" . $count . "</perpage>\n"; echo "\t\t<total>" . $resultcount . "</total>\n"; echo "\t</docinfo>\n"; } $rs = sql_slave("SELECT &searchtmp.`cache_id` `cacheid`,\n &searchtmp.`longitude` `longitude`,\n &searchtmp.`latitude` `latitude`,\n `caches`.`wp_oc` `waypoint`,\n `caches`.`date_hidden` `date_hidden`,\n `caches`.`name` `name`,\n `caches`.`country` `countrycode`,\n `caches`.`terrain` `terrain`,\n `caches`.`difficulty` `difficulty`,\n `caches`.`desc_languages` `desc_languages`,\n `cache_size`.`name` `size`,\n `cache_size`.`id` `size_id`,\n `cache_type`.`name` `type`,\n `cache_type`.`id` `type_id`,\n `cache_status`.`name` `status`,\n `cache_status`.`id` `status_id`,\n `user`.`username` `username`,\n `user`.`user_id` `user_id`,\n `cache_desc`.`desc` `desc`,\n `cache_desc`.`short_desc` `short_desc`,\n `cache_desc`.`hint` `hint`,\n `cache_desc`.`desc_html` `html`,\n &searchtmp.`distance` `distance`,\n `sys_trans_text`.`text` `country`\n FROM &searchtmp\n INNER JOIN `caches` ON &searchtmp.`cache_id`=`caches`.`cache_id`\n INNER JOIN `user` ON &searchtmp.`user_id`=`user`.`user_id`\n INNER JOIN `cache_desc`\n ON `caches`.`cache_id`=`cache_desc`.`cache_id` \n AND `caches`.`default_desclang`=`cache_desc`.`language`\n INNER JOIN `cache_type` ON `caches`.`type`=`cache_type`.`id`\n INNER JOIN `cache_status` ON `caches`.`status`=`cache_status`.`id`\n INNER JOIN `cache_size` ON `caches`.`size`=`cache_size`.`id`\n LEFT JOIN `countries` ON `countries`.`short`=`caches`.`country`\n LEFT JOIN `sys_trans_text` ON `sys_trans_text`.`trans_id`=`countries`.`trans_id`\n AND `sys_trans_text`.`lang`='&1'", $opt['template']['locale']); while ($r = sql_fetch_array($rs)) { if (strlen($r['desc_languages']) > 2) { $r = get_locale_desc($r); } $thisline = $xmlLine; $lat = sprintf('%01.5f', $r['latitude']); $thisline = str_replace('{lat}', help_latToDegreeStr($lat), $thisline); $thisline = str_replace('{latvalue}', $lat, $thisline); $lon = sprintf('%01.5f', $r['longitude']); $thisline = str_replace('{lon}', help_lonToDegreeStr($lon), $thisline); $thisline = str_replace('{lonvalue}', $lon, $thisline); $time = date('d.m.Y', strtotime($r['date_hidden'])); $thisline = str_replace('{time}', $time, $thisline); $thisline = str_replace('{waypoint}', $r['waypoint'], $thisline); $thisline = str_replace('{cacheid}', $r['cacheid'], $thisline); $thisline = str_replace('{cachename}', filterevilchars($r['name']), $thisline); $thisline = str_replace('{country}', text_xmlentities($r['country']), $thisline); $thisline = str_replace('{countryid}', $r['country'], $thisline); if ($r['hint'] == '') { $thisline = str_replace('{hints}', '', $thisline); } else { $thisline = str_replace('{hints}', str_rot13_gc(decodeEntities(filterevilchars(strip_tags($r['hint'])))), $thisline); } $thisline = str_replace('{shortdesc}', filterevilchars($r['short_desc']), $thisline); if ($r['html'] == 0) { $thisline = str_replace('{htmlwarn}', '', $thisline); $thisline = str_replace('{desc}', filterevilchars(strip_tags($r['desc'])), $thisline); } else { $thisline = str_replace('{htmlwarn}', ' (Text converted from HTML)', $thisline); $thisline = str_replace('{desc}', html2txt(filterevilchars($r['desc'])), $thisline); } $thisline = str_replace('{type}', $r['type'], $thisline); $thisline = str_replace('{typeid}', $r['type_id'], $thisline); $thisline = str_replace('{container}', $r['size'], $thisline); $thisline = str_replace('{sizeid}', $r['size_id'], $thisline); $thisline = str_replace('{status}', $r['status'], $thisline); $thisline = str_replace('{statusid}', $r['status_id'], $thisline); $difficulty = sprintf('%01.1f', $r['difficulty'] / 2); $thisline = str_replace('{difficulty}', $difficulty, $thisline); $terrain = sprintf('%01.1f', $r['terrain'] / 2); $thisline = str_replace('{terrain}', $terrain, $thisline); $thisline = str_replace('{owner}', filterevilchars($r['username']), $thisline); $thisline = str_replace('{ownerid}', filterevilchars($r['user_id']), $thisline); $thisline = str_replace('{distance}', text_xmlentities(sprintf("%01.1f", $r['distance'])), $thisline); $thisline = lf2crlf($thisline); if (!$db['debug']) { echo $thisline; } } mysql_free_result($rs); sql_drop_temp_table_slave('searchtmp'); if (!$db['debug']) { echo "</result>\n"; } }
// display user activity (by Łza 2012) if (date('m') == 4 and date('d') == 1) { $tmplog_username_aktywnosc = ' (<img src="tpl/stdstyle/images/blue/thunder_ico.png" alt="user activity" width="13" height="13" border="0" title="' . tr('viewlog_aktywnosc') . '"/>' . rand(1, 9) . ') '; } else { $tmplog_username_aktywnosc = ' (<img src="tpl/stdstyle/images/blue/thunder_ico.png" alt="user activity" width="13" height="13" border="0" title="' . tr('viewlog_aktywnosc') . ' [' . $record['znalezione'] . '+' . $record['nieznalezione'] . '+' . $record['ukryte'] . ']"/>' . ($record['ukryte'] + $record['znalezione'] + $record['nieznalezione']) . ') '; } // hide nick of athor of COG(OC Team) for user if ($record['type'] == 12 && !$usr['admin']) { $record['userid'] = '0'; $tmplog_username_aktywnosc = ''; $tmplog_username = tr('cog_user_name'); } $tmplog = mb_ereg_replace('{username_aktywnosc}', $tmplog_username_aktywnosc, $tmplog); // mobile caches by Łza if ($record['type'] == 4 && $record['mobile_latitude'] != 0) { $tmplog_kordy_mobilnej = mb_ereg_replace(" ", " ", htmlspecialchars(help_latToDegreeStr($record['mobile_latitude']), ENT_COMPAT, 'UTF-8')) . ' ' . mb_ereg_replace(" ", " ", htmlspecialchars(help_lonToDegreeStr($record['mobile_longitude']), ENT_COMPAT, 'UTF-8')); $tmplog = mb_ereg_replace('{kordy_mobilniaka}', $record['km'] . ' km [<img src="tpl/stdstyle/images/blue/szczalka_mobile.png" title="' . tr('viewlog_kordy') . '" />' . $tmplog_kordy_mobilnej . ']', $tmplog); } else { $tmplog = mb_ereg_replace('{kordy_mobilniaka}', ' ', $tmplog); } if ($record['text_html'] == 0) { $processed_text = htmlspecialchars($processed_text, ENT_COMPAT, 'UTF-8'); $processed_text = help_addHyperlinkToURL($processed_text); } else { $processed_text = userInputFilter::purifyHtmlStringAndDecodeHtmlSpecialChars($processed_text); } $processed_text = str_replace($smileytext, $smileyimage, $processed_text); $tmplog_text = $processed_text . $edit_footer; $tmplog = mb_ereg_replace('{show_deleted}', $show_deleted, $tmplog); $tmplog = mb_ereg_replace('{username}', $tmplog_username, $tmplog); $tmplog = mb_ereg_replace('{userid}', $record['userid'], $tmplog);
if ($cache_type != GeoCache::TYPE_MOVING) { tpl_set_var('waypoints_start', ''); tpl_set_var('waypoints_end', ''); $wp_rs = sql("SELECT `wp_id`, `type`, `longitude`, `latitude`, `desc`, `status`, `stage`, `waypoint_type`.`&1` wp_type, waypoint_type.icon wp_icon FROM `waypoints` INNER JOIN waypoint_type ON (waypoints.type = waypoint_type.id) WHERE `cache_id`='&2' ORDER BY `stage`,`wp_id`", $lang_db, $cache_id); if (mysql_num_rows($wp_rs) != 0) { $waypoints = '<table id="gradient" cellpadding="5" width="97%" border="1" style="border-collapse: collapse; font-size: 11px; line-height: 1.6em; color: #000000; ">'; $waypoints .= '<tr>'; if ($cache_type == GeoCache::TYPE_OTHERTYPE || $cache_type == GeoCache::TYPE_MULTICACHE || $cache_type == GeoCache::TYPE_QUIZ) { $waypoints .= '<th align="center" valign="middle" width="30"><b>' . tr('stage_wp') . '</b></th>'; } $waypoints .= '<th width="32"><b>' . tr('symbol_wp') . '</b></th><th width="32"><b>' . tr('type_wp') . '</b></th><th width="32"><b>' . tr('coordinates_wp') . '</b></th><th><b>' . tr('describe_wp') . '</b></th><th width="22"><b>' . tr('status_wp') . '</b></th><th width="22"><b>' . tr('edit') . '</b></th><th width="22"><b>' . tr('delete') . '</b></th></tr>'; for ($i = 0; $i < mysql_num_rows($wp_rs); $i++) { $tmpline1 = $wpline; $wp_record = sql_fetch_array($wp_rs); $coords_lat = mb_ereg_replace(" ", " ", htmlspecialchars(help_latToDegreeStr($wp_record['latitude']), ENT_COMPAT, 'UTF-8')); $coords_lon = mb_ereg_replace(" ", " ", htmlspecialchars(help_lonToDegreeStr($wp_record['longitude']), ENT_COMPAT, 'UTF-8')); $tmpline1 = mb_ereg_replace('{wp_icon}', htmlspecialchars($wp_record['wp_icon'], ENT_COMPAT, 'UTF-8'), $tmpline1); $tmpline1 = mb_ereg_replace('{type}', htmlspecialchars($wp_record['wp_type'], ENT_COMPAT, 'UTF-8'), $tmpline1); $tmpline1 = mb_ereg_replace('{lon}', $coords_lon, $tmpline1); $tmpline1 = mb_ereg_replace('{lat}', $coords_lat, $tmpline1); $tmpline1 = mb_ereg_replace('{desc}', nl2br($wp_record['desc']), $tmpline1); $tmpline1 = mb_ereg_replace('{wpid}', $wp_record['wp_id'], $tmpline1); if ($cache_type == GeoCache::TYPE_OTHERTYPE || $cache_type == GeoCache::TYPE_MULTICACHE || $cache_type == GeoCache::TYPE_QUIZ) { $tmpline1 = mb_ereg_replace('{stagehide_end}', '', $tmpline1); $tmpline1 = mb_ereg_replace('{stagehide_start}', '', $tmpline1); if ($wp_record['stage'] == 0) { $tmpline1 = mb_ereg_replace('{number}', "", $tmpline1); } else { $tmpline1 = mb_ereg_replace('{number}', $wp_record['stage'], $tmpline1); } } else {
function search_output() { global $opt; global $converted_from_html; global $phpzip, $bUseZip; $txtLine = "Name: {cachename} von {owner}\nKoordinaten: {lon} {lat}\nStatus: {status}\n\nVersteckt am: {time}\nWegpunkt: {waypoint}\nLand: {country}\nCacheart: {type}\nBehälter: {container}\nD/T: {difficulty}/{terrain}\nOnline: " . $opt['page']['absolute_url'] . "viewcache.php?wp={waypoint}\n\nKurzbeschreibung: {shortdesc}\n\nBeschreibung{htmlwarn}:\n<===================>\n{desc}\n<===================>\n\nZusätzliche Hinweise:\n<===================>\n{hints}\n<===================>\nA|B|C|D|E|F|G|H|I|J|K|L|M\nN|O|P|Q|R|S|T|U|V|W|X|Y|Z\n\nLogeinträge:\n{logs}\n"; $txtLogs = "<===================>\n{username} / {date} / {type}\n\n{text}\n"; $rs = sql_slave(' SELECT SQL_BUFFER_RESULT &searchtmp.`cache_id` `cacheid`, &searchtmp.`longitude` `longitude`, &searchtmp.`latitude` `latitude`, `caches`.`wp_oc` `waypoint`, `caches`.`date_hidden` `date_hidden`, `caches`.`name` `name`, `caches`.`terrain` `terrain`, `caches`.`difficulty` `difficulty`, `caches`.`desc_languages` `desc_languages`, `sys_trans_text`.`text` AS `country`, `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`, `user`.`user_id`, `user`.`username`, `user`.`data_license` FROM &searchtmp INNER JOIN `caches` ON &searchtmp.`cache_id`=`caches`.`cache_id` INNER JOIN `cache_desc` ON `cache_desc`.`cache_id`=`caches`.`cache_id` AND `caches`.`default_desclang`=`cache_desc`.`language` INNER JOIN `cache_type` ON `cache_type`.`id`=`caches`.`type` INNER JOIN `cache_size` ON `cache_size`.`id`=`caches`.`size` INNER JOIN `cache_status` ON `cache_status`.`id`=`caches`.`status` INNER JOIN `user` ON `user`.`user_id`=`caches`.`user_id` LEFT JOIN `countries` ON `countries`.`short`=`caches`.`country` LEFT JOIN `sys_trans_text` ON `sys_trans_text`.`trans_id`=`countries`.`trans_id` AND `sys_trans_text`.`lang`=\'&1\'', $opt['template']['locale']); 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}', $r['country'], $thisline); if ($r['hint'] == '') { $thisline = mb_ereg_replace('{hints}', '', $thisline); } else { $thisline = mb_ereg_replace('{hints}', str_rot13_gc(decodeEntities(strip_tags($r['hint']))), $thisline); } $thisline = mb_ereg_replace('{shortdesc}', $r['short_desc'], $thisline); $license = getLicenseDisclaimer($r['user_id'], $r['username'], $r['data_license'], $r['cacheid'], $opt['template']['locale'], true, false, true); if ($license != "") { $license = "\r\n\r\n{$license}"; } if ($r['html'] == 0) { $thisline = mb_ereg_replace('{htmlwarn}', '', $thisline); $thisline = mb_ereg_replace('{desc}', decodeEntities(strip_tags($r['desc'])) . $license, $thisline); } else { $thisline = mb_ereg_replace('{htmlwarn}', " ({$converted_from_html})", $thisline); $thisline = mb_ereg_replace('{desc}', html2txt($r['desc']) . $license, $thisline); } $thisline = mb_ereg_replace('{type}', $r['type'], $thisline); $thisline = mb_ereg_replace('{container}', $r['size'], $thisline); $thisline = mb_ereg_replace('{status}', $r['status'], $thisline); $difficulty = sprintf('%01.1f', $r['difficulty'] / 2); $thisline = mb_ereg_replace('{difficulty}', $difficulty, $thisline); $terrain = sprintf('%01.1f', $r['terrain'] / 2); $thisline = mb_ereg_replace('{terrain}', $terrain, $thisline); $thisline = mb_ereg_replace('{owner}', $r['username'], $thisline); // logs ermitteln $logentries = ''; $rsLogs = sql_slave("SELECT `cache_logs`.`id`, `cache_logs`.`text_html`, `log_types`.`de` `type`, `cache_logs`.`date`, `cache_logs`.`text`, `user`.`username` FROM `cache_logs`, `user`, `log_types` WHERE `cache_logs`.`user_id`=`user`.`user_id` AND `cache_logs`.`type`=`log_types`.`id` AND `cache_logs`.`cache_id`=&1 ORDER BY `cache_logs`.`date` DESC LIMIT 20", $r['cacheid']); while ($rLog = sql_fetch_array($rsLogs)) { $thislog = $txtLogs; $thislog = mb_ereg_replace('{id}', $rLog['id'], $thislog); if (substr($rLog['date'], 11) == "00:00:00") { $dateformat = "d.m.Y"; } else { $dateformat = "d.m.Y H:i"; } $thislog = mb_ereg_replace('{date}', date($dateformat, strtotime($rLog['date'])), $thislog); $thislog = mb_ereg_replace('{username}', $rLog['username'], $thislog); $logtype = $rLog['type']; $thislog = mb_ereg_replace('{type}', $logtype, $thislog); if ($rLog['text_html'] == 0) { $thislog = mb_ereg_replace('{text}', decodeEntities(strip_tags($rLog['text'])), $thislog); } else { $thislog = mb_ereg_replace('{text}', html2txt($rLog['text']), $thislog); } $logentries .= $thislog . "\n"; } $thisline = mb_ereg_replace('{logs}', $logentries, $thisline); $thisline = lf2crlf($thisline); if (!$bUseZip) { echo $thisline; } else { $phpzip->add_data($r['waypoint'] . '.txt', $thisline); } } mysql_free_result($rs); }
} else { // close previous entry $q = "update user_nick_history set date_to = NOW() where date_to is null and user_id = :1"; $db->multiVariableQuery($q, (int) $usr['userid']); } // update and save current nick $q = "update user set username = :1 where user_id = :2"; $db->multiVariableQuery($q, $username, (int) $usr['userid']); $q = "insert into user_nick_history (user_id, date_from, username) select user_id, now(), username from user where user_id = :1"; $db->multiVariableQuery($q, (int) $usr['userid']); $db->commit(); $usr['username'] = $username; } $tplname = 'myprofile'; tpl_set_var('country', htmlspecialchars(tr($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', '<!--'); tpl_set_var('guides_end', '-->');
if ($cache_type == 1 || $cache_type == 3 || $cache_type == 7) { $waypoints .= '<th align="center" valign="middle" width="30"><b>' . tr('stage_wp') . '</b></th>'; } $waypoints .= '<th align="center" valign="middle" width="40"> <b>' . tr('symbol_wp') . '</b> </th> <th align="center" valign="middle" width="40"> <b>' . tr('type_wp') . '</b> </th> <th width="90" align="center" valign="middle"> <b>' . tr('coordinates_wp') . '</b> </th> <th align="center" valign="middle"><b>' . tr('describe_wp') . '</b></th></tr>'; } /*@var $waypoint lib\Objects\GeoCache\Waypoint */ foreach ($geocache->getWaypoints() as $waypoint) { if ($waypoint->getStatus() != Waypoint::STATUS_HIDDEN) { $wpTypeTranslation = tr('wayPointType' . $waypoint->getType()); $tmpline1 = $wpline; // string in viewcache.inc.php if ($waypoint->getStatus() == Waypoint::STATUS_VISIBLE) { $coords_lat_lon = "<a class=\"links4\" href=\"#\" onclick=\"javascript:window.open('http://www.opencaching.pl/coordinates.php?lat=" . $waypoint->getCoordinates()->getLatitude() . "&lon=" . $waypoint->getCoordinates()->getLongitude() . "&popup=y&wp=" . htmlspecialchars($geocache->getWaypointId(), ENT_COMPAT, 'UTF-8') . "','Koordinatenumrechnung','width=240,height=334,resizable=yes,scrollbars=1'); return event.returnValue=false\">" . mb_ereg_replace(" ", " ", htmlspecialchars(help_latToDegreeStr($waypoint->getCoordinates()->getLatitude()), ENT_COMPAT, 'UTF-8') . "<br/>" . htmlspecialchars(help_lonToDegreeStr($waypoint->getCoordinates()->getLongitude()), ENT_COMPAT, 'UTF-8')) . "</a>"; } if ($waypoint->getStatus() == Waypoint::STATUS_VISIBLE_HIDDEN_COORDS) { $coords_lat_lon = "N ?? ??????<br />E ?? ??????"; } $tmpline1 = mb_ereg_replace('{wp_icon}', htmlspecialchars($waypoint->getIconName(), ENT_COMPAT, 'UTF-8'), $tmpline1); $tmpline1 = mb_ereg_replace('{type}', htmlspecialchars($wpTypeTranslation, ENT_COMPAT, 'UTF-8'), $tmpline1); $tmpline1 = mb_ereg_replace('{lat_lon}', $coords_lat_lon, $tmpline1); $tmpline1 = mb_ereg_replace('{desc}', " " . nl2br($waypoint->getDescription()) . " ", $tmpline1); $tmpline1 = mb_ereg_replace('{wpid}', $waypoint->getId(), $tmpline1); if ($cache_type == 1 || $cache_type == 3 || $cache_type == 7) { $tmpline1 = mb_ereg_replace('{stagehide_end}', '', $tmpline1); $tmpline1 = mb_ereg_replace('{stagehide_start}', '', $tmpline1); if ($waypoint->getStage() == 0) { $tmpline1 = mb_ereg_replace('{number}', "", $tmpline1); } else {
$count = $db->rowCount(); if ($count != 0) { //$notes = '<table border="0" cellspacing="2" cellpadding="1" style="margin-left: 10px; line-height: 1.4em; font-size: 13px;" width="95%">'; //$notes .= '<tr><td width="22"> </td><td><strong>GeoCache</strong></td></tr><tr><td colspan="2"><hr></hr></td></tr>'; $notes = ""; $bgcolor1 = '#ffffff'; $bgcolor2 = '#eeeeee'; //for ($i = 0; $i < mysql_num_rows($notes_rs); $i++) for ($i = 0; $i < $count; $i++) { $bgcolor = $i % 2 ? $bgcolor1 : $bgcolor2; //$notes_record = sql_fetch_array($notes_rs); $notes_record = $db->dbResultFetch(); $cacheicon = myninc::checkCacheStatusByUser($notes_record, $usr['userid']); $user_coords = ' '; if ($notes_record['latitude'] != null && $notes_record['longitude'] != null) { $user_coords = mb_ereg_replace(" ", " ", htmlspecialchars(help_latToDegreeStr($notes_record['latitude'], 1), ENT_COMPAT, 'UTF-8')) . ' ' . mb_ereg_replace(" ", " ", htmlspecialchars(help_lonToDegreeStr($notes_record['longitude'], 1), ENT_COMPAT, 'UTF-8')); $user_coords .= ' <a class="links" href="mycache_notes.php?delete_coords=' . $notes_record['cache_mod_cords_id'] . '" onclick="return confirm(\'' . tr('coordsmod_info_02') . '\');"><img style="vertical-align: middle;" src="tpl/stdstyle/images/log/16x16-trash.png" title=' . tr('reset_coords') . ' /></a>'; } $delete_user_note = ' '; if ($notes_record['notes_desc'] != null) { $delete_user_note = '<a class="links" href="mycache_notes.php?delete={noteid}" onclick="return confirm(\'' . tr("mycache_notes_01") . '\');"><img style="vertical-align: middle;" src="tpl/stdstyle/images/log/16x16-trash.png" alt="" title=' . tr('delete') . ' /></a>'; } $notes .= '<tr> <td style="background-color: {bgcolor}"><img src="' . $cacheicon . '" alt="" /></td> <td align="left" style="background-color: {bgcolor}"><a href="viewcache.php?cacheid={cacheid}" onmouseover="if (\'{notes_text}\' != \'\') Tip(\'{notes_text}\', OFFSETY, 25, OFFSETX, -135, PADDING,5, WIDTH,280,SHADOW,true)" onmouseout="UnTip()">' . $notes_record['cache_name'] . '</a></td> <td style="background-color: {bgcolor}"> </td> <td nowrap style="background-color: {bgcolor}">' . $user_coords . '</td> <td nowrap style="text-align:center; background-color: {bgcolor}">{lastfound}</td> <td nowrap style="text-align:center; background-color: {bgcolor}"><img src="tpl/stdstyle/images/{icon_name}" border="0" alt="" onmouseover="Tip(\'{log_text}\', OFFSETY, 25, OFFSETX, -135, PADDING,5, WIDTH,280,SHADOW,true)" onmouseout="UnTip()"/></td> <td style="background-color: {bgcolor}; text-align:center">' . $delete_user_note . '</td></tr>'; $notes = mb_ereg_replace('{bgcolor}', $bgcolor, $notes);
$tmpline = str_replace('{date_created_sort}', date($logdateformat_ymd, strtotime($caches_record['date_created'])), $tmpline); $ratingA = $caches_record['toprating']; if ($ratingA > 0) { $ratingimg = '<img src="images/rating-star.png" alt="' . $tr_Recommended . '" title="' . $tr_Recommended . '" />'; } else { $ratingimg = ''; } $tmpline = str_replace('{toprating}', $ratingA, $tmpline); $tmpline = str_replace('{ratpic}', $ratingimg, $tmpline); $login = 0; if ($usr == false) { $tmpline = str_replace('{long}', tr('please_login'), $tmpline); $tmpline = str_replace('{lat}', tr('to_see_coords'), $tmpline); } else { if ($CalcCoordinates) { $tmpline = str_replace('{long}', htmlspecialchars(help_lonToDegreeStr($caches_record['longitude'])), $tmpline); if ($caches_record['coord_modified'] == true) { $tmpline = str_replace('{mod_cord_style}', 'style="color:orange;" alt ="' . $tr_Coord_have_been_modified . '" title="' . $tr_Coord_have_been_modified . '"', $tmpline); $tmpline = str_replace('{mod_suffix}', '[F]', $tmpline); } else { $tmpline = str_replace('{mod_cord_style}', '', $tmpline); $tmpline = str_replace('{mod_suffix}', '', $tmpline); } $tmpline = str_replace('{lat}', htmlspecialchars(help_latToDegreeStr($caches_record['latitude'])), $tmpline); } } $tmpline = str_replace('{cachetype}', htmlspecialchars(cache_type_from_id($caches_record['cache_type'], $lang), ENT_COMPAT, 'UTF-8'), $tmpline); // sp2ong short_desc ermitteln TODO: nicht die erste sondern die richtige wählen $tmpline = str_replace('{wp_oc}', htmlspecialchars($caches_record['wp_oc'], ENT_COMPAT, 'UTF-8'), $tmpline); if ($CalcCoordinates) { $tmpline = str_replace('{latitude}', htmlspecialchars($caches_record['latitude'], ENT_COMPAT, 'UTF-8'), $tmpline);