-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathedit.log.php
92 lines (70 loc) · 2.07 KB
/
edit.log.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?php
// global $plog_level; $plog_level=1;
include 'core/Page.php';
if ( !Session::logged_in() ) Page::Redirect('login');
plog("New page!");
$p= new Page;
if ( !$p->ajax ) $p->HTML('header.html',array("###MENU###"=>Dropdown_menu($p)));
$p->title ="Your Website";
$p->CSS( "main.css" );
$p->Jquery();
$getpost=getpost();
$p->HTML('<BR>');
global $auth_database;
plog("Get mods!");
$m=new Modification($auth_database);
$mods=$m->All('ORDER BY Timestamp DESC');
$m_auth=new Auth($auth_database);
if ( !false_or_null($mods) ) {
$datatemp=array();
foreach ( $mods as $mod ) {
$user=$m_auth->Get($mod['r_Auth']);
if ( !isset($datatemp[$user['username']]) ) $datatemp[$user['username']]=1;
else $datatemp[$user['username']]+=1;
}
$datapoints=array();
foreach ( $datatemp as $username=>$events ) {
$datapoints[]=array( "value"=>$events, "color"=>"#FFAAAA", "highlight"=>"5AD3D1", "label"=>$username );
}
$chart=Pie($p,400,400,$datapoints);
// $p->CSS('.'.$chart.' { }');
$data=array();
foreach ( $mods as $mod ) {
$user=$m_auth->Get($mod['r_Auth']);
$what='';
$w=json_decode($mod['What'],true);
foreach ( $w as $dataset ) {
foreach ( $dataset as $table=>$change ) {
$what.=$table.' <a class="bare" href="'.strtolower($table).'.edit?ID='.$change['I'].'" title="Edit '.$table.' #'.$change['I'].'">#'.$change['I'].'</a>\'s '
.$change['F']. ( isset($change['E']) ? ' » '.$change['E'] : '' );;
}
}
$data[]=array(
$user['username'],
$what,
$mod['Message'],
human_datetime(intval($mod['Timestamp'])),
);
}
$table=new TableHelper( array(
'table'=>"table wide",
'thead'=>"tablehead",
'th'=>"tablehead",
'td'=>"tablecell",
'headings'=>array(
'Who',
'What',
' ',
// 'Message',
'When'
),
'data'=>$data
)
);
$p->HTML('<h3>Activity Since '.date('M-d-Y',strtotime("-6 months")).'</h3>');
$p->HTML('<div class="formboundary">');
$p->Table($table);
$p->HTML('</div>');
}
if ( !$p->ajax ) $p->HTML('footer.html');
$p->Render();