[BUG?] Global custom ad zone doesn't work on gateway

Daegaladh

Member
I've created a global custom ad zone to use in both, rankings and gateway, but nothing shows on the gateway page.
 

Daegaladh

Member
Don't worry, I've found the problem and fixed it:
In plugins\Ads\in_gateway.php
$result = $DB->query("SELECT * FROM {$CONF['sql_prefix']}_osbanners WHERE type = 'in' AND active = 1 ORDER BY RAND()", __FILE__, __LINE__);

I've just replaced WHERE type = 'in' with WHERE type = 'global' OR type = 'in'
 

Basti

Administrator
Staff member
Global was not intended to show on the gateway, not a bug.
I advise to simple paste your ad in that zone as well and don't alter the core code of the plugin
 

Daegaladh

Member
Then it isn't "global". Why duplicate the same ads in different zones when I could have only a global one with that simple mod?
 

Basti

Administrator
Staff member
Well you overthink the word global here ( not saying its your fault ). Its meant for the main site, global as in wrapper.html, display global in sidebar etc, gateway is another design.
This features more targeted ad areas

You are free to keep the change obviously, but keep note that its lost on updates. Not that the plugin updates often though

If we were to integrate that change i'am 100% sure the complaints would come that people cannot target votepage alone. And that was one of the reasons the plugin was changed to how it is.
 

Daegaladh

Member
If we were to integrate that change i'am 100% sure the complaints would come that people cannot target votepage alone. And that was one of the reasons the plugin was changed to how it is.
Why? It doesn't affect to gateway page zones, only allows the global zones to show on the gateway , you can still create zones for the gateway that only works there. That's why I used an OR:
WHERE type = 'global' OR type = 'in'
 

Basti

Administrator
Staff member
It would affect those.
We will not make the "global" wrapper + gateway, because what if the user only want a gateway zone on the gateway?

If we would change it to your code = it loads ads of type "global" or "in",
now any gateway zone now has the chance to load a global ad, it might not display the ad, but it still increases the views count, as any ad of type global or in is loaded and runs through the while loop php code. Which means it also gets an views +1.

Much better to keep those 2 seperated to provide more specified ad areas.
The word "global" could be changed though to avoid confusion such as in your case, maybe global (wrapper.html). Not sure

If you can enhance the code to provide your functionality but also keep the view count correct without setting up a query for each zone name ( i do not ), feel free to share the code. But with that edit alone its not enough
 
Last edited:
Top