Update modules code with small fixes and improvements

This commit is contained in:
Marc Alexander
2023-02-13 20:24:54 +01:00
parent ccd7e27410
commit 46a9e89db2
17 changed files with 64 additions and 59 deletions

View File

@@ -115,18 +115,18 @@ class attachments extends module_base
*/
public function get_template_acp($module_id)
{
return array(
return [
'title' => 'ACP_PORTAL_ATTACHMENTS_NUMBER_SETTINGS',
'vars' => array(
'vars' => [
'legend1' => 'ACP_PORTAL_ATTACHMENTS_NUMBER_SETTINGS',
'board3_attachments_number_' . $module_id => array('lang' => 'PORTAL_ATTACHMENTS_NUMBER' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
'board3_attach_max_length_' . $module_id => array('lang' => 'PORTAL_ATTACHMENTS_MAX_LENGTH' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
'board3_attachments_forum_ids_' . $module_id => array('lang' => 'PORTAL_ATTACHMENTS_FORUM_IDS', 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => array('board3.portal.modules_helper', 'generate_forum_select'), 'submit' => array('board3.portal.modules_helper', 'store_selected_forums')),
'board3_attachments_forum_exclude_' . $module_id => array('lang' => 'PORTAL_ATTACHMENTS_FORUM_EXCLUDE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'board3_attachments_filetype_' . $module_id => array('lang' => 'PORTAL_ATTACHMENTS_FILETYPE', 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => 'select_filetype', 'submit' => 'store_filetypes'),
'board3_attachments_exclude_' . $module_id => array('lang' => 'PORTAL_ATTACHMENTS_EXCLUDE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
),
);
'board3_attachments_number_' . $module_id => ['lang' => 'PORTAL_ATTACHMENTS_NUMBER' , 'validate' => 'int', 'type' => 'number:0:999', 'explain' => true],
'board3_attach_max_length_' . $module_id => ['lang' => 'PORTAL_ATTACHMENTS_MAX_LENGTH', 'validate' => 'int', 'type' => 'number:0:999', 'explain' => true],
'board3_attachments_forum_ids_' . $module_id => ['lang' => 'PORTAL_ATTACHMENTS_FORUM_IDS', 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => ['board3.portal.modules_helper', 'generate_forum_select'], 'submit' => ['board3.portal.modules_helper', 'store_selected_forums']],
'board3_attachments_forum_exclude_' . $module_id => ['lang' => 'PORTAL_ATTACHMENTS_FORUM_EXCLUDE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true],
'board3_attachments_filetype_' . $module_id => ['lang' => 'PORTAL_ATTACHMENTS_FILETYPE', 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => 'select_filetype', 'submit' => 'store_filetypes'],
'board3_attachments_exclude_' . $module_id => ['lang' => 'PORTAL_ATTACHMENTS_EXCLUDE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true],
],
];
}
/**
@@ -279,7 +279,7 @@ class attachments extends module_base
WHERE
a.topic_id <> 0
AND a.topic_id = t.topic_id
' . $where . '
' . $this->db->sql_escape($where) . '
ORDER BY
filetime ' . ((!$this->config['display_order']) ? 'DESC' : 'ASC') . ', post_msg_id ASC';
$result = $this->db->sql_query_limit($sql, $this->config['board3_attachments_number_' . $module_id], 0, 600);