Fixed more template errors in order to get everything running with PHP 8.0.

Also: Fixed some tiny PHP errors.
Thanks for reporting, Matthias!
This commit is contained in:
azett 2021-02-13 13:03:09 +01:00
parent 3ce4a44864
commit 7e8ddb88b8
6 changed files with 163 additions and 158 deletions

View File

@ -109,7 +109,9 @@ class admin_maintain_updates extends AdminPanelAction {
$success = -1; $success = -1;
} }
$this->smarty->assign('updates', $ver); $this->smarty->assign('stableversion', $ver ['stable']);
$this->smarty->assign('unstableversion', $ver ['unstable']);
$this->smarty->assign('notice', $ver ['notice']);
$this->smarty->assign('fpweb', $this->fpweb); $this->smarty->assign('fpweb', $this->fpweb);
$this->smarty->assign('sfweb', $this->sfweb); $this->smarty->assign('sfweb', $this->sfweb);
$this->smarty->assign('success', $success); $this->smarty->assign('success', $success);

View File

@ -1,7 +1,7 @@
<h2>{$panelstrings.head}</h2> <h2>{$panelstrings.head}</h2>
{include file=shared:errorlist.tpl} {include file=shared:errorlist.tpl}
{$panelstrings.list|sprintf:$smarty.const.SYSTEM_VER:$sfweb:$updates.stable:$fpweb:$updates.unstable} {$panelstrings.list|sprintf:$smarty.const.SYSTEM_VER:$sfweb:$stableversion:$fpweb:$unstableversion}
{if $updates.notice} {if $notice}
<h5>{$panelstrings.notice}</h5> <h5>{$panelstrings.notice}</h5>
<p>{$updates.notice}</p> <p>{$notice}</p>
{/if} {/if}

View File

@ -1,137 +1,140 @@
<?php <?php
class LayoutDefault { class LayoutDefault {
var $content;
var $fpdb;
var $fp_widgets;
var $smarty;
var $config;
var $lang;
var $tpl = 'index.tpl'; var $content;
var $message_queue = array(); var $fpdb;
function LayoutDefault($content=array()) { var $fp_widgets;
$this->pagecontent = $content; var $smarty;
$this->fpdb =& new FPDB; var $config;
$GLOBALS['fpdb'] =& $this->fpdb;
$this->fp_widgets =& new widget_indexer; var $lang;
$GLOBALS['fp_widgets'] =& $this->fp_widgets;
$this->smarty =& $GLOBALS['_FP_SMARTY']; var $tpl = 'index.tpl';
$GLOBALS['fp_config'] =& $this->config; var $message_queue = array();
$this->config = $GLOBALS['fp_config']['general'];
function LayoutDefault($content = array()) {
$this->pagecontent = $content;
$this->theme = theme_loadsettings(); $this->fpdb =& new FPDB();
$GLOBALS['theme'] =& $this->theme; $GLOBALS ['fpdb'] = & $this->fpdb;
$this->lang = lang_load(); $this->fp_widgets =& new widget_indexer();
$GLOBALS['lang'] =& $this->lang; $GLOBALS ['fp_widgets'] = & $this->fp_widgets;
// user_loggedin() or sess_setup(); $this->smarty = & $GLOBALS ['_FP_SMARTY'];
plugin_loadall(); $GLOBALS ['fp_config'] = & $this->config;
$this->config = $GLOBALS ['fp_config'] ['general'];
// init smarty $this->theme = theme_loadsettings();
$GLOBALS ['theme'] = & $this->theme;
$this->smarty->compile_dir = CACHE_DIR; $this->lang = lang_load();
$this->smarty->cache_dir = SMARTY_DIR . 'cache/'; $GLOBALS ['lang'] = & $this->lang;
$this->smarty->caching = 0;
// user_loggedin() or sess_setup();
plugin_loadall();
do_action('init'); // init smarty
} $this->smarty->compile_dir = CACHE_DIR;
$this->smarty->cache_dir = SMARTY_DIR . 'cache/';
$this->smarty->caching = 0;
function display() {
$this->main();
theme_init($this->smarty, $this);
$this->smarty->display($this->tpl);
unset($this->smarty);
do_action('shutdown');
}
/*
function post_message($module, $ring, $message) {
$this->message_queue[$module][$ring][]=$message;
}
function flush_messages($module, $ring=-1) {
$msg_arr=array();
if ($ring<0)
$ring_arr =
array_keys($this->message_queue[$module]);
else
$ring_arr = array($ring);
foreach($ring_arr as $this_ring) {
$localq=& $this->message_queue[$module][$this_ring];
foreach ($localq as $msg) {
$msg_arr[]=$msg;
}
}
$this->smarty->append('err', $msg_arr);
return $msg_arr;
}
*/
do_action('init');
} }
class Abstract_LayoutIndex extends LayoutDefault { function display() {
$this->main();
theme_init($this->smarty, $this);
$this->smarty->display($this->tpl);
var $tpl = 'index.tpl'; unset($this->smarty);
do_action('shutdown');
} }
class Abstract_LayoutComment extends LayoutDefault { /*
*
* function post_message($module, $ring, $message) {
* $this->message_queue[$module][$ring][]=$message;
*
* }
*
* function flush_messages($module, $ring=-1) {
*
* $msg_arr=array();
* if ($ring<0)
* $ring_arr =
* array_keys($this->message_queue[$module]);
* else
* $ring_arr = array($ring);
*
* foreach($ring_arr as $this_ring) {
* $localq=& $this->message_queue[$module][$this_ring];
* foreach ($localq as $msg) {
* $msg_arr[]=$msg;
* }
* }
*
* $this->smarty->append('err', $msg_arr);
* return $msg_arr;
* }
*/
}
var $tpl = 'comments.tpl'; class Abstract_LayoutIndex extends LayoutDefault {
var $tpl = 'index.tpl';
}
class Abstract_LayoutComment extends LayoutDefault {
var $tpl = 'comments.tpl';
}
class Abstract_LayoutDialog extends LayoutDefault {
var $tpl = 'default.tpl';
function page($subject, $content, $rawcontent = false) {
$this->pagecontent = array(
'subject' => $subject,
'content' => $content
);
if ($rawcontent) {
$this->smarty->assign('rawcontent', true);
} else {
$this->smarty->assign('rawcontent', false);
}
} }
class Abstract_LayoutDialog extends LayoutDefault { function pagecontent($params, $content, &$smarty, &$repeat) {
if ($this->pagecontent) {
var $tpl = 'default.tpl'; $this->smarty->assign($this->pagecontent);
return $content;
function page($subject, $content, $rawcontent=false) { } else
$this->pagecontent = array( return;
'subject'=>$subject,
'content'=>$content
);
if ($rawcontent) $this->smarty->assign('rawcontent', true);
}
function pagecontent($params, $content, &$smarty, &$repeat) {
if ($this->pagecontent) {
$this->smarty->assign($this->pagecontent);
return $content;
} else return;
}
function display() {
$this->smarty->register_block('page', array(&$this, 'pagecontent'));
parent::display();
}
} }
function display() {
$this->smarty->register_block('page', array(
&$this,
'pagecontent'
));
parent::display();
}
}
?> ?>

View File

@ -5,7 +5,7 @@
<subtitle>{$flatpress.subtitle}</subtitle> <subtitle>{$flatpress.subtitle}</subtitle>
<link href="{$smarty.const.BLOG_BASEURL}" /> <link href="{$smarty.const.BLOG_BASEURL}" />
<link rel="self" href="{$smarty.server.REQUEST_URI|escape}" /> <link rel="self" href="{$smarty.server.REQUEST_URI|escape}" />
<generator uri="http://www.flatpress.org/" version="{$flatpress.version}"> <generator uri="http://www.flatpress.org/" version="{$smarty.const.SYSTEM_VER}">
FlatPress FlatPress
</generator> </generator>
<rights> {$flatpress.author} {$smarty.now|date_format:'%Y'} </rights> <rights> {$flatpress.author} {$smarty.now|date_format:'%Y'} </rights>

View File

@ -8,7 +8,7 @@
<title>{$flatpress.title} » {$subject}</title> <title>{$flatpress.title} » {$subject}</title>
<link>{$the_comment_link}</link> <link>{$the_comment_link}</link>
<description><![CDATA[{$flatpress.subtitle}]]></description> <description><![CDATA[{$flatpress.subtitle}]]></description>
<copyright>Copyright {$smarty.now|date_format:"$Y"}, {$flatpress.author}</copyright> <copyright>Copyright {'Y'|date}, {$flatpress.author}</copyright>
{*<managingEditor>{$flatpress.email} ({$flatpress.author})</managingEditor>*} {*<managingEditor>{$flatpress.email} ({$flatpress.author})</managingEditor>*}
<language>{$fp_config.locale.lang}</language> <language>{$fp_config.locale.lang}</language>
<atom:link rel="self" href="{'rss2'|theme_comments_feed_link:$id}" type="application/rss+xml" /> <atom:link rel="self" href="{'rss2'|theme_comments_feed_link:$id}" type="application/rss+xml" />

View File

@ -71,7 +71,7 @@ class Plugin_PrettyURLs {
function permalink($str, $id) { function permalink($str, $id) {
global $fpdb, $post; global $fpdb, $post;
if (PRETTYURLS_TITLES) if (isset($post) && PRETTYURLS_TITLES)
$title = sanitize_title($post ['subject']); $title = sanitize_title($post ['subject']);
else else
$title = $id; $title = $id;
@ -499,7 +499,7 @@ class Plugin_PrettyURLs {
if (isset($this->fp_params ['paged']) && $this->fp_params ['paged'] > 1) if (isset($this->fp_params ['paged']) && $this->fp_params ['paged'] > 1)
$page = $this->fp_params ['paged']; $page = $this->fp_params ['paged'];
$page += $v; $page += ($v . '');
if ($page > 0) { if ($page > 0) {
$l .= 'page/' . $page . '/'; $l .= 'page/' . $page . '/';