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
6ed03685
Commit
6ed03685
authored
Jun 15, 2022
by
Félicie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
delete the question with answer and comment
parent
ddbb232a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
39 deletions
+39
-39
posts.php
qa-include/app/posts.php
+4
-4
question-view.php
qa-include/pages/question-view.php
+33
-33
qa-lang-question.php
qa-lang/fr/qa-lang-question.php
+1
-1
Hidden.php
qa-src/Controllers/Admin/Hidden.php
+1
-1
No files found.
qa-include/app/posts.php
View file @
6ed03685
...
...
@@ -338,8 +338,8 @@ function qa_post_delete($postid)
$commentsfollows
=
qa_post_get_question_commentsfollows
(
$postid
);
$closepost
=
qa_post_get_question_closepost
(
$postid
);
if
(
count
(
$answers
)
||
count
(
$commentsfollows
))
qa_fatal_error
(
'Could not delete question ID due to dependents: '
.
$postid
);
//
if (count($answers) || count($commentsfollows))
//
qa_fatal_error('Could not delete question ID due to dependents: ' . $postid);
qa_question_delete
(
$oldpost
,
null
,
null
,
null
,
$closepost
);
break
;
...
...
@@ -348,8 +348,8 @@ function qa_post_delete($postid)
$question
=
qa_post_get_full
(
$oldpost
[
'parentid'
],
'Q'
);
$commentsfollows
=
qa_post_get_answer_commentsfollows
(
$postid
);
if
(
count
(
$commentsfollows
))
qa_fatal_error
(
'Could not delete answer ID due to dependents: '
.
$postid
);
//
if (count($commentsfollows))
//
qa_fatal_error('Could not delete answer ID due to dependents: ' . $postid);
qa_answer_delete
(
$oldpost
,
$question
,
null
,
null
,
null
);
break
;
...
...
qa-include/pages/question-view.php
View file @
6ed03685
...
...
@@ -217,32 +217,32 @@ function qa_page_q_post_rules($post, $parentpost = null, $siblingposts = null, $
// Now make any changes based on the child posts
if
(
isset
(
$childposts
))
{
foreach
(
$childposts
as
$childpost
)
{
// Skip the child post if it is a note
if
(
$childpost
[
'basetype'
]
===
'N'
)
{
continue
;
}
if
(
$childpost
[
'parentid'
]
==
$post
[
'postid'
])
{
// this post has comments
$rules
[
'deleteable'
]
=
false
;
if
(
$childpost
[
'basetype'
]
==
'A'
&&
qa_post_is_by_user
(
$childpost
,
$userid
,
$cookieid
))
{
if
(
!
qa_opt
(
'allow_multi_answers'
))
$rules
[
'answerbutton'
]
=
false
;
if
(
!
qa_opt
(
'allow_self_answer'
))
$rules
[
'claimable'
]
=
false
;
}
}
if
(
$childpost
[
'closedbyid'
]
==
$post
[
'postid'
])
{
// other questions are closed as duplicates of this one
$rules
[
'deleteable'
]
=
false
;
}
}
}
//
if (isset($childposts)) {
//
foreach ($childposts as $childpost) {
//
// Skip the child post if it is a note
//
if ($childpost['basetype'] === 'N') {
//
continue;
//
}
//
if ($childpost['parentid'] == $post['postid']) {
//
// this post has comments
//
$rules['deleteable'] = false;
//
if ($childpost['basetype'] == 'A' && qa_post_is_by_user($childpost, $userid, $cookieid)) {
//
if (!qa_opt('allow_multi_answers'))
//
$rules['answerbutton'] = false;
//
if (!qa_opt('allow_self_answer'))
//
$rules['claimable'] = false;
//
}
//
}
//
if ($childpost['closedbyid'] == $post['postid']) {
//
// other questions are closed as duplicates of this one
//
$rules['deleteable'] = false;
//
}
//
}
//
}
// Return the resulting rules
...
...
@@ -611,13 +611,13 @@ function qa_page_q_answer_view($question, $answer, $isselected, $usershtml, $for
);
}
if
(
$answer
[
'followable'
])
{
$buttons
[
'follow'
]
=
array
(
'tags'
=>
'name="'
.
$prefix
.
'dofollow"'
,
'label'
=>
qa_lang_html
(
'question/follow_button'
),
'popup'
=>
qa_lang_html
(
'question/follow_a_popup'
),
);
}
//
if ($answer['followable']) {
//
$buttons['follow'] = array(
//
'tags' => 'name="' . $prefix . 'dofollow"',
//
'label' => qa_lang_html('question/follow_button'),
//
'popup' => qa_lang_html('question/follow_a_popup'),
//
);
//
}
if
(
$answer
[
'commentbutton'
])
{
$buttons
[
'comment'
]
=
array
(
...
...
qa-lang/fr/qa-lang-question.php
View file @
6ed03685
...
...
@@ -38,7 +38,7 @@
'a_notify_x_label'
=>
'Envoyez-moi un e-mail (^) si ma réponse est sélectionnée ou commentée'
,
'a_waiting_your_approval'
=>
'Cette réponse est en attente de votre approbation'
,
'a_your_waiting_approval'
=>
'Votre réponse sera vérifiée et approuvée prochainement.'
,
'add_answer_button'
=>
'Ajouter réponse'
,
'add_answer_button'
=>
'Ajouter
une
réponse'
,
'add_comment_button'
=>
'Ajouter un commentaire'
,
'add_q_favorites'
=>
'Ajouter cette question à mes favoris'
,
'anon_name_label'
=>
'Votre nom à afficher (en option)'
,
...
...
qa-src/Controllers/Admin/Hidden.php
View file @
6ed03685
...
...
@@ -150,7 +150,7 @@ class Hidden extends BaseController
);
}
if
(
!
qa_user_post_permit_error
(
'permit_delete_hidden'
,
$question
)
&&
!
$dependcounts
[
$qhiddenpostid
[
$key
]]
)
{
if
(
!
qa_user_post_permit_error
(
'permit_delete_hidden'
,
$question
))
{
// Possible values for popup: delete_q_popup, delete_a_popup, delete_c_popup
$buttons
[
'delete'
]
=
array
(
'tags'
=>
'name="admin_'
.
qa_html
(
$qhiddenpostid
[
$key
])
.
'_delete" onclick="return qa_admin_click(this);"'
,
...
...
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