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.
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: 09.10.2024, 12:52 - Dateigröße: 3.72 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/stats/receive_stats.php";
 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 (sizeof($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                  if ((strpos($response, 'Thank you') !== false || strpos($response, 'Flood protection') !== false))
 094                  {
 095                      trigger_error($user->lang('THANKS_SEND_STATISTICS') . adm_back_link($this->u_action));
 096                  }
 097                  else
 098                  {
 099                      trigger_error($user->lang('FAIL_SEND_STATISTICS') . adm_back_link($this->u_action));
 100                  }
 101              }
 102   
 103              trigger_error($user->lang('CONFIG_UPDATED') . adm_back_link($this->u_action));
 104          }
 105   
 106          $template->assign_vars(array(
 107              'U_COLLECT_STATS'        => $collect_url,
 108              'S_COLLECT_STATS'        => (!empty($config['help_send_statistics'])) ? true : false,
 109              'RAW_DATA'                => $collector->get_data_for_form(),
 110              'U_ACP_MAIN'            => append_sid("{$phpbb_admin_path}index.$phpEx"),
 111              'U_ACTION'                => $this->u_action,
 112              // Pass earliest time we should try to send stats again
 113              'COLLECT_STATS_TIME'    => intval($config['help_send_statistics_time']) + 86400,
 114          ));
 115   
 116          $raw = $collector->get_data_raw();
 117   
 118          foreach ($raw as $provider => $data)
 119          {
 120              if ($provider == 'install_id')
 121              {
 122                  $data = array($provider => $data);
 123              }
 124   
 125              $template->assign_block_vars('providers', array(
 126                  'NAME'    => htmlspecialchars($provider),
 127              ));
 128   
 129              foreach ($data as $key => $value)
 130              {
 131                  if (is_array($value))
 132                  {
 133                      $value = utf8_wordwrap(serialize($value), 75, "\n", true);
 134                  }
 135   
 136                  $template->assign_block_vars('providers.values', array(
 137                      'KEY'    => utf8_htmlspecialchars($key),
 138                      'VALUE'    => utf8_htmlspecialchars($value),
 139                  ));
 140              }
 141          }
 142      }
 143  }
 144