kkm323
Well-known member
noAre there unread posts on the page you are looking at?
noAre there unread posts on the page you are looking at?
Since it's based on the unread link, if the unread link is set to #post-12000, and post ID 12000 exists on the page, I can't think of any way at all that the ad wouldn't be attached to that post. Are you 100% certain that Post ID 12000 is on the page you are looking at?Sometimes I click on a thread I never read before and I am redirected to the newest post (lets say the last post of the eight posts of the thread). But the ad is placed in the first post of the page.
1. from forum_list you click on the latest thread. http://domain.com/posts/12345
2. posts/12345 redirects to threads/23483/#post-12345
Browser is navigating to this post
3. $this->_params['unreadLink'] is set to the first post (let's say it is #post-12000).
Ad is displaying at the first post which is not within the first browser view at all
Any ideas how to solve that as easy as possible?
Yeah, I'm not sure why the addon he was using was causing it, but ultimately when it comes down to it, if you have a BBCode addon that is doing something weird with the "magic method" __ToString() for itself, it would cause problems.This is a nice add on but there're plenty of threads where I had errors and could not access them. similar to Russ bug
There are some settings on the options page that gives you some control over usergroups and forums to display ads in already... As far as making the ad HTML have some freeform logic, it's probably not going to be possible since it's HTML and not BBCode. If you make it all BBCode, then you would lose the ability to do things like include JavaScript (important for most ad serving).I ended up disabling the built in ones to that add-on and the problem went away.
On a side note DP, can we use conditionals inside the ad code at all? Show to a certain group/exclude certain forums
Right, and isn't that what you would want? If you haven't read *any* of the posts on the page, the ad being on the first post on that page?The unread link always points to the first unread post *on the actual page*.
So if on forum list you click on the latest /post/ link, you will be redirected to the thread with this post as anchor.
If you have never seen this thread the unread post is always the first post on this page.
Yeah, but not sure there's a lot that can be done about that... if they are on a page (for whatever reason) that doesn't contain the first unread post for them, it will simply fall back to the first post on the page. It's an unfortunate side effect of the hash part of a URL being client-side only (the server-side does not know the the user is at #post-12345 for example). So I'm using the best thing that I could find that *is* server-side (the unread link) to make an educated guess of what the user is looking at. It's most certainly not perfect, and I really wish there was a way to be able to read the hash part of a URL on the server-side. But since it's not possible, we are left with other options for determining what they are looking at.The ad appears at the first unread post which may be post 10.
However on forum list there are only links to the LATEST posts.
As an example you click on posts/24 and you will be redirected to thread/xxx/#post-24. The ad wil be in post 10.
Not sure it would be possible without making things *really* complicated in the options, which would end up making it incredibly difficult to work in *any* way...Ya I'm aware of those, it's just a tad bit limited for what I need to be done. I need to hide the ads in a certain forum to anyone, currently it's the opposite where it only allows you to force things or hide to certain groups.
We use essential cookies to make this site work, and optional cookies to enhance your experience.