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

update_custom_bbcodes_with_idn.php

Zuletzt modifiziert: 02.04.2025, 15:03 - Dateigröße: 1.71 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\v31x;
15   
16  class update_custom_bbcodes_with_idn extends \phpbb\db\migration\migration
17  {
18      static public function depends_on()
19      {
20          return array(
21              '\phpbb\db\migration\data\v31x\v312',
22          );
23      }
24   
25      public function update_data()
26      {
27          return array(
28              array('custom', array(array($this, 'update_bbcodes_table'))),
29          );
30      }
31   
32      public function update_bbcodes_table()
33      {
34          if (!class_exists('acp_bbcodes'))
35          {
36              include($this->phpbb_root_path . 'includes/acp/acp_bbcodes.' . $this->php_ext);
37          }
38   
39          $bbcodes = new \acp_bbcodes();
40   
41          $sql = 'SELECT bbcode_id, bbcode_match, bbcode_tpl
42              FROM ' . BBCODES_TABLE;
43          $result = $this->sql_query($sql);
44   
45          $sql_ary = array();
46          while ($row = $this->db->sql_fetchrow($result))
47          {
48              if (preg_match('/(URL|LOCAL_URL|RELATIVE_URL)/', $row['bbcode_match']))
49              {
50                  $data = $bbcodes->build_regexp($row['bbcode_match'], $row['bbcode_tpl']);
51                  $sql_ary[$row['bbcode_id']] = array(
52                      'first_pass_match'            => $data['first_pass_match'],
53                      'first_pass_replace'        => $data['first_pass_replace'],
54                      'second_pass_match'            => $data['second_pass_match'],
55                      'second_pass_replace'        => $data['second_pass_replace']
56                  );
57              }
58          }
59          $this->db->sql_freeresult($result);
60   
61          foreach ($sql_ary as $bbcode_id => $bbcode_data)
62          {
63              $sql = 'UPDATE ' . BBCODES_TABLE . '
64                  SET ' . $this->db->sql_build_array('UPDATE', $bbcode_data) . '
65                  WHERE bbcode_id = ' . (int) $bbcode_id;
66              $this->sql_query($sql);
67          }
68      }
69  }
70