if ($log_record['encrypt'] == 1 && $log_record['cache_owner'] != $usr['userid'] && $log_record['luser_id'] != $usr['userid']) { //crypt the log ROT13, but keep HTML-Tags and Entities $data_text = str_rot13_html($data_text); } else { $logtext .= "<br/>"; } $logtext .= $data_text; $thisline = mb_ereg_replace('{log_text}', $logtext, $thisline); $thisline = mb_ereg_replace('{logicon}', "tpl/stdstyle/images/" . $log_record['icon_small'], $thisline); $thisline = mb_ereg_replace('{cacheicon}', $cacheicon, $thisline); $thisline = mb_ereg_replace('{smallmapurl}', create_map_url($markerpositions, $i + $markerpositions['plain_cache_num'], $latitude, $longitude), $thisline); $file_content .= $thisline . "\n"; } $file_content .= '</ul>'; } tpl_set_var('new_logs', $file_content); mysql_free_result($rsl); } } // AJAX Chat -shoutbox function getShoutBoxContent() { // URL to the chat directory: if (!defined('AJAX_CHAT_URL')) { define('AJAX_CHAT_URL', './chat/'); } // Path to the chat directory: if (!defined('AJAX_CHAT_PATH')) { define('AJAX_CHAT_PATH', realpath(dirname($_SERVER['SCRIPT_FILENAME']) . '/chat') . '/'); } // Validate the path to the chat:
// do not use slave server for the next time ... db_slave_exclude(); //add record to cache_desc table sql("INSERT INTO `cache_desc` (\n\t\t\t\t\t\t\t\t\t\t\t\t`id`,\n\t\t\t\t\t\t\t\t\t\t\t\t`cache_id`,\n\t\t\t\t\t\t\t\t\t\t\t\t`language`,\n\t\t\t\t\t\t\t\t\t\t\t\t`desc`,\n\t\t\t\t\t\t\t\t\t\t\t\t`desc_html`,\n\t\t\t\t\t\t\t\t\t\t\t\t`hint`,\n\t\t\t\t\t\t\t\t\t\t\t\t`short_desc`,\n\t\t\t\t\t\t\t\t\t\t\t\t`last_modified`,\n\t\t\t\t\t\t\t\t\t\t\t\t`desc_htmledit`,\n\t\t\t\t\t\t\t\t\t\t\t\t`node`\n\t\t\t\t\t\t\t\t\t\t\t) VALUES ('', '&1', '&2', '&3', '&4', '&5', '&6', NOW(), '&7', '&8')", $cache_id, $sel_lang, $desc, $descMode != 1 ? 1 : 0, nl2br(htmlspecialchars($hints, ENT_COMPAT, 'UTF-8')), $short_desc, $descMode == 3 ? 1 : 0, $oc_nodeid); // insert cache-attributes for ($i = 0; $i < count($cache_attribs); $i++) { if ($cache_attribs[$i] + 0 > 0) { sql("INSERT INTO `caches_attributes` (`cache_id`, `attrib_id`) VALUES ('&1', '&2')", $cache_id, $cache_attribs[$i] + 0); } } // only if cache is published NOW or activate_date is in the past if ($publish == 'now2' || $publish == 'later' && mktime($activate_hour, 0, 0, $activate_month, $activate_day, $activate_year) <= $today) { //do event handling include_once $opt['rootpath'] . '/lib/eventhandler.inc.php'; event_notify_new_cache($cache_id + 0); event_new_cache($usr['userid'] + 0); } // redirection tpl_redirect('viewcache.php?cacheid=' . urlencode($cache_id)); } else { tpl_set_var('general_message', $error_general); } } } } if ($no_tpl_build == false) { tpl_set_var('scrollposx', isset($_REQUEST['scrollposx']) ? $_REQUEST['scrollposx'] + 0 : 0); tpl_set_var('scrollposy', isset($_REQUEST['scrollposy']) ? $_REQUEST['scrollposy'] + 0 : 0); // make the template and send it out tpl_BuildTemplate(); }
sql("DELETE FROM `mp3` WHERE `uuid`='&1'", $uuid); sql("INSERT INTO `removed_objects` (`localID`, `uuid`, `type`, `removed_date`, `node`) VALUES ('&1', '&2', 6, NOW(), '&3')", $localid, $uuid, $oc_nodeid); switch ($type) { // log case 1: sql("UPDATE `cache_logs` SET `mp3count`=`mp3count`-1 WHERE `id`='&1'", $objectid); $rs = sql("SELECT `cache_id` FROM `cache_logs` WHERE `deleted`=0 AND `id`='&1'", $objectid); $r = sql_fetch_array($rs); mysql_free_result($rs); tpl_redirect('viewlogs.php?cacheid=' . urlencode($r['cache_id'])); break; // cache // cache case 2: sql("UPDATE `caches` SET `mp3count`=`mp3count`-1 WHERE `cache_id`='&1'", $objectid); tpl_redirect('editcache.php?cacheid=' . urlencode($objectid)); break; } tpl_redirect('index.php'); exit; } else { $tplname = 'message'; tpl_set_var('messagetitle', $message_title_internal); tpl_set_var('message_start', ''); tpl_set_var('message_end', ''); tpl_set_var('message', $message_internal); } } } //make the template and send it out tpl_BuildTemplate();
if ($rowCount == 0) { tpl_set_var('no_ignores', $no_ignores); tpl_set_var('ignores_caches', ''); tpl_set_var('title_text_tab', ''); } else { //tpl_set_var('title_text_tab', $title_text_lbl); tpl_set_var('no_ignores', ''); $ignores = ''; for ($i = 0; $i < $rowCount; $i++) { $record = $dbc->dbResultFetch(); //$tmp_ignore = $i % 2 == 0 ? $ignoree : $ignoreo; $bgcolor = $i % 2 ? $bgcolor1 : $bgcolor2; $tmp_ignore = $ignore; $tmp_ignore = str_replace('{cachename}', htmlspecialchars($record['name']), $tmp_ignore); if ($record['last_found'] == NULL || $record['last_found'] == '0000-00-00 00:00:00') { $tmp_ignore = str_replace('{lastfound}', htmlspecialchars($no_found_date), $tmp_ignore); } else { $tmp_ignore = str_replace('{lastfound}', htmlspecialchars(strftime($dateformat, strtotime($record['last_found']))), $tmp_ignore); } $tmp_ignore = str_replace('{urlencode_cacheid}', htmlspecialchars(urlencode($record['cache_id'])), $tmp_ignore); $tmp_ignore = str_replace('{cacheid}', htmlspecialchars($record['cache_id']), $tmp_ignore); $tmp_ignore = mb_ereg_replace('{bgcolor}', $bgcolor, $tmp_ignore); $ignores .= $tmp_ignore . "\n"; } tpl_set_var('ignores_caches', $ignores); } unset($dbc); } } //make the template and send it out tpl_BuildTemplate();
//no article specified => sitemap $tplname = 'sitemap'; } else { if (!file_exists($stylepath . '/articles/' . $article . '.tpl.php')) { //article doesn't exists => sitemap $tplname = 'sitemap'; } else { //set article inside the articles-directory switch ($_REQUEST['page']) { case 'stat': require_once './graphs/cachetypes-oc.php'; tpl_set_var('oc_statistics_link', genStatPieUrl()); break; default: break; } if (file_exists($stylepath . '/articles/' . $article . '.inc.php')) { require_once $stylepath . '/articles/' . $article . '.inc.php'; } $tplname = 'articles/' . $article; } } } if (date('m') == 4 and date('d') == 1) { tpl_set_var('list_of_news', tr('PrimaAprilis')); tpl_set_var('news', tr('PMOnly')); $tplname = 'news'; } tpl_set_var('language4js', $lang); //make the template and send it out tpl_BuildTemplate();
$lang_db = $lang; } else { $lang_db = "en"; } // try to get localised name first $adm1 = sqlvalue("SELECT `countries`.`{$lang}`\n FROM `countries`\n WHERE `countries`.`short`='{$sCode}'", 0); if ($adm1 == null) { $adm1 = sqlvalue("SELECT `name` FROM `nuts_codes` WHERE `code`='{$sCode}'", 0); } } tpl_set_var('country', $adm1); tpl_set_var('region', $adm3); } else { tpl_set_var('country', ""); tpl_set_var('region', ""); } //From Google $url = 'http://maps.googleapis.com/maps/api/geocode/json?latlng=' . $lat . ',' . $lon . '&sensor=false&language=' . $lang; $data = @file_get_contents($url); $jsondata = json_decode($data, true); //print_r($jsondata); if (isset($jsondata['status']) && strtoupper($jsondata['status']) == 'OK') { $woj = $jsondata['results']['0']['address_components']['5']['long_name']; tpl_set_var('region_gm', $woj); } else { tpl_set_var('region_gm', ''); } // $loc = coordToLocation($lat, $lon); // tpl_set_var('region_gm', $loc['woj']); //make the template and send it out tpl_BuildTemplate();
$pattern = "<span style='font-size:13px'><img src='{cacheIcon}' class='icon16' alt='Cache' title='Cache' />\n <a href='viewcache.php?cacheid={cacheId}'><b>{cacheName}</b></a></span> \n \n <span style='font-size:11px'> " . tr('hidden_by') . "</span>\n <span style='font-size:13px'><a href='viewprofile.php?userid={userId}'><b>{userName}</b></a></span><br>\n \n <span style='font-size:11px;font-style:italic'>{cacheShortDesc}</span><br>\n \n <span class='content-title-noshade' style='font-size:11px'>{country} > {region}</span>\n <br><br> \n <table class='CacheTitledLog' >\n <tr><td>{logText}\n <br><br><img src='images/rating-star.png'/> Autor: <a href='viewprofile.php?userid={logUserId}'><b>{logUserName}<b></a></td></tr>\n </table>"; for ($i = 0; $i < $dbc->rowCount(); $i++) { $rec = $dbc->dbResultFetch(); $line = $pattern; $line = mb_ereg_replace('{cacheIcon}', myninc::checkCacheStatusByUser($rec, $usrid), $line); $line = mb_ereg_replace('{dateAlg}', $rec["date_alg"], $line); $line = mb_ereg_replace('{cacheName}', $rec["cacheName"], $line); $line = mb_ereg_replace('{userId}', $rec["user_id"], $line); $line = mb_ereg_replace('{userName}', $rec["userName"], $line); $line = mb_ereg_replace('{cacheId}', $rec["cache_id"], $line); $line = mb_ereg_replace('{country}', $rec["cacheCountry"], $line); $line = mb_ereg_replace('{region}', $rec["cacheRegion"], $line); $line = mb_ereg_replace('{cacheShortDesc}', $rec["short_desc"], $line); $line = mb_ereg_replace('{logUserId}', $rec["logUserId"], $line); $line = mb_ereg_replace('{logUserName}', $rec["logUserName"], $line); $text = mb_ereg_replace('<p>', '', $rec["text"]); $text = mb_ereg_replace('</p>', '<br>', $text); $line = mb_ereg_replace('{logText}', $text, $line); $TitledCaches .= $line; } $is_titled = $dbc->rowCount() ? '1' : '0'; if ($is_titled == '0') { $TitledCaches = ''; } tpl_set_var('TitledCaches', $TitledCaches); tpl_set_var('is_titled', $is_titled); unset($dbc); //make the template and send it out tpl_BuildTemplate(false); //not neccessary, call tpl_BuildTemplate with true as argument and the db will be closed there db_disconnect();
function setCommonMap3Vars() { global $rootpath, $lang, $cachemap_mapper; // from global settings.inc.php tpl_set_var("cachemap_mapper", $cachemap_mapper); /* SET YOUR MAP CODE HERE */ tpl_set_var('cachemap_header', '<script src="//maps.googleapis.com/maps/api/js?v=3.22&language=' . $lang . '" ' . 'type="text/javascript"></script>' . '<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">'); /* * Generate dynamic URL to cachemap3.js file, this will make sure it will be reloaded by the browser. * The time-stamp will be stripped by a rewrite rule in lib/.htaccess. */ $cacheMapVersion = filemtime($rootpath . 'lib/cachemap3.js') % 1000000; $cacheMapVersion += filemtime($rootpath . 'lib/cachemap3.php') % 1000000; $cacheMapVersion += filemtime($rootpath . 'lib/cachemap3lib.inc.php') % 1000000; $cacheMapVersion += filemtime($rootpath . 'lib/settings.inc.php') % 1000000; tpl_set_var('lib_cachemap3_js', "lib/cachemap3." . $cacheMapVersion . ".js"); }
$text = mb_ereg_replace('{to_username}', $to_username, $text); XDb::xSql("INSERT INTO `email_user`\n SET `ipaddress`=? , `date_generated`=NOW(), `date_sent`='0',\n `from_user_id`= ? , `from_email`=?, `to_user_id`=?,\n `to_email`=?, `mail_subject`=?, `mail_text`=?, `send_emailaddress`=?", $_SERVER["REMOTE_ADDR"], $usr['userid'], $from_email, $userid, $to_email, $subject, $text, $send_emailaddress); tpl_redirect('mailto.php?userid=' . urlencode($userid) . '&message=' . urlencode($message_sent)); } } } // display tpl_set_var('userid', htmlspecialchars($userid, ENT_COMPAT, 'UTF-8')); tpl_set_var('to_username', htmlspecialchars($to_username, ENT_COMPAT, 'UTF-8')); if ($message) { tpl_set_var('message_start', ''); tpl_set_var('message_end', ''); tpl_set_var('message', strip_tags($message)); tpl_set_var('formular_start', '<!--'); tpl_set_var('formular_end', '-->'); } else { tpl_set_var('message_start', '<!--'); tpl_set_var('message_end', '-->'); tpl_set_var('message', strip_tags($message)); tpl_set_var('formular_start', ''); tpl_set_var('formular_end', ''); tpl_set_var('subject', htmlspecialchars($subject, ENT_COMPAT, 'UTF-8')); tpl_set_var('errnosubject', isset($message_errnosubject) ? $message_errnosubject : ''); tpl_set_var('errnotext', isset(${$message_errnotext}) ? $message_errnotext : ''); tpl_set_var('text', htmlspecialchars($text, ENT_COMPAT, 'UTF-8')); tpl_set_var('send_emailaddress_sel', $send_emailaddress == 1 ? "checked" : ""); } } } //make the template and send it out tpl_BuildTemplate();
function savequery($queryid, $queryname, $saveas, $submit, $saveas_queryid) { global $usr, $tplname; global $error_empty_name, $nosaveastext, $saveastext, $error_queryname_exists; $displayform = $submit == false; $error_no_name = false; $error_duplicate_name = false; // ok ... checken, ob die query uns gehört und dann speichern $rs = sql("SELECT `user_id` FROM `queries` WHERE `id`='&1' AND (`user_id`=0 OR `user_id`='&2')", $queryid, $usr['userid']); if (mysql_num_rows($rs) == 0) { echo 'fatal error: query not found or permission denied'; exit; } mysql_free_result($rs); if ($saveas == false) { if ($displayform == false && $queryname == '') { $displayform = true; $error_no_name = true; } else { // prüfen ob name bereits vorhanden $rs = sql("SELECT COUNT(*) `c` FROM `queries` WHERE `user_id`='&1' AND `name`='&2'", $usr['userid'], $queryname); $r = sql_fetch_array($rs); mysql_free_result($rs); if ($r['c'] > 0) { $displayform = true; $error_duplicate_name = true; } } } else { if ($saveas_queryid == 0) { $displayform = true; } else { // prüfen ob saveas_queryid existiert und uns gehört $rs = sql("SELECT `user_id` FROM `queries` WHERE `id`='&1' AND (`user_id`=0 OR `user_id`='&2')", $saveas_queryid, $usr['userid']); if (mysql_num_rows($rs) == 0) { echo 'fatal error: saveas_query not found or permission denied'; exit; } mysql_free_result($rs); } } if ($displayform == true) { // abfrageform für name $tplname = 'savequery'; if ($error_no_name == true) { tpl_set_var('nameerror', $error_empty_name); } else { if ($error_duplicate_name == true) { tpl_set_var('nameerror', $error_queryname_exists); } else { tpl_set_var('nameerror', ''); } } tpl_set_var('queryname', htmlspecialchars($queryname, ENT_COMPAT, 'UTF-8')); tpl_set_var('queryid', htmlspecialchars($queryid, ENT_COMPAT, 'UTF-8')); // oldqueries auslesen $options = ''; $rs = sql("SELECT `id`, `name` FROM `queries` WHERE `user_id`='&1' ORDER BY `name` ASC", $usr['userid']); if (mysql_num_rows($rs) == 0) { tpl_set_var('selecttext', $nosaveastext); tpl_set_var('oldqueries', ''); } else { tpl_set_var('selecttext', $saveastext); while ($r = sql_fetch_array($rs)) { if ($r['id'] == $queryid) { $options .= '<option value="' . $r['id'] . '" selected="selected">' . htmlspecialchars($r['name'], ENT_COMPAT, 'UTF-8') . '</option>' . "\n"; } else { $options .= '<option value="' . $r['id'] . '">' . htmlspecialchars($r['name'], ENT_COMPAT, 'UTF-8') . '</option>' . "\n"; } } mysql_free_result($rs); tpl_set_var('oldqueries', $options); } tpl_BuildTemplate(); exit; } $rs = sql("SELECT `options` FROM `queries` WHERE `id`='&1'", $queryid); $r = sql_fetch_array($rs); mysql_free_result($rs); // ok, speichern if ($saveas == true) { sql("UPDATE `queries` SET `options`='&1', `last_queried`=NOW() WHERE `id`='&2'", $r['options'], $saveas_queryid); } else { sql("INSERT INTO `queries` (`user_id`, `last_queried`, `name`, `uuid`, `options`) VALUES ( '&1', NOW(), '&2', '&3', '&4')", $usr['userid'], $queryname, create_uuid(), $r['options']); } tpl_redirect('query.php?action=view'); }
<?php //prepare the templates and include all neccessary require_once './lib/common.inc.php'; if ($usr['admin']) { $_SESSION['submitted'] = false; $sql = "SELECT name FROM caches WHERE cache_id=" . intval($_REQUEST['cacheid']); $cachename = @mysql_result(@mysql_query($sql), 0); tpl_set_var('cachename', $cachename); tpl_set_var('cacheid', $_REQUEST['cacheid']); $tplname = 'add_rr_comment'; tpl_BuildTemplate(); }
//we get the point data in to an array called $points: if (!$error) { for ($i = 0; $i < count($coords) - 1; $i = $i + 2) { $points[] = array("lon" => $coords[$i], "lat" => $coords[$i + 1]); if ($coords[$i] + 0 == 0 or $coords[$i + 1] + 0 == 0) { $error .= "Invalid Co-ords found in import file.<br>\n"; break; } } } // add it to the route_points database: $point_num = 0; foreach ($points as $point) { $point_num++; $result = XDb::xSql('INSERT into route_points (route_id, point_nr, lat, lon) VALUES ( ?, ?, ?, ?)', $route_id, $route_id, $point['lat'], $point['lon']); } } //end update points tpl_redirect('myroutes.php'); exit; } //end submit tpl_set_var('name', htmlspecialchars($record['name'], ENT_COMPAT, 'UTF-8')); tpl_set_var('desc', htmlspecialchars($record['description'], ENT_COMPAT, 'UTF-8')); tpl_set_var('radius', $record['radius']); tpl_set_var('routeid', $route_id); } } //make the template and send it out tpl_BuildTemplate();
tpl_set_var('cachemap_header', '<script src="http://maps.google.com/maps?file=api&v=2.x&key=' . $googlemap_key . '" type="text/javascript"></script> <script language="JavaScript1.2" type="text/javascript"> <!-- window.onbeforeunload = saveMapType; function saveMapType(){ var ajaxRequest; // The variable that makes Ajax possible! try{ // Opera 8.0+, Firefox, Safari ajaxRequest = new XMLHttpRequest(); } catch (e){ // Internet Explorer Browsers try{ ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try{ ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ // Something went wrong alert("Your browser broke!"); return false; } } } // Create a function that will receive data sent from the server ajaxRequest.onreadystatechange = function(){ if(ajaxRequest.readyState == 4){ document.myForm.time.value = ajaxRequest.responseText; } } var mapid; switch (map.getCurrentMapType()) { case G_NORMAL_MAP: mapid = "0"; break; case G_SATELLITE_MAP: mapid = "1"; break; case G_HYBRID_MAP: mapid = "2"; break; case G_PHYSICAL_MAP: mapid = "3"; break; default: mapid = "0"; } var climit = ((document.getElementById("cachelimit").value / 50) - 1); var csort = document.getElementById("cachesort").value; var queryString = "?map_v=2&maptype=" + mapid + "&cachelimit=" + climit + "&cachesort=" + csort; ajaxRequest.open("GET", "cachemapsettings.php" + queryString, false); ajaxRequest.send(null); } //--> </script>');
/** * Call OKAPI, parse response and display the results * @param array $params - params of the cache to search and display */ private function htmlFormat(array $params) { //call OKAPI $okapi_resp = \okapi\Facade::service_call('services/caches/shortcuts/search_and_retrieve', $this->user_id, $params); if (!is_a($okapi_resp, "ArrayObject")) { // strange OKAPI return !? error_log(__METHOD__ . ": ERROR: strange OKAPI response - not an ArrayObject"); exit(0); } \okapi\OkapiErrorHandler::disable(); if ($okapi_resp->count() == 0) { // no caches found exit(0); } // get the first object from the list $arrayCopy = $okapi_resp->getArrayCopy(); $geoCache = new \lib\Objects\GeoCache\GeoCache(array('okapiRow' => array_pop($arrayCopy))); //generate the results if ($this->screenWidth < 400) { tpl_set_tplname('map/map_cacheinfo_small'); } else { tpl_set_tplname('map/map_cacheinfo'); } tpl_set_var('cache_lat', $geoCache->getCoordinates()->getLatitude()); tpl_set_var('cache_lon', $geoCache->getCoordinates()->getLongitude()); tpl_set_var('cache_name', $geoCache->getCacheName()); tpl_set_var('cache_icon', $geoCache->getCacheIcon()); $is_event = $geoCache->getCacheType() == $geoCache::TYPE_EVENT ? '1' : '0'; // be aware: booleans not working here tpl_set_var('is_event', $is_event, false); $is_scored = $geoCache->getRatingId() != 0 && $geoCache->getRatingVotes() > 2 ? '1' : '0'; tpl_set_var('is_scored', $is_scored, false); tpl_set_var('rating_desc', tr($geoCache->getRatingDesc())); $is_recommended = $geoCache->getRecommendations() > 0 ? '1' : '0'; tpl_set_var('is_recommended', $is_recommended, false); tpl_set_var('cache_recommendations', $geoCache->getRecommendations(), false); tpl_set_var('cache_code', $geoCache->getWaypointId()); tpl_set_var('cache_founds', $geoCache->getFounds()); tpl_set_var('cache_not_founds', $geoCache->getNotFounds()); tpl_set_var('cache_rating_votes', $geoCache->getRatingVotes()); tpl_set_var('cache_willattends', $geoCache->getWillattends()); tpl_set_var('cache_url', $geoCache->getCacheUrl()); tpl_set_var('user_name', $geoCache->getOwner()->getUserName()); tpl_set_var('user_profile', $geoCache->getOwner()->getProfileUrl()); tpl_set_var('cache_size_desc', tr($geoCache->getSizeDesc())); $is_powertrail_part = $geoCache->isPowerTrailPart() ? '1' : '0'; tpl_set_var('is_powertrail_part', $is_powertrail_part, false); if ($geoCache->isPowerTrailPart()) { tpl_set_var('pt_name', $geoCache->getPowerTrail()->getName()); tpl_set_var('pt_image', $geoCache->getPowerTrail()->getImage()); tpl_set_var('pt_icon', $geoCache->getPowerTrail()->getFootIcon()); tpl_set_var('pt_url', $geoCache->getPowerTrail()->getPowerTrailUrl()); } $is_titled = $geoCache->isTitled() ? 'true' : 'false'; tpl_set_var('is_titled', $is_titled, false); //tpl_set_var('is_titled', $geoCache->isTitled(), false); // make the template and send it out tpl_BuildTemplate(false, false, true); }
$thisline = mb_ereg_replace('{log_picture_onclick}', "alert('" . $spoiler_disable_msg . "'); return false;", $thisline); $thisline = mb_ereg_replace('{link}', 'index.php', $thisline); $thisline = mb_ereg_replace('{longdesc}', 'index.php', $thisline); } else { $thisline = mb_ereg_replace('{log_picture_onclick}', "enlarge(this)", $thisline); $thisline = mb_ereg_replace('{link}', $pic_record['url'], $thisline); $thisline = mb_ereg_replace('{longdesc}', str_replace("uploads", "uploads", $pic_record['url']), $thisline); } $thisline = mb_ereg_replace('{imgsrc}', 'thumbs.php?uuid=' . urlencode($pic_record['uuid']), $thisline); if ($pic_record['title'] == "") { $title = "link"; } else { $title = htmlspecialchars($pic_record['title'], ENT_COMPAT, 'UTF-8'); } $thisline = mb_ereg_replace('{title}', "<a class=links href=viewlogs.php?logid=" . $pic_record['object_id'] . ">" . $title . "</a>", $thisline); $logpicturelines .= $thisline; } while ($pic_record = XDb::xFetchArray($rspictures)); } XDb::xFreeResults($rspictures); $tmplog = $logpicturelines; $logs = "{$tmplog}\n"; tpl_set_var('logpictures', $logs); } else { //display search page // redirection tpl_redirect('viewcache.php?cacheid=' . urlencode($cache_id)); exit; } } //make the template and send it out tpl_BuildTemplate();
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; }
tpl_set_var('is_active_flags', ' <a href="admin_users.php?userid=' . $user_id . '&is_active_flag=1"><font color="#ff0000">' . tr('lock') . ' ' . tr('user_account') . '</font></a> <img src="' . $stylepath . '/images/blue/atten-red.png" align="top" alt="" />'); } else { tpl_set_var('is_active_flags', ' <a href="admin_users.php?userid=' . $user_id . '&is_active_flag=1"><font color="#228b22">' . tr('unlock') . ' ' . tr('user_account') . '</font></a> <img src="' . $stylepath . '/images/blue/atten-green.png" align="bottom" alt="" />'); } if (!$record['stat_ban']) { tpl_set_var('stat_ban', ' <a href="admin_users.php?userid=' . $user_id . '&stat_ban=1"><font color="#ff0000">' . tr('lock') . ' ' . tr('user_stats') . '</font></a> <img src="' . $stylepath . '/images/blue/atten-red.png" align="top" alt="" />'); } else { tpl_set_var('stat_ban', ' <a href="admin_users.php?userid=' . $user_id . '&stat_ban=1"><font color="#228b22">' . tr('unlock') . ' ' . tr('user_stats') . '</font></a> <img src="' . $stylepath . '/images/blue/atten-green.png" align="top" alt="" />'); } if ($user->getFoundGeocachesCount() < 10) { $ignoreFoundLimit = $user->isIngnoreGeocacheLimitWhileCreatingNewGeocache(); if ($ignoreFoundLimit) { $translation = tr('ignoreFoundLimitRm'); } else { $translation = tr('ignoreFoundLimitAdd'); } $ignoreFoundLimitHtml = '<a href="admin_users.php?userid=' . $user_id . '&ignoreFoundLimit=' . (int) (!$ignoreFoundLimit) . '"><font color="#ff0000">' . $translation . '</font></a><img src="' . $stylepath . '/images/blue/atten-red.png" align="top" alt="" />'; tpl_set_var('ignoreFoundLimit', $ignoreFoundLimitHtml); } else { tpl_set_var('ignoreFoundLimit', 'n/d'); } // force all caches to be verified - form $verify_all = $record['verify_all']; if ($verify_all == 0) { tpl_set_var('hide_flag', '<p><img src="tpl/stdstyle/images/blue/arrow2.png" alt="" align="middle" /> <a href="admin_users.php?userid=' . $user_id . '&verify_all=1"><font color="#ff0000">' . tr('admin_users_verify_all') . '</font></a> <img src="' . $stylepath . '/images/blue/atten-red.png" align="top" alt="" /></p>'); } else { tpl_set_var('hide_flag', '<p><img src="tpl/stdstyle/images/blue/arrow2.png" alt="" align="middle" /> <a href="admin_users.php?userid=' . $user_id . '&verify_all=0"><font color="#228b22">' . tr('admin_users_verify_none') . '</font></a> <img src="' . $stylepath . '/images/blue/atten-green.png" align="top" alt="" /></p>'); } $tplname = 'admin_users'; tpl_BuildTemplate(); }
tpl_set_var('desclang', htmlspecialchars($desc_lang, ENT_COMPAT, 'UTF-8')); tpl_set_var('desclang_name', htmlspecialchars(db_LanguageFromShort($desc_lang), ENT_COMPAT, 'UTF-8')); tpl_set_var('cachename', htmlspecialchars($desc_record['name'], ENT_COMPAT, 'UTF-8')); tpl_set_var('reset', $reset); tpl_set_var('submit', $submit); // Text / normal HTML / HTML editor tpl_set_var('use_tinymce', $desc_htmledit == 1 ? 1 : 0); if ($desc_html == 1 && $desc_htmledit == 1) { // TinyMCE $headers = tpl_get_var('htmlheaders') . "\n"; $headers .= '<script language="javascript" type="text/javascript" src="resource2/tinymce/tiny_mce_gzip.js"></script>' . "\n"; $headers .= '<script language="javascript" type="text/javascript" src="resource2/tinymce/config/desc.js.php?cacheid=' . ($desc_record['cache_id'] + 0) . '&lang=' . strtolower($locale) . '"></script>' . "\n"; tpl_set_var('htmlheaders', $headers); tpl_set_var('descMode', 3); } else { if ($desc_html == 1) { tpl_set_var('descMode', 2); } else { tpl_set_var('descMode', 1); } } } else { //TODO: not the owner } } else { tpl_errorMsg('editdesc', $error_desc_not_found); } } } //make the template and send it out tpl_BuildTemplate();
public function DisplayAllOpensprawdzaczCaches($OpensprawdzaczSetup, $opt) { /** * Displays initial form for cache waypoint (OPXXXX) input * * and * * display list of caches in Opensprawdzacz. */ /** * if isset $_GET['op_keszynki'] means that user entered cache OP, and want search for this * cache through Opensprawdzacz. * This part get cache waypoint from url, check if cache owner allow specified cahe for check by * OpenSprawdzacz * */ if (isset($_GET['op_keszynki'])) { $this->cache_wp = mysql_real_escape_string($_GET['op_keszynki']); $this->cache_wp = strtoupper($this->cache_wp); } else { $formularz = ' <form action="' . $OpensprawdzaczSetup->scriptname . '" method="get"> ' . tr('os_podaj_waypoint') . ': <input type="text" name="op_keszynki" maxlength="6"/> <button type="submit" name="przeslanie_waypointa" value="' . tr('submit') . '" style="font-size:14px;width:160px"><b>' . tr('submit') . '</b></button> </form> '; if (isset($_GET['sort'])) { $sort_tmp = mysql_real_escape_string($_GET['sort']); switch ($sort_tmp) { case 'autor': $sortowanie = '`user`.`username`'; break; case 'nazwa': $sortowanie = '`caches`.`name`'; break; case 'wpt': $sortowanie = '`caches`.`wp_oc`'; break; case 'szczaly': $sortowanie = '`opensprawdzacz`.`proby`'; break; case 'sukcesy': $sortowanie = '`opensprawdzacz`.`sukcesy`'; break; default: $sortowanie = '`caches`.`name`'; break; } } else { $sortowanie = '`caches`.`name`'; } $zapytajka = "\n\n SELECT `waypoints`.`cache_id`,\n `waypoints`.`type`,\n `waypoints`.`stage`,\n `waypoints`.`desc`,\n `caches`.`name`,\n `caches`.`wp_oc`,\n `caches`.`user_id`,\n `caches`.`type`,\n `caches`.`status`,\n `user`.`username`,\n `cache_type`.`sort`,\n `cache_type`.`icon_small`,\n `opensprawdzacz`.`proby`,\n `opensprawdzacz`.`sukcesy`\n FROM `waypoints`\n LEFT JOIN `opensprawdzacz`\n ON `waypoints`.`cache_id` = `opensprawdzacz`.`cache_id`,\n `caches`, `user`, `cache_type`\n WHERE `waypoints`.`opensprawdzacz` = 1\n AND `waypoints`.`type` = 3\n AND `caches`.`type` = `cache_type`.`id`\n AND `caches`.`user_id` = `user`.`user_id`\n AND `waypoints`.`cache_id` = `caches`.`cache_id`\n ORDER BY {$sortowanie}\n LIMIT 0, 1000\n\n "; $status = array('1' => '<img src="tpl/stdstyle/images/log/16x16-found.png" border="0" alt="Gotowa do szukania">', '2' => '<img src="tpl/stdstyle/images/log/16x16-temporary.png" border="0" alt="Tymczasowo niedost�pna">', '3' => '<img src="tpl/stdstyle/images/log/16x16-dnf.png" border="0" alt="zarchiwizowana">', '4' => '<img src="tpl/stdstyle/images/log/16x16-temporary.png" border="0" alt="Ukryta do czasu weryfikacji">', '5' => '<img src="tpl/stdstyle/images/log/16x16-temporary.png" border="0" alt="jeszcze niedost�pna">', '6' => '<img src="tpl/stdstyle/images/log/16x16-dnf.png" border="0" alt="Zablokowana przez COG">'); $conn = new PDO("mysql:host=" . $opt['db']['server'] . ";dbname=" . $opt['db']['name'], $opt['db']['username'], $opt['db']['password']); $conn->query('SET CHARSET utf8'); $keszynki_opensprawdzacza = $conn->query($zapytajka)->fetchAll(); $ile_keszynek = count($keszynki_opensprawdzacza); $pag = new Pagination(); // $dane = array("hej","dupa","laska", "scierwo"); $numbers = $pag->Paginate($keszynki_opensprawdzacza, $OpensprawdzaczSetup->caches_on_page); $result = $pag->fetchResult(); /* foreach ($result as $r) { echo "<div>aa$r</div>"; } */ $paginacja = ' '; if (isset($_GET["sort"])) { $sort = '&sort=' . $_GET["sort"]; } else { $sort = ''; } if (isset($_GET["page"])) { $tPage = sql_escape($_GET["page"]); } else { $tPage = 1; } if ($tPage > 1) { $paginacja .= '<a href="' . $OpensprawdzaczSetup->scriptname . '?page=' . ($num - 1) . $sort . '">[<' . tr('os_f02') . ']</a> '; } foreach ($numbers as $num) { if ($num == $tPage) { $paginacja .= '<b>[' . $num . ']</b>'; } else { $paginacja .= '<a href="' . $OpensprawdzaczSetup->scriptname . '?page=' . $num . $sort . '">[' . $num . ']</a> '; } } if ($tPage < count($numbers)) { $paginacja .= '<a href="' . $OpensprawdzaczSetup->scriptname . '?page=' . ($tPage + 1) . $sort . '">[' . tr('os_f01') . ' >]</a> '; } $tabelka_keszynek = ''; $proby = 0; $trafienia = 0; // foreach ($keszynki_opensprawdzacza as $dane_keszynek ) foreach ($result as $dane_keszynek) { // $dane_keszynek = mysql_fetch_array($keszynki_opensprawdzacza); $proby = $proby + $dane_keszynek['proby']; $trafienia = $trafienia + $dane_keszynek['sukcesy']; if ($dane_keszynek['status'] == 1 || $dane_keszynek['status'] == 2) { $tabelka_keszynek .= ' <tr> <td><a class="links" href="viewcache.php?wp=' . $dane_keszynek['wp_oc'] . '">' . $dane_keszynek['wp_oc'] . '</a></td> <td><a class="links" href="' . $OpensprawdzaczSetup->scriptname . '?op_keszynki=' . $dane_keszynek['wp_oc'] . '"> ' . $dane_keszynek['name'] . '</a> </td> <td><a href="viewcache.php?wp=' . $dane_keszynek['wp_oc'] . '"><img src="tpl/stdstyle/images/' . $dane_keszynek['icon_small'] . '" /></a></td> <td align="center">' . $status[$dane_keszynek['status']] . '</td> <td><a href="viewprofile.php?userid=' . $dane_keszynek['user_id'] . '">' . $dane_keszynek['username'] . '</td> <td align="center">' . $dane_keszynek['proby'] . '</td> <td align="center">' . $dane_keszynek['sukcesy'] . '</td> </tr>'; } } $tabelka_keszynek .= ' <tr><td colspan="7"><img src="tpl/stdstyle/images/blue/dot_blue.png" height="1" width="100%"/></td></tr><tr> <td><img src="/tpl/stdstyle/images/misc/16x16-info.png" /></td> <td>' . tr('os_f00') . ': </td> <td>' . $ile_keszynek . '</td> <td align="center"> ' . $status[1] . '<br />' . $status[2] . ' </td> <td> (' . tr('log_type_available') . ')<br /> (' . tr('temp_unavailables') . ') </td> <td align="center">' . $proby . '</td> <td align="center">' . $trafienia . '</td> </tr> </table>'; $tabelka_keszynek .= '<br /><p align="center">' . $paginacja . '</p>'; tpl_set_var("sekcja_1_start", ''); tpl_set_var("sekcja_1_stop", ''); tpl_set_var("sekcja_2_start", '<!--'); tpl_set_var("sekcja_2_stop", '-->'); tpl_set_var("sekcja_3_start", '<!--'); tpl_set_var("sekcja_3_stop", '-->'); tpl_set_var("sekcja_4_start", '<!--'); tpl_set_var("sekcja_4_stop", '-->'); tpl_set_var("sekcja_formularz_opensprawdzacza_start", '<!--'); tpl_set_var("sekcja_formularz_opensprawdzacza_stop", ''); tpl_set_var("formularz", $formularz); tpl_set_var("keszynki", $tabelka_keszynek); $this->endzik(); } }
* * For license information see doc/license.txt ****************************************************************************/ /**************************************************************************** * * Unicode Reminder メモ * * template specific variables setup ****************************************************************************/ //set all main template replacement to default values tpl_set_var('htmlheaders', ''); tpl_set_var('lang', $lang); tpl_set_var('style', $style); tpl_set_var('loginbox', ' '); tpl_set_var('functionsbox', '<a href="index.php?page=suche">' . t('Search') . '</a> | <a href="index.php?page=sitemap">' . t('Sitemap') . '</a>'); tpl_set_var('runtime', ''); //set up main template specific string $sLoggedOut = '<form action="' . ($opt['page']['https']['force_login'] ? $opt['page']['absolute_https_url'] : '') . 'login.php" method="post" enctype="application/x-www-form-urlencoded" name="login" dir="ltr" style="display: inline;"><b>' . t('User:'******'</b> <input name="email" size="10" type="text" class="textboxes" value="" /> <b>' . t('Password:'******'</b> <input name="password" size="10" type="password" class="textboxes" value="" /> <input type="hidden" name="action" value="login" /><input type="hidden" name="target" value="{target}" /><input type="hidden" name="source" value="titlebar" /> <input type="submit" name="LogMeIn" value="' . t('Login') . '" class="formbutton" style="width: 74px;" onclick="submitbutton(\'LogMeIn\')" /></form>'; $sLoggedIn = "<b>" . t('Logged in as') . ' <a href="myhome.php" class="testing-top-left-corner-username">{username}</a></b> - <a href="login.php?action=logout">' . t('Logout') . '</a></b>'; // target in Loginbox setzen $target = basename($_SERVER['PHP_SELF']) . '?'; // REQUEST-Variablen durchlaufen und an target anhaengen $allowed = ['cacheid', 'userid', 'logid', 'desclang', 'descid']; reset($_REQUEST); while (list($varname, $varvalue) = each($_REQUEST)) { if (in_array($varname, $allowed)) { $target .= $varname . '=' . $varvalue . '&'; } } if (mb_substr($target, -1) == '?' || mb_substr($target, -1) == '&') { $target = mb_substr($target, 0, -1);
$file_content .= '<b>' . $log_record['user_name'] . '</b>: '; if ($log_record['encrypt'] == 1 && $log_record['cache_owner'] != $usr['userid'] && $log_record['luser_id'] != $usr['userid']) { $file_content .= "<img src=\\'/tpl/stdstyle/images/free_icons/lock.png\\' alt=\\`\\` /><br/>"; } if ($log_record['encrypt'] == 1 && ($log_record['cache_owner'] == $usr['userid'] || $log_record['luser_id'] == $usr['userid'])) { $file_content .= "<img src=\\'/tpl/stdstyle/images/free_icons/lock_open.png\\' alt=\\`\\` /><br/>"; } $data = cleanup_text(str_replace("\r\n", " ", $log_record['log_text'])); $data = str_replace("\n", " ", $data); if ($log_record['encrypt'] == 1 && $log_record['cache_owner'] != $usr['userid'] && $log_record['luser_id'] != $usr['userid']) { //crypt the log ROT13, but keep HTML-Tags and Entities $data = str_rot13_html($data); } else { $file_content .= "<br/>"; } $file_content .= $data; $file_content .= '\', PADDING,5, WIDTH,280,SHADOW,true)" onmouseout="UnTip()">' . htmlspecialchars($log_record['cache_name'], ENT_COMPAT, 'UTF-8') . '</a></b></td>'; $file_content .= '<td><b><a class="links" href="viewprofile.php?userid=' . htmlspecialchars($log_record['user_id'], ENT_COMPAT, 'UTF-8') . '">' . htmlspecialchars($log_record['user_name'], ENT_COMPAT, 'UTF-8') . '</a></b></td>'; $file_content .= "</tr>"; } } $pages = mb_ereg_replace('{last_img}', $last_img, $pages); $pages = mb_ereg_replace('{first_img}', $first_img, $pages); $pages = mb_ereg_replace('{first_img_inactive}', $first_img_inactive, $pages); $pages = mb_ereg_replace('{last_img_inactive}', $last_img_inactive, $pages); tpl_set_var('file_content', $file_content); tpl_set_var('pages', $pages); } } //make the template and send it out tpl_BuildTemplate();
function validate_coords($lat_h, $lat_min, $lon_h, $lon_min, $lonEW, $latNS, $error_coords_not_ok) { if ($lat_h == '') { tpl_set_var('lat_message', $error_coords_not_ok); $error = true; } if ($lat_min == '') { tpl_set_var('lat_message', $error_coords_not_ok); $error = true; } if ($lon_h == '') { tpl_set_var('lon_message', $error_coords_not_ok); $error = true; } if ($lon_min == '') { tpl_set_var('lon_message', $error_coords_not_ok); $error = true; } if (@$error) { return $error; } //check coordinates $error = false; if ($lat_h != '' || $lat_min != '') { if (!mb_ereg_match('^[0-9]{1,2}$', $lat_h)) { tpl_set_var('lat_message', $error_coords_not_ok); $error = true; $lat_h_not_ok = true; } else { if ($lat_h >= 0 && $lat_h < 90) { $lat_h_not_ok = false; } else { tpl_set_var('lat_message', $error_coords_not_ok); $error = true; $lat_h_not_ok = true; } } if (is_numeric($lat_min)) { if ($lat_min >= 0 && $lat_min < 60) { $lat_min_not_ok = false; } else { tpl_set_var('lat_message', $error_coords_not_ok); $error = true; $lat_min_not_ok = true; } } else { tpl_set_var('lat_message', $error_coords_not_ok); $error = true; $lat_min_not_ok = true; } $latitude = $lat_h + round($lat_min, 3) / 60; if ($latNS == 'S') { $latitude = -$latitude; } if ($latitude == 0) { tpl_set_var('lon_message', $error_coords_not_ok); $error = true; $lat_min_not_ok = true; } } else { $latitude = NULL; $lat_h_not_ok = true; $lat_min_not_ok = true; $error = true; } if ($lon_h != '' || $lon_min != '') { if (!mb_ereg_match('^[0-9]{1,3}$', $lon_h)) { tpl_set_var('lon_message', $error_coords_not_ok); $error = true; $lon_h_not_ok = true; } else { if ($lon_h >= 0 && $lon_h < 180) { $lon_h_not_ok = false; } else { tpl_set_var('lon_message', $error_coords_not_ok); $error = true; $lon_h_not_ok = true; } } if (is_numeric($lon_min)) { if ($lon_min >= 0 && $lon_min < 60) { $lon_min_not_ok = false; } else { tpl_set_var('lon_message', $error_coords_not_ok); $error = true; $lon_min_not_ok = true; } } else { tpl_set_var('lon_message', $error_coords_not_ok); $error = true; $lon_min_not_ok = true; } $longitude = $lon_h + round($lon_min, 3) / 60; if ($lonEW == 'W') { $longitude = -$longitude; } if ($longitude == 0) { tpl_set_var('lon_message', $error_coords_not_ok); $error = true; $lon_min_not_ok = true; } } else { $longitude = NULL; $lon_h_not_ok = true; $lon_min_not_ok = true; $error = true; } $lon_not_ok = $lon_min_not_ok || $lon_h_not_ok; $lat_not_ok = $lat_min_not_ok || $lat_h_not_ok; /* if ($lon_not_ok == false) print "lon_ok<br>"; if ($lat_not_ok == false) print "lat_ok<br>"; exit; */ return $error; }
function buildDescriptionLanguageSelector($show_all_langs, $lang, $defaultLangugaeList, $db, $show_all, $show_all_langs) { tpl_set_var('show_all_langs', '0'); tpl_set_var('show_all_langs_submit', '<input type="submit" name="show_all_langs_submit" value="' . $show_all . '"/>'); if ($show_all_langs == 1) { tpl_set_var('show_all_langs', '1'); tpl_set_var('show_all_langs_submit', ''); $db->simpleQuery('SELECT short FROM languages WHERE 1'); $dbResult = $db->dbResultFetchAll(); $defaultLangugaeList = array(); foreach ($dbResult as $langTmp) { $defaultLangugaeList[] = $langTmp['short']; } } $langsoptions = ''; foreach ($defaultLangugaeList as $defLang) { if (strtoupper($lang) === strtoupper($defLang)) { $selected = 'selected="selected"'; } else { $selected = ''; } $langsoptions .= '<option value="' . htmlspecialchars($defLang, ENT_COMPAT, 'UTF-8') . '" ' . $selected . ' >' . htmlspecialchars(tr('language_' . strtoupper($defLang)), ENT_COMPAT, 'UTF-8') . '</option>' . "\n"; } tpl_set_var('langoptions', $langsoptions); }
$pokaz_problem = 'bgcolor=red'; } elseif ($dnf == 1) { $pokaz_problem = 'bgcolor=yellow'; } elseif ($warning > 0) { $pokaz_problem = 'bgcolor=#EEEEEE'; } } elseif ($stat_cache == 2) { if ($log_record['dni_od_zmiany'] > 155) { $pokaz_problem = 'bgcolor=red'; } elseif ($log_record['dni_od_zmiany'] > 124) { $pokaz_problem = 'bgcolor=yellow'; } } $file_content .= "<tr " . $pokaz_problem . ">" . $tabelka . "</td></tr>\n"; } unset($dbc); $pages = mb_ereg_replace('{last_img}', $last_img, $pages); $pages = mb_ereg_replace('{first_img}', $first_img, $pages); $pages = mb_ereg_replace('{first_img_inactive}', $first_img_inactive, $pages); $pages = mb_ereg_replace('{last_img_inactive}', $last_img_inactive, $pages); tpl_set_var('file_content', $file_content); tpl_set_var('pages', $pages); if ($stat_cache == 2) { tpl_set_var('col5_header', tr('last_modified2_label')); } else { tpl_set_var('col5_header', tr('last_found')); } } } //make the template and send it out tpl_BuildTemplate();
tpl_set_var('gk_hoch', (int) $gk[1]); $qthlocator = help_latlongToQTH($lat_float, $lon_float); tpl_set_var('qthlocator', $qthlocator); */ $utm = ll2utm($lat_float, $lon_float); tpl_set_var('utm2_zone', $utm[0]); tpl_set_var('utm2_letter', $utm[1]); tpl_set_var('utm2_NS', $utm[2]); tpl_set_var('utm2_north', (int) $utm[3]); tpl_set_var('utm2_EW', $utm[4]); tpl_set_var('utm2_east', (int) $utm[5]); tpl_set_var('nocacheid_start', '<!--'); tpl_set_var('nocacheid_end', '-->'); tpl_set_var('owner', ''); tpl_set_var('cachename', ''); tpl_set_var('wp', ''); // wp gesetzt? $wp = isset($_REQUEST['wp']) ? $_REQUEST['wp'] : ''; if ($wp != '') { $rs = XDb::xSql("SELECT `caches`.`name`, `user`.`username`\n FROM `caches` INNER JOIN `user` ON (`user`.`user_id`=`caches`.`user_id`)\n WHERE `caches`.`wp_oc`= ? ", $wp); if ($r = XDb::xFetchArray($rs)) { tpl_set_var('nocacheid_start', ''); tpl_set_var('nocacheid_end', ''); tpl_set_var('owner', htmlspecialchars($r['username'], ENT_COMPAT, 'UTF-8')); tpl_set_var('cachename', htmlspecialchars($r['name'], ENT_COMPAT, 'UTF-8')); tpl_set_var('wp', htmlspecialchars($wp, ENT_COMPAT, 'UTF-8')); } } //make the template and send it out tpl_BuildTemplate();
if (trim($_REQUEST['data']) == '') { die('data cannot be empty! <a href="?">back</a>'); } // user data tpl_set_var('qrcode', $_REQUEST['data']); $uuq = md5($_REQUEST['data']); $filename = $PNG_TEMP_DIR . 'test.png'; QRcode::png($_REQUEST['data'], $filename, $errorCorrectionLevel, $matrixPointSize, 2); } else { //default data tpl_set_var('qrcode', $config['qrCodeUrl']); QRcode::png($config['qrCodeUrl'], $filename, $errorCorrectionLevel, $matrixPointSize, 2); } // Create image instances $dest = imagecreatefromjpeg($GLOBALS['rootpath'] . '/images/' . $config['qrCodeLogo']); $src = imagecreatefrompng($dynbasepath . 'tmp/test.png'); $src_w = imagesx($src); $xd = 86 - $src_w / 2; $yd = 142 - $src_w / 2; // Copy and merge imagecopymerge($dest, $src, $xd, $yd, 0, 0, $src_w, $src_w, 100); // Output and free from memory imagejpeg($dest, $dynbasepath . 'tmp/qrcode.jpg', 85); ImageDestroy($dest); // generate number for refresh image $rand = rand(); tpl_set_var('imgqrcode', '<img src="/tmp/qrcode.jpg?rand=' . $rand . '" border="0" alt="" width="171" height="284" />'); } } //make the template and send it out tpl_BuildTemplate();
// sql ("SELECT COUNT(*) FROM cache_logs WHERE type=1 AND user_id=&1 GROUP BY GROUP BY YEAR(`date_created`), MONTH(`date_created`), DAY(`date_created`)",$user_id); $rsGeneralStat = sql("SELECT YEAR(`date_created`) usertime, hidden_count, founds_count, log_notes_count, username FROM `user` WHERE user_id=&1 ", $user_id); if ($rsGeneralStat !== false) { $user_record = sql_fetch_array($rsGeneralStat); tpl_set_var('username', $user_record['username']); } $content .= '<p> </p><p> </p><div class="content2-container bg-blue02"><p class="content-title-noshade-size1"> <img src="tpl/stdstyle/images/blue/cache.png" class="icon32" alt="Caches created" title="Caches created" /> ' . tr("graph_created") . '</p></div><br />'; $content .= '<p><img src="graphs/PieGraphustat.php?userid=' . $user_id . '&t=cc' . '" border="0" alt="" width="500" height="300" /></p>'; $year = date("Y"); $rsCreateCachesMonth = sql("SELECT COUNT(*) `count`, MONTH(`date_created`) `month`, YEAR(`date_created`) `year` FROM `caches` WHERE YEAR(`date_created`)=&1 AND status <> 4 AND status <> 5 AND user_id=&2 GROUP BY MONTH(`date_created`), YEAR(`date_created`) ORDER BY YEAR(`date_created`) ASC, MONTH(`date_created`) ASC", $year, $user_id); if ($rsCreateCachesMonth !== false) { // while ($rccm = mysql_fetch_array($rsCreateCachesYear)){ $content .= '<p><img src="graphs/BarGraphustat.php?userid=' . $user_id . '&t=ccm' . $year . '" border="0" alt="" width="500" height="200" /></p>'; if ($user_record['usertime'] != $year) { $yearr = $year - 1; $content .= '<p><img src="graphs/BarGraphustat.php?userid=' . $user_id . '&t=ccm' . $yearr . '" border="0" alt="" width="500" height="200" /></p>'; } // } } mysql_free_result($rsGeneralStat); mysql_free_result($rsCreateCachesMonth); $rsCreateCachesYear = sql("SELECT COUNT(*) `count`,YEAR(`date_created`) `year` FROM `caches` WHERE status <> 4 AND status <> 5 AND user_id=&1 GROUP BY YEAR(`date_created`) ORDER BY YEAR(`date_created`) ASC", $user_id); if ($rsCreateCachesYear !== false) { $content .= '<p><img src="graphs/BarGraphustat.php?userid=' . $user_id . '&t=ccy" border="0" alt="" width="500" height="200" /></p>'; } mysql_free_result($rsCreateCachesYear); } tpl_set_var('content', $content); } } tpl_BuildTemplate();
$record = $dbc->dbResultFetch($s); tpl_redirect("viewprofile.php?userid=" . $record['user_id']); } else { $i = 0; while ($record = $dbc->dbResultFetch($s)) { $tmp_line = $line; $tmp_line = mb_ereg_replace('{bgcolor}', $i % 2 == 0 ? $bgcolor1 : $bgcolor2, $tmp_line); $tmp_line = mb_ereg_replace('{username}', htmlspecialchars($record['username'], ENT_COMPAT, 'UTF-8'), $tmp_line); $tmp_line = mb_ereg_replace('{user_id}', htmlspecialchars($record['user_id'], ENT_COMPAT, 'UTF-8'), $tmp_line); $tmp_line = mb_ereg_replace('{date_created}', htmlspecialchars(fixPlMonth(strftime($dateformat, strtotime($record['date_created']))), ENT_COMPAT, 'UTF-8'), $tmp_line); $lines .= $tmp_line . "\n"; $i++; } tpl_set_var('lines', $lines); tpl_set_var('username', ''); tpl_set_var('not_found', ''); } } else { // User not found tpl_set_var('username', $options['username']); tpl_set_var('not_found', '<b>' . tr("message_user_not_found") . ': ' . $options['username'] . '</b><br/><br/>'); tpl_set_var('lines', ''); } } else { tpl_set_var('username', ''); tpl_set_var('not_found', ''); tpl_set_var('lines', ''); } } } tpl_BuildTemplate();
function tpl_errorMsg($tplnameError, $msg) { global $tplname; $tplname = 'error'; tpl_set_var('error_msg', $msg); tpl_set_var('tplname', $tplnameError); tpl_BuildTemplate(); exit; }
<?php use Utils\Database\XDb; //prepare the templates and include all neccessary require_once './lib/common.inc.php'; //Preprocessing if ($error == false) { //get the news $tplname = 'news'; $newscontent = ''; require $stylepath . '/news.inc.php'; $rsNewsTopics = XDb::xSql('SELECT `name`, `id` FROM `news_topics` ORDER BY `id` ASC'); while ($rNewsTopics = XDb::xFetchArray($rsNewsTopics)) { $rsNews = XDb::xSql("SELECT `date_posted`, `content` FROM `news`\n WHERE `topic`= ? AND `display`=1\n ORDER BY `date_posted` DESC LIMIT 0, 20", $rNewsTopics['id']); while ($rNews = XDb::xFetchArray($rsNews)) { $thisnewscontent = $tpl_newstopic_without_topic; $thisnewscontent = mb_ereg_replace('{date}', date('d-m-Y', strtotime($rNews['date_posted'])), $thisnewscontent); $thisnewscontent = mb_ereg_replace('{message}', $rNews['content'], $thisnewscontent); $newscontent .= $thisnewscontent . "\n"; } XDb::xFreeResults($rsNews); } XDb::xFreeResults($rsNewsTopics); //$newscontent .= "</table>"; tpl_set_var('list_of_news', $newscontent); } //make the template and send it out tpl_BuildTemplate();