• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Add-on Post an ad as a message

Mr Lucky

Well-known member
#1
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

Well-known member
#2
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
 

Liam W

Well-known member
#4
You can use this code for an ad message appearance:

HTML:
<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="http://data-vocabulary.org/Person">
                <div class="messageUserBlock">
                    <div class="avatarHolder">
                        <span class="helper"></span>
                        <xen:avatar user="$visitor" size="m" img="true" />
                    </div>
                    <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>
                    </h3>
                    <span class="arrow"><span></span></span>
                </div>
            </div>
            <div class="messageInfo primaryContent">
                <div class="messageContent">
                    <article>
                        <blockquote class="messageText ugc baseHtml">
                           <xen:comment>Advert code goes below this line</xen:comment>
                        </blockquote>
                    </article>
                </div>
            </div>
        </li>
    </xen:if>
</xen:if>
From: https://xenforo.com/community/resources/responsive-adsense.2084/

Liam