think_exception.tpl 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <?php
  2. $cdnurl = function_exists('config') ? config('view_replace_str.__CDN__') : '';
  3. $publicurl = function_exists('config') ? (config('view_replace_str.__PUBLIC__')?:'/') : '/';
  4. $debug = function_exists('config') ? config('app_debug') : false;
  5. $lang = [
  6. 'An error occurred' => '发生错误',
  7. 'Home' => '返回主页',
  8. 'Previous Page' => '返回上一页',
  9. 'The page you are looking for is temporarily unavailable' => '你所浏览的页面暂时无法访问',
  10. 'You can return to the previous page and try again' => '你可以返回上一页重试'
  11. ];
  12. $langSet = '';
  13. if (isset($_GET['lang'])) {
  14. $langSet = strtolower($_GET['lang']);
  15. } elseif (isset($_COOKIE['think_var'])) {
  16. $langSet = strtolower($_COOKIE['think_var']);
  17. } elseif (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
  18. preg_match('/^([a-z\d\-]+)/i', $_SERVER['HTTP_ACCEPT_LANGUAGE'], $matches);
  19. $langSet = strtolower($matches[1]);
  20. }
  21. $langSet = $langSet && in_array($langSet, ['zh-cn', 'en']) ? $langSet : 'zh-cn';
  22. $langSet == 'en' && $lang = array_combine(array_keys($lang), array_keys($lang));
  23. ?>
  24. <!DOCTYPE html>
  25. <html>
  26. <head>
  27. <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
  28. <title><?=$lang['An error occurred']?></title>
  29. <meta name="robots" content="noindex,nofollow" />
  30. <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
  31. <link rel="shortcut icon" href="<?php echo $cdnurl;?>/assets/img/favicon.ico" />
  32. <style>
  33. * {-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;}
  34. html,body,div,span,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,abbr,address,cite,code,del,dfn,em,img,ins,kbd,q,samp,small,strong,sub,sup,var,b,i,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,caption,article,aside,canvas,details,figcaption,figure,footer,header,hgroup,menu,nav,section,summary,time,mark,audio,video {margin:0;padding:0;border:0;outline:0;vertical-align:baseline;background:transparent;}
  35. article,aside,details,figcaption,figure,footer,header,hgroup,nav,section {display:block;}
  36. html {font-size:16px;line-height:24px;width:100%;height:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;overflow-y:scroll;overflow-x:hidden;}
  37. img {vertical-align:middle;max-width:100%;height:auto;border:0;-ms-interpolation-mode:bicubic;}
  38. body {min-height:100%;background:#f4f6f8;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:"Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",微软雅黑,Arial,sans-serif;}
  39. .clearfix {clear:both;zoom:1;}
  40. .clearfix:before,.clearfix:after {content:"\0020";display:block;height:0;visibility:hidden;}
  41. .clearfix:after {clear:both;}
  42. body.error-page-wrapper,.error-page-wrapper.preview {background-position:center center;background-repeat:no-repeat;background-size:cover;position:relative;}
  43. .error-page-wrapper .content-container {border-radius:2px;text-align:center;box-shadow:0 0 30px rgba(99,99,99,0.06);padding:50px;background-color:#fff;width:100%;max-width:560px;position:absolute;left:50%;top:50%;margin-top:-220px;margin-left:-280px;}
  44. .error-page-wrapper .content-container.in {left:0px;opacity:1;}
  45. .error-page-wrapper .head-line {transition:color .2s linear;font-size:40px;line-height:60px;letter-spacing:-1px;margin-bottom:20px;color:#777;}
  46. .error-page-wrapper .subheader {transition:color .2s linear;font-size:32px;line-height:46px;color:#494949;}
  47. .error-page-wrapper .hr {height:1px;background-color:#eee;width:80%;max-width:350px;margin:25px auto;}
  48. .error-page-wrapper .context {transition:color .2s linear;font-size:16px;line-height:27px;color:#aaa;}
  49. .error-page-wrapper .context p {margin:0;}
  50. .error-page-wrapper .context p:nth-child(n+2) {margin-top:16px;}
  51. .error-page-wrapper .buttons-container {margin-top:35px;overflow:hidden;}
  52. .error-page-wrapper .buttons-container a {transition:text-indent .2s ease-out,color .2s linear,background-color .2s linear;text-indent:0px;font-size:14px;text-transform:uppercase;text-decoration:none;color:#fff;background-color:#2ecc71;border-radius:99px;padding:8px 0 8px;text-align:center;display:inline-block;overflow:hidden;position:relative;width:45%;}
  53. .error-page-wrapper .buttons-container a:hover {text-indent:15px;}
  54. .error-page-wrapper .buttons-container a:nth-child(1) {float:left;}
  55. .error-page-wrapper .buttons-container a:nth-child(2) {float:right;}
  56. @media screen and (max-width:580px) {
  57. .error-page-wrapper {padding:30px 5%;}
  58. .error-page-wrapper .content-container {padding:37px;position:static;left:0;margin-top:0;margin-left:0;}
  59. .error-page-wrapper .head-line {font-size:36px;}
  60. .error-page-wrapper .subheader {font-size:27px;line-height:37px;}
  61. .error-page-wrapper .hr {margin:30px auto;width:215px;}
  62. }
  63. @media screen and (max-width:450px) {
  64. .error-page-wrapper {padding:30px;}
  65. .error-page-wrapper .head-line {font-size:32px;}
  66. .error-page-wrapper .hr {margin:25px auto;width:180px;}
  67. .error-page-wrapper .context {font-size:15px;line-height:22px;}
  68. .error-page-wrapper .context p:nth-child(n+2) {margin-top:10px;}
  69. .error-page-wrapper .buttons-container {margin-top:29px;}
  70. .error-page-wrapper .buttons-container a {float:none !important;width:65%;margin:0 auto;font-size:13px;padding:9px 0;}
  71. .error-page-wrapper .buttons-container a:nth-child(2) {margin-top:12px;}
  72. }
  73. </style>
  74. </head>
  75. <body class="error-page-wrapper">
  76. <div class="content-container">
  77. <div class="head-line">
  78. <img src="<?=$cdnurl?>/assets/img/error.svg" alt="" width="120"/>
  79. </div>
  80. <div class="subheader">
  81. <?=$debug?$message:$lang['The page you are looking for is temporarily unavailable']?>
  82. </div>
  83. <div class="hr"></div>
  84. <div class="context">
  85. <p>
  86. <?=$lang['You can return to the previous page and try again']?>
  87. </p>
  88. </div>
  89. <div class="buttons-container">
  90. <a href="<?=$publicurl?>"><?=$lang['Home']?></a>
  91. <a href="javascript:" onclick="history.go(-1)"><?=$lang['Previous Page']?></a>
  92. </div>
  93. </div>
  94. </body>
  95. </html>