Verzeichnisstruktur phpBB-3.2.0
- Veröffentlicht
- 06.01.2017
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. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
avatar_types.php
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\v310;
15
16 class avatar_types extends \phpbb\db\migration\migration
17 {
18 /**
19 * @var avatar type map
20 */
21 protected $avatar_type_map = array(
22 AVATAR_UPLOAD => 'avatar.driver.upload',
23 AVATAR_REMOTE => 'avatar.driver.remote',
24 AVATAR_GALLERY => 'avatar.driver.local',
25 );
26
27 static public function depends_on()
28 {
29 return array(
30 '\phpbb\db\migration\data\v310\dev',
31 '\phpbb\db\migration\data\v310\avatars',
32 );
33 }
34
35 public function update_data()
36 {
37 return array(
38 array('custom', array(array($this, 'update_user_avatar_type'))),
39 array('custom', array(array($this, 'update_group_avatar_type'))),
40 );
41 }
42
43 public function update_user_avatar_type()
44 {
45 foreach ($this->avatar_type_map as $old => $new)
46 {
47 $sql = 'UPDATE ' . $this->table_prefix . "users
48 SET user_avatar_type = '$new'
49 WHERE user_avatar_type = '$old'";
50 $this->db->sql_query($sql);
51 }
52 }
53
54 public function update_group_avatar_type()
55 {
56 foreach ($this->avatar_type_map as $old => $new)
57 {
58 $sql = 'UPDATE ' . $this->table_prefix . "groups
59 SET group_avatar_type = '$new'
60 WHERE group_avatar_type = '$old'";
61 $this->db->sql_query($sql);
62 }
63 }
64 }
65