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

acp_help_phpbb.php

Zuletzt modifiziert: 02.04.2025, 15:02 - Dateigröße: 3.88 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  /**
015  * @ignore
016  */
017  if (!defined('IN_PHPBB'))
018  {
019      exit;
020  }
021   
022  class acp_help_phpbb
023  {
024      var $u_action;
025   
026      function main($id, $mode)
027      {
028          global $config, $request, $template, $user, $phpbb_dispatcher, $phpbb_admin_path, $phpbb_root_path, $phpEx;
029   
030          if (!class_exists('phpbb_questionnaire_data_collector'))
031          {
032              include($phpbb_root_path . 'includes/questionnaire/questionnaire.' . $phpEx);
033          }
034   
035          $collect_url = "https://www.phpbb.com/statistics/send";
036   
037          $this->tpl_name = 'acp_help_phpbb';
038          $this->page_title = 'ACP_HELP_PHPBB';
039   
040          $submit = ($request->is_set_post('submit')) ? true : false;
041   
042          $form_key = 'acp_help_phpbb';
043          add_form_key($form_key);
044          $error = array();
045   
046          if ($submit && !check_form_key($form_key))
047          {
048              $error[] = $user->lang['FORM_INVALID'];
049          }
050          // Do not write values if there is an error
051          if (count($error))
052          {
053              $submit = false;
054          }
055   
056          // generate a unique id if necessary
057          if (!isset($config['questionnaire_unique_id']))
058          {
059              $install_id = unique_id();
060              $config->set('questionnaire_unique_id', $install_id);
061          }
062          else
063          {
064              $install_id = $config['questionnaire_unique_id'];
065          }
066   
067          $collector = new phpbb_questionnaire_data_collector($install_id);
068   
069          // Add data provider
070          $collector->add_data_provider(new phpbb_questionnaire_php_data_provider());
071          $collector->add_data_provider(new phpbb_questionnaire_system_data_provider());
072          $collector->add_data_provider(new phpbb_questionnaire_phpbb_data_provider($config));
073   
074          /**
075           * Event to modify ACP help phpBB page and/or listen to submit
076           *
077           * @event core.acp_help_phpbb_submit_before
078           * @var    boolean    submit            Do we display the form or process the submission
079           * @since 3.2.0-RC2
080           */
081          $vars = array('submit');
082          extract($phpbb_dispatcher->trigger_event('core.acp_help_phpbb_submit_before', compact($vars)));
083   
084          if ($submit)
085          {
086              $config->set('help_send_statistics', $request->variable('help_send_statistics', false));
087              $response = $request->variable('send_statistics_response', '');
088   
089              $config->set('help_send_statistics_time', time());
090   
091              if (!empty($response))
092              {
093                  $decoded_response = json_decode(html_entity_decode($response, ENT_COMPAT), true);
094   
095                  if ($decoded_response && isset($decoded_response['status']) && $decoded_response['status'] == 'ok')
096                  {
097                      trigger_error($user->lang('THANKS_SEND_STATISTICS') . adm_back_link($this->u_action));
098                  }
099                  else
100                  {
101                      trigger_error($user->lang('FAIL_SEND_STATISTICS') . adm_back_link($this->u_action), E_USER_WARNING);
102                  }
103              }
104   
105              trigger_error($user->lang('CONFIG_UPDATED') . adm_back_link($this->u_action));
106          }
107   
108          $template->assign_vars(array(
109              'U_COLLECT_STATS'        => $collect_url,
110              'S_COLLECT_STATS'        => (!empty($config['help_send_statistics'])) ? true : false,
111              'S_STATS'                => $collector->get_data_raw(),
112              'S_STATS_DATA'            => json_encode($collector->get_data_raw()),
113              'U_ACP_MAIN'            => append_sid("{$phpbb_admin_path}index.$phpEx"),
114              'U_ACTION'                => $this->u_action,
115              // Pass earliest time we should try to send stats again
116              'COLLECT_STATS_TIME'    => intval($config['help_send_statistics_time']) + 86400,
117          ));
118   
119          $raw = $collector->get_data_raw();
120   
121          foreach ($raw as $provider => $data)
122          {
123              if ($provider == 'install_id')
124              {
125                  $data = array($provider => $data);
126              }
127   
128              $template->assign_block_vars('providers', array(
129                  'NAME'    => htmlspecialchars($provider, ENT_COMPAT),
130              ));
131   
132              foreach ($data as $key => $value)
133              {
134                  if (is_array($value))
135                  {
136                      $value = utf8_wordwrap(serialize($value), 75, "\n", true);
137                  }
138   
139                  $template->assign_block_vars('providers.values', array(
140                      'KEY'    => utf8_htmlspecialchars($key),
141                      'VALUE'    => utf8_htmlspecialchars($value),
142                  ));
143              }
144          }
145      }
146  }
147