PHP 8: Get login page to work (using twig 3)
This commit is contained in:
parent
4082c94bf3
commit
1228b2f99d
|
@ -1,8 +1,9 @@
|
|||
{
|
||||
"require": {
|
||||
"phpunit/phpunit": "^5",
|
||||
"phpunit/phpunit": "^10",
|
||||
"guzzlehttp/guzzle": "^7.0",
|
||||
"lifo/ip": "^1.1",
|
||||
"twig/twig": "^1.0"
|
||||
"twig/twig": "^3.0",
|
||||
"phpmyadmin/twig-i18n-extension": "^4.0"
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,6 +1,6 @@
|
|||
<?PHP
|
||||
|
||||
function error_handler($errno, $errstr, $errfile, $errline, $errcontext){
|
||||
function error_handler($errno, $errstr, $errfile, $errline){
|
||||
if(error_reporting() & $errno){
|
||||
$config['debug']=true;
|
||||
error($errstr . ' in ' . $errfile . ' at line ' . $errline);
|
||||
|
|
|
@ -6,25 +6,25 @@
|
|||
|
||||
defined('TINYBOARD') or exit;
|
||||
|
||||
require_once 'vendor/autoload.php';
|
||||
|
||||
use PhpMyAdmin\Twig\Extensions\I18nExtension;
|
||||
|
||||
$twig = false;
|
||||
|
||||
function load_twig() {
|
||||
global $twig, $config;
|
||||
|
||||
require_once 'vendor/autoload.php';
|
||||
Twig_Autoloader::register();
|
||||
|
||||
$loader = new Twig_Loader_Filesystem($config['dir']['template']);
|
||||
$twig = new Twig_Environment($loader, array(
|
||||
$loader = new Twig\Loader\FilesystemLoader($config['dir']['template']);
|
||||
$twig = new Twig\Environment($loader, array(
|
||||
'autoescape' => false,
|
||||
'cache' => is_writable('templates') || (is_dir('templates/cache') && is_writable('templates/cache')) ?
|
||||
"{$config['dir']['template']}/cache" : false,
|
||||
'debug' => $config['debug']
|
||||
));
|
||||
|
||||
// Add extensions (if they are still compatible with Twig 1.x)
|
||||
$twig->addExtension(new Twig_Extensions_Extension_Tinyboard());
|
||||
$twig->addExtension(new Twig_Extensions_Extension_I18n());
|
||||
$twig->addExtension(new I18nExtension());
|
||||
}
|
||||
|
||||
function Element($templateFile, array $options) {
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
{% endif %}
|
||||
{% if config.recaptcha %}
|
||||
<script src="//www.google.com/recaptcha/api.js"></script>
|
||||
<style type="text/css">{% raw %}
|
||||
<style type="text/css">{% verbatim %}
|
||||
#recaptcha_area {
|
||||
float: none !important;
|
||||
padding: 0 !important;
|
||||
|
@ -55,4 +55,4 @@
|
|||
.recaptchatable, #recaptcha_area tr, #recaptcha_area td, #recaptcha_area th {
|
||||
padding: 0 !important;
|
||||
}
|
||||
{% endraw %}</style>{% endif %}
|
||||
{% endverbatim %}</style>{% endif %}
|
||||
|
|
|
@ -35,8 +35,8 @@
|
|||
|
||||
</footer>
|
||||
<div class="pages"></div>
|
||||
<script type="text/javascript">{% raw %}
|
||||
<script type="text/javascript">{% verbatim %}
|
||||
ready();
|
||||
{% endraw %}</script>
|
||||
{% endverbatim %}</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,119 +0,0 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var active_page = "thread"
|
||||
, board_name = "{{ board.uri }}"
|
||||
, thread_id = "{{ thread.id }}";
|
||||
</script>
|
||||
|
||||
{% include 'header.html' %}
|
||||
|
||||
{% set meta_subject %}{% if config.thread_subject_in_title and thread.subject %}{{ thread.subject|e }}{% else %}{{ thread.body_nomarkup[:256]|remove_modifiers|e }}{% endif %}{% endset %}
|
||||
|
||||
<meta name="description" content="{{ board.url }} - {{ board.title|e }} - {{ meta_subject }}" />
|
||||
<meta name="twitter:card" value="summary">
|
||||
<meta property="og:title" content="{{ meta_subject }}" />
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:url" content="{{ config.domain }}/{{ board.uri }}/{{ config.dir.res }}{{ thread.id }}.html" />
|
||||
{% if thread.files.0.thumb %}<meta property="og:image" content="{{ config.domain }}/{{ board.uri }}/{{ config.dir.thumb }}{{ thread.files.0.thumb }}" />{% endif %}
|
||||
<meta property="og:description" content="{{ thread.body_nomarkup|e }}" />
|
||||
|
||||
<title>{{ board.url }} - {{ meta_subject }}</title>
|
||||
</head>
|
||||
<body id="thread" class="8chan vichan {% if mod %}is-moderator{% else %}is-not-moderator{% endif %} active-thread" data-stylesheet="{% if config.default_stylesheet.1 != '' %}{{ config.default_stylesheet.1 }}{% else %}default{% endif %}">
|
||||
<div class="bar top">
|
||||
{{ boardlist.top }}
|
||||
</div>
|
||||
<a name="top"></a>
|
||||
{% if pm %}<div class="top_notice">You have <a href="?/PM/{{ pm.id }}">an unread PM</a>{% if pm.waiting > 0 %}, plus {{ pm.waiting }} more waiting{% endif %}.</div><hr />{% endif %}
|
||||
{% if config.url_banner %}<img class="board_image" src="{{ config.url_banner }}" {% if config.banner_width or config.banner_height %}style="{% if config.banner_width %}width:{{ config.banner_width }}px{% endif %};{% if config.banner_width %}height:{{ config.banner_height }}px{% endif %}" {% endif %}alt="" />{% endif %}
|
||||
<div id="pagewrap">
|
||||
<header>
|
||||
<h1 class="glitch" data-text="{{ board.url }} - {{ board.title|e }}">{{ board.url }} - {{ board.title|e }}</h1>
|
||||
<div class="subtitle">
|
||||
{% if board.subtitle %}
|
||||
{% if config.allow_subtitle_html %}
|
||||
{{ board.subtitle }}
|
||||
{% else %}
|
||||
{{ board.subtitle|e }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if mod %}<p><a href="?/">{% trans %}Return to dashboard{% endtrans %}</a></p>{% endif %}
|
||||
</div>
|
||||
</header>
|
||||
|
||||
{% include 'attention_bar.html' %}
|
||||
|
||||
|
||||
{{ config.ad.top }}
|
||||
|
||||
{% include 'post_form.html' %}
|
||||
|
||||
{% if config.global_message %}<hr /><div class="blotter">{{ config.global_message }}</div>{% endif %}
|
||||
<hr />
|
||||
<div class="threadlinks-noup">
|
||||
<span class="threadlink">[ <a href="{{ return }}">{% trans %}Return{% endtrans %}</a> /</span>
|
||||
<span class="threadlink"><a href="#bottom" style="padding-left: 10px"> {% trans %}Go to bottom{% endtrans %}</a> ]</span>
|
||||
</div>
|
||||
<hr />
|
||||
<form name="postcontrols" action="{{ config.post_url }}" method="post">
|
||||
<input type="hidden" name="board" value="{{ board.uri }}" />
|
||||
{% if mod %}<input type="hidden" name="mod" value="1" />{% endif %}
|
||||
|
||||
{{ body }}
|
||||
|
||||
<div id="thread-interactions">
|
||||
<span id="thread-links">
|
||||
<a id="thread-return" href="{{ return }}">[{% trans %}Return{% endtrans %}]</a>
|
||||
<a id="thread-top" href="#top">[{% trans %}Go to top{% endtrans %}]</a>
|
||||
{% if config.catalog_link %}
|
||||
<a id="thread-catalog" href="{{ config.root }}{{ board.dir }}{{ config.catalog_link }}">[{% trans %}Catalog{% endtrans %}]</a>
|
||||
{% endif %}
|
||||
{% if config.home_link %}
|
||||
| <a id="thread-home" href="{{ config.root }}">[{% trans %}Home{% endtrans %}]</a>
|
||||
{% endif %}
|
||||
</span>
|
||||
|
||||
<span id="thread-quick-reply">
|
||||
<a id="link-quick-reply" href="#">[{% trans %}Post a Reply{% endtrans %}]</a>
|
||||
</span>
|
||||
|
||||
{% include 'report_delete.html' %}
|
||||
</div>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
</form>
|
||||
|
||||
{{ boardlist.bottom }}
|
||||
|
||||
{{ config.ad.bottom }}
|
||||
|
||||
<footer>
|
||||
{% include 'badges.html' %}
|
||||
<p class="unimportant" style="margin-top:20px;text-align:center;">- <a href="https://github.com/savetheinternet/Tinyboard">Tinyboard</a> +
|
||||
<a href='https://github.com/vichan-devel/vichan'>vichan</a> +
|
||||
<a href='https://github.com/lainchan/lainchan'>lainchan</a> {{ config.version }} -
|
||||
<br><a href="https://github.com/savetheinternet/Tinyboard">Tinyboard</a> Copyright © 2010-2014 Tinyboard Development Group
|
||||
<br><a href="https://github.com/vichan-devel/vichan">vichan</a> Copyright © 2012-2016 vichan-devel
|
||||
<br><a href="https://github.com/lainchan/lainchan">lainchan</a> Copyright © 2014-2017 lainchan Administration</p>
|
||||
{% for footer in config.footer %}<p class="unimportant" style="text-align:center;">{{ footer }}</p>{% endfor %}
|
||||
</footer>
|
||||
</div>
|
||||
<div class="bar bottom">
|
||||
<div class="threadlinks">
|
||||
<span class="threadlink">[ <a href="{{ return }}">{% trans %}Return{% endtrans %}</a> /</span>
|
||||
<span class="threadlink"><a href="#" style="padding-left: 10px"> {% trans %}Go to top{% endtrans %}</a> /</span>
|
||||
</div>
|
||||
<div class=pages></div>
|
||||
</div>
|
||||
<script type="text/javascript">{% raw %}
|
||||
ready();
|
||||
{% endraw %}</script>
|
||||
<a href="#" id="bottom"></a>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue