mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 05:50:42 +02:00
acp module for submitting statistical information to phpBB
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9698 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -39,7 +39,7 @@ class acp_ranks
|
||||
$this->tpl_name = 'acp_ranks';
|
||||
$this->page_title = 'ACP_MANAGE_RANKS';
|
||||
|
||||
$form_name = 'acp_prune';
|
||||
$form_name = 'acp_ranks';
|
||||
add_form_key($form_name);
|
||||
|
||||
switch ($action)
|
||||
|
93
phpBB/includes/acp/acp_send_statistics.php
Normal file
93
phpBB/includes/acp/acp_send_statistics.php
Normal file
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @package acp
|
||||
* @version $Id: acp_ranks.php 8479 2008-03-29 00:22:48Z naderman $
|
||||
* @copyright (c) 2005 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
include($phpbb_root_path . 'includes/questionnaire/questionnaire_phpbb.' . $phpEx);
|
||||
|
||||
|
||||
/**
|
||||
* @package acp
|
||||
*/
|
||||
class acp_send_statistics
|
||||
{
|
||||
var $u_action;
|
||||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $config, $template;
|
||||
|
||||
$collect_url = "http://www.phpbb.com/stats/getstatdata.php";
|
||||
|
||||
$this->tpl_name = 'acp_send_statistics';
|
||||
$this->page_title = 'ACP_SEND_STATISTICS';
|
||||
|
||||
$c = new Questionnaire_Data_Collector();
|
||||
$c->addDataProvider(new Questionnaire_PHP_Data_Provider());
|
||||
$c->addDataProvider(new Questionnaire_System_Data_Provider());
|
||||
$c->addDataProvider(new questionnaire_phpbb_data_provider($config));
|
||||
|
||||
$template->assign_vars(array(
|
||||
'U_COLLECT_STATS' => $collect_url,
|
||||
'RAW_DATA' => $c->getDataForForm(),
|
||||
));
|
||||
|
||||
$raw = $c->getDataRaw();
|
||||
|
||||
foreach ($raw as $provider => $data)
|
||||
{
|
||||
$template->assign_block_vars('providers', array(
|
||||
'NAME' => htmlentities($provider),
|
||||
));
|
||||
|
||||
foreach ($data as $key => $value)
|
||||
{
|
||||
if (is_array($value))
|
||||
{
|
||||
$value = utf8_wordwrap(serialize($value), 75, "\n", true);
|
||||
}
|
||||
|
||||
$template->assign_block_vars('providers.values', array(
|
||||
'KEY' => htmlentities($key),
|
||||
'VALUE' => htmlentities($value),
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Output the data as an HTML Definition List.
|
||||
*
|
||||
* @param mixed
|
||||
* @param string
|
||||
* @param string
|
||||
* @return void
|
||||
*/
|
||||
function data_printer($value, $key)
|
||||
{
|
||||
echo '<dt>', htmlentities($key), '</dt>', $ident, "\t", '<dd>';
|
||||
if (is_array($value))
|
||||
{
|
||||
$value = htmlentities(serialize($value));
|
||||
echo '<dl>';
|
||||
echo '</dl>';
|
||||
} else {
|
||||
echo htmlentities($value);
|
||||
}
|
||||
echo '</dd>';
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
37
phpBB/includes/acp/info/acp_send_statistics.php
Normal file
37
phpBB/includes/acp/info/acp_send_statistics.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @package acp
|
||||
* @version $Id$
|
||||
* @copyright (c) 2005 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @package module_install
|
||||
*/
|
||||
class acp_send_statistics_info
|
||||
{
|
||||
function module()
|
||||
{
|
||||
return array(
|
||||
'filename' => 'acp_send_statistics',
|
||||
'title' => 'ACP_SEND_STATISTICS',
|
||||
'version' => '1.0.0',
|
||||
'modes' => array(
|
||||
'questionnaire' => array('title' => 'ACP_SEND_STATISTICS', 'auth' => 'acl_a_server', 'cat' => array('ACP_SERVER_CONFIGURATION')),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
function install()
|
||||
{
|
||||
}
|
||||
|
||||
function uninstall()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
Reference in New Issue
Block a user