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
360c7423
Commit
360c7423
authored
Jun 10, 2010
by
Richard Mansfield
Browse files
Allow activity delay to be forced
Signed-off-by:
Richard Mansfield
<
richardm@catalyst.net.nz
>
parent
570a9189
Changes
2
Hide whitespace changes
Inline
Side-by-side
htdocs/interaction/forum/lib.php
View file @
360c7423
...
...
@@ -446,18 +446,20 @@ EOF;
if
(
is_array
(
$postnow
)
&&
!
empty
(
$postnow
))
{
$values
=
array
();
$postswhere
=
'id IN ('
.
join
(
','
,
array_map
(
'intval'
,
$postnow
))
.
')'
;
$delay
=
false
;
}
else
{
$currenttime
=
time
();
$minpostdelay
=
$currenttime
-
get_config_plugin
(
'interaction'
,
'forum'
,
'postdelay'
)
*
60
;
$values
=
array
(
db_format_timestamp
(
$minpostdelay
));
$postswhere
=
'ctime < ?'
;
$delay
=
null
;
}
$posts
=
get_column_sql
(
'SELECT id FROM {interaction_forum_post} WHERE sent = 0 AND deleted = 0 AND '
.
$postswhere
,
$values
);
if
(
$posts
)
{
set_field_select
(
'interaction_forum_post'
,
'sent'
,
1
,
'deleted = 0 AND sent = 0 AND '
.
$postswhere
,
$values
);
foreach
(
$posts
as
$postid
)
{
activity_occurred
(
'newpost'
,
array
(
'postid'
=>
$postid
),
'interaction'
,
'forum'
,
(
bool
)
$postnow
);
activity_occurred
(
'newpost'
,
array
(
'postid'
=>
$postid
),
'interaction'
,
'forum'
,
$delay
);
}
}
}
...
...
htdocs/lib/activity.php
View file @
360c7423
...
...
@@ -34,9 +34,12 @@ defined('INTERNAL') || die();
* @param string $activitytype type of activity
* @param mixed $data data
*/
function
activity_occurred
(
$activitytype
,
$data
,
$plugintype
=
null
,
$pluginname
=
null
,
$
override
delay
=
false
)
{
function
activity_occurred
(
$activitytype
,
$data
,
$plugintype
=
null
,
$pluginname
=
null
,
$delay
=
null
)
{
$at
=
activity_locate_typerecord
(
$activitytype
,
$plugintype
,
$pluginname
);
if
(
!
empty
(
$at
->
delay
)
&&
!
$overridedelay
)
{
if
(
is_null
(
$delay
))
{
$delay
=
!
empty
(
$at
->
delay
);
}
if
(
$delay
)
{
$delayed
=
new
StdClass
;
$delayed
->
type
=
$at
->
id
;
$delayed
->
data
=
serialize
(
$data
);
...
...
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