Anhand dieses Beitrags habe ich versucht eine EXT daraus zu machen.
Die html und css Einträge sind kein Problem, nur eines bereitet mir Schwierigkeiten, beim manuellen Einbau muss man in der
root/viewtopic.php
vor:
Code: Alles auswählen
'POST_DATE' => $user->format_date($row['post_time'], false, ($view == 'print') ? true : false),
Code: Alles auswählen
'MONTH_YEAR' => $user->format_date($row['post_time'], 'M Y', false),
'DATE' => $user->format_date($row['post_time'], 'd', false),
listner.php
einzutragen, doch leider wird mir dieser Fehler angezeigt:
Hier mal meineFatal error: Call to a member function format_date() on a non-object in /users/kirk2/www/phpBB3/ext/kirk/calendarinposting/event/listener.php on line 56
./event/listner.php
Code: Alles auswählen
<?php
/**
*
* @package phpBB Extension - Kirk calendarinposting
* @copyright (c) 2014 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace kirk\calendarinposting\event;
/**
* @ignore
*/
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
/**
* Event listener
*/
class listener implements EventSubscriberInterface
{
static public function getSubscribedEvents()
{
return array(
'core.viewtopic_modify_post_action_conditions' => 'add_calendar',
);
}
/* @var \phpbb\controller\helper */
protected $helper;
/* @var \phpbb\db\driver\driver_interface */
protected $db;
/* @var \phpbb\template\template */
protected $template;
/* @var \phpbb\user */
protected $user;
/* @var string phpEx */
protected $php_ext;
/**
* Constructor
*
* @param \phpbb\controller\helper $helper Controller helper object
* @param \phpbb\db\driver\driver_interface $db Database object
* @param \phpbb\template $template Template object
* @param string $php_ext phpEx
*/
public function add_calendar($event)
{
$post_row = array(
'MONTH_YEAR' => $this->user->format_date($row['post_time'], 'M Y', false),
'DATE' => $this->user->format_date($row['post_time'], 'd', false),
);
}
}
Fatal error: Call to a member function format_date() on a non-object
nicht dahinter was da verkehrt ist.