XF 2.3 I need to create a button for marking the forum as read.. question about the date tag at the end.

zzlpolitics

Active member
So the Mark Read button has the below URL that seems to change with time. I assume it has a purpose. Well, if I were to paste that URL into an HTML template to create a button, the date number wont change. If I just remove everything after and including the ?, it still seems to mark the forum read but I'm assuming the date thing has a purpose.

other-topics.2/mark-read?date=1726206320

Does this make sense? Can I omit the ?date part and not cause any problems for users who want to mark the forum read?

Thanks as always.
 
Solution
You should use the xenForo link syntax for this button:
HTML:
<xf:button href="{{ link('forums/mark-read', '-', {'date': $xf.time}) }}" data-xf-click="overlay">Mark forums read</xf:button>
You can add a class if you need it.
You should use the xenForo link syntax for this button:
HTML:
<xf:button href="{{ link('forums/mark-read', '-', {'date': $xf.time}) }}" data-xf-click="overlay">Mark forums read</xf:button>
You can add a class if you need it.
 
Solution
You should use conditional too:
HTML:
<xf:if is="$xf.visitor.user_id">
    <xf:button href="{{ link('forums/mark-read', '-', {'date': $xf.time}) }}" data-xf-click="overlay">Mark forums read</xf:button>
</xf:if>
Because a simple visitor cannot mark the forums as read, this is reserved for members and therefore only displayed to them.
 
Back
Top Bottom