|
1
|
|
|
<?php |
|
2
|
|
|
/************************************************************************** |
|
3
|
|
|
********** English Wikipedia Account Request Interface ********** |
|
4
|
|
|
*************************************************************************** |
|
5
|
|
|
** Wikipedia Account Request Graphic Design by Charles Melbye, ** |
|
6
|
|
|
** which is licensed under a Creative Commons ** |
|
7
|
|
|
** Attribution-Noncommercial-Share Alike 3.0 United States License. ** |
|
8
|
|
|
** ** |
|
9
|
|
|
** All other code are released under the Public Domain ** |
|
10
|
|
|
** by the ACC Development Team. ** |
|
11
|
|
|
** ** |
|
12
|
|
|
** See CREDITS for the list of developers. ** |
|
13
|
|
|
***************************************************************************/ |
|
14
|
|
|
|
|
15
|
|
|
class StatsTemplateStats extends StatisticsPage |
|
16
|
|
|
{ |
|
17
|
|
|
protected function execute() |
|
18
|
|
|
{ |
|
19
|
|
|
$query = <<<SQL |
|
20
|
|
|
SELECT |
|
21
|
|
|
t.id as "Template ID", |
|
22
|
|
|
t.usercode as "Template Code", |
|
23
|
|
|
u.count as "Active users using template", |
|
24
|
|
|
countall as "All users using template" |
|
25
|
|
|
FROM welcometemplate t |
|
26
|
|
|
LEFT JOIN |
|
27
|
|
|
( |
|
28
|
|
|
SELECT |
|
29
|
|
|
welcome_template, |
|
30
|
|
|
COUNT(*) as count |
|
31
|
|
|
FROM user |
|
32
|
|
|
WHERE |
|
33
|
|
|
(status = "User" OR status = "Admin") |
|
34
|
|
|
AND welcome_template IS NOT NULL |
|
35
|
|
|
GROUP BY welcome_template |
|
36
|
|
|
) u ON u.welcome_template = t.id |
|
37
|
|
|
LEFT JOIN |
|
38
|
|
|
( |
|
39
|
|
|
SELECT |
|
40
|
|
|
welcome_template as allid, |
|
41
|
|
|
COUNT(*) as countall |
|
42
|
|
|
FROM user |
|
43
|
|
|
WHERE welcome_template IS NOT NULL |
|
44
|
|
|
GROUP BY welcome_template |
|
45
|
|
|
) u2 ON u2.allid = t.id; |
|
46
|
|
|
SQL; |
|
47
|
|
|
|
|
48
|
|
|
$qb = new QueryBrowser(); |
|
49
|
|
|
$r = $qb->executeQueryToTable($query); |
|
50
|
|
|
|
|
51
|
|
|
return $r; |
|
52
|
|
|
} |
|
53
|
|
|
|
|
54
|
|
|
public function getPageName() |
|
55
|
|
|
{ |
|
56
|
|
|
return "TemplateStats"; |
|
57
|
|
|
} |
|
58
|
|
|
|
|
59
|
|
|
public function getPageTitle() |
|
60
|
|
|
{ |
|
61
|
|
|
return "Template Stats"; |
|
62
|
|
|
} |
|
63
|
|
|
|
|
64
|
|
|
public function isProtected() |
|
65
|
|
|
{ |
|
66
|
|
|
return true; |
|
67
|
|
|
} |
|
68
|
|
|
|
|
69
|
|
|
public function requiresWikiDatabase() |
|
70
|
|
|
{ |
|
71
|
|
|
return false; |
|
72
|
|
|
} |
|
73
|
|
|
} |
|
74
|
|
|
|