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
ad7de9cc
Commit
ad7de9cc
authored
Oct 29, 2014
by
Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Shorten function name to qa_db_uservote_remove_own
And some minor formatting
parent
d5e23e1b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
9 deletions
+6
-9
qa-app-post-update.php
qa-include/qa-app-post-update.php
+3
-3
qa-db-votes.php
qa-include/qa-db-votes.php
+3
-6
No files found.
qa-include/qa-app-post-update.php
View file @
ad7de9cc
...
...
@@ -478,7 +478,7 @@
$postid
=
$oldquestion
[
'postid'
];
qa_db_post_set_userid
(
$postid
,
$userid
);
qa_db_
remove_owner_votes_from_post
(
$postid
);
qa_db_
uservote_remove_own
(
$postid
);
qa_db_post_recount_votes
(
$postid
);
qa_db_points_update_ifuser
(
$oldquestion
[
'userid'
],
array
(
'qposts'
,
'aselects'
,
'qvoteds'
,
'upvoteds'
,
'downvoteds'
));
...
...
@@ -737,7 +737,7 @@
$postid
=
$oldanswer
[
'postid'
];
qa_db_post_set_userid
(
$postid
,
$userid
);
qa_db_
remove_owner_votes_from_post
(
$postid
);
qa_db_
uservote_remove_own
(
$postid
);
qa_db_post_recount_votes
(
$postid
);
qa_db_points_update_ifuser
(
$oldanswer
[
'userid'
],
array
(
'aposts'
,
'aselecteds'
,
'avoteds'
,
'upvoteds'
,
'downvoteds'
));
...
...
@@ -1047,7 +1047,7 @@
$postid
=
$oldcomment
[
'postid'
];
qa_db_post_set_userid
(
$postid
,
$userid
);
qa_db_
remove_owner_votes_from_post
(
$postid
);
qa_db_
uservote_remove_own
(
$postid
);
qa_db_post_recount_votes
(
$postid
);
qa_db_points_update_ifuser
(
$oldcomment
[
'userid'
],
array
(
'cposts'
));
...
...
qa-include/qa-db-votes.php
View file @
ad7de9cc
...
...
@@ -153,15 +153,12 @@
/**
* Remove all votes assigned to a post that had been cast by the owner of the post.
*
* @param int $postid The post
id which will be removed all votes from its owner
.
* @param int $postid The post
ID from which the owner's votes will be removed
.
*/
function
qa_db_
remove_owner_votes_from_post
(
$postid
)
function
qa_db_
uservote_remove_own
(
$postid
)
{
qa_db_query_sub
(
'DELETE uv FROM ^uservotes uv '
.
'JOIN ^posts p '
.
'ON uv.postid = p.postid AND uv.userid = p.userid '
.
'WHERE uv.postid = #'
,
$postid
'DELETE uv FROM ^uservotes uv JOIN ^posts p ON uv.postid=p.postid AND uv.userid=p.userid WHERE uv.postid=#'
,
$postid
);
}
...
...
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