Digital Point Ad Positioning

Digital Point Ad Positioning 1.3.0b

No permission to download
The ads always seem to show up on the first post of each page - not the most recent towards the bottom....did I set something up wrong?
 
The ads always seem to show up on the first post of each page - not the most recent towards the bottom....did I set something up wrong?
Current feature, only works for unread post.
If you have visited it once, then it will be display on the 1st post.
 
Maybe it's because I always check using Chrome's incognito window (no cookies)

I'm too lazy to log out in my regular browser. :)
 
For the feedback:

There is a problem with this line of code (from DigitalPointAdPositioning_ViewPublic_Thread_View):
PHP:
            $html = (string)$this->_params['posts'][$postIdForAd]['messageHtml'];

When a Bb Code has an empty content [bbcode][/bbcode], it breaks.

Here's a workaround but not clean at all. Replace above string with:
PHP:
            $arrayParams = (array) $this->_params['posts'][$postIdForAd]['messageHtml'];
            $html = reset($arrayParams);
            $parser = new XenForo_BbCode_Parser(XenForo_BbCode_Formatter_Base::create('Base'));
            $html= $parser->render($html);
 
A feedback to the feedback: the above workaround is not needed. the error with Bb Codes was coming from this:
When a Bb Code has no content the key 0 of $tag['children'][0] doesn't exist. So an error occurs.
 
  • Like
Reactions: rdn
So are you saying the workaround doesn't work?

Can you just check for an empty bbcode before you try to cast it?

something really crappy like:

Code:
if (! strstr( (string)$this->_params['posts'][$postIdForAd]['messageHtml'], '[bbcode][/bbcode]')) {
    $html = (string)$this->_params['posts'][$postIdForAd]['messageHtml'];
}
 
Quick question... can Xenforo tags and logic be used in the ad text? I want to switch advert size if I am in Responsive mode.

Cheers
 
Quick question... can Xenforo tags and logic be used in the ad text? I want to switch advert size if I am in Responsive mode.

Cheers
I used this on my ads to switch when in responsive view:

Code:
if ($(window).width() > 800)
{
/* Forum Bottom */
google_ad_slot = "XXXXXXXXXX";
google_ad_width = 728;
google_ad_height = 90;
}
else
{
/* Forum Bottom Small */
google_ad_slot = "YYYYYYYYYY";
google_ad_width = 468;
google_ad_height = 60;
}
 
A feedback to the feedback: the above workaround is not needed. the error with Bb Codes was coming from this:
When a Bb Code has no content the key 0 of $tag['children'][0] doesn't exist. So an error occurs.
Is that not needed? i am having the same issues. When logged in there is no issue. When i log out and click on random threads i get the issue detailed above by you.
 
Is that not needed? i am having the same issues. When logged in there is no issue. When i log out and click on random threads i get the issue detailed above by you.
I'm not sure sorry. The way the ads is inserted inside the message is a little brutal, may be an alternative solution could be found to avoid any problems.
 
I'd like to be able to hide an ad in a specific forum (In memoriam).
How can I do that? I tried:


<xen:if is="!in_array({$forum.node_id}, array(54))">
Content here
</xen:if>

No luck.

Pls advise :)
 
Hi @digitalpoint , so basically guests that aren't logged-in, would always see an ad in and after the first post on every page? since they're not logged-in, it's impossible to know which comment they read last? this is what I get at least from reading the first pages of this thread. Is that it or I"m doing something wrong? registered users see the ads in different places in the thread based on the newest comment, but guests aren't.

Thanks.
 
Last edited:
  • Like
Reactions: rdn
Hi @digitalpoint , so basically guests that aren't logged-in, would always see an ad in and after the first post on every page? since they're not logged-in, it's impossible to know which comment they read last? this is what I get at least, and from my understating reading the first pages of this thread. Is that it or I"m doing something wrong? registered users see the ads in different places in the thread based on the newest comment, but guests aren't.

Thanks.
Yes, that should be fix.
And also, be able to choose which node section to show ads.
 
Hi @digitalpoint , so basically guests that aren't logged-in, would always see an ad in and after the first post on every page? since they're not logged-in, it's impossible to know which comment they read last? this is what I get at least from reading the first pages of this thread. Is that it or I"m doing something wrong? registered users see the ads in different places in the thread based on the newest comment, but guests aren't.

Thanks.
Yep
 
Top Bottom