Jump to content

(NB41) Enhanced Advertisements


Recommended Posts

  • 2 weeks later...
Posted

have version 1.0.8 installed. Set up an ad to use geo countries. But it ignores the country and displays whatever country i choose. I select Argentina and still shows in uk.

Any ideas what could be wrong @newbie LAC ?

Posted

Hello,

16 minutes ago, loccom said:

have version 1.0.8 installed. Set up an ad to use geo countries. But it ignores the country and displays whatever country i choose. I select Argentina and still shows in uk.

Any ideas what could be wrong @newbie LAC ?

Could you tell me that UK ip address? I'll check it.

Be sure you use IPS GEO service.

Posted
2 minutes ago, newbie LAC said:

Hello,

Could you tell me that UK ip address? I'll check it.

Be sure you use IPS GEO service.

Its definatly a UK IP, I use the same ip on other systems, and I have GEO turned on in club enhancements too

ahh i think its because my IPS subscription ran out the other day. Clever old IPS

  • 3 weeks later...
Posted

Hi

I am trying to workaround the Adsence requiment for not serving ads in several topics with "improper" content.

this I could do with, 

{{if \IPS\Request::i()->app == 'forums' and \IPS\Request::i()->module == 'forums' and \IPS\Request::i()->controller == 'topic' and in_array(\IPS\Request::i()->id, array(107168,164188))}}

and serving the static ad with ELSE condition

but also I have several forums locked for guests and because IPS could no provide solution for allowing the Adsense crawler in this forums, google serve no ads there.

I tried to solve this issue with ELSEIF condition, but then whle code became too bulky and duplicate.

 

Coudl I somehow combine the following logic to serve the ads in the topic view:

If the ForumID = a,b,c OR TopicID=  d,e,f  then "Code1"

else "code 2"

 

Thank you

Posted (edited)

Hello,

13 minutes ago, Sergey_SV said:

Coudl I somehow combine the following logic to serve the ads in the topic view:

If the ForumID = a,b,c OR TopicID=  d,e,f  then "Code1"

 else "code 2"

{{$forumId = 0; $topicId = 0;}}
{{if \IPS\Request::i()->app == 'forums' and \IPS\Request::i()->module == 'forums' and \IPS\Request::i()->controller == 'forums'}}
    {{$forumId = \IPS\Request::i()->id;}}
{{elseif \IPS\Request::i()->app == 'forums' and \IPS\Request::i()->module == 'forums' and \IPS\Request::i()->controller == 'topic'}}
    {{$topicId = \IPS\Request::i()->id; try { $topic = \IPS\forums\Topic::loadAndCheckPerms(\IPS\Request::i()->id); $forumId = $topic->forum_id; } catch(\Exception $e) {};}}
{{endif}}
{{if in_array($forumId, array('a','b','c')) or in_array($topicId, array('d','e','f'))}}
	Code1
{{else}}
	code 2
{{endif}}

 

Edited by newbie LAC
Posted

I would not like to use variable "forumid" to specify all the forums where I do not want the advertisement. Would not it have another variable that could identify that we are in a club and thus not publish the banner?

Posted
15 minutes ago, newbie LAC said:

Hello,


{{$forumId = 0; $topicId = 0;}}
{{if \IPS\Request::i()->app == 'forums' and \IPS\Request::i()->module == 'forums' and \IPS\Request::i()->controller == 'forums'}}
    {{$forumId = \IPS\Request::i()->id;}}
{{elseif \IPS\Request::i()->app == 'forums' and \IPS\Request::i()->module == 'forums' and \IPS\Request::i()->controller == 'topic'}}
    {{$topicId = \IPS\Request::i()->id; try { $topic = \IPS\forums\Topic::loadAndCheckPerms(\IPS\Request::i()->id); $forumId = $topic->forum_id; } catch(\Exception $e) {};}}
{{endif}}
{{if in_array($forumId, array('a','b','c')) or in_array($topicId, array('d','e','f'))}}
	Code1
{{else}}
	code 2
{{endif}}

 

Great! worked like a charm

Posted
1 minute ago, DSyste said:

I would not like to use variable "forumid" to specify all the forums where I do not want the advertisement

No need to do it.

1 minute ago, DSyste said:

Would not it have another variable that could identify that we are in a club and thus not publish the banner?

No. Forum created in the club is a forum and looks like forum.

I added 1 variable to determine club pages

Wait while I'll upload new version

Posted
20 minutes ago, newbie LAC said:

Show advert on all pages except clubs


{{if !isset(\IPS\Output::i()->hiddenElements['nbenhadverts_club_id'])}}
    This advert doesn't display in clubs
{{endif}}

 

Worked like a charm. 😎

Would not it be nice to have nbenhadverts_forum_id too?

It would be simpler and I believe that faster too.

Posted
1 minute ago, DSyste said:

Would not it be nice to have nbenhadverts_forum_id too?

I added for nodes

\IPS\Output::i()->hiddenElements['nbenhadverts_node_id']

But this afffect to all nodes: forum, files category, calendar etc

You can use something like

{{if \IPS\Output::i()->hiddenElements['nbenhadverts_node_class'] == 'IPS\forums\Forum' and \IPS\Output::i()->hiddenElements['nbenhadverts_node_id'] == 5}}
	Show advert in the forum with ID 5 including topics
{{endif}}

 

Posted

Perfect !!! kiss.gif

My script before:

{{if request.app == 'forums' and request.module == 'forums' and request.do != 'add' and !isset(\IPS\Output::i()->hiddenElements['nbenhadverts_club_id'])}}
    {{$forumId = 0; try { $topic = \IPS\forums\Topic::loadAndCheckPerms( \IPS\Request::i()->id ); $forumId = $topic->forum_id; } catch( \Exception $e ) {};}}
{{if !in_array($forumId, array(26,10))}}1{{endif}}{{endif}}

 

Current Script:

{{if \IPS\Output::i()->hiddenElements['nbenhadverts_node_class'] == 'IPS\forums\Forum' and request.do != 'add' and !isset(\IPS\Output::i()->hiddenElements['nbenhadverts_club_id']) and !in_array(\IPS\Output::i()->hiddenElements['nbenhadverts_node_id'], array(26,10))}}1{{endif}}

 

Posted

Is anyone having issues with ads not auto renewing? 

In the last month even though invoices have been paid the ads linked to those are not auto renewed and are left disabled meaning I have to go and manually adjust the end date where as before this would be done automatically on invoice payment. 

Posted

Hello,

4 hours ago, gavpedz said:

Is anyone having issues with ads not auto renewing? 

In the last month even though invoices have been paid the ads linked to those are not auto renewed and are left disabled meaning I have to go and manually adjust the end date where as before this would be done automatically on invoice payment. 

Not sure this issue related with my app.

Posted (edited)

You can show an ad only after the user has created a topic?

Today I use this way but I do not have the expected result -> member.member_posts == 1

It would spend something like -> member.member_topics == 1

Edited by DSyste
Posted

Hello,

15 hours ago, DSyste said:

You can show an ad only after the user has created a topic?

sql-query only

{{if \IPS\Member::loggedIn()->member_id and \IPS\Db::i()->select('COUNT(*)', 'forums_topics', array('starter_id=?', \IPS\Member::loggedIn()->member_id))->first() == 1}}

 

  • 2 weeks later...
  • Recently Browsing   0 members

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