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
523265dc
Commit
523265dc
authored
Feb 01, 2016
by
Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Coding style (qa_page_q_post_rules)
parent
ee52e218
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
83 additions
and
74 deletions
+83
-74
question-view.php
qa-include/pages/question-view.php
+83
-74
No files found.
qa-include/pages/question-view.php
View file @
523265dc
...
@@ -79,20 +79,24 @@
...
@@ -79,20 +79,24 @@
}
}
/**
* Calculates which operations the current user may perform on a post. This function is a key part of Q2A's logic
* and is ripe for overriding by plugins. The latter two arrays can contain additional posts retrieved from the
* database, and these will be ignored.
*
* @param array $post The question/answer/comment to check.
* @param array $parentpost The post's parent if there is one.
* @param array $siblingposts The post's siblings (i.e. those with the same type and parent as the post).
* @param null $childposts The post's children (e.g. comments on answers).
* @return array List of elements that can be added to the post.
*/
function
qa_page_q_post_rules
(
$post
,
$parentpost
=
null
,
$siblingposts
=
null
,
$childposts
=
null
)
function
qa_page_q_post_rules
(
$post
,
$parentpost
=
null
,
$siblingposts
=
null
,
$childposts
=
null
)
/*
Returns elements that can be added to $post which describe which operations the current user may perform on that
post. This function is a key part of Q2A's logic and is ripe for overriding by plugins. Pass $post's $parentpost if
there is one, or null otherwise. Pass an array which contains $post's siblings (i.e. other posts with the same type
and parent) in $siblingposts and $post's children in $childposts. Both of these latter arrays can contain additional
posts retrieved from the database, and these will be ignored.
*/
{
{
if
(
qa_to_override
(
__FUNCTION__
))
{
$args
=
func_get_args
();
return
qa_call_override
(
__FUNCTION__
,
$args
);
}
if
(
qa_to_override
(
__FUNCTION__
))
{
$args
=
func_get_args
();
return
qa_call_override
(
__FUNCTION__
,
$args
);
}
$userid
=
qa_get_logged_in_userid
();
$userid
=
qa_get_logged_in_userid
();
$cookieid
=
qa_cookie_get
();
$cookieid
=
qa_cookie_get
();
$userlevel
=
qa_user_level_for_post
(
$post
);
$userlevel
=
qa_user_level_for_post
(
$post
);
$userfields
=
qa_get_logged_in_user_cache
();
$userfields
=
qa_get_logged_in_user_cache
();
if
(
!
isset
(
$userfields
))
{
if
(
!
isset
(
$userfields
))
{
...
@@ -103,112 +107,117 @@
...
@@ -103,112 +107,117 @@
);
);
}
}
$rules
[
'isbyuser'
]
=
qa_post_is_by_user
(
$post
,
$userid
,
$cookieid
);
$rules
[
'isbyuser'
]
=
qa_post_is_by_user
(
$post
,
$userid
,
$cookieid
);
$rules
[
'queued'
]
=
(
substr
(
$post
[
'type'
],
1
)
==
'_QUEUED'
)
;
$rules
[
'queued'
]
=
substr
(
$post
[
'type'
],
1
)
==
'_QUEUED'
;
$rules
[
'closed'
]
=
(
$post
[
'basetype'
]
==
'Q'
)
&&
(
isset
(
$post
[
'closedbyid'
])
||
(
isset
(
$post
[
'selchildid'
])
&&
qa_opt
(
'do_close_on_select'
)));
$rules
[
'closed'
]
=
$post
[
'basetype'
]
==
'Q'
&&
(
isset
(
$post
[
'closedbyid'
])
||
(
isset
(
$post
[
'selchildid'
])
&&
qa_opt
(
'do_close_on_select'
)));
// Cache some responses to the user permission checks
// Cache some responses to the user permission checks
$permiterror_post_q
=
qa_user_permit_error
(
'permit_post_q'
,
null
,
$userlevel
,
true
,
$userfields
);
// don't check limits here, so we can show error message
$permiterror_post_q
=
qa_user_permit_error
(
'permit_post_q'
,
null
,
$userlevel
,
true
,
$userfields
);
// don't check limits here, so we can show error message
$permiterror_post_a
=
qa_user_permit_error
(
'permit_post_a'
,
null
,
$userlevel
,
true
,
$userfields
);
$permiterror_post_a
=
qa_user_permit_error
(
'permit_post_a'
,
null
,
$userlevel
,
true
,
$userfields
);
$permiterror_post_c
=
qa_user_permit_error
(
'permit_post_c'
,
null
,
$userlevel
,
true
,
$userfields
);
$permiterror_post_c
=
qa_user_permit_error
(
'permit_post_c'
,
null
,
$userlevel
,
true
,
$userfields
);
$edit_option
=
$post
[
'basetype'
]
==
'Q'
?
'permit_edit_q'
:
(
$post
[
'basetype'
]
==
'A'
?
'permit_edit_a'
:
'permit_edit_c'
);
$edit_option
=
$post
[
'basetype'
]
==
'Q'
?
'permit_edit_q'
:
(
$post
[
'basetype'
]
==
'A'
?
'permit_edit_a'
:
'permit_edit_c'
);
$permiterror_edit
=
qa_user_permit_error
(
$edit_option
,
null
,
$userlevel
,
true
,
$userfields
);
$permiterror_edit
=
qa_user_permit_error
(
$edit_option
,
null
,
$userlevel
,
true
,
$userfields
);
$permiterror_retagcat
=
qa_user_permit_error
(
'permit_retag_cat'
,
null
,
$userlevel
,
true
,
$userfields
);
$permiterror_retagcat
=
qa_user_permit_error
(
'permit_retag_cat'
,
null
,
$userlevel
,
true
,
$userfields
);
$permiterror_flag
=
qa_user_permit_error
(
'permit_flag'
,
null
,
$userlevel
,
true
,
$userfields
);
$permiterror_flag
=
qa_user_permit_error
(
'permit_flag'
,
null
,
$userlevel
,
true
,
$userfields
);
$permiterror_hide_show
=
qa_user_permit_error
(
$rules
[
'isbyuser'
]
?
null
:
'permit_hide_show'
,
null
,
$userlevel
,
true
,
$userfields
);
$permiterror_hide_show
=
qa_user_permit_error
(
$rules
[
'isbyuser'
]
?
null
:
'permit_hide_show'
,
null
,
$userlevel
,
true
,
$userfields
);
$permiterror_close_open
=
qa_user_permit_error
(
$rules
[
'isbyuser'
]
?
null
:
'permit_close_q'
,
null
,
$userlevel
,
true
,
$userfields
);
$permiterror_close_open
=
qa_user_permit_error
(
$rules
[
'isbyuser'
]
?
null
:
'permit_close_q'
,
null
,
$userlevel
,
true
,
$userfields
);
$permiterror_moderate
=
qa_user_permit_error
(
'permit_moderate'
,
null
,
$userlevel
,
true
,
$userfields
);
$permiterror_moderate
=
qa_user_permit_error
(
'permit_moderate'
,
null
,
$userlevel
,
true
,
$userfields
);
// General permissions
// General permissions
$rules
[
'authorlast'
]
=
((
!
isset
(
$post
[
'lastuserid'
]))
||
(
$post
[
'lastuserid'
]
===
$post
[
'userid'
]))
;
$rules
[
'authorlast'
]
=
!
isset
(
$post
[
'lastuserid'
])
||
$post
[
'lastuserid'
]
===
$post
[
'userid'
]
;
$rules
[
'viewable'
]
=
$post
[
'hidden'
]
?
(
!
$permiterror_hide_show
)
:
(
$rules
[
'queued'
]
?
(
$rules
[
'isbyuser'
]
||
!
$permiterror_moderate
)
:
true
);
$rules
[
'viewable'
]
=
$post
[
'hidden'
]
?
!
$permiterror_hide_show
:
(
$rules
[
'queued'
]
?
(
$rules
[
'isbyuser'
]
||
!
$permiterror_moderate
)
:
true
);
// Answer, comment and edit might show the button even if the user still needs to do something (e.g. log in)
// Answer, comment and edit might show the button even if the user still needs to do something (e.g. log in)
$rules
[
'answerbutton'
]
=
(
$post
[
'type'
]
==
'Q'
)
&&
(
$permiterror_post_a
!=
'level'
)
&&
(
!
$rules
[
'closed'
])
&&
$rules
[
'answerbutton'
]
=
$post
[
'type'
]
==
'Q'
&&
$permiterror_post_a
!=
'level'
&&
!
$rules
[
'closed'
]
(
qa_opt
(
'allow_self_answer'
)
||
!
$rules
[
'isbyuser'
]);
&&
(
qa_opt
(
'allow_self_answer'
)
||
!
$rules
[
'isbyuser'
]);
$rules
[
'commentbutton'
]
=
((
$post
[
'type'
]
==
'Q'
)
||
(
$post
[
'type'
]
==
'A'
))
&&
$rules
[
'commentbutton'
]
=
(
$post
[
'type'
]
==
'Q'
||
$post
[
'type'
]
==
'A'
)
&&
$permiterror_post_c
!=
'level'
(
$permiterror_post_c
!=
'level'
)
&&
qa_opt
((
$post
[
'type'
]
==
'Q'
)
?
'comment_on_qs'
:
'comment_on_as'
);
&&
qa_opt
(
$post
[
'type'
]
==
'Q'
?
'comment_on_qs'
:
'comment_on_as'
);
$rules
[
'commentable'
]
=
$rules
[
'commentbutton'
]
&&
!
$permiterror_post_c
;
$rules
[
'commentable'
]
=
$rules
[
'commentbutton'
]
&&
!
$permiterror_post_c
;
$button_errors
=
array
(
'login'
,
'level'
,
'approve'
);
$button_errors
=
array
(
'login'
,
'level'
,
'approve'
);
$rules
[
'editbutton'
]
=
(
!
$post
[
'hidden'
])
&&
(
!
$rules
[
'closed'
])
&&
$rules
[
'editbutton'
]
=
!
$post
[
'hidden'
]
&&
!
$rules
[
'closed'
]
(
$rules
[
'isbyuser'
]
||
(
!
in_array
(
$permiterror_edit
,
$button_errors
)
&&
(
!
$rules
[
'queued'
])));
&&
(
$rules
[
'isbyuser'
]
||
(
!
in_array
(
$permiterror_edit
,
$button_errors
)
&&
(
!
$rules
[
'queued'
])));
$rules
[
'editable'
]
=
$rules
[
'editbutton'
]
&&
(
$rules
[
'isbyuser'
]
||
!
$permiterror_edit
);
$rules
[
'editable'
]
=
$rules
[
'editbutton'
]
&&
(
$rules
[
'isbyuser'
]
||
!
$permiterror_edit
);
$rules
[
'retagcatbutton'
]
=
(
$post
[
'basetype'
]
==
'Q'
)
&&
(
qa_using_tags
()
||
qa_using_categories
())
&&
$rules
[
'retagcatbutton'
]
=
$post
[
'basetype'
]
==
'Q'
&&
(
qa_using_tags
()
||
qa_using_categories
())
(
!
$post
[
'hidden'
])
&&
(
$rules
[
'isbyuser'
]
||
(
!
in_array
(
$permiterror_retagcat
,
$button_errors
))
);
&&
!
$post
[
'hidden'
]
&&
(
$rules
[
'isbyuser'
]
||
!
in_array
(
$permiterror_retagcat
,
$button_errors
)
);
$rules
[
'retagcatable'
]
=
$rules
[
'retagcatbutton'
]
&&
(
$rules
[
'isbyuser'
]
||
!
$permiterror_retagcat
);
$rules
[
'retagcatable'
]
=
$rules
[
'retagcatbutton'
]
&&
(
$rules
[
'isbyuser'
]
||
!
$permiterror_retagcat
);
if
(
$rules
[
'editbutton'
]
&&
$rules
[
'retagcatbutton'
])
{
// only show one button since they lead to the same form
if
(
$rules
[
'editbutton'
]
&&
$rules
[
'retagcatbutton'
])
{
// only show one button since they lead to the same form
if
(
$rules
[
'retagcatable'
]
&&
!
$rules
[
'editable'
])
if
(
$rules
[
'retagcatable'
]
&&
!
$rules
[
'editable'
])
$rules
[
'editbutton'
]
=
false
;
// if we can do this without getting an error, show that as the title
$rules
[
'editbutton'
]
=
false
;
// if we can do this without getting an error, show that as the title
else
else
$rules
[
'retagcatbutton'
]
=
false
;
$rules
[
'retagcatbutton'
]
=
false
;
}
}
$rules
[
'aselectable'
]
=
(
$post
[
'type'
]
==
'Q'
)
&&
!
qa_user_permit_error
(
$rules
[
'isbyuser'
]
?
null
:
'permit_select_a'
,
null
,
$userlevel
,
true
,
$userfields
);
$rules
[
'aselectable'
]
=
$post
[
'type'
]
==
'Q'
&&
!
qa_user_permit_error
(
$rules
[
'isbyuser'
]
?
null
:
'permit_select_a'
,
null
,
$userlevel
,
true
,
$userfields
);
$rules
[
'flagbutton'
]
=
qa_opt
(
'flagging_of_posts'
)
&&
(
!
$rules
[
'isbyuser'
])
&&
(
!
$post
[
'hidden'
])
&&
(
!
$rules
[
'queued'
])
&&
$rules
[
'flagbutton'
]
=
qa_opt
(
'flagging_of_posts'
)
&&
!
$rules
[
'isbyuser'
]
&&
!
$post
[
'hidden'
]
&&
!
$rules
[
'queued'
]
(
!@
$post
[
'userflag'
])
&&
!
in_array
(
$permiterror_flag
,
$button_errors
);
&&
!@
$post
[
'userflag'
]
&&
!
in_array
(
$permiterror_flag
,
$button_errors
);
$rules
[
'flagtohide'
]
=
$rules
[
'flagbutton'
]
&&
(
!
$permiterror_flag
)
&&
((
$post
[
'flagcount'
]
+
1
)
>=
qa_opt
(
'flagging_hide_after'
)
);
$rules
[
'flagtohide'
]
=
$rules
[
'flagbutton'
]
&&
!
$permiterror_flag
&&
(
$post
[
'flagcount'
]
+
1
)
>=
qa_opt
(
'flagging_hide_after'
);
$rules
[
'unflaggable'
]
=@
$post
[
'userflag'
]
&&
(
!
$post
[
'hidden'
])
;
$rules
[
'unflaggable'
]
=
@
$post
[
'userflag'
]
&&
!
$post
[
'hidden'
]
;
$rules
[
'clearflaggable'
]
=
(
$post
[
'flagcount'
]
>=
(
@
$post
[
'userflag'
]
?
2
:
1
))
&&
!
qa_user_permit_error
(
'permit_hide_show'
,
null
,
$userlevel
,
true
,
$userfields
);
$rules
[
'clearflaggable'
]
=
(
$post
[
'flagcount'
]
>=
(
@
$post
[
'userflag'
]
?
2
:
1
))
&&
!
qa_user_permit_error
(
'permit_hide_show'
,
null
,
$userlevel
,
true
,
$userfields
);
// Other actions only show the button if it's immediately possible
// Other actions only show the button if it's immediately possible
$notclosedbyother
=!
(
$rules
[
'closed'
]
&&
isset
(
$post
[
'closedbyid'
])
&&
!
$rules
[
'authorlast'
]);
$notclosedbyother
=
!
(
$rules
[
'closed'
]
&&
isset
(
$post
[
'closedbyid'
])
&&
!
$rules
[
'authorlast'
]);
$nothiddenbyother
=!
(
$post
[
'hidden'
]
&&
!
$rules
[
'authorlast'
]);
$nothiddenbyother
=
!
(
$post
[
'hidden'
]
&&
!
$rules
[
'authorlast'
]);
$rules
[
'closeable'
]
=
qa_opt
(
'allow_close_questions'
)
&&
(
$post
[
'type'
]
==
'Q'
)
&&
(
!
$rules
[
'closed'
])
&&
!
$permiterror_close_open
;
$rules
[
'closeable'
]
=
qa_opt
(
'allow_close_questions'
)
&&
$post
[
'type'
]
==
'Q'
&&
!
$rules
[
'closed'
]
&&
!
$permiterror_close_open
;
$rules
[
'reopenable'
]
=
$rules
[
'closed'
]
&&
isset
(
$post
[
'closedbyid'
])
&&
(
!
$permiterror_close_open
)
&&
(
!
$post
[
'hidden'
])
&&
// cannot reopen a question if it's been hidden, or if it was closed by someone else and you don't have global closing permissions
(
$notclosedbyother
||
!
qa_user_permit_error
(
'permit_close_q'
,
null
,
$userlevel
,
true
,
$userfields
));
$rules
[
'reopenable'
]
=
$rules
[
'closed'
]
&&
isset
(
$post
[
'closedbyid'
])
&&
!
$permiterror_close_open
&&
!
$post
[
'hidden'
]
// cannot reopen a question if it's been hidden, or if it was closed by someone else and you don't have global closing permissions
&&
(
$notclosedbyother
||
!
qa_user_permit_error
(
'permit_close_q'
,
null
,
$userlevel
,
true
,
$userfields
));
$rules
[
'moderatable'
]
=
$rules
[
'queued'
]
&&
!
$permiterror_moderate
;
$rules
[
'hideable'
]
=
(
!
$post
[
'hidden'
])
&&
(
$rules
[
'isbyuser'
]
||
!
$rules
[
'queued'
])
&&
$rules
[
'moderatable'
]
=
$rules
[
'queued'
]
&&
!
$permiterror_moderate
;
(
!
$permiterror_hide_show
)
&&
(
$notclosedbyother
||
!
qa_user_permit_error
(
'permit_hide_show'
,
null
,
$userlevel
,
true
,
$userfields
));
// cannot hide a question if it was closed by someone else and you don't have global hiding permissions
// cannot hide a question if it was closed by someone else and you don't have global hiding permissions
$rules
[
'hideable'
]
=
!
$post
[
'hidden'
]
&&
(
$rules
[
'isbyuser'
]
||
!
$rules
[
'queued'
])
&&
!
$permiterror_hide_show
$rules
[
'reshowimmed'
]
=
$post
[
'hidden'
]
&&
!
qa_user_permit_error
(
'permit_hide_show'
,
null
,
$userlevel
,
true
,
$userfields
);
&&
(
$notclosedbyother
||
!
qa_user_permit_error
(
'permit_hide_show'
,
null
,
$userlevel
,
true
,
$userfields
));
// means post can be reshown immediately without checking whether it needs moderation
// means post can be reshown immediately without checking whether it needs moderation
$rules
[
'reshowable'
]
=
$post
[
'hidden'
]
&&
(
!
$permiterror_hide_show
)
&&
$rules
[
'reshowimmed'
]
=
$post
[
'hidden'
]
&&
!
qa_user_permit_error
(
'permit_hide_show'
,
null
,
$userlevel
,
true
,
$userfields
);
// cannot reshow a question if it was hidden by someone else, or if it has flags - unless you have global hide/show permissions
$rules
[
'reshowable'
]
=
$post
[
'hidden'
]
&&
(
!
$permiterror_hide_show
)
&&
(
$rules
[
'reshowimmed'
]
||
(
$nothiddenbyother
&&
!
$post
[
'flagcount'
]));
(
$rules
[
'reshowimmed'
]
||
(
$nothiddenbyother
&&
!
$post
[
'flagcount'
]));
// cannot reshow a question if it was hidden by someone else, or if it has flags - unless you have global hide/show permissions
$rules
[
'deleteable'
]
=
$post
[
'hidden'
]
&&
!
qa_user_permit_error
(
'permit_delete_hidden'
,
null
,
$userlevel
,
true
,
$userfields
);
$rules
[
'deleteable'
]
=
$post
[
'hidden'
]
&&
!
qa_user_permit_error
(
'permit_delete_hidden'
,
null
,
$userlevel
,
true
,
$userfields
);
$rules
[
'claimable'
]
=
(
!
isset
(
$post
[
'userid'
]))
&&
isset
(
$userid
)
&&
strlen
(
@
$post
[
'cookieid'
])
&&
(
strcmp
(
@
$post
[
'cookieid'
],
$cookieid
)
==
0
)
&&
$rules
[
'claimable'
]
=
!
isset
(
$post
[
'userid'
])
&&
isset
(
$userid
)
&&
strlen
(
@
$post
[
'cookieid'
])
&&
(
strcmp
(
@
$post
[
'cookieid'
],
$cookieid
)
==
0
)
!
((
$post
[
'basetype'
]
==
'Q'
)
?
$permiterror_post_q
:
((
$post
[
'basetype'
]
==
'A'
)
?
$permiterror_post_a
:
$permiterror_post_c
));
&&
!
(
$post
[
'basetype'
]
==
'Q'
?
$permiterror_post_q
:
(
$post
[
'basetype'
]
==
'A'
?
$permiterror_post_a
:
$permiterror_post_c
));
$rules
[
'followable'
]
=
(
$post
[
'type'
]
==
'A'
)
?
qa_opt
(
'follow_on_as'
)
:
false
;
$rules
[
'followable'
]
=
$post
[
'type'
]
==
'A'
?
qa_opt
(
'follow_on_as'
)
:
false
;
// Check for claims that could break rules about self answering and multiple answers
// Check for claims that could break rules about self answering and multiple answers
if
(
$rules
[
'claimable'
]
&&
(
$post
[
'basetype'
]
==
'A'
)
)
{
if
(
$rules
[
'claimable'
]
&&
$post
[
'basetype'
]
==
'A'
)
{
if
(
(
!
qa_opt
(
'allow_self_answer'
))
&&
isset
(
$parentpost
)
&&
qa_post_is_by_user
(
$parentpost
,
$userid
,
$cookieid
)
)
if
(
(
!
qa_opt
(
'allow_self_answer'
))
&&
isset
(
$parentpost
)
&&
qa_post_is_by_user
(
$parentpost
,
$userid
,
$cookieid
)
)
$rules
[
'claimable'
]
=
false
;
$rules
[
'claimable'
]
=
false
;
if
(
isset
(
$siblingposts
)
&&
!
qa_opt
(
'allow_multi_answers'
))
if
(
isset
(
$siblingposts
)
&&
!
qa_opt
(
'allow_multi_answers'
))
{
foreach
(
$siblingposts
as
$siblingpost
)
foreach
(
$siblingposts
as
$siblingpost
)
{
if
(
(
$siblingpost
[
'parentid'
]
==
$post
[
'parentid'
])
&&
(
$siblingpost
[
'basetype'
]
==
'A'
)
&&
qa_post_is_by_user
(
$siblingpost
,
$userid
,
$cookieid
))
if
(
$siblingpost
[
'parentid'
]
==
$post
[
'parentid'
]
&&
$siblingpost
[
'basetype'
]
==
'A'
&&
qa_post_is_by_user
(
$siblingpost
,
$userid
,
$cookieid
))
$rules
[
'claimable'
]
=
false
;
$rules
[
'claimable'
]
=
false
;
}
}
}
}
// Now make any changes based on the child posts
// Now make any changes based on the child posts
if
(
isset
(
$childposts
))
{
if
(
isset
(
$childposts
))
{
foreach
(
$childposts
as
$childpost
)
{
foreach
(
$childposts
as
$childpost
)
{
if
(
$childpost
[
'parentid'
]
==
$post
[
'postid'
])
{
if
(
$childpost
[
'parentid'
]
==
$post
[
'postid'
])
{
// this post has comments
// this post has comments
$rules
[
'deleteable'
]
=
false
;
$rules
[
'deleteable'
]
=
false
;
if
(
(
$childpost
[
'basetype'
]
==
'A'
)
&&
qa_post_is_by_user
(
$childpost
,
$userid
,
$cookieid
))
{
if
(
$childpost
[
'basetype'
]
==
'A'
&&
qa_post_is_by_user
(
$childpost
,
$userid
,
$cookieid
))
{
if
(
!
qa_opt
(
'allow_multi_answers'
))
if
(
!
qa_opt
(
'allow_multi_answers'
))
$rules
[
'answerbutton'
]
=
false
;
$rules
[
'answerbutton'
]
=
false
;
if
(
!
qa_opt
(
'allow_self_answer'
))
if
(
!
qa_opt
(
'allow_self_answer'
))
$rules
[
'claimable'
]
=
false
;
$rules
[
'claimable'
]
=
false
;
}
}
}
}
...
...
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