OpenX和地理定位问题

Mil*_*los 5 openx

我下载了最新版本的OpenX 2.8.6,我正在尝试设置地理位置定位,但它不起作用.我在管理面板中启用了geoTargeting(配置 - >全局设置 - >地理定位模块类型 - > OpenX Max mind(平面文件)).我在OpenX的文档中读到,没有必要在插件设置中放置任何数据库路径,所以我试过没有.我设置测试横幅的交付选项仅在塞尔维亚显示.我正在重新显示显示横幅的页面,但此横幅从未显示过.

我想也许问题出在旧数据库中,我的IP地址无法识别,所以我从MaxMind(国家数据库的精简版)下载了最新的一个数据库(.dat文件)并将路径放在插件的设置中,但它仍然无效.

任何人都可以帮我解决这个问题吗?

lif*_*ter 5

我有同样的问题.从版本2.8.x开始,OpenX似乎使用自己的基于php的GeoIP-Database阅读器(例如设置下的"flatfile"选项)而不是使用geoip模块 - 这似乎不适用于当前的GeoIP.dat

为了解决这个问题,我做了以下几点:

1)打开插件/ geoTargeting/oxMaxMindGeoIP/oxMaxMindGeoIP.delivery.php

2)搜索:

    if (isset($GLOBALS['_MAX']['GEO_IP'])) {
        $ip   = $GLOBALS['_MAX']['GEO_IP'];
        OX_Delivery_logMessage('['.$ip.'] : ip from cookie. Plugin_geoTargeting_oxMaxMindGeoIP_oxMaxMindGeoIP_Delivery_getGeoInfo', 7);
    } else {
        $ip = $_SERVER['REMOTE_ADDR'];
        OX_Delivery_logMessage('['.$ip.'] : ip from remote addr. Plugin_geoTargeting_oxMaxMindGeoIP_oxMaxMindGeoIP_Delivery_getGeoInfo', 7);
    }
    $aGeoConf = (is_array($conf['oxMaxMindGeoIP'])) ? $conf['oxMaxMindGeoIP'] : array();
Run Code Online (Sandbox Code Playgroud)

3)插入以下内容:

$ret = array(
    "country_code" => $_SERVER['GEOIP_COUNTRY_CODE']
);
return $ret;
Run Code Online (Sandbox Code Playgroud)

4)保存和完成

您将在函数头中找到可能的返回值:

 * @return array An array(
 *                  'country_code',
 *                  'region',
 *                  'city',
 *                  'postal_code',
 *                  'latitude',
 *                  'longitude',
 *                  'dma_code',
 *                  'area_code',
 *                  'organisation',
 *                  'isp',
 *                  'netspeed'
 *              );
 */
Run Code Online (Sandbox Code Playgroud)

阅读你的module-doc(mod_geoip)如何从当前(或给定)IP获取地理数据.在上面的例子中,我使用的是lighttpd 1.5 + mod_geoip(非官方模块).但是这个修复也适用于apache_note/pecl-geoip/mod_geoip env ...

哦,顺便说一下.它当然要快得多,依赖于将db缓存在内存中的mod_geoip,而不是每次请求都通过php完成它(就像openx那样).