diff --git a/htdocs/404.php b/htdocs/404.php index 20dceac9..c3bd9415 100644 --- a/htdocs/404.php +++ b/htdocs/404.php @@ -19,43 +19,18 @@ $tpl->cache_lifetime = 300; $tpl->cache_id = $sUserCountry; - // simplify variables if exists - $redirectUrl = ''; - $isRedirect404 = false; - if (isset($_SERVER['REDIRECT_URL'])) - { - $redirectUrl = $_SERVER['REDIRECT_URL']; - $isRedirect404 = true; - } - - // assign redirection status + // test for redirection to this page + $isRedirect404 = isset($_SERVER['REDIRECT_URL']); $tpl->assign('isRedirect404', $isRedirect404); - - // check if original path starts with "/" and remove it - if (substr($redirectUrl, 0, 1) == '/') - $redirectUrl = substr($redirectUrl, 1); - - // get number of subdirectories (-1 because the last part of url is treated as file) - $numDirs = count(explode('/', $redirectUrl)) - 1 -2; - - // put ../ together according to $numDirs - $prePath = ''; - for ($i=0; $i<$numDirs; $i++) - { - $prePath .= '../'; - } - - // assign path - $tpl->assign('actualpath',$prePath); - // website, if is 404 redirection + // determine website url, if is 404 redirection if ($isRedirect404) { // check length $uril = 70; $uri = 'http://'.strtolower($_SERVER['SERVER_NAME']).$_SERVER['REQUEST_URI']; // limit to $uril - if(strlen($uri) > $uril) { + if (strlen($uri) > $uril) { $uri = substr($uri,0,$uril-3).'...'; } @@ -73,7 +48,10 @@ // simplify $opt foreach ($options as $option) { - $opt404[$option] = (isset($opt['page']['404'][$_SERVER['SERVER_NAME']][$option]) ? $opt['page']['404'][$_SERVER['SERVER_NAME']][$option] : $opt['page']['404']['www.opencaching.de'][$option]); + if (isset($opt['page']['404'][$_SERVER['SERVER_NAME']][$option])) + $opt404[$option] = $opt['page']['404'][$_SERVER['SERVER_NAME']][$option]; + else + $opt404[$option] = $opt['page']['404']['www.opencaching.de'][$option]; } // get feeds from $feeds array diff --git a/htdocs/lib2/OcSmarty.class.php b/htdocs/lib2/OcSmarty.class.php index 338fcc5f..b04947e9 100644 --- a/htdocs/lib2/OcSmarty.class.php +++ b/htdocs/lib2/OcSmarty.class.php @@ -164,6 +164,7 @@ class OcSmarty extends Smarty $optn['page']['headimagepath'] = $opt['page']['headimagepath']; $optn['page']['max_logins_per_hour'] = $opt['page']['max_logins_per_hour']; $optn['page']['absolute_url'] = $opt['page']['absolute_url']; + $optn['page']['absolute_urlpath'] = parse_url($opt['page']['absolute_url'], PHP_URL_PATH); $optn['page']['target'] = $this->target; $optn['page']['showdonations'] = $opt['page']['showdonations']; $optn['page']['title'] = $opt['page']['title']; diff --git a/htdocs/templates2/ocstyle/res_cacheicon_22.tpl b/htdocs/templates2/ocstyle/res_cacheicon_22.tpl index a2c58f56..149461b5 100644 --- a/htdocs/templates2/ocstyle/res_cacheicon_22.tpl +++ b/htdocs/templates2/ocstyle/res_cacheicon_22.tpl @@ -3,32 +3,29 @@ * * Unicode Reminder メモ ***************************************************************************} -{* check if actualpath is set *} -{if !isset($actualpath)}{assign var='actualpath' value=''}{/if} - {strip} {* OCSTYLE *} {*cachetype=1 status=1 logtype=0 owner=false small=false*} {if $cachetype==1} - {t}Unknown Geocache{/t} + {t}Unknown Geocache{/t} {elseif $cachetype==2} - {t}Traditional Geocache{/t} + {t}Traditional Geocache{/t} {elseif $cachetype==3} - {t}Multicache{/t} + {t}Multicache{/t} {elseif $cachetype==4} - {t}Virtual Geocache{/t} + {t}Virtual Geocache{/t} {elseif $cachetype==5} - {t}Webcam Geocache{/t} + {t}Webcam Geocache{/t} {elseif $cachetype==6} - {t}Event Geocache{/t} + {t}Event Geocache{/t} {elseif $cachetype==7} - {t}Quizcache{/t} + {t}Quizcache{/t} {elseif $cachetype==8} - {t}Math/Physics Geocache{/t} + {t}Math/Physics Geocache{/t} {elseif $cachetype==9} - {t}Moving Geocache{/t} + {t}Moving Geocache{/t} {elseif $cachetype==10} - {t}Drive-In Geocache{/t} + {t}Drive-In Geocache{/t} {else}   {/if} diff --git a/htdocs/templates2/ocstyle/res_newcaches.tpl b/htdocs/templates2/ocstyle/res_newcaches.tpl index 59ce681c..20bfee82 100755 --- a/htdocs/templates2/ocstyle/res_newcaches.tpl +++ b/htdocs/templates2/ocstyle/res_newcaches.tpl @@ -3,9 +3,6 @@ * * Unicode Reminder メモ ***************************************************************************} -{* check if actualpath is set *} -{if !isset($actualpath)}{assign var='actualpath' value=''}{/if} - {if $minimap_enabled}
@@ -14,9 +11,9 @@ {foreach name=newcaches from=$newcaches item=cacheitem}
  • - + - diff --git a/htdocs/templates2/ocstyle/res_oconly.tpl b/htdocs/templates2/ocstyle/res_oconly.tpl index 6d285a09..29d6b2bb 100644 --- a/htdocs/templates2/ocstyle/res_oconly.tpl +++ b/htdocs/templates2/ocstyle/res_oconly.tpl @@ -3,9 +3,6 @@ * * Unicode Reminder メモ ***************************************************************************} -{* check if actualpath is set *} -{if !isset($actualpath)}{assign var='actualpath' value=''}{/if} - {if $oconly} - {if $opt.help.oconly != ''}{$opt.help.oconly}{/if}{if $size=='15x21'}{else}{/if}{if $opt.help.oconly != ''}{/if} + {if $opt.help.oconly != ''}{$opt.help.oconly}{/if}{if $size=='15x21'}{else}{/if}{if $opt.help.oconly != ''}{/if} {/if} diff --git a/htdocs/templates2/ocstyle/sys_oc404.tpl b/htdocs/templates2/ocstyle/sys_oc404.tpl index 7d2ff70c..21ae8f48 100755 --- a/htdocs/templates2/ocstyle/sys_oc404.tpl +++ b/htdocs/templates2/ocstyle/sys_oc404.tpl @@ -27,26 +27,26 @@ - - - - - - + + + + + +
    - +
    {include file="res_cacheicon_22.tpl" cachetype=$cacheitem.type actualpath=$actualpath}{include file="res_cacheicon_22.tpl" cachetype=$cacheitem.type} {$cacheitem.date_created|date_format:$opt.format.date}  {$cacheitem.name|escape} {include file="res_oconly.tpl" oconly=$cacheitem.oconly actualpath=$actualpath} + {$cacheitem.name|escape} {include file="res_oconly.tpl" oconly=$cacheitem.oconly} {t}by{/t} {$cacheitem.username|escape}