Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
question2answer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
outils
question2answer
Commits
451a2c6d
Commit
451a2c6d
authored
Aug 28, 2014
by
Scott Vivian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved complex logic out of if clause
parent
28b53c8c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
qa-app-format.php
qa-include/qa-app-format.php
+17
-17
No files found.
qa-include/qa-app-format.php
View file @
451a2c6d
...
...
@@ -944,25 +944,25 @@
$laterquestion
=
@
$keepquestions
[
$question
[
'postid'
]];
if
(
isset
(
$laterquestion
))
{
if
(
(
abs
(
$laterquestion
[
'_time'
]
-
$question
[
'_time'
])
<
300
)
// the two events were within 5 minutes of each other
&&
(
(
@
$laterquestion
[
'oupdatetype'
])
&&
// the more recent reference was an edit
(
!@
$question
[
'oupdatetype'
])
&&
// this is not an edit
(
$laterquestion
[
'_type'
]
==
$question
[
'_type'
])
&&
// the same part (Q/A/C) is referenced here
(
$laterquestion
[
'_userid'
]
==
$question
[
'_userid'
])
// the same user made the later edit
)
||
// or ...
(
(
@
$question
[
'opersonal'
])
&&
// this question (in an update list) is personal to the user
(
!@
$laterquestion
[
'opersonal'
])
// the other one was not personal
)
)
{
unset
(
$keepquestions
[
$question
[
'postid'
]]);
// Remove any previous instance of the post to force a new position
// the two events were within 5 minutes of each other
$close_events
=
abs
(
$laterquestion
[
'_time'
]
-
$question
[
'_time'
])
<
300
;
$later_edit
=
@
$laterquestion
[
'oupdatetype'
]
&&
// the more recent reference was an edit
!@
$question
[
'oupdatetype'
]
&&
// this is not an edit
$laterquestion
[
'_type'
]
==
$question
[
'_type'
]
&&
// the same part (Q/A/C) is referenced here
$laterquestion
[
'_userid'
]
==
$question
[
'_userid'
];
// the same user made the later edit
// this question (in an update list) is personal to the user, but the other one was not
$this_personal
=
@
$question
[
'opersonal'
]
&&
!@
$laterquestion
[
'opersonal'
];
if
(
$close_events
&&
(
$later_edit
||
$this_personal
))
{
// Remove any previous instance of the post to force a new position
unset
(
$keepquestions
[
$question
[
'postid'
]]);
$keepquestions
[
$question
[
'postid'
]]
=
$question
;
}
}
else
// keep this reference if there is no more recent one
}
else
// keep this reference if there is no more recent one
$keepquestions
[
$question
[
'postid'
]]
=
$question
;
}
...
...
Write
Preview
Markdown
is supported
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