[tl] Anonymous Posting

xF2 Add-on [tl] Anonymous Posting 2.1.3

No permission to download

Lordnikon22

Member
Registered
Joined
Jul 12, 2022
Messages
23
Points
13

Reputation:

This is my quick_reply_macros tempate:


PHP:
<xf:macro name="body"
    arg-message=""
    arg-attachmentData="{{ null }}"
    arg-forceHash=""
    arg-messageSelector=""
    arg-multiQuoteHref=""
    arg-multiQuoteStorageKey=""
    arg-simple="{{ false }}"
    arg-submitText=""
    arg-lastDate="0"
    arg-lastKnownDate="0"
    arg-loadExtra="{{ true }}"
    arg-simpleSubmit="{{ false }}"
    arg-minHeight="100"
    arg-placeholder="{{ phrase('reply_placeholder') }}"
    arg-deferred="{{ false }}"
    arg-showGuestControls="{{ true }}"
    arg-previewUrl="">

    <xf:css src="message.less" />
    <xf:set var="$sticky" value="{{ property('messageSticky') }}" />

    <div class="message message--quickReply block-topRadiusContent block-bottomRadiusContent{{ $simple ? ' message--simple' : '' }}">
        <div class="message-inner">
            <div class="message-cell message-cell--user">
                <div class="message-user {{ $sticky.user_info ? 'is-sticky' : '' }}">
                    <div class="message-avatar">
                        <div class="message-avatar-wrapper">
                            <xf:set var="$user" value="{{ $xf.visitor.user_id ? $xf.visitor : null }}" />
                            <xf:avatar user="$user" size="{{ $simple ? 's' : 'm' }}" defaultname="" />
                        </div>
                    </div>
                    <span class="message-userArrow"></span>
                </div>
            </div>
            <div class="message-cell message-cell--main">
                <div class="message-editorWrapper">
                    <xf:set var="$editorHtml">
                        <xf:macro name="editor"
                            arg-message="{$message}"
                            arg-attachmentData="{$attachmentData}"
                            arg-forceHash="{$forceHash}"
                            arg-messageSelector="{$messageSelector}"
                            arg-multiQuoteHref="{$multiQuoteHref}"
                            arg-multiQuoteStorageKey="{$multiQuoteStorageKey}"
                            arg-minHeight="{$minHeight}"
                            arg-placeholder="{$placeholder}"
                            arg-submitText="{$submitText}"
                            arg-deferred="{$deferred}"
                            arg-lastDate="{$lastDate}"
                            arg-lastKnownDate="{$lastKnownDate}"
                            arg-loadExtra="{$loadExtra}"
                            arg-simpleSubmit="{$simpleSubmit}"
                            arg-showGuestControls="{$showGuestControls}"
                            arg-previewUrl="{$previewUrl}"
                        />
                    </xf:set>

                    <xf:if is="$deferred">
                        <div class="editorPlaceholder" data-xf-click="editor-placeholder">
                            <div class="editorPlaceholder-editor is-hidden">{$editorHtml|raw}</div>
                            <div class="editorPlaceholder-placeholder">
                                <div class="input"><span class="u-muted"> {$placeholder}</span></div>
                            </div>
                        </div>
                    <xf:else />
                        {$editorHtml|raw}
                    </xf:if>
                </div>
            </div>
        </div>
    </div>
</xf:macro>

<xf:macro name="editor"
    arg-message=""
    arg-attachmentData="{{ null }}"
    arg-forceHash=""
    arg-messageSelector=""
    arg-multiQuoteHref=""
    arg-multiQuoteStorageKey=""
    arg-minHeight="100"
    arg-placeholder=""
    arg-submitText=""
    arg-deferred="{{ false }}"
    arg-lastDate="0"
    arg-lastKnownDate="0"
    arg-loadExtra="{{ true }}"
    arg-simpleSubmit="{{ false }}"
    arg-showGuestControls="{{ true }}"
    arg-previewUrl=""
>
    <xf:editor name="message"
        value="{$message}"
        attachments="{{ $attachmentData ? $attachmentData.attachments : [] }}"
        data-min-height="{$minHeight}"
        placeholder="{$placeholder}"
        data-deferred="{{ $deferred ? 'on' : 'off' }}"
        data-xf-key="{{ phrase('shortcut.quick_reply') }}"
        data-preview-url="{$previewUrl}" />

    <xf:if is="!$xf.visitor.user_id && $showGuestControls">
        <xf:textboxrow name="_xfUsername" rowtype="fullWidth noGutter" data-xf-init="guest-username"
            maxlength="{{ max_length($xf.visitor, 'username') }}"
            label="{{ phrase('name') }}" />
    </xf:if>
    <xf:if is="$xf.visitor.isShownCaptcha()">
        <div class="js-captchaContainer" data-row-type="fullWidth noGutter"></div>
        <noscript><xf:hiddenval name="no_captcha" value="1" /></noscript>
    </xf:if>

    <xf:if is="$attachmentData">
        <xf:macro template="helper_attach_upload" name="uploaded_files_list"
            arg-attachments="{$attachmentData.attachments}"
            arg-class="attachmentUploads--spaced" />
    </xf:if>

    <div class="formButtonGroup {{ $simpleSubmit ? 'formButtonGroup--simple' : '' }}">
        <div class="formButtonGroup-primary">
            <xf:button type="submit" class="button--primary" icon="reply">
                {{ $submitText ?: phrase('post_reply') }}
            </xf:button>
        </div>
        <xf:if contentcheck="true">
            <div class="formButtonGroup-extra">
                <xf:contentcheck>
                    <xf:if is="$attachmentData">
                        <xf:macro template="helper_attach_upload" name="upload_link_from_data"
                            arg-attachmentData="{$attachmentData}"
                            arg-forceHash="{$forceHash}" />
                    </xf:if>
                    <xf:if is="$xf.options.multiQuote && $multiQuoteHref">
                        <xf:macro template="multi_quote_macros" name="button"
                            arg-href="{$multiQuoteHref}"
                            arg-messageSelector="{$messageSelector}"
                            arg-storageKey="{$multiQuoteStorageKey}" />
                    </xf:if>
                </xf:contentcheck>
            </div>
        </xf:if>
        <xf:hiddenval name="last_date" autocomplete="off">{$lastDate}</xf:hiddenval>
        <xf:hiddenval name="last_known_date" autocomplete="off">{$lastKnownDate}</xf:hiddenval>
        <xf:hiddenval name="load_extra">{{ $loadExtra ? 1 : 0 }}</xf:hiddenval>
    </div>
</xf:macro>

Can't find that line.
 
Last edited:

BattleKing

Spirit of darkness
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P Member
Collaborate
Registered
Joined
May 24, 2020
Messages
3,514
Points
523

Reputation:

This is my quick_reply_macros tempate:


PHP:
<xf:macro name="body"
    arg-message=""
    arg-attachmentData="{{ null }}"
    arg-forceHash=""
    arg-messageSelector=""
    arg-multiQuoteHref=""
    arg-multiQuoteStorageKey=""
    arg-simple="{{ false }}"
    arg-submitText=""
    arg-lastDate="0"
    arg-lastKnownDate="0"
    arg-loadExtra="{{ true }}"
    arg-simpleSubmit="{{ false }}"
    arg-minHeight="100"
    arg-placeholder="{{ phrase('reply_placeholder') }}"
    arg-deferred="{{ false }}"
    arg-showGuestControls="{{ true }}"
    arg-previewUrl="">

    <xf:css src="message.less" />
    <xf:set var="$sticky" value="{{ property('messageSticky') }}" />

    <div class="message message--quickReply block-topRadiusContent block-bottomRadiusContent{{ $simple ? ' message--simple' : '' }}">
        <div class="message-inner">
            <div class="message-cell message-cell--user">
                <div class="message-user {{ $sticky.user_info ? 'is-sticky' : '' }}">
                    <div class="message-avatar">
                        <div class="message-avatar-wrapper">
                            <xf:set var="$user" value="{{ $xf.visitor.user_id ? $xf.visitor : null }}" />
                            <xf:avatar user="$user" size="{{ $simple ? 's' : 'm' }}" defaultname="" />
                        </div>
                    </div>
                    <span class="message-userArrow"></span>
                </div>
            </div>
            <div class="message-cell message-cell--main">
                <div class="message-editorWrapper">
                    <xf:set var="$editorHtml">
                        <xf:macro name="editor"
                            arg-message="{$message}"
                            arg-attachmentData="{$attachmentData}"
                            arg-forceHash="{$forceHash}"
                            arg-messageSelector="{$messageSelector}"
                            arg-multiQuoteHref="{$multiQuoteHref}"
                            arg-multiQuoteStorageKey="{$multiQuoteStorageKey}"
                            arg-minHeight="{$minHeight}"
                            arg-placeholder="{$placeholder}"
                            arg-submitText="{$submitText}"
                            arg-deferred="{$deferred}"
                            arg-lastDate="{$lastDate}"
                            arg-lastKnownDate="{$lastKnownDate}"
                            arg-loadExtra="{$loadExtra}"
                            arg-simpleSubmit="{$simpleSubmit}"
                            arg-showGuestControls="{$showGuestControls}"
                            arg-previewUrl="{$previewUrl}"
                        />
                    </xf:set>

                    <xf:if is="$deferred">
                        <div class="editorPlaceholder" data-xf-click="editor-placeholder">
                            <div class="editorPlaceholder-editor is-hidden">{$editorHtml|raw}</div>
                            <div class="editorPlaceholder-placeholder">
                                <div class="input"><span class="u-muted"> {$placeholder}</span></div>
                            </div>
                        </div>
                    <xf:else />
                        {$editorHtml|raw}
                    </xf:if>
                </div>
            </div>
        </div>
    </div>
</xf:macro>

<xf:macro name="editor"
    arg-message=""
    arg-attachmentData="{{ null }}"
    arg-forceHash=""
    arg-messageSelector=""
    arg-multiQuoteHref=""
    arg-multiQuoteStorageKey=""
    arg-minHeight="100"
    arg-placeholder=""
    arg-submitText=""
    arg-deferred="{{ false }}"
    arg-lastDate="0"
    arg-lastKnownDate="0"
    arg-loadExtra="{{ true }}"
    arg-simpleSubmit="{{ false }}"
    arg-showGuestControls="{{ true }}"
    arg-previewUrl=""
>
    <xf:editor name="message"
        value="{$message}"
        attachments="{{ $attachmentData ? $attachmentData.attachments : [] }}"
        data-min-height="{$minHeight}"
        placeholder="{$placeholder}"
        data-deferred="{{ $deferred ? 'on' : 'off' }}"
        data-xf-key="{{ phrase('shortcut.quick_reply') }}"
        data-preview-url="{$previewUrl}" />

    <xf:if is="!$xf.visitor.user_id && $showGuestControls">
        <xf:textboxrow name="_xfUsername" rowtype="fullWidth noGutter" data-xf-init="guest-username"
            maxlength="{{ max_length($xf.visitor, 'username') }}"
            label="{{ phrase('name') }}" />
    </xf:if>
    <xf:if is="$xf.visitor.isShownCaptcha()">
        <div class="js-captchaContainer" data-row-type="fullWidth noGutter"></div>
        <noscript><xf:hiddenval name="no_captcha" value="1" /></noscript>
    </xf:if>

    <xf:if is="$attachmentData">
        <xf:macro template="helper_attach_upload" name="uploaded_files_list"
            arg-attachments="{$attachmentData.attachments}"
            arg-class="attachmentUploads--spaced" />
    </xf:if>

    <div class="formButtonGroup {{ $simpleSubmit ? 'formButtonGroup--simple' : '' }}">
        <div class="formButtonGroup-primary">
            <xf:button type="submit" class="button--primary" icon="reply">
                {{ $submitText ?: phrase('post_reply') }}
            </xf:button>
        </div>
        <xf:if contentcheck="true">
            <div class="formButtonGroup-extra">
                <xf:contentcheck>
                    <xf:if is="$attachmentData">
                        <xf:macro template="helper_attach_upload" name="upload_link_from_data"
                            arg-attachmentData="{$attachmentData}"
                            arg-forceHash="{$forceHash}" />
                    </xf:if>
                    <xf:if is="$xf.options.multiQuote && $multiQuoteHref">
                        <xf:macro template="multi_quote_macros" name="button"
                            arg-href="{$multiQuoteHref}"
                            arg-messageSelector="{$messageSelector}"
                            arg-storageKey="{$multiQuoteStorageKey}" />
                    </xf:if>
                </xf:contentcheck>
            </div>
        </xf:if>
        <xf:hiddenval name="last_date" autocomplete="off">{$lastDate}</xf:hiddenval>
        <xf:hiddenval name="last_known_date" autocomplete="off">{$lastKnownDate}</xf:hiddenval>
        <xf:hiddenval name="load_extra">{{ $loadExtra ? 1 : 0 }}</xf:hiddenval>
    </div>
</xf:macro>

Can't find that line.
Lordnikon22sorry my mistake and not clear enough, it is the template modification which you need to change, the one from the addon

1699369605195.png
 

Lordnikon22

Member
Registered
Joined
Jul 12, 2022
Messages
23
Points
13

Reputation:

Lordnikon22

Member
Registered
Joined
Jul 12, 2022
Messages
23
Points
13

Reputation:

Oh, i need to add in my ini $config['development']['enabled'] = true; ?
 

BattleKing

Spirit of darkness
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P Member
Collaborate
Registered
Joined
May 24, 2020
Messages
3,514
Points
523

Reputation:

View previous replies…

Lordnikon22

Member
Registered
Joined
Jul 12, 2022
Messages
23
Points
13

Reputation:

Just a note, i disabled the Quick Reply in my forum, only use the normal reply box.

But anyways i tried the modification in thread_reply but still not rendering the CheckBox.

Still same problem, if i disable attach permission the CheckBox is missing:

https://streamable.com/mrotpo
 

BattleKing

Spirit of darkness
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P Member
Collaborate
Registered
Joined
May 24, 2020
Messages
3,514
Points
523

Reputation:

Just a note, i disabled the Quick Reply in my forum, only use the normal reply box.

But anyways i tried the modification in thread_reply but still not rendering the CheckBox.

Still same problem, if i disable attach permission the CheckBox is missing:

https://streamable.com/mrotpo
Lordnikon22did you checked that the forum you are looking into is enable for anonymous posts, it works great on my installation
 
Top