• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Digital Point Ad Positioning

Digital Point Ad Positioning 1.3.0b

No permission to download

digitalpoint

Well-known member
Doesn't look like that's from 1.5.3 serialization or from PHP7. That looks like somewhere upstream the array of posts to be displayed in the view renderer was changed. Specifically it's trying to display an ad on a post that no longer exists in the array of posts to show. Maybe some addon is doing something with the $posts array. You could probably change this:
PHP:
(!$userModel->isMemberOfUserGroup(@$this->_params['posts'][@$postIdForAd], $options->dppa_insidepost_hidepostby) || !XenForo_Visitor::getUserId())
to this:
PHP:
(!$userModel->isMemberOfUserGroup((array)@$this->_params['posts'][@$postIdForAd], $options->dppa_insidepost_hidepostby) || !XenForo_Visitor::getUserId())
That will force the (now) null post to be an empty array at least.
 

RoldanLT

Well-known member
Doesn't look like that's from 1.5.3 serialization or from PHP7. That looks like somewhere upstream the array of posts to be displayed in the view renderer was changed. Specifically it's trying to display an ad on a post that no longer exists in the array of posts to show. Maybe some addon is doing something with the $posts array. You could probably change this:
PHP:
(!$userModel->isMemberOfUserGroup(@$this->_params['posts'][@$postIdForAd], $options->dppa_insidepost_hidepostby) || !XenForo_Visitor::getUserId())
to this:
PHP:
(!$userModel->isMemberOfUserGroup((array)@$this->_params['posts'][@$postIdForAd], $options->dppa_insidepost_hidepostby) || !XenForo_Visitor::getUserId())
That will force the (now) null post to be an empty array at least.
I will apply this once I encounter that error again.
Thanks!
 

RoldanLT

Well-known member
Doesn't look like that's from 1.5.3 serialization or from PHP7. That looks like somewhere upstream the array of posts to be displayed in the view renderer was changed. Specifically it's trying to display an ad on a post that no longer exists in the array of posts to show. Maybe some addon is doing something with the $posts array. You could probably change this:
PHP:
(!$userModel->isMemberOfUserGroup(@$this->_params['posts'][@$postIdForAd], $options->dppa_insidepost_hidepostby) || !XenForo_Visitor::getUserId())
to this:
PHP:
(!$userModel->isMemberOfUserGroup((array)@$this->_params['posts'][@$postIdForAd], $options->dppa_insidepost_hidepostby) || !XenForo_Visitor::getUserId())
That will force the (now) null post to be an empty array at least.
You current code on the addon is this:
(!$userModel->isMemberOfUserGroup(@@$this->_params['posts'][@$postIdForAd], $options->dppa_insidepost_hidepostby) || !XenForo_Visitor::getUserId())
Why having double @ ?
@@$this->_params
 

Sunka

Well-known member
I got this error on PHP 7.0.0 Server.
Code:
Server Error Log

Error Info
TypeError: Argument 1 passed to XenForo_Model_User::isMemberOfUserGroup() must be of the type array, null given, called in /library/DigitalPointAdPositioning/ViewPublic/Thread/View.php on line 41 - library/XenForo/Model/User.php:1707
Generated By: Unknown Account, Today at 5:41 AM

Stack Trace
#0 /library/DigitalPointAdPositioning/ViewPublic/Thread/View.php(41): XenForo_Model_User->isMemberOfUserGroup(NULL, Array)
#1 /library/XenForo/ViewRenderer/Abstract.php(227): DigitalPointAdPositioning_ViewPublic_Thread_View->renderHtml()
#2 /library/XenForo/ViewRenderer/HtmlPublic.php(71): XenForo_ViewRenderer_Abstract->renderViewObject('DigitalPointAdP...', 'Html', Array, 'thread_view')
#3 /library/XenForo/FrontController.php(604): XenForo_ViewRenderer_HtmlPublic->renderView('XenForo_ViewPub...', Array, 'thread_view', NULL)
#4 /library/XenForo/FrontController.php(158): XenForo_FrontController->renderView(Object(XenForo_ControllerResponse_View), Object(XenForo_ViewRenderer_HtmlPublic), Array)
#5 /index.php(13): XenForo_FrontController->run()
#6 {main}

Request State
array(3) {
  ["url"] => string(102) "http://www.myforum.com/thread/81/"
  ["_GET"] => array(1) {
    ["/thread/81/"] => string(0) ""
  }
  ["_POST"] => array(0) {
  }
}
How to manually patch this?
Thanks!
Doesn't look like that's from 1.5.3 serialization or from PHP7. That looks like somewhere upstream the array of posts to be displayed in the view renderer was changed. Specifically it's trying to display an ad on a post that no longer exists in the array of posts to show. Maybe some addon is doing something with the $posts array. You could probably change this:
PHP:
(!$userModel->isMemberOfUserGroup(@$this->_params['posts'][@$postIdForAd], $options->dppa_insidepost_hidepostby) || !XenForo_Visitor::getUserId())
to this:
PHP:
(!$userModel->isMemberOfUserGroup((array)@$this->_params['posts'][@$postIdForAd], $options->dppa_insidepost_hidepostby) || !XenForo_Visitor::getUserId())
That will force the (now) null post to be an empty array at least.
Just replace "@@" with "@" and you have it. :)
Similiar error show to me too, like @RoldanLT
Which template exactly to edit?

from
PHP:
(!$userModel->isMemberOfUserGroup(@$this->_params['posts'][@$postIdForAd], $options->dppa_insidepost_hidepostby) || !XenForo_Visitor::getUserId())
to
PHP:
(!$userModel->isMemberOfUserGroup((array)@$this->_params['posts'][@$postIdForAd], $options->dppa_insidepost_hidepostby) || !XenForo_Visitor::getUserId())
 

gavpeds

Active member
That's the other issue... It *is* against AdSense ToS to move ads in any way.
I have used this adon in the past and want to use again. But if this is against adsens ToS then would using this adon not be a great edia as ads are moved to which ever lost is viewed or am I missing something?

Oh and is this still working with the latest xenforo update?
 

MrDeranged

Well-known member
Trying to use this addon to show ads inside the currently viewed post for guests and it's acting a bit wonky. Not sure if it's working as intended or if I'm doing something wrong so I had some questions.

If a guest follows a link to a post in the middle of a page, should the ad be showing up in that post? For example, I just followed a permalink to post 7 on a 56 post thread and the ad is showing up in post 1. I thought it was supposed to show in the currently viewed post?

Is the ad supposed to show in the same spot in the post each time, or is it random? I'm experiencing the following:

upload_2015-12-13_13-19-43.png

same post after reloading page:

upload_2015-12-13_13-24-14.png

Thanks in advance.
 

MrDeranged

Well-known member
So even if a guest uses a permalink to the site, XF doesn't know what post the guest is looking at? That's kind of "duh", lol. This would have been perfect if it worked for guests. I d0n't want to show registered users ads inside posts.

Thanks for the clarification. :)
 

woody

Active member
I've used this plugin successfully on my forum for some time. http://forum.ih8mud.com The PixelExit skin was recently updated, and the "Insert Ad After Post" no longer displays an ad when viewing the forum on desktop. Mobile works just fine. The ad code is still present (DFP), but no ads appear.

Any thoughts welcome, I've been chatting with @Russ on this as well and thus far, no solution.
 

digitalpoint

Well-known member
Sorry, I don't know anything about third party skins. It's designed to work with the default XF theme. Some third party skins might still work with it if they are similar enough to the default theme.
 
Any idea why Adsense (responsive) overlaps 2nd posts randomly? I'm using the same add-on version on two different forums, and it seems like it's only affecting the one where I converted from vB -> xF. I'm not using custom skins on either.
 

digitalpoint

Well-known member
The system doesn't do anything special with HTML. I would just make sure the ad code you are injecting with the addon is the same between both forums.