PDF rausgenommen

This commit is contained in:
aschwarz
2023-01-23 11:03:31 +01:00
parent 82d562a322
commit a6523903eb
28078 changed files with 4247552 additions and 2 deletions

View File

@ -0,0 +1,69 @@
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
namespace phpbb\textreparser\plugins;
class contact_admin_info extends \phpbb\textreparser\base
{
/**
* @var \phpbb\config\db_text
*/
protected $config_text;
/**
* Constructor
*
* @param \phpbb\config\db_text $config_text
*/
public function __construct(\phpbb\config\db_text $config_text)
{
$this->config_text = $config_text;
}
/**
* {@inheritdoc}
*/
public function get_max_id()
{
return 1;
}
/**
* {@inheritdoc}
*/
protected function get_records_by_range($min_id, $max_id)
{
$values = $this->config_text->get_array(array(
'contact_admin_info',
'contact_admin_info_uid',
'contact_admin_info_flags',
));
return array(array(
'id' => 1,
'text' => $values['contact_admin_info'],
'bbcode_uid' => $values['contact_admin_info_uid'],
'enable_bbcode' => $values['contact_admin_info_flags'] & OPTION_FLAG_BBCODE,
'enable_magic_url' => $values['contact_admin_info_flags'] & OPTION_FLAG_LINKS,
'enable_smilies' => $values['contact_admin_info_flags'] & OPTION_FLAG_SMILIES,
));
}
/**
* {@inheritdoc}
*/
protected function save_record(array $record)
{
$this->config_text->set('contact_admin_info', $record['text']);
}
}

View File

@ -0,0 +1,30 @@
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
namespace phpbb\textreparser\plugins;
class forum_description extends \phpbb\textreparser\row_based_plugin
{
/**
* {@inheritdoc}
*/
public function get_columns()
{
return array(
'id' => 'forum_id',
'text' => 'forum_desc',
'bbcode_uid' => 'forum_desc_uid',
'options' => 'forum_desc_options',
);
}
}

View File

@ -0,0 +1,30 @@
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
namespace phpbb\textreparser\plugins;
class forum_rules extends \phpbb\textreparser\row_based_plugin
{
/**
* {@inheritdoc}
*/
public function get_columns()
{
return array(
'id' => 'forum_id',
'text' => 'forum_rules',
'bbcode_uid' => 'forum_rules_uid',
'options' => 'forum_rules_options',
);
}
}

View File

@ -0,0 +1,30 @@
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
namespace phpbb\textreparser\plugins;
class group_description extends \phpbb\textreparser\row_based_plugin
{
/**
* {@inheritdoc}
*/
public function get_columns()
{
return array(
'id' => 'group_id',
'text' => 'group_desc',
'bbcode_uid' => 'group_desc_uid',
'options' => 'group_desc_options',
);
}
}

View File

@ -0,0 +1,32 @@
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
namespace phpbb\textreparser\plugins;
class pm_text extends \phpbb\textreparser\row_based_plugin
{
/**
* {@inheritdoc}
*/
public function get_columns()
{
return array(
'id' => 'msg_id',
'enable_bbcode' => 'enable_bbcode',
'enable_smilies' => 'enable_smilies',
'enable_magic_url' => 'enable_magic_url',
'text' => 'message_text',
'bbcode_uid' => 'bbcode_uid',
);
}
}

View File

@ -0,0 +1,74 @@
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
namespace phpbb\textreparser\plugins;
class poll_option extends \phpbb\textreparser\base
{
/**
* @var \phpbb\db\driver\driver_interface
*/
protected $db;
/**
* Constructor
*
* @param \phpbb\db\driver\driver_interface $db Database connection
*/
public function __construct(\phpbb\db\driver\driver_interface $db)
{
$this->db = $db;
}
/**
* {@inheritdoc}
*/
public function get_max_id()
{
$sql = 'SELECT MAX(topic_id) AS max_id FROM ' . POLL_OPTIONS_TABLE;
$result = $this->db->sql_query($sql);
$max_id = (int) $this->db->sql_fetchfield('max_id');
$this->db->sql_freeresult($result);
return $max_id;
}
/**
* {@inheritdoc}
*/
protected function get_records_by_range($min_id, $max_id)
{
$sql = 'SELECT o.topic_id, o.poll_option_id, o.poll_option_text AS text, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, p.bbcode_uid
FROM ' . POLL_OPTIONS_TABLE . ' o, ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . ' p
WHERE o.topic_id BETWEEN ' . $min_id . ' AND ' . $max_id .'
AND t.topic_id = o.topic_id
AND p.post_id = t.topic_first_post_id';
$result = $this->db->sql_query($sql);
$records = $this->db->sql_fetchrowset($result);
$this->db->sql_freeresult($result);
return $records;
}
/**
* {@inheritdoc}
*/
protected function save_record(array $record)
{
$sql = 'UPDATE ' . POLL_OPTIONS_TABLE . "
SET poll_option_text = '" . $this->db->sql_escape($record['text']) . "'
WHERE topic_id = " . $record['topic_id'] . '
AND poll_option_id = ' . $record['poll_option_id'];
$this->db->sql_query($sql);
}
}

View File

@ -0,0 +1,42 @@
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
namespace phpbb\textreparser\plugins;
class poll_title extends \phpbb\textreparser\row_based_plugin
{
/**
* {@inheritdoc}
*/
public function get_columns()
{
return array(
'id' => 'topic_id',
'text' => 'poll_title',
);
}
/**
* {@inheritdoc}
*/
protected function get_records_by_range_query($min_id, $max_id)
{
$sql = 'SELECT t.topic_id AS id, t.poll_title AS text, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, p.bbcode_uid
FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . ' p
WHERE t.topic_id BETWEEN ' . $min_id . ' AND ' . $max_id .'
AND t.poll_start > 0
AND p.post_id = t.topic_first_post_id';
return $sql;
}
}

View File

@ -0,0 +1,32 @@
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
namespace phpbb\textreparser\plugins;
class post_text extends \phpbb\textreparser\row_based_plugin
{
/**
* {@inheritdoc}
*/
public function get_columns()
{
return array(
'id' => 'post_id',
'enable_bbcode' => 'enable_bbcode',
'enable_smilies' => 'enable_smilies',
'enable_magic_url' => 'enable_magic_url',
'text' => 'post_text',
'bbcode_uid' => 'bbcode_uid',
);
}
}

View File

@ -0,0 +1,65 @@
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
namespace phpbb\textreparser\plugins;
class user_signature extends \phpbb\textreparser\row_based_plugin
{
/**
* @var array Bit numbers used for user options
* @see \phpbb\user
*/
protected $keyoptions;
/**
* {@inheritdoc}
*/
protected function add_missing_fields(array $row)
{
if (!isset($this->keyoptions))
{
$this->save_keyoptions();
}
$options = $row['user_options'];
$row += array(
'enable_bbcode' => phpbb_optionget($this->keyoptions['sig_bbcode'], $options),
'enable_smilies' => phpbb_optionget($this->keyoptions['sig_smilies'], $options),
'enable_magic_url' => phpbb_optionget($this->keyoptions['sig_links'], $options),
);
return parent::add_missing_fields($row);
}
/**
* {@inheritdoc}
*/
public function get_columns()
{
return array(
'id' => 'user_id',
'text' => 'user_sig',
'bbcode_uid' => 'user_sig_bbcode_uid',
'user_options' => 'user_options',
);
}
/**
* Save the keyoptions var from \phpbb\user
*/
protected function save_keyoptions()
{
$class_vars = get_class_vars('phpbb\\user');
$this->keyoptions = $class_vars['keyoptions'];
}
}