XF 2.1 How do I remove the confirmation message when marking forums read?

Edelheid

Member
Hi, would anyone know how to get this done? I would be grateful for any help.

I'm referring to the Forums > Mark forums read (dropdown option). Many years ago in XF 1 IIRC this used to be the controller file, but unsure where it is now or if it's the same procedure.
 
So just to add my 5 cents within 30 min of bringing XF up (from vb) I was asked if it were possible to remove the confirmation prompt for "mark all read". Is this just a user with a personal hang up, maybe, but adding a checkbox there would not hurt and wouldn't technically break the principle of warning the user before an irreversible operation.

That said I recall seeing somewhere how to do this (modifying some php file), or maybe I didn't, but now I cannot find it in the search. If it exists and it's not just sleep deprivation can someone link me to it?

Also, can this be done via the add-on mechanism so as to avoid modifying php files? I version control everything and would rather not have to constantly rebase when updating XF.

PS - Kindly nobody PM me that you can do this as professional services, save my delete button some wear, no offense but I can very much do it myself if it comes to that. Kind regards.
 
Minimal change solution: submit confirmation form automatically by javascript - I could not find any other sane way, since the code expects a POST-call with tokens and stuff.

Edit style template: mark_forum_thread

Changes highlighted in red. Sorry, wasn't able to change text color inside a code block, so pasting as is.. just copy the red bits if needed..

(edit: added overlay-container hide for cleaner click)

<xf:if is="$forum">
<xf:title>{{ phrase('mark_forum_read') }}</xf:title>
<xf:else />
<xf:title>{{ phrase('mark_forums_read') }}</xf:title>
</xf:if>

<xf:form action="{{ link('forums/mark-read', $forum, {'date': $date}) }}" class="block" ajax="true" id="_customidMarkForumsRead">
<div class="block-container" style="display: none;">
<xf:if is="$forum">
<div class="block-body">
<xf:inforow rowtype="confirm">
{{ phrase('you_sure_you_want_to_mark_this_forum_read') }}
<strong><a href="{{ link('forums', $forum) }}">{$forum.title}</a></strong>
</xf:inforow>
</div>
<xf:submitrow submit="{{ phrase('mark_forum_read') }}" rowtype="simple" icon="markRead" />
<xf:else />
<div class="block-body">
<xf:inforow rowtype="confirm">{{ phrase('you_sure_you_want_to_mark_all_forums_read') }}</xf:inforow>
</div>
<xf:submitrow submit="{{ phrase('mark_forums_read') }}" rowtype="simple" icon="markRead" />
</xf:if>
</div>
</xf:form>

<xf:js>
$('.overlay-container').hide();

$('#_customidMarkForumsRead').submit();
</xf:js>
 
Last edited:
Minimal change solution: submit confirmation form automatically by javascript - I could not find any other sane way, since the code expects a POST-call with tokens and stuff.

Edit style template: mark_forum_thread

Changes highlighted in red. Sorry, wasn't able to change text color inside a code block, so pasting as is.. just copy the red bits if needed..

(edit: added overlay-container hide for cleaner click)

<xf:if is="$forum">
<xf:title>{{ phrase('mark_forum_read') }}</xf:title>
<xf:else />
<xf:title>{{ phrase('mark_forums_read') }}</xf:title>
</xf:if>

<xf:form action="{{ link('forums/mark-read', $forum, {'date': $date}) }}" class="block" ajax="true" id="_customidMarkForumsRead">
<div class="block-container" style="display: none;">
<xf:if is="$forum">
<div class="block-body">
<xf:inforow rowtype="confirm">
{{ phrase('you_sure_you_want_to_mark_this_forum_read') }}
<strong><a href="{{ link('forums', $forum) }}">{$forum.title}</a></strong>
</xf:inforow>
</div>
<xf:submitrow submit="{{ phrase('mark_forum_read') }}" rowtype="simple" icon="markRead" />
<xf:else />
<div class="block-body">
<xf:inforow rowtype="confirm">{{ phrase('you_sure_you_want_to_mark_all_forums_read') }}</xf:inforow>
</div>
<xf:submitrow submit="{{ phrase('mark_forums_read') }}" rowtype="simple" icon="markRead" />
</xf:if>
</div>
</xf:form>

<xf:js>
$('.overlay-container').hide();

$('#_customidMarkForumsRead').submit();
</xf:js>
This is a great solution, thanks.
 
Actual great solution:

$5 bucks or 2 minutes of my time to modify the template with the exact same result. This place will nickel and dime you to death for simple changes.
 
2 minutes of my time to modify the template
It's going to take you more than two minutes to find the nonexistent style template "mark_forum_thread."

The actual style template for this is gonna be: "forum_mark_read"

You can hack that template for all your styles as you install them, or you can take care of it the right way by using the addon.

Keep in mind that template hacks can crop up later as interference with custom styles, a lot of which depend on the templates not being modified.
 
We don't hard delete posts.

The thread you started is here: https://xenforo.com/community/threads/unregistered-unable-to-mark-forums-read.159366/

It has a total of 3 posts and no deleted posts.

The other thread is this with no replies: https://xenforo.com/community/threa...k-read-and-mark-read-for-unregistered.159406/

What you are claiming simply didn't happen.
But you deleted a post by me. Why did you do it? Do you want to scare away customers or what is your purpose? We are customers here, not someone who wants to quarrel. You seem to take everything personally and you are probably not that helpful. I very much regret that I bought Xenforo when I see how you behave towards customers who pay money and get this back?
 
But you deleted a post by me. Why did you do it? Do you want to scare away customers or what is your purpose? We are customers here, not someone who wants to quarrel. You seem to take everything personally and you are probably not that helpful. I very much regret that I bought Xenforo when I see how you behave towards customers who pay money and get this back?
Sigh ...

You have 9 posts on this site.

None of them have been deleted, by me or anyone else.
 
Top Bottom