import v1.1.0_beta1 | 2009-08-21
This commit is contained in:
@ -9,7 +9,7 @@
|
||||
* @packager Keyboard Monkeys
|
||||
*/
|
||||
|
||||
class Stats_AuthorizationsController extends Monkeys_Controller_Action
|
||||
class Stats_AuthorizationsController extends CommunityID_Controller_Action
|
||||
{
|
||||
public function indexAction()
|
||||
{
|
||||
@ -71,13 +71,13 @@ class Stats_AuthorizationsController extends Monkeys_Controller_Action
|
||||
|
||||
private function _populateWeekData(&$labelsy, &$datay)
|
||||
{
|
||||
$stats = new Stats();
|
||||
$stats = new Stats_Model_Stats();
|
||||
$authorizations = $stats->getNumAuthorizationsDays(strtotime('-1 week'), time());
|
||||
|
||||
for ($i = -7; $i < 0; $i++) {
|
||||
$time = strtotime("$i days");
|
||||
$date = date('Y-m-d', $time);
|
||||
$labelsy[] = Stats::$weekDays[date('w', $time)];
|
||||
$labelsy[] = Stats_Model_Stats::$weekDays[date('w', $time)];
|
||||
if (isset($authorizations[$date])) {
|
||||
$datay[] = $authorizations[$date]['entry'];
|
||||
} else {
|
||||
@ -88,14 +88,14 @@ class Stats_AuthorizationsController extends Monkeys_Controller_Action
|
||||
|
||||
private function _populateYearData(&$labelsy, &$datay)
|
||||
{
|
||||
$stats = new Stats();
|
||||
$stats = new Stats_Model_Stats();
|
||||
$firstDayOfMonth = date('Y-' . date('m') . '-01');
|
||||
$authorizations = $stats->getNumAuthorizationsYear(strtotime('-11 months', strtotime($firstDayOfMonth)), time());
|
||||
|
||||
for ($i = -11; $i <= 0; $i++) {
|
||||
$time = strtotime("$i months");
|
||||
$monthNumber = date('n', $time);
|
||||
$labelsy[] = Stats::$months[$monthNumber];
|
||||
$labelsy[] = Stats_Model_Stats::$months[$monthNumber];
|
||||
if (isset($authorizations[$monthNumber])) {
|
||||
$datay[] = $authorizations[$monthNumber]['entry'];
|
||||
} else {
|
||||
|
@ -9,7 +9,7 @@
|
||||
* @packager Keyboard Monkeys
|
||||
*/
|
||||
|
||||
class Stats_IndexController extends Monkeys_Controller_Action
|
||||
class Stats_IndexController extends CommunityID_Controller_Action
|
||||
{
|
||||
protected $_numCols = 1;
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
* @packager Keyboard Monkeys
|
||||
*/
|
||||
|
||||
class Stats_RegistrationsController extends Monkeys_Controller_Action
|
||||
class Stats_RegistrationsController extends CommunityID_Controller_Action
|
||||
{
|
||||
public function indexAction()
|
||||
{
|
||||
@ -78,13 +78,13 @@ class Stats_RegistrationsController extends Monkeys_Controller_Action
|
||||
|
||||
private function _populateWeekData(&$labelsy, &$datay)
|
||||
{
|
||||
$stats = new Stats();
|
||||
$stats = new Stats_Model_Stats();
|
||||
$registeredUsers = $stats->getNumRegisteredUsersDays(strtotime('-1 week'), time());
|
||||
|
||||
for ($i = -7; $i < 0; $i++) {
|
||||
$time = strtotime("$i days");
|
||||
$date = date('Y-m-d', $time);
|
||||
$labelsy[] = Stats::$weekDays[date('w', $time)];
|
||||
$labelsy[] = Stats_Model_Stats::$weekDays[date('w', $time)];
|
||||
if (isset($registeredUsers[$date])) {
|
||||
$datay[] = $registeredUsers[$date]['users'];
|
||||
} else {
|
||||
@ -95,7 +95,7 @@ class Stats_RegistrationsController extends Monkeys_Controller_Action
|
||||
|
||||
private function _populateMonthData(&$labelsy, &$datay)
|
||||
{
|
||||
$stats = new Stats();
|
||||
$stats = new Stats_Model_Stats();
|
||||
$registeredUsers = $stats->getNumRegisteredUsersDays(strtotime('-30 days'), strtotime('-1 week'));
|
||||
|
||||
for ($i = -30; $i < -7; $i++) {
|
||||
@ -112,14 +112,14 @@ class Stats_RegistrationsController extends Monkeys_Controller_Action
|
||||
|
||||
private function _populateYearData(&$labelsy, &$datay)
|
||||
{
|
||||
$stats = new Stats();
|
||||
$stats = new Stats_Model_Stats();
|
||||
$firstDayOfMonth = date('Y-' . date('m') . '-01');
|
||||
$registeredUsers = $stats->getNumRegisteredUsersYear(strtotime('-11 months', strtotime($firstDayOfMonth)), time());
|
||||
|
||||
for ($i = -11; $i <= 0; $i++) {
|
||||
$time = strtotime("$i months");
|
||||
$monthNumber = date('n', $time);
|
||||
$labelsy[] = Stats::$months[$monthNumber];
|
||||
$labelsy[] = Stats_Model_Stats::$months[$monthNumber];
|
||||
if (isset($registeredUsers[$monthNumber])) {
|
||||
$datay[] = $registeredUsers[$monthNumber]['users'];
|
||||
} else {
|
||||
|
@ -9,7 +9,7 @@
|
||||
* @packager Keyboard Monkeys
|
||||
*/
|
||||
|
||||
class Stats_SitesController extends Monkeys_Controller_Action
|
||||
class Stats_SitesController extends CommunityID_Controller_Action
|
||||
{
|
||||
public function indexAction()
|
||||
{
|
||||
@ -85,7 +85,7 @@ class Stats_SitesController extends Monkeys_Controller_Action
|
||||
|
||||
private function _populateWeekData(&$labelsy, &$datay, &$datay2)
|
||||
{
|
||||
$stats = new Stats();
|
||||
$stats = new Stats_Model_Stats();
|
||||
$initialTrustedSites = $stats->getNumTrustedSites(strtotime('-1 week'));
|
||||
$initialRegisteredUsers = $stats->getNumRegisteredUsers(strtotime('-1 week'));
|
||||
|
||||
@ -95,7 +95,7 @@ class Stats_SitesController extends Monkeys_Controller_Action
|
||||
for ($i = -7; $i < 0; $i++) {
|
||||
$time = strtotime("$i days");
|
||||
$date = date('Y-m-d', $time);
|
||||
$labelsy[] = Stats::$weekDays[date('w', $time)];
|
||||
$labelsy[] = Stats_Model_Stats::$weekDays[date('w', $time)];
|
||||
|
||||
if (isset($sites[$date])) {
|
||||
$sitesPeriod = $sites[$date]['site'];
|
||||
@ -125,7 +125,7 @@ class Stats_SitesController extends Monkeys_Controller_Action
|
||||
|
||||
private function _populateYearData(&$labelsy, &$datay, &$datay2)
|
||||
{
|
||||
$stats = new Stats();
|
||||
$stats = new Stats_Model_Stats();
|
||||
$initialTrustedSites = $stats->getNumTrustedSites(strtotime('-1 week'));
|
||||
$initialRegisteredUsers = $stats->getNumRegisteredUsers(strtotime('-1 week'));
|
||||
|
||||
@ -137,7 +137,7 @@ class Stats_SitesController extends Monkeys_Controller_Action
|
||||
for ($i = -11; $i <= 0; $i++) {
|
||||
$time = strtotime("$i months");
|
||||
$monthNumber = date('n', $time);
|
||||
$labelsy[] = Stats::$months[$monthNumber];
|
||||
$labelsy[] = Stats_Model_Stats::$months[$monthNumber];
|
||||
|
||||
if (isset($sites[$monthNumber])) {
|
||||
$sitesPeriod = $sites[$monthNumber]['site'];
|
||||
|
@ -9,11 +9,11 @@
|
||||
* @packager Keyboard Monkeys
|
||||
*/
|
||||
|
||||
class Stats_TopController extends Monkeys_Controller_Action
|
||||
class Stats_TopController extends CommunityID_Controller_Action
|
||||
{
|
||||
public function indexAction()
|
||||
{
|
||||
$stats = new Stats();
|
||||
$stats = new Stats_Model_Stats();
|
||||
$this->view->sites = $stats->getTopTenSites();
|
||||
}
|
||||
}
|
||||
|
@ -4,13 +4,13 @@
|
||||
* @copyright Copyright (C) 2005-2009 Keyboard Monkeys Ltd. http://www.kb-m.com
|
||||
* @license http://creativecommons.org/licenses/BSD/ BSD License
|
||||
* @author Keyboard Monkeys Ltd.
|
||||
* @since Textroller 0.9
|
||||
* @package TextRoller
|
||||
* @since CommunityID 0.9
|
||||
* @package CommunityID
|
||||
* @packager Keyboard Monkeys
|
||||
*/
|
||||
|
||||
|
||||
class Stats
|
||||
class Stats_Model_Stats
|
||||
{
|
||||
private $_db;
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
<h3><?= $this->translate('Authorizations per day') ?></h3>
|
||||
<h3><?php echo $this->translate('Authorizations per day') ?></h3>
|
||||
<div>
|
||||
<?= $this->translate('Select view') ?>:
|
||||
<?php echo $this->translate('Select view') ?>:
|
||||
<select name="view" onchange="COMMID.stats.loadReport('authorizations', 'statsAuths', 'type=' + this.value)">
|
||||
<option value="week" <?= $this->weekSelected ?>><?= $this->translate('Last Week') ?></option>
|
||||
<option value="year" <?= $this->yearSelected ?>><?= $this->translate('Last Year') ?></option>
|
||||
<option value="week" <?php echo $this->weekSelected ?>><?= $this->translate('Last Week') ?></option>
|
||||
<option value="year" <?php echo $this->yearSelected ?>><?= $this->translate('Last Year') ?></option>
|
||||
</select>
|
||||
</div>
|
||||
<img src="<?= $this->base ?>/stats/authorizations/graph?rand=<?= $this->rand ?>&type=<?= $this->type ?>" />
|
||||
<img src="<?php echo $this->base ?>/stats/authorizations/graph?rand=<?= $this->rand ?>&type=<?= $this->type ?>" />
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
<h3><?= $this->translate('Registrations per day') ?></h3>
|
||||
<h3><?php echo $this->translate('Registrations per day') ?></h3>
|
||||
<div>
|
||||
<?= $this->translate('Select view') ?>:
|
||||
<?php echo $this->translate('Select view') ?>:
|
||||
<select name="view" onchange="COMMID.stats.loadReport('registrations', 'statsRegs', 'type=' + this.value)">
|
||||
<option value="week" <?= $this->weekSelected ?>><?= $this->translate('Last Week') ?></option>
|
||||
<option value="month" <?= $this->monthSelected ?>><?= $this->translate('Last Month') ?></option>
|
||||
<option value="year" <?= $this->yearSelected ?>><?= $this->translate('Last Year') ?></option>
|
||||
<option value="week" <?php echo $this->weekSelected ?>><?= $this->translate('Last Week') ?></option>
|
||||
<option value="month" <?php echo $this->monthSelected ?>><?= $this->translate('Last Month') ?></option>
|
||||
<option value="year" <?php echo $this->yearSelected ?>><?= $this->translate('Last Year') ?></option>
|
||||
</select>
|
||||
</div>
|
||||
<img src="<?= $this->base ?>/stats/registrations/graph?rand=<?= $this->rand ?>&type=<?= $this->type ?>" />
|
||||
<img src="<?php echo $this->base ?>/stats/registrations/graph?rand=<?= $this->rand ?>&type=<?= $this->type ?>" />
|
||||
|
@ -1,9 +1,9 @@
|
||||
<h3><?= $this->translate('Trusted Sites') ?></h3>
|
||||
<h3><?php echo $this->translate('Trusted Sites') ?></h3>
|
||||
<div>
|
||||
<?= $this->translate('Select view') ?>:
|
||||
<?php echo $this->translate('Select view') ?>:
|
||||
<select name="view" onchange="COMMID.stats.loadReport('sites', 'statsNumTrustedSites', 'type=' + this.value)">
|
||||
<option value="week" <?= $this->weekSelected ?>><?= $this->translate('Last Week') ?></option>
|
||||
<option value="year" <?= $this->yearSelected ?>><?= $this->translate('Last Year') ?></option>
|
||||
<option value="week" <?php echo $this->weekSelected ?>><?= $this->translate('Last Week') ?></option>
|
||||
<option value="year" <?php echo $this->yearSelected ?>><?= $this->translate('Last Year') ?></option>
|
||||
</select>
|
||||
</div>
|
||||
<img src="<?= $this->base ?>/stats/sites/graph?rand=<?= $this->rand ?>&type=<?= $this->type ?>" />
|
||||
<img src="<?php echo $this->base ?>/stats/sites/graph?rand=<?= $this->rand ?>&type=<?= $this->type ?>" />
|
||||
|
@ -1,10 +1,10 @@
|
||||
<h3><?= $this->translate('Top 10 Trusted Sites') ?></h3>
|
||||
<h3><?php echo $this->translate('Top 10 Trusted Sites') ?></h3>
|
||||
<table id="topTenTable">
|
||||
<? foreach ($this->sites as $num => $siteInfo): ?>
|
||||
<?php foreach ($this->sites as $num => $siteInfo): ?>
|
||||
<tr>
|
||||
<td><?= $num + 1 ?></td>
|
||||
<td><?= $siteInfo['site'] ?></td>
|
||||
<td>(<?= $this->translate('%s users', $siteInfo['num']) ?>)</td>
|
||||
<td><?php echo $num + 1 ?></td>
|
||||
<td><?php echo $siteInfo['site'] ?></td>
|
||||
<td>(<?php echo $this->translate('%s users', $siteInfo['num']) ?>)</td>
|
||||
</tr>
|
||||
<? endforeach ?>
|
||||
<?php endforeach ?>
|
||||
</table>
|
||||
|
Reference in New Issue
Block a user