Zeile 48 | Zeile 48 |
---|
$plugins->run_hooks("admin_tools_statistics_overall_begin");
// Do we have date range criteria?
|
$plugins->run_hooks("admin_tools_statistics_overall_begin");
// Do we have date range criteria?
|
if($mybb->input['from_year'])
| if($mybb->get_input('from_year'))
|
{ $start_dateline = mktime(0, 0, 0, $mybb->get_input('from_month', MyBB::INPUT_INT), $mybb->get_input('from_day', MyBB::INPUT_INT), $mybb->get_input('from_year', MyBB::INPUT_INT)); $end_dateline = mktime(23, 59, 59, $mybb->get_input('to_month', MyBB::INPUT_INT), $mybb->get_input('to_day', MyBB::INPUT_INT), $mybb->get_input('to_year', MyBB::INPUT_INT));
| { $start_dateline = mktime(0, 0, 0, $mybb->get_input('from_month', MyBB::INPUT_INT), $mybb->get_input('from_day', MyBB::INPUT_INT), $mybb->get_input('from_year', MyBB::INPUT_INT)); $end_dateline = mktime(23, 59, 59, $mybb->get_input('to_month', MyBB::INPUT_INT), $mybb->get_input('to_day', MyBB::INPUT_INT), $mybb->get_input('to_year', MyBB::INPUT_INT));
|
Zeile 56 | Zeile 56 |
---|
}
// Otherwise default to the last 30 days
|
}
// Otherwise default to the last 30 days
|
if(!$mybb->input['from_year'] || $start_dateline > TIME_NOW || $end_dateline > mktime(23, 59, 59))
| if(!$mybb->get_input('from_year') || $start_dateline > TIME_NOW || $end_dateline > mktime(23, 59, 59))
|
{ $start_dateline = TIME_NOW-(60*60*24*30); $end_dateline = TIME_NOW;
| { $start_dateline = TIME_NOW-(60*60*24*30); $end_dateline = TIME_NOW;
|
Zeile 69 | Zeile 69 |
---|
$last_dateline = 0;
|
$last_dateline = 0;
|
if($mybb->input['page'] && $mybb->input['page'] > 1)
| $mybb->input['page'] = $mybb->get_input('page', MyBB::INPUT_INT); if($mybb->input['page'] > 1)
|
{
|
{
|
$mybb->input['page'] = $mybb->get_input('page', MyBB::INPUT_INT);
| |
$start = ($mybb->input['page']*$per_page)-$per_page; } else
| $start = ($mybb->input['page']*$per_page)-$per_page; } else
|
Zeile 90 | Zeile 90 |
---|
$stat['change_users'] = ($stat['numusers'] - $stats[$last_dateline]['numusers']); $stat['change_threads'] = ($stat['numthreads'] - $stats[$last_dateline]['numthreads']); $stat['change_posts'] = ($stat['numposts'] - $stats[$last_dateline]['numposts']);
|
$stat['change_users'] = ($stat['numusers'] - $stats[$last_dateline]['numusers']); $stat['change_threads'] = ($stat['numthreads'] - $stats[$last_dateline]['numthreads']); $stat['change_posts'] = ($stat['numposts'] - $stats[$last_dateline]['numposts']);
|
| } else { $stat['change_users'] = 0; $stat['change_threads'] = 0; $stat['change_posts'] = 0;
|
}
$stats[$stat['dateline']] = $stat;
|
}
$stats[$stat['dateline']] = $stat;
|
|
|
$last_dateline = $stat['dateline'];
|
$last_dateline = $stat['dateline'];
|
}
| }
|
if(empty($stats)) { flash_message($lang->error_no_results_found_for_criteria, 'error'); }
|
if(empty($stats)) { flash_message($lang->error_no_results_found_for_criteria, 'error'); }
|
krsort($stats, SORT_NUMERIC);
| krsort($stats, SORT_NUMERIC);
|
$page->add_breadcrumb_item($lang->overall_statistics, "index.php?module=tools-statistics");
$page->output_header($lang->statistics." - ".$lang->overall_statistics);
|
$page->add_breadcrumb_item($lang->overall_statistics, "index.php?module=tools-statistics");
$page->output_header($lang->statistics." - ".$lang->overall_statistics);
|
|
|
$page->output_nav_tabs($sub_tabs, 'overall_statistics');
// Date range fields
| $page->output_nav_tabs($sub_tabs, 'overall_statistics');
// Date range fields
|
Zeile 118 | Zeile 124 |
---|
echo " ".$form->generate_submit_button($lang->view); echo "</fieldset>\n"; $form->end();
|
echo " ".$form->generate_submit_button($lang->view); echo "</fieldset>\n"; $form->end();
|
|
|
if(!empty($stats)) { echo "<fieldset><legend>{$lang->users}</legend>\n"; echo "<img src=\"index.php?module=tools-statistics&action=do_graph&type=users{$range}\" />\n";
|
if(!empty($stats)) { echo "<fieldset><legend>{$lang->users}</legend>\n"; echo "<img src=\"index.php?module=tools-statistics&action=do_graph&type=users{$range}\" />\n";
|
echo "</fieldset>\n";
| echo "</fieldset>\n";
|
echo "<fieldset><legend>{$lang->threads}</legend>\n"; echo "<img src=\"index.php?module=tools-statistics&action=do_graph&type=threads{$range}\" />\n"; echo "</fieldset>\n";
| echo "<fieldset><legend>{$lang->threads}</legend>\n"; echo "<img src=\"index.php?module=tools-statistics&action=do_graph&type=threads{$range}\" />\n"; echo "</fieldset>\n";
|
Zeile 190 | Zeile 196 |
---|
elseif($number == 0) { $growth_string = "(<img src=\"./styles/{$cp_style}/images/icons/no_change.png\" alt=\"{$lang->no_change}\" title=\"{$lang->no_change}\" style=\"vertical-align: middle; margin-top: -2px;\" /> {$friendly_number})";
|
elseif($number == 0) { $growth_string = "(<img src=\"./styles/{$cp_style}/images/icons/no_change.png\" alt=\"{$lang->no_change}\" title=\"{$lang->no_change}\" style=\"vertical-align: middle; margin-top: -2px;\" /> {$friendly_number})";
|
} else {
| } else {
|
$growth_string = "(<img src=\"./styles/{$cp_style}/images/icons/decrease.png\" alt=\"{$lang->decrease}\" title=\"{$lang->decrease}\" style=\"vertical-align: middle; margin-top: -2px;\" /> {$friendly_number})"; }
|
$growth_string = "(<img src=\"./styles/{$cp_style}/images/icons/decrease.png\" alt=\"{$lang->decrease}\" title=\"{$lang->decrease}\" style=\"vertical-align: middle; margin-top: -2px;\" /> {$friendly_number})"; }
|
|
|
return $growth_string; }
| return $growth_string; }
|
Zeile 209 | Zeile 215 |
---|
// Do we have date range criteria? if($range['end'] || $range['start'])
|
// Do we have date range criteria? if($range['end'] || $range['start'])
|
{
| {
|
$start = (int)$range['start']; $end = (int)$range['end'];
|
$start = (int)$range['start']; $end = (int)$range['end'];
|
}
| }
|
// Otherwise default to the last 30 days else { $start = TIME_NOW-(60*60*24*30); $end = TIME_NOW;
|
// Otherwise default to the last 30 days else { $start = TIME_NOW-(60*60*24*30); $end = TIME_NOW;
|
}
| }
|
$allowed_types = array('users', 'threads', 'posts'); if(!in_array($type, $allowed_types)) { die; }
|
$allowed_types = array('users', 'threads', 'posts'); if(!in_array($type, $allowed_types)) { die; }
|
require_once MYBB_ROOT.'inc/class_graph.php';
| require_once MYBB_ROOT.'inc/class_graph.php';
if(!Graph::can_use()) { die; }
|
$points = $stats = $datelines = array(); if($start == 0)
| $points = $stats = $datelines = array(); if($start == 0)
|