Jump to content

(NB41) Enhanced Advertisements


Recommended Posts

Hello,

6 hours ago, Sonya* said:

Node?

Yes.

{{$show = true;}}
{{if $item = \IPS\Output::i()->hiddenElements['nbenhadverts_item_item'] and ($item->mapped('pinned') or $item->mapped('featured'))}}
	{{$show = false;}}
{{elseif $club = \IPS\Output::i()->hiddenElements['nbenhadverts_club'] and $club->featured}}
	{{$show = false;}}
{{endif}}
{{if $show}}
	Show advert everywhere except of pinned and featured items
{{endif}}

 

Link to comment
  • 3 weeks later...
  • 1 month later...

Type of advertisement: Supply HTML Code 
Show the advertisement: Just below the page header
HTML code:

<script type="text/javascript">

if(window.innerWidth > 1019)
{
    var forums = ["83", "84", "85", "86"];
    var forum_id = request.id;
    if (forums.includes(forum_id)
    {
        // Desktop tag/code 1
    }
    else
    {
        // Desktop tag/code 2
    }
}
else
{
    var forums = ["83", "84", "85", "86"];
    var forum_id = request.id;
    if (forums.includes(forum_id))
    {
        // Mobile tag/code 1
    }
    else
    {
        // Mobile tag/code 2
    }
}
</script>

There is JavaScript in the field of HTML code.. not even know if it's working but it's the best I can make.

1. The first "if" = Desktop or mobile.
2. The second "if" = Two tags available and the forum id defines which one is in use.

Now I don't know how to get "request.id" so do you have an idea how to solve this? Maybe Extra Condition field would work better?

@newbie LAC

Fixed version:

<script type="text/javascript">

if(window.innerWidth > 1019)
{
    var forums = [83, 84, 85, 86];
    var forum_id = {expression="(request.app == 'forums' and request.module == 'forums'and request.controller == 'forums' and isset(request.id)) ? request.id : 0"};
    if (forums.includes(forum_id))
    {
        // Desktop tag/code 1
    }
    else
    {
        // Desktop tag/code 2
    }
}
else
{
    var forums = [83, 84, 85, 86];
    var forum_id = {expression="(request.app == 'forums' and request.module == 'forums'and request.controller == 'forums' and isset(request.id)) ? request.id : 0"};
    if (forums.includes(forum_id))
    {
        // Mobile tag/code 1
    }
    else
    {
        // Mobile tag/code 2
    }
}
</script>

 

Edited by sulervo
Link to comment

Hello,

12 hours ago, sulervo said:

Now I don't know how to get "request.id" so do you have an idea how to solve this? Maybe Extra Condition field would work better?

 

    var forum_id = {expression="(request.app == 'forums' and request.module == 'forums'and request.controller == 'forums' and isset(request.id)) ? request.id : 0"};

 

Link to comment

Hello,

13 hours ago, sulervo said:

How about JavaScript solution? Sorry I forgot told it. Thank you.

 

// Topic view
var forum_id = {expression="(request.app == 'forums' and request.module == 'forums'and request.controller == 'topic') ? \IPS\Output::i()->hiddenElements['nbenhadverts_node_id'] : 0"};

 

Edited by newbie LAC
Link to comment
  • 1 month later...

Hello,

14 hours ago, jesuralem said:

Just so you know, i have 2 ads in the sidebar with your app, and for some reason i wasn't able to edit or move any block in the sidebar, any move just would not be saved.

I was able to do it disabling your app and re-enabling it once mu changes were made.

I need more information to reproduce

- Adverts settings

- Widgets locations

Link to comment
  • 2 weeks later...
  • 2 weeks later...
  • 2 weeks later...

Hi @newbie LAC

Just to make sure I understand correctly 🙂

I want on my Forum to add space for Google Adsense between posts in topic view. Every Topic, every page.
For example, after every 7th and 15th post (I have 20 post per page in topic view).
This application of yours can enable this?

Link to comment

Hello,

7 hours ago, Nesa said:

I want on my Forum to add space for Google Adsense between posts in topic view. Every Topic, every page.
For example, after every 7th and 15th post (I have 20 post per page in topic view).
This application of yours can enable this?

Yes

7 hours ago, Nesa said:

I want on my Forum to add space for Google Adsense between posts in topic view. Every Topic, every page.
For example, after every 7th and 15th post (I have 20 post per page in topic view).

You can also use 

 

Link to comment
  • 2 weeks later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...