2024-10-24, 07:58 AM
I am using the Curves UI-alpha theme and could not delete threads or posts as a registered user. I tracked it down to a missing </form> in the editpost_delete template (within the Edit Post Templates group).
I also added a label for the checkbox so that a user can click on the word rather than trying to click on the checkbox, to indicate they want the post deleted. Changes are indicated in bold below:
<form action="editpost.php" method="post" name="editpost">
<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
<div class="card border-0 mb-4">
<div class="card-header rounded-bottom text-19 fw-bold">
{$lang->edit_post}
</div>
<div class="card-body">
<div class="row g-2 pb-3 border-bottom">
<div class="col-lg-auto align-self-center border-end pe-3 me-3">
<input type="checkbox" class="form-check-input" name="delete" value="1" tabindex="9" id="delete-post" /> <label for="delete-post"> {$lang->delete_q}</label>
</div>
<div class="col-lg align-self-center">
<i class="fa-solid fa-circle-exclamation text-danger"></i> {$lang->delete_2}
</div>
<div class="col-lg-auto text-end align-self-center">
<input type="submit" class="btn btn-danger" name="submit" value="{$lang->delete_now}" tabindex="10" />
<input type="hidden" name="action" value="deletepost" />
<input type="hidden" name="pid" value="{$pid}" />
</form>
</div>
</div>
</div></div>
I also added a label for the checkbox so that a user can click on the word rather than trying to click on the checkbox, to indicate they want the post deleted. Changes are indicated in bold below:
<form action="editpost.php" method="post" name="editpost">
<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
<div class="card border-0 mb-4">
<div class="card-header rounded-bottom text-19 fw-bold">
{$lang->edit_post}
</div>
<div class="card-body">
<div class="row g-2 pb-3 border-bottom">
<div class="col-lg-auto align-self-center border-end pe-3 me-3">
<input type="checkbox" class="form-check-input" name="delete" value="1" tabindex="9" id="delete-post" /> <label for="delete-post"> {$lang->delete_q}</label>
</div>
<div class="col-lg align-self-center">
<i class="fa-solid fa-circle-exclamation text-danger"></i> {$lang->delete_2}
</div>
<div class="col-lg-auto text-end align-self-center">
<input type="submit" class="btn btn-danger" name="submit" value="{$lang->delete_now}" tabindex="10" />
<input type="hidden" name="action" value="deletepost" />
<input type="hidden" name="pid" value="{$pid}" />
</form>
</div>
</div>
</div></div>