Commit 45024405 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Display number of view page views on stats page


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent f3068aab
......@@ -868,6 +868,7 @@ $string['alphabet'] = 'A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z';
$string['formatpostbbcode'] = 'You can format your post using BBCode. %sLearn more%s';
$string['Created'] = 'Created';
$string['Total'] = 'Total';
$string['Visits'] = 'Visits';
// import related strings (maybe separated later)
$string['importedfrom'] = 'Imported from %s';
......
......@@ -443,7 +443,7 @@ function view_statistics($limit, $offset) {
'#',
get_string('view'),
get_string('Owner', 'view'),
get_string('visits'),
get_string('Visits'),
get_string('feedback', 'view'),
);
$data['table'] = view_stats_table($limit, $offset);
......@@ -475,7 +475,7 @@ function view_stats_table($limit, $offset) {
$viewdata = get_records_sql_array(
"SELECT
v.id, v.title, v.owner, v.group, v.institution,
v.id, v.title, v.owner, v.group, v.institution, v.visits,
u.firstname, u.lastname,
COUNT(vf.*) AS comments
FROM {view} v
......@@ -483,8 +483,9 @@ function view_stats_table($limit, $offset) {
LEFT JOIN {usr} u ON v.owner = u.id
LEFT JOIN {group} g ON v.group = g.id
LEFT JOIN {institution} i ON v.institution = i.name
GROUP BY v.id, v.title, v.owner, v.group, v.institution,
u.firstname, u.lastname",
GROUP BY v.id, v.title, v.owner, v.group, v.institution, v.visits,
u.firstname, u.lastname
ORDER BY v.visits DESC",
array(),
$offset,
$limit
......
......@@ -3,7 +3,7 @@
<td>{$offset + $dwoo.foreach.default.iteration}</td>
<td><a href="{$WWWROOT}view/view.php?id={$item->id}">{$item->title}</a></td>
<td>{$item->author}</td>
<td></td>
<td>{$item->visits}</td>
<td>{$item->comments}</td>
</tr>
{/foreach}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment