Skip to content
Permalink
Browse files

added some English help pages; updates #163

  • Loading branch information...
following5 committed Jul 19, 2015
1 parent c188371 commit 61ea00ce382764da997d9cc2a386e165660deb72
@@ -23,6 +23,10 @@
//no article specified
$tpl->redirect('index.php');
}
else if (isset($_REQUEST['wiki']))
{
$tpl->redirect(helppageurl($article));
}
else if (!file_exists($opt['stylepath'] . '/articles/' . $language . '/' . $article . '.tpl'))
{
// does article exist in default-language?
@@ -665,12 +665,4 @@
$opt['httpd']['user'] = 'apache';
$opt['httpd']['group'] = 'apache';
/* CMS links for external pages
*/
// explanation of common login errors
$opt['cms']['login'] = 'http://wiki.opencaching.de/index.php/Login_auf_Opencaching.de';
// explanation of nature protection areas
$opt['cms']['npa'] = 'http://wiki.opencaching.de/index.php/Schutzgebiete';
?>

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -79,6 +79,7 @@ function getWaypoints($cacheid)
tpl_set_var('message_start', "");
tpl_set_var('message_end', "");
tpl_set_var('message', $login_required);
tpl_set_var('helplink', helppagelink('login'));
}
else
{
@@ -62,6 +62,7 @@
tpl_set_var('message_start', "");
tpl_set_var('message_end', "");
tpl_set_var('message', $login_required);
tpl_set_var('helplink', helppagelink('login'));
}
else
{
@@ -48,6 +48,7 @@
tpl_set_var('message_end', '');
tpl_set_var('target', 'editlog.php?logid=' . urlencode($log_id));
tpl_set_var('message', $login_required);
tpl_set_var('helplink', helppagelink('login'));
}
else
{
@@ -62,7 +62,7 @@
{t}Forgotten your E-Mail-Address?{/t} <a href="remindemail.php">{t}Remind me{/t}</a>
</p>
<p>
{t}Here you can find more troubleshooting:{/t} <a href="http://wiki.opencaching.de/index.php/Login_auf_Opencaching.de" target="_blank">{t}Problems with login{/t}</a>.
{t}Here you can find more troubleshooting:{/t} {helplink}{t}Problems with login{/t}</a>.
</p>
<div class="buffer" style="width: 500px;">&nbsp;</div>
</div>
@@ -1270,14 +1270,24 @@ function helppagelink($ocpage)
{
global $opt, $locale, $translate;
$help_locale = $locale;
$rs = sql("SELECT `helppage` FROM `helppages` WHERE `ocpage`='&1' AND `language`='&2'",
$ocpage, $locale);
$ocpage, $help_locale);
if (mysql_num_rows($rs) == 0)
{
mysql_free_result($rs);
$rs = sql("SELECT `helppage` FROM `helppages` WHERE `ocpage`='&1' AND `language`='*'",
$ocpage);
}
if (mysql_num_rows($rs) == 0)
{
mysql_free_result($rs);
$rs = sql("SELECT `helppage` FROM `helppages` WHERE `ocpage`='&1' AND `language`='&2'",
$ocpage, $opt['template']['default']['fallback_locale']);
if (mysql_num_rows($rs) > 0)
$help_locale = $opt['template']['default']['fallback_locale'];
}
if (mysql_num_rows($rs) > 0)
{
$record = sql_fetch_array($rs);
@@ -1293,8 +1303,8 @@ function helppagelink($ocpage)
if (substr($helppage,0,1) == "!")
return "<a class='nooutline' href='" . substr($helppage,1) . "' " . $imgtitle . " target='_blank'>";
else
if ($helppage != "" && isset($opt['locale'][$locale]['helpwiki']))
return "<a class='nooutline' href='" . $opt['locale'][$locale]['helpwiki'] .
if ($helppage != "" && isset($opt['locale'][$help_locale]['helpwiki']))
return "<a class='nooutline' href='" . $opt['locale'][$help_locale]['helpwiki'] .
str_replace(' ','_',$helppage) . "' " . $imgtitle . " target='_blank'>";
return "";
@@ -156,6 +156,7 @@
// see config2/settings-dist.inc.php
$opt['template']['default']['locale'] = 'DE'; // may be overwritten by $opt['domain'][...]['locale']
$opt['template']['default']['fallback_locale'] = 'EN'; // may be overwritten by $opt['domain'][...]['article_locale']
// include all locale settings
require_once($rootpath . 'config2/locale.inc.php');
@@ -185,7 +186,4 @@
$opt['template']['locales']['PT']['show'] = false;
$opt['template']['locales']['RU']['show'] = false;
// info on nature protection areas
$opt['cms']['npa'] = 'http://wiki.opencaching.de/index.php/Schutzgebiete';
?>
@@ -156,6 +156,7 @@
// see config2/settings-dist.inc.php
$opt['template']['default']['locale'] = 'DE'; // may be overwritten by $opt['domain'][...]['locale']
$opt['template']['default']['country'] = 'DE'; // may be overwritten by $opt['domain'][...]['country']
$opt['template']['default']['fallback_locale'] = 'EN'; // may be overwritten by $opt['domain'][...]['article_locale']
// include all locale settings
require_once($rootpath . 'config2/locale.inc.php');
@@ -220,9 +221,6 @@
// you can use -1 to use the master (not recommended, because replicated to slaves)
$opt['db']['slave']['primary'] = -1;
// info on nature protection areas
$opt['cms']['npa'] = 'http://wiki.opencaching.de/index.php/Schutzgebiete';
/* post_config() is invoked directly before the first HTML line of the main.tpl.php is sent to the client.
*/
@@ -183,7 +183,6 @@ function display($dummy1=null, $dummy2=null, $dummy3=null)
$optn['format'] = $opt['locale'][$opt['template']['locale']]['format'];
$optn['mail'] = $opt['mail'];
$optn['lib'] = $opt['lib'];
$optn['cms'] = $opt['cms'];
$optn['geokrety'] = $opt['geokrety'];
$optn['template']['usercountrieslist'] = labels::getLabels('usercountrieslist');
$optn['help']['oconly'] = helppagelink('oconly','OConly');
@@ -361,9 +361,9 @@ function fix_magic_quotes_gpc()
// pay attention to use only ' quotes in $text (escape other ')
//
// see corresponding function in lib/common.inc.php
function helppagelink($ocpage, $title='Instructions')
function helppageurl($ocpage)
{
global $opt, $translate;
global $opt;
$help_locale = $opt['template']['locale'];
$helppage = sql_value("SELECT `helppage` FROM `helppages`
@@ -385,17 +385,27 @@ function helppagelink($ocpage, $title='Instructions')
if ($helppage == "" && isset($opt['locale'][$opt['template']['locale']]['help'][$ocpage]))
$helppage = $opt['locale'][$opt['template']['locale']]['help'][$ocpage];
$imgtitle = $translate->t($title, '', basename(__FILE__), __LINE__);
$imgtitle = "alt='" . $imgtitle . "' title='" . $imgtitle . "'";
if (substr($helppage,0,1) == "!")
return "<a class='nooutline' href='" . substr($helppage,1) . "' " . $imgtitle . " target='_blank'>";
substr($helppage,1);
else if ($helppage != "" && isset($opt['locale'][$help_locale]['helpwiki']))
return $opt['locale'][$help_locale]['helpwiki'] . str_replace(' ','_',$helppage);
else
if ($helppage != "" && isset($opt['locale'][$help_locale]['helpwiki']))
return "<a class='nooutline' href='" . $opt['locale'][$help_locale]['helpwiki'] .
str_replace(' ','_',$helppage) . "' " . $imgtitle . " target='_blank'>";
return "";
}
function helppagelink($ocpage, $title='Instructions')
{
global $translate;
return "";
$helpurl = helppageurl($ocpage);
if ($helpurl == "")
return "";
else
{
$imgtitle = $translate->t($title, '', basename(__FILE__), __LINE__);
$imgtitle = "alt='" . $imgtitle . "' title='" . $imgtitle . "'";
return "<a class='nooutline' href='" . $helpurl . "' " . $imgtitle . " target='_blank'>";
}
}
@@ -37,7 +37,7 @@ function get_desc_npas($cache_id)
$npas = get_npas($cache_id);
if ($npas)
{
$desc = "<p>" . str_replace('%1',$opt['cms']['npa'], _('This geocache is probably placed within the following protection areas (<a href="%1">Info</a>):')) . "</p>\n" .
$desc = "<p>" . str_replace('%1',helppagelink('npa'), _('This geocache is probably placed within the following protected areas (%1Info</a>):')) . "</p>\n" .
"<ul>\n";
foreach ($npas as $npa)
$desc .= "<li>" . $npa['npaTypeName'] . ": <a href='http://www.google.de/search?q=".urlencode($npa['npaTypeName'].' '.$npa['npaName'])."' target='_blank'>" . $npa['npaName'] . "</a></li>\n";
@@ -65,7 +65,12 @@ function CreateCacheFile()
$aMenu[$r['id']]['authlevel'] = ($r['access']==0) ? AUTH_LEVEL_ALL : AUTH_LEVEL_ADMIN;
if (substr($r['href'],0,1) == '!')
{
$aMenu[$r['id']]['href'] = substr($r['href'],1);
$aMenu[$r['id']]['href'] = str_replace('%LANG', strtolower($opt['template']['locale']), substr($r['href'],1));
$aMenu[$r['id']]['target'] = 'target="_blank"';
}
else if (strstr($r['href'],'&wiki'))
{
$aMenu[$r['id']]['href'] = $r['href'];
$aMenu[$r['id']]['target'] = 'target="_blank"';
}
else
@@ -36,6 +36,7 @@
tpl_set_var('message_start', "");
tpl_set_var('message_end', "");
tpl_set_var('message', $login_required);
tpl_set_var('helplink', helppagelink('login'));
}
else
{
@@ -38,6 +38,7 @@
tpl_set_var('username', '');
tpl_set_var('target', htmlspecialchars('newdesc.php?cacheid=' . urlencode($cache_id), ENT_COMPAT, 'UTF-8'));
tpl_set_var('message', $login_required);
tpl_set_var('helplink', helppagelink('login'));
}
else
{
@@ -47,6 +47,7 @@
tpl_set_var('message_start', '');
tpl_set_var('message_end', '');
tpl_set_var('message', $login_required);
tpl_set_var('helplink', helppagelink('login'));
}
else
{
@@ -42,6 +42,7 @@
tpl_set_var('message', $login_required);
tpl_set_var('message_start', '');
tpl_set_var('message_end', '');
tpl_set_var('helplink', helppagelink('login'));
}
else
{
@@ -258,7 +258,8 @@
The date refers to the day when the data was downloaded from www.opencaching.de, and it may be omitted for photos and log entries.
<br />
<br />
Due to some questions from users, we would like to point out that the Opencaching.de
More explanations on the data license are available in the <a href="http://wiki.opencaching.de/index.php/Data_license" target="_blank">Wiki</a>.</p>
<p>Due to some questions from users, we would like to point out that the Opencaching.de
data license is, of course, no "exclusive" license. This means that every user may
publish her contents &ndash; on the Opencaching.de website or somewhere else &ndash; under
additional licenses (<em>multiple licensing</em>). This may be noted in the geocache
@@ -12,12 +12,12 @@
<table class="table">
<tr>
<td style="padding-bottom:20px;">
{t 1=$opt.template.style}The following list is generated automatically by the given recommendations of the users. You can find more informations on
regional classification in the <a href="http://wiki.opencaching.de/index.php/Empfehlungen">Wiki</a>.<br />
{t 1=$helppagelink 2=$opt.template.style}The following list is generated automatically by the given recommendations of the users. You can find more informations on
regional classification in the %1Wiki</a>.<br />
<br />
The numbers in the list below means:<br />
<img src="images/rating-star.gif" border="0" alt="Recommendations" /> Number of users that recommend this cache<br />
<img src="resource2/%1/images/log/16x16-found.png" width="16" height="16" border="0" alt="Found" /> Checks = Number of time the cache was found<br />
<img src="resource2/%2/images/log/16x16-found.png" width="16" height="16" border="0" alt="Found" /> Checks = Number of time the cache was found<br />
Index tries to take the number of recommendations and founds in an order to show 'the best' geocache first.<br />
<img src="images/tops-formula.png" border="0" alt="Formula" />{/t}
</td>
@@ -475,7 +475,7 @@ function showalllists()
<div style="border: solid 1px red; padding:10px 10px 0px 10px; margin: 3px 0 8px 0">
<p style="line-height: 1.6em;">
<img src="resource2/{$opt.template.style}/images/viewcache/npa.gif" align="left" style="margin-right: 25px;" width="32" height="32" alt="NSG/NPA" />
{t 1=$opt.cms.npa}This geocache is probably placed within a nature protection area! See <a href="%1">here</a> for further informations, please.{/t}<br />
{t 1=$npahelplink}This geocache is probably placed within a nature protection area! See %1here</a> for further informations, please.{/t}<br />
{foreach from=$npaareasWarning item=npaItem name=npaareas}
{$npaItem.npaTypeName|escape}
{$npaItem.npaName|escape} (<a href="http://www.google.de/search?q={$npaItem.npaTypeName|urlencode}+{$npaItem.npaName|urlencode}" target="_blank">{t}Info{/t}</a>){if !$smarty.foreach.npaareas.last},{/if}
@@ -486,7 +486,7 @@ function showalllists()
{if count($npaareasNoWarning) > 0}
<p style="line-height: 1.6em;">
{t 1=$opt.cms.npa}This geocache is probably placed within the following protection areas (<a href="%1">Info</a>):{/t}
{t 1=$npahelplink}This geocache is probably placed within the following protected areas (%1Info</a>):{/t}
{foreach from=$npaareasNoWarning item=npaItem name=npaareas}
{$npaItem.npaTypeName|escape}
{$npaItem.npaName|escape} (<a href="http://www.google.de/search?q={$npaItem.npaTypeName|urlencode}+{$npaItem.npaName|urlencode}" target="_blank">{t}Info{/t}</a>){if !$smarty.foreach.npaareas.last},{/if}
@@ -36,5 +36,6 @@
sql_free_result($rs);
}
$tpl->assign('helppagelink', helppagelink('tops'));
$tpl->display();
?>
@@ -349,6 +349,7 @@ function getChildWaypoints($cacheid)
$tpl->assign('shortlink_domain', $opt['logic']['shortlink_domain']);
$tpl->assign('listing_admin', $login->listingAdmin());
$tpl->assign('npahelplink', helppagelink('npa'));
// display the page
$tpl->display();

0 comments on commit 61ea00c

Please sign in to comment.
You can’t perform that action at this time.