Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
26abf06c
Commit
26abf06c
authored
Mar 18, 2010
by
Richard Mansfield
Browse files
Fix update of last view log processing time
Signed-off-by:
Richard Mansfield
<
richardm@catalyst.net.nz
>
parent
175d69c7
Changes
1
Show whitespace changes
Inline
Side-by-side
htdocs/lib/mahara.php
View file @
26abf06c
...
@@ -2384,13 +2384,8 @@ function cron_site_data_daily() {
...
@@ -2384,13 +2384,8 @@ function cron_site_data_daily() {
if
(
rename
(
$viewlog
,
$viewlog
.
'.temp'
)
and
$fh
=
@
fopen
(
$viewlog
.
'.temp'
,
'r'
))
{
if
(
rename
(
$viewlog
,
$viewlog
.
'.temp'
)
and
$fh
=
@
fopen
(
$viewlog
.
'.temp'
,
'r'
))
{
// Read the new stuff out of the file
// Read the new stuff out of the file
$latest
=
get_field
(
'view_visit'
,
'MAX(ctime)'
);
if
(
empty
(
$latest
))
{
$latest
=
get_config
(
'viewloglatest'
);
$latest
=
get_config
(
'viewloglatest'
);
}
else
{
set_config
(
'viewloglatest'
,
$latest
);
}
$visits
=
array
();
$visits
=
array
();
while
(
!
feof
(
$fh
))
{
while
(
!
feof
(
$fh
))
{
$line
=
fgets
(
$fh
,
1024
);
$line
=
fgets
(
$fh
,
1024
);
...
@@ -2427,6 +2422,8 @@ function cron_site_data_daily() {
...
@@ -2427,6 +2422,8 @@ function cron_site_data_daily() {
execute_sql
(
"UPDATE
{
view
}
SET visits = visits + ? WHERE id = ?"
,
array
(
$newvisits
,
$viewid
));
execute_sql
(
"UPDATE
{
view
}
SET visits = visits + ? WHERE id = ?"
,
array
(
$newvisits
,
$viewid
));
}
}
set_config
(
'viewloglatest'
,
$time
);
unlink
(
$viewlog
.
'.temp'
);
unlink
(
$viewlog
.
'.temp'
);
}
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment