Копировать в папку:
/ext/rxu/topicactions/
Расширение позволяет удалять (в стандартную "корзину" или безвозвратно) темы по расписанию.
/ext/rxu/topicactions/
Before cron job. Log for scheduling and canceling the scheduling.
I got it but that is again not something that can be done in 1-2 steps. it requires adding dependency injections here and there, additional language entries and changing code in several extension files and so on.
okay got you thanks!
Thank you, how can i use add_log() to add moderator log? Please give me an example.
Thank you very much. Now im on the phone. I will test those codes and let you know if it works.
i put this code:
Код: Выделить всё
add_log('mod', 0, 0, 'LOG_DETECT', 'test', 'test');
add_log()
deletedWrong place
Код: Выделить всё
'NO_TIME_SET' => 'Action was not planned.',
Код: Выделить всё
'LOG_TOPIC_ACTIONS' => '<strong>Action planned with topic</strong> » %s',
'LOG_TOPIC_ACTIONS_CANCEL' => '<strong>Action canceled with topic</strong> » %s',
Код: Выделить всё
protected $manager;
Код: Выделить всё
protected $phpbb_log;
/** @var \phpbb\log */
Код: Выделить всё
public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\template\template $template, \phpbb\user $user, \rxu\topicactions\functions\manager $manager)
manager $manager
, \phpbb\log\log $phpbb_log
Код: Выделить всё
return $sql_ary;
Код: Выделить всё
$sql = 'SELECT topic_title
FROM ' . TOPICS_TABLE . '
WHERE topic_id = ' . (int) $topic_id;
$result = $this->db->sql_query($sql);
$topic_title = $this->db->sql_fetchfield('topic_title');
$this->db->sql_freeresult($result);
$data_ary = array(
'topic_id' => $topic_id,
'topic_title' => $topic_title
);
$this->log->add('mod', $this->user->data['user_id'], $this->user->data['session_ip'], ($time > 0) ? 'LOG_TOPIC_ACTIONS' : 'LOG_TOPIC_ACTIONS_CANCEL', time(), $data_ary);
Код: Выделить всё
'core.modify_quickmod_options' => 'action_type',
Код: Выделить всё
'core.user_setup' => 'load_language_on_setup',
Код: Выделить всё
public function topic_action($event)
Код: Выделить всё
public function load_language_on_setup($event)
{
$lang_set_ext = $event['lang_set_ext'];
$lang_set_ext[] = array(
'ext_name' => 'rxu/topicactions',
'lang_set' => 'topic_actions',
);
$event['lang_set_ext'] = $lang_set_ext;
}
Код: Выделить всё
- '@rxu.topicactions.manager'
Код: Выделить всё
- '@log'
thank you very much for the tutorial, but it didn't work for me.
@Sheer