本文整理汇总了PHP中tpl_set_var函数的典型用法代码示例。如果您正苦于以下问题:PHP tpl_set_var函数的具体用法?PHP tpl_set_var怎么用?PHP tpl_set_var使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tpl_set_var函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: str_rot13_html
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:
开发者ID:pawelzielak,项目名称:opencaching-pl,代码行数:31,代码来源:mojaokolica.php
示例2: db_slave_exclude
// 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();
}
开发者ID:PaulinaKowalczuk,项目名称:oc-server3,代码行数:31,代码来源:newcache.php
示例3: sql
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();
开发者ID:pawelzielak,项目名称:opencaching-pl,代码行数:31,代码来源:removemp3.php
示例4: tpl_set_var
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();
开发者ID:pawelzielak,项目名称:opencaching-pl,代码行数:31,代码来源:myignores.php
示例5: switch
//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();
开发者ID:pawelzielak,项目名称:opencaching-pl,代码行数:31,代码来源:articles.php
示例6: sqlvalue
$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();
开发者ID:pawelzielak,项目名称:opencaching-pl,代码行数:31,代码来源:region.php
示例7: tr
$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();
开发者ID:pawelzielak,项目名称:opencaching-pl,代码行数:31,代码来源:index.php
示例8: setCommonMap3Vars
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");
}
开发者ID:kojoty,项目名称:opencaching-pl,代码行数:17,代码来源:cachemap3_common.php
示例9: mb_ereg_replace
$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();
开发者ID:kojoty,项目名称:opencaching-pl,代码行数:31,代码来源:mailto.php
示例10: savequery
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');
}
开发者ID:pawelzielak,项目名称:opencaching-pl,代码行数:87,代码来源:query.php
示例11: intval
<?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();
}
开发者ID:pawelzielak,项目名称:opencaching-pl,代码行数:13,代码来源:add_rr_comment.php
示例12: array
//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();
开发者ID:kojoty,项目名称:opencaching-pl,代码行数:31,代码来源:myroutes_edit.php
示例13: tpl_set_var
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>');
开发者ID:pawelzielak,项目名称:opencaching-pl,代码行数:58,代码来源:cachemap2.php
示例14: htmlFormat
/**
* 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);
}
开发者ID:pawelzielak,项目名称:opencaching-pl,代码行数:63,代码来源:xmlmap.php
示例15: mb_ereg_replace
$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();
开发者ID:kojoty,项目名称:opencaching-pl,代码行数:31,代码来源:gallery_cache.php
示例16: outputLocidSelectionForm
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;
}
开发者ID:pawelzielak,项目名称:opencaching-pl,代码行数:81,代码来源:search.php
示例17: tpl_set_var
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();
}
开发者ID:pawelzielak,项目名称:opencaching-pl,代码行数:31,代码来源:admin_users.php
示例18: tpl_set_var
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();
开发者ID:RH-Code,项目名称:opencaching,代码行数:31,代码来源:editdesc.php
示例19: DisplayAllOpensprawdzaczCaches
//.........这里部分代码省略.........
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
|
请发表评论