Verzeichnisstruktur phpBB-3.3.15


Veröffentlicht
28.08.2024

So funktioniert es


Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück

Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

notifications.php

Zuletzt modifiziert: 02.04.2025, 15:03 - Dateigröße: 2.83 KiB


001  <?php
002  /**
003  *
004  * This file is part of the phpBB Forum Software package.
005  *
006  * @copyright (c) phpBB Limited <https://www.phpbb.com>
007  * @license GNU General Public License, version 2 (GPL-2.0)
008  *
009  * For full copyright and license information, please see
010  * the docs/CREDITS.txt file.
011  *
012  */
013   
014  namespace phpbb\db\migration\data\v310;
015   
016  class notifications extends \phpbb\db\migration\migration
017  {
018      public function effectively_installed()
019      {
020          return $this->db_tools->sql_table_exists($this->table_prefix . 'notifications');
021      }
022   
023      static public function depends_on()
024      {
025          return array('\phpbb\db\migration\data\v310\dev');
026      }
027   
028      public function update_schema()
029      {
030          return array(
031              'add_tables'        => array(
032                  $this->table_prefix . 'notification_types'    => array(
033                      'COLUMNS'            => array(
034                          'notification_type'            => array('VCHAR:255', ''),
035                          'notification_type_enabled'    => array('BOOL', 1),
036                      ),
037                      'PRIMARY_KEY'        => array('notification_type', 'notification_type_enabled'),
038                  ),
039                  $this->table_prefix . 'notifications'        => array(
040                      'COLUMNS'            => array(
041                          'notification_id'                  => array('UINT', null, 'auto_increment'),
042                          'item_type'                           => array('VCHAR:255', ''),
043                          'item_id'                          => array('UINT', 0),
044                          'item_parent_id'                   => array('UINT', 0),
045                          'user_id'                        => array('UINT', 0),
046                          'notification_read'                => array('BOOL', 0),
047                          'notification_time'                => array('TIMESTAMP', 1),
048                          'notification_data'                   => array('TEXT_UNI', ''),
049                      ),
050                      'PRIMARY_KEY'        => 'notification_id',
051                      'KEYS'                => array(
052                          'item_ident'        => array('INDEX', array('item_type', 'item_id')),
053                          'user'                => array('INDEX', array('user_id', 'notification_read')),
054                      ),
055                  ),
056                  $this->table_prefix . 'user_notifications'    => array(
057                      'COLUMNS'            => array(
058                          'item_type'            => array('VCHAR:255', ''),
059                          'item_id'            => array('UINT', 0),
060                          'user_id'            => array('UINT', 0),
061                          'method'            => array('VCHAR:255', ''),
062                          'notify'            => array('BOOL', 1),
063                      ),
064                  ),
065              ),
066          );
067      }
068   
069      public function revert_schema()
070      {
071          return array(
072              'drop_tables'    => array(
073                  $this->table_prefix . 'notification_types',
074                  $this->table_prefix . 'notifications',
075                  $this->table_prefix . 'user_notifications',
076              ),
077          );
078      }
079   
080      public function update_data()
081      {
082          return array(
083              array('module.add', array(
084                  'ucp',
085                  'UCP_MAIN',
086                  array(
087                      'module_basename'    => 'ucp_notifications',
088                      'module_langname'    => 'UCP_NOTIFICATION_LIST',
089                      'module_mode'        => 'notification_list',
090                      'module_auth'        => 'cfg_allow_board_notifications',
091                  ),
092              )),
093              array('module.add', array(
094                  'ucp',
095                  'UCP_PREFS',
096                  array(
097                      'module_basename'    => 'ucp_notifications',
098                      'module_langname'    => 'UCP_NOTIFICATION_OPTIONS',
099                      'module_mode'        => 'notification_options',
100                  ),
101              )),
102              array('config.add', array('load_notifications', 1)),
103          );
104      }
105  }
106