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

poll_option.php

Zuletzt modifiziert: 02.04.2025, 15:02 - Dateigröße: 1.30 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\textreparser\plugins;
15   
16  class poll_option extends \phpbb\textreparser\row_based_plugin
17  {
18      /**
19      * {@inheritdoc}
20      */
21      public function get_columns()
22      {
23          return [
24              'id'   => 'topic_id',
25              'text' => 'poll_option_text',
26          ];
27      }
28   
29      /**
30      * {@inheritdoc}
31      */
32      protected function get_records_by_range_query($min_id, $max_id)
33      {
34          $sql = 'SELECT o.topic_id, o.poll_option_id, o.poll_option_text AS text, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, p.bbcode_uid
35              FROM ' . POLL_OPTIONS_TABLE . ' o, ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . ' p
36              WHERE o.topic_id BETWEEN ' . $min_id . ' AND ' . $max_id .'
37                  AND t.topic_id = o.topic_id
38                  AND p.post_id = t.topic_first_post_id';
39   
40          return $sql;
41      }
42   
43      /**
44      * {@inheritdoc}
45      */
46      protected function save_record(array $record)
47      {
48          $sql = 'UPDATE ' . POLL_OPTIONS_TABLE . "
49              SET poll_option_text = '" . $this->db->sql_escape($record['text']) . "'
50              WHERE topic_id = " . $record['topic_id'] . '
51                  AND poll_option_id = ' . $record['poll_option_id'];
52          $this->db->sql_query($sql);
53      }
54  }
55