6 * @copyright (c) 2005 phpBB Group
7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
14 if (!defined('IN_PHPBB'))
19 include($phpbb_root_path . 'includes/questionnaire/questionnaire.' . $phpEx);
24 class acp_send_statistics
28 function main($id, $mode)
30 global $config, $template, $phpbb_admin_path, $phpEx;
32 $collect_url = "http://www.phpbb.com/stats/receive_stats.php";
34 $this->tpl_name = 'acp_send_statistics';
35 $this->page_title = 'ACP_SEND_STATISTICS';
37 // generate a unique id if necessary
38 if (!isset($config['questionnaire_unique_id']))
40 $install_id = unique_id();
41 set_config('questionnaire_unique_id', $install_id);
45 $install_id = $config['questionnaire_unique_id'];
48 $collector = new phpbb_questionnaire_data_collector($install_id);
51 $collector->add_data_provider(new phpbb_questionnaire_php_data_provider());
52 $collector->add_data_provider(new phpbb_questionnaire_system_data_provider());
53 $collector->add_data_provider(new phpbb_questionnaire_phpbb_data_provider($config));
55 $template->assign_vars(array(
56 'U_COLLECT_STATS' => $collect_url,
57 'RAW_DATA' => $collector->get_data_for_form(),
58 'U_ACP_MAIN' => append_sid("{$phpbb_admin_path}index.$phpEx"),
61 $raw = $collector->get_data_raw();
63 foreach ($raw as $provider => $data)
65 if ($provider == 'install_id')
67 $data = array($provider => $data);
70 $template->assign_block_vars('providers', array(
71 'NAME' => htmlspecialchars($provider),
74 foreach ($data as $key => $value)
78 $value = utf8_wordwrap(serialize($value), 75, "\n", true);
81 $template->assign_block_vars('providers.values', array(
82 'KEY' => utf8_htmlspecialchars($key),
83 'VALUE' => utf8_htmlspecialchars($value),