Add-on Post an ad as a message

Mr Lucky

Well-known member
There may already be an addon that does this, I'm sure I've seen it on some forums.

I don't mean just place the ad in a message that a user has posted.

This addon would create a dedicated user and post the ad as a message as that user (e.g. as second post of every thread)

You specify the name of the user, e.g. Advertisement, or Sponsored ad.

Liam W

in memoriam 1998-2020
You can do this by placing the ad code in surrounding tags to mimic a post in the relevant ad template...

I'm not sure of the full structure at the moment, but I'm pretty sure it's in an FAQ thread somewhere.


Liam W

in memoriam 1998-2020
You can use this code for an ad message appearance:

<xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 AND {$thread.reply_count} > 0">
    <xen:if is="!{$visitor.user_id}">
        <li class="message">
            <div class="messageUserInfo" itemscope="itemscope" itemtype="">
                <div class="messageUserBlock">
                    <div class="avatarHolder">
                        <span class="helper"></span>
                        <xen:avatar user="$visitor" size="m" img="true" />
                    <h3 class="userText">
                    <span style="font-weight: bold"><xen:comment>Username goes here (outside comment tags)</xen:comment></span>
                    <em class="userTitle" itemprop="title"><xen:comment>User title goes here (outside comment tags)</xen:comment></em>
                    <span class="arrow"><span></span></span>
            <div class="messageInfo primaryContent">
                <div class="messageContent">
                        <blockquote class="messageText ugc baseHtml">
                           <xen:comment>Advert code goes below this line</xen:comment>