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
4dff3693
Commit
4dff3693
authored
Feb 16, 2014
by
Scott Vivian
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request from pupi1985 (deprecate qa_post_userid_to_handle); fixes #18
parents
32e9ee6a
de7b2702
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
27 deletions
+21
-27
qa-app-posts.php
qa-include/qa-app-posts.php
+10
-25
qa-app-users.php
qa-include/qa-app-users.php
+11
-2
No files found.
qa-include/qa-app-posts.php
View file @
4dff3693
...
...
@@ -34,6 +34,7 @@
require_once
QA_INCLUDE_DIR
.
'qa-app-format.php'
;
require_once
QA_INCLUDE_DIR
.
'qa-app-post-create.php'
;
require_once
QA_INCLUDE_DIR
.
'qa-app-post-update.php'
;
require_once
QA_INCLUDE_DIR
.
'qa-app-users.php'
;
require_once
QA_INCLUDE_DIR
.
'qa-util-string.php'
;
...
...
@@ -56,7 +57,7 @@
post types you can specify the $name of the post's author, which is relevant if the $userid is null.
*/
{
$handle
=
qa_
post_
userid_to_handle
(
$userid
);
$handle
=
qa_userid_to_handle
(
$userid
);
$text
=
qa_post_content_to_text
(
$content
,
$format
);
switch
(
$type
)
{
...
...
@@ -118,7 +119,8 @@
else
$setnotify
=
$oldpost
[
'notify'
];
$byhandle
=
qa_post_userid_to_handle
(
$byuserid
);
$byhandle
=
qa_userid_to_handle
(
$byuserid
);
$text
=
qa_post_content_to_text
(
$content
,
$format
);
switch
(
$oldpost
[
'basetype'
])
{
...
...
@@ -151,7 +153,7 @@
$oldpost
=
qa_post_get_full
(
$postid
,
'QAC'
);
if
(
$oldpost
[
'basetype'
]
==
'Q'
)
{
$byhandle
=
qa_
post_
userid_to_handle
(
$byuserid
);
$byhandle
=
qa_userid_to_handle
(
$byuserid
);
$answers
=
qa_post_get_question_answers
(
$postid
);
$commentsfollows
=
qa_post_get_question_commentsfollows
(
$postid
);
$closepost
=
qa_post_get_question_closepost
(
$postid
);
...
...
@@ -169,7 +171,7 @@
*/
{
$oldquestion
=
qa_post_get_full
(
$questionid
,
'Q'
);
$byhandle
=
qa_
post_
userid_to_handle
(
$byuserid
);
$byhandle
=
qa_userid_to_handle
(
$byuserid
);
$answers
=
qa_post_get_question_answers
(
$questionid
);
if
(
isset
(
$answerid
)
&&
!
isset
(
$answers
[
$answerid
]))
...
...
@@ -188,7 +190,7 @@
{
$oldquestion
=
qa_post_get_full
(
$questionid
,
'Q'
);
$oldclosepost
=
qa_post_get_question_closepost
(
$questionid
);
$byhandle
=
qa_
post_
userid_to_handle
(
$byuserid
);
$byhandle
=
qa_userid_to_handle
(
$byuserid
);
if
(
$closed
)
{
if
(
isset
(
$originalpostid
))
...
...
@@ -220,7 +222,7 @@
*/
{
$oldpost
=
qa_post_get_full
(
$postid
,
'QAC'
);
$byhandle
=
qa_
post_
userid_to_handle
(
$byuserid
);
$byhandle
=
qa_userid_to_handle
(
$byuserid
);
switch
(
$oldpost
[
'basetype'
])
{
case
'Q'
:
...
...
@@ -331,25 +333,8 @@
Return the handle corresponding to $userid, unless it is null in which case return null.
*/
{
if
(
isset
(
$userid
))
{
if
(
QA_FINAL_EXTERNAL_USERS
)
{
require_once
QA_INCLUDE_DIR
.
'qa-app-users.php'
;
$handles
=
qa_get_public_from_userids
(
array
(
$userid
));
return
@
$handles
[
$userid
];
}
else
{
$user
=
qa_db_single_select
(
qa_db_user_account_selectspec
(
$userid
,
true
));
if
(
!
is_array
(
$user
))
qa_fatal_error
(
'User ID could not be found: '
.
$userid
);
return
$user
[
'handle'
];
}
}
return
null
;
trigger_error
(
'Function qa_post_userid_to_handle is deprecated; use qa_userid_to_handle instead'
,
E_USER_DEPRECATED
);
return
qa_userid_to_handle
(
$userid
);
}
...
...
qa-include/qa-app-users.php
View file @
4dff3693
...
...
@@ -634,6 +634,16 @@
}
function
qa_userid_to_handle
(
$userid
)
/*
Return an string mapping the received userid to that user's handle (public username), or to null if not found
*/
{
$handles
=
qa_userids_to_handles
(
array
(
$userid
));
return
empty
(
$handles
)
?
null
:
$handles
[
$userid
];
}
function
qa_handles_to_userids
(
$handles
,
$exactonly
=
false
)
/*
Return an array mapping each handle in $handles the user's userid, or null if not found. If $exactonly is true then
...
...
@@ -1151,4 +1161,4 @@ in a category for which they have elevated privileges).
/*
Omit PHP closing tag to help avoid accidental output
*/
\ No newline at end of file
*/
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