Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Smarter way of doing this is by website invocation. After selecting which site to use, there is the option to generate invocation per site. New page opens with series of short js codes. First one is for header, it looks somethnig like this:

Code Block
  <!-- Generated by OpenX 2.8.10 -->
<script type='text/javascript' src='http://openx.zentralplus.ch/delivery/spcjs.php?id=1'></script>

...

To further improve this, and to speed up the process of page loading, for every page with banners we can define exactly which zones should be loaded (otherwise, invocation is done for all defined zones, sitewide, regardless of the page). It should be done like this:

Code Block

<script type='text/javascript'>
var OA_zones = {'813':813,'814':814,'815':815,'825':825,'816':816,'817':817,'823':823,'818':818,'1236':1236,'821':821,'819':819,'820':820,'822':822,'824':824,'1216':1216,'1234':1234,'826':826};
</script>

...

For detection, we create new template and include it in _html-head.tpl like this

Code Block

{{ render file="_tpl/_ismobdevice.tpl" }} 

Then the template _ismobdevice.tpl looks like this:

Code Block

{{ if isset($smarty.request.mobile) || isset($smarty.request.tablet) || isset($smarty.request.phone) || $gimme->browser->browser_working == "webkit" && $gimme->browser->ua_type == 'mobile' }}
    {{ assign var=isMobDevice value=1 scope="global" }}
{{ else }}
    {{ assign var=isMobDevice value=0 scope="global" }}
{{ /if }}

On the position of the page where we want to include some banner, we check what kind of banner (actually, zone, because zone containes one or more banners) to show

Code Block

{{ if !$isMobDevice }}
<script type='text/javascript'><!--// <![CDATA[
    /* [id3] Fullbanner Front */
    OA_show(3);
// ]]> --></script><noscript><a target='_blank' href='http://openx.zentralplus.ch/delivery/ck.php?n=2c5c0aa'><img border='0' alt='' src='http://openx.zentralplus.ch/delivery/avw.php?zoneid=3&amp;n=2c5c0aa' /></a></noscript>
{{ else }}
<script type='text/javascript'><!--// <![CDATA[
    /* [id6] Tablet and mobile Front */
    OA_show(6);
// ]]> --></script><noscript><a target='_blank' href='http://openx.zentralplus.ch/delivery/ck.php?n=642d667'><img border='0' alt='' src='http://openx.zentralplus.ch/delivery/avw.php?zoneid=6&amp;n=642d667' /></a></noscript>
{{ /if }}

...

OpenX Plugins, Hacks, Extensions 

There are several plugins, hacks and extensions for OpenX available. We do not recommend using them, as they are only valid till a security update by OpenX comes up and will stop working after that. Also, it is difficult to make some of them run on OpenX and they require a lot of testing. 

OpenX Enterprise solution 

...