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

fix_user_styles.php

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


01  <?php
02  /**
03  *
04  * This file is part of the phpBB Forum Software package.
05  *
06  * @copyright (c) phpBB Limited <https://www.phpbb.com>
07  * @license GNU General Public License, version 2 (GPL-2.0)
08  *
09  * For full copyright and license information, please see
10  * the docs/CREDITS.txt file.
11  *
12  */
13   
14  namespace phpbb\db\migration\data\v32x;
15   
16  class fix_user_styles extends \phpbb\db\migration\migration
17  {
18   
19      static public function depends_on()
20      {
21          return array(
22              '\phpbb\db\migration\data\v320\v320',
23          );
24      }
25   
26      public function update_data()
27      {
28          return array(
29              array('custom', array(array($this, 'styles_fix'))),
30          );
31      }
32   
33      public function styles_fix()
34      {
35          $default_style = (int) $this->config['default_style'];
36          $enabled_styles = array();
37   
38          // Get enabled styles
39          $sql = 'SELECT style_id
40              FROM ' . STYLES_TABLE . '
41              WHERE style_active = 1';
42          $result = $this->db->sql_query($sql);
43          while ($row = $this->db->sql_fetchrow($result))
44          {
45              $enabled_styles[] = (int) $row['style_id'];
46          }
47          $this->db->sql_freeresult($result);
48   
49          // Set the default style to users who have an invalid style
50          $this->sql_query('UPDATE ' . USERS_TABLE . '
51              SET user_style = ' . (int) $default_style . '
52              WHERE ' . $this->db->sql_in_set('user_style', $enabled_styles, true));
53      }
54  }
55