Ads Manager 2 Lite by Siropu

Ads Manager 2 Lite by Siropu [Paid] 1.2.11

No permission to buy (€29.99)
Try this code:

JavaScript:
<xf:js>
$(function()
{
     var unit = $('div[data-position="container_content_above"]');
     var stickyPoint = 0;

     if (unit.length)
     {
          $(window).scroll(function()
          {
               var unitScrollOffset = unit.offset().top;
               var scrollTop = $(document).scrollTop();

               if (unitScrollOffset - scrollTop <= 0 && stickyPoint == 0)
               {
                    unit.css({position: 'fixed', top: $('.p-nav').height() + 10, width: 'auto', 'z-index': 99});
                stickyPoint = scrollTop;
               }
               else if (stickyPoint >= scrollTop)
               {
                    unit.css({position: '', top: '', width: ''});
                stickyPoint = 0;
               }
          });
     }

     $(window).resize(function()
     {
           unit.css({position: '', top: '', width: ''});
     });
});
</xf:js>

It is based on the sidebar fixed code here: https://xenforo.com/community/resources/ads-manager-2-by-siropu.6153/field?field=faq
Thanks for this, it works great on mobile but on desktop the ad moves to the left of the screen upon scroll.
 
Try adding a value for right alignment in the code above (you can play with the value to match your website):

unit.css({position: 'fixed', top: $('.p-nav').height() + 10, width: 'auto', 'z-index': 99, right: 100});
 
Try adding a value for right alignment in the code above (you can play with the value to match your website):

unit.css({position: 'fixed', top: $('.p-nav').height() + 10, width: 'auto', 'z-index': 99, right: 100});
Thanks for that, I got it to work only to discover that scrolling upwards makes the page very jagged/jumpy and the ad flashes on and off, which is not a nice experience for my users who are used to a smooth scroll.

Thanks again for taking the time to look at this, I was so close to having this working but it's not fair to keep asking you for help with it so I don't mind if we just stop trying. (y)
 
Hello @Siropu,

i got the newest version of the lite version.

I would like to add a link to Amazon right after the first post and search there exactly as the title of the post is called and display the ad in XF's post layout.

Example:

Can you help me pls?
 
@oxygeno2, regarding "post style": just made a screenshot for you. As stated in the update, you have to use the "Settings" tab in the package (you can then assign your ads to that package):

Bildschirmfoto 2023-03-20 um 23.48.39.png
 
don't work for me
First, create a code type package with the position "Below first thread post container". When you select a Thread view position, a new option will show up in the package settings called "Display in post layout" where you can specify the thread author, avatar and title.

Create an ad that inherits the package settings and you are done.
 
Thanks @Siropu i just found it ;) (y).

Can you tell me how to program the following situation?

Code:
Hello "Threadstarter",

Have a look here: "Link: Threadtitle". Everyone will find what they are looking for there!

thanks in advance :)
 
Can you tell me how to program the following situation?
I tested this and it does not work:
HTML:
<xf:if is="$xf.visitor.user_id">
    Hello {{ $xf.visitor.username}},
<xf:else />
    Hello Guest,
</xf:if>
<br />
Go here <a href="https://google.com/?q={{ $thread.title|urlencode }}">{{ $thread.title }}</a>
You can display the user name, but you don't have access to $post or $thread, so you can not display the thread title easily. :(

Maybe Siropu can help you.
 
You can access the thread via {$xf.samParams.thread.title}
Oh, cool (y)

Tested, works:

HTML:
<xf:if is="$xf.visitor.user_id">
    Hello {{ $xf.visitor.username}},
<xf:else />
    Hello Guest,
</xf:if>
<br />
Go here <a href="https://google.com/?q={{ $xf.samParams.thread.title|urlencode }}">{{ $xf.samParams.thread.title }}</a>
 
Back
Top Bottom