1. 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

Discussion in 'Resource and Add-on Requests' started by Mr Lucky, Aug 15, 2016.

  1. Mr Lucky

    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.
  2. Liam W

    Liam W Well-Known Member

    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.

  3. Mr Lucky

    Mr Lucky Well-Known Member

    Thanks, I'll have a look.

    I did some searches but it only brought up basic a positioning or ad placement addons
  4. Liam W

    Liam W Well-Known Member

    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="http://data-vocabulary.org/Person">
                    <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>
    From: https://xenforo.com/community/resources/responsive-adsense.2084/

    Mr Lucky likes this.

Share This Page