Plugin Directory

Changeset 1851532


Ignore:
Timestamp:
04/03/2018 08:03:23 AM (8 years ago)
Author:
devdmkr
Message:

update

Location:
prime-ads/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • prime-ads/trunk/inc/services/AdsHelper.php

    r1849088 r1851532  
    221221
    222222        if($turbo){
    223             if(strpos($block->template, 'Yandex') === false) return '';
    224             if(!preg_match('#blockId: "([^"]+)"#iU', $block->template, $blockId)) return '';
     223            if(!preg_match('#R-A-\d{6}-\d#iU', $block->template, $blockId)) return '';
    225224               
    226             $blockId = $blockId[1];
     225            $blockId = $blockId[0];
    227226            if(!in_array($blockId, $this->rsyaIds)) return '';
    228227            return '<figure data-turbo-ad-id="ad_place_' . array_search($blockId, $this->rsyaIds) . '"></figure>';
     
    270269            foreach ($links[0] as $key => $value){
    271270                if($turbo){
    272                     $template = preg_replace("#" . preg_quote($links[1][$key],'#') . "#U", (isset($_SERVER['HTTPS']) ? "https" : "http") . '://' . $_SERVER['HTTP_HOST'] . '/' . get_option('ads-link-hash') . '/' . md5('textblock' . date('d.m.Y')) . '/' . $block->id . '_' .($key+1) . '.html', $template);
     271                    $template = preg_replace("#" . preg_quote($links[1][$key],'#') . "#U", (isset($_SERVER['HTTPS']) ? "https" : "http") . '://' . $_SERVER['HTTP_HOST'] . '/out-away/textblock/' . $block->id . '_' .($key+1) . '.html', $template);
    273272                }else{
    274273                    $template = str_replace($value, '', $template);
     
    382381                $template = str_replace("{{image_$num}}", PrimeAds::$ADS_UPLOADS_URL.$tizer->image, $template);
    383382                if($turbo){
    384                     $url = (isset($_SERVER['HTTPS']) ? "https" : "http") . '://' . $_SERVER['HTTP_HOST'] . '/' . get_option('ads-link-hash') . '/' . md5('simptizer' . date('d.m.Y')) . '/' . $tizer->rel_id . '_' . $group->id . '.html';
     383                    $url = (isset($_SERVER['HTTPS']) ? "https" : "http") . '://' . $_SERVER['HTTP_HOST'] . '/out-away/simptizer/' . $tizer->rel_id . '_' . $group->id . '.html';
    385384                    $ttizer = (array) $tizer;
    386385                    $ttizer['url'] = $url;
  • prime-ads/trunk/prime-ads.php

    r1849088 r1851532  
    33    Plugin Name: Prime Ads
    44    Description: Вывод рекламы с сервиса Prime Ads
    5     Version: 2.1.8
     5    Version: 2.1.9
    66    Author: Proffit
    77    Author URI: http://proffit.guru/
     
    1919use AdsNS\SxGeo\SxGeo;
    2020
    21 define('ADS_VERSION', '2.1.8');
     21define('ADS_VERSION', '2.1.9');
    2222define('ADS_DB_VERSION', '2.1.8');
    2323define('ADS_PATH', realpath(__DIR__));
     
    8888            'index.php?ads_type=$matches[1]&ads_id=$matches[2]',
    8989            'top' );
     90        add_rewrite_rule(
     91            'out-away/([\w-]+)/([0-9_]+)\.html$',
     92            'index.php?ads_type=$matches[1]&ads_id=$matches[2]',
     93            'top' );
    9094        $ads_flushed = get_option('ads-flushed');
    9195        if(!$ads_flushed || $ads_flushed != 'yes'){
     
    154158    function parseRequest( &$wp )
    155159    {
    156         $types = get_option('ads-types');
    157         if(!$types){
    158             $this->_generateTypes();
     160        $types = array('simptizer' => 'ads_simple_tizer', 'textblock' => 'ads_text_block', 'comment' => 'ads_comment', 'post' => 'ads_offer_post');
     161        if(!isset($types[$wp->query_vars['ads_type']])){
    159162            $types = get_option('ads-types');
    160         }
     163            if(!$types){
     164                $this->generateTypes();
     165                $types = get_option('ads-types');
     166            }
     167        }
     168
    161169        if (array_key_exists('ads_type', $wp->query_vars) &&
    162170                array_key_exists('ads_id', $wp->query_vars)){
     
    371379        global $wpdb;
    372380        $blocks = $wpdb->get_results(
    373             "SELECT * FROM " . $wpdb->prefix . "ads_code_block");
     381            "SELECT cb.* FROM " . $wpdb->prefix . "ads_code_block as cb left join " . $wpdb->prefix . "ads_position as p on cb.position=p.id WHERE `is_turbo`=1");
    374382        if(!$blocks) return array();
    375383        $ids = array();
    376384
    377385        foreach ($blocks as $block) {
    378             if(!strpos($block->template, 'Yandex')) continue;
    379             if(!preg_match('#blockId: "([^"]+)"#iU', $block->template, $blockId)) continue;
    380             $ids[] = $blockId[1];
     386            if(!preg_match('#R-A-\d{6}-\d#iU', $block->template, $blockId)) continue;
     387            $ids[] = $blockId[0];
    381388        }
    382389        $ids = array_unique($ids);
  • prime-ads/trunk/readme.txt

    r1849088 r1851532  
    77Requires at least: 4.0
    88Tested up to: 4.7
    9 Stable tag: 2.1.8
     9Stable tag: 2.1.9
    1010
    1111Ответная часть сервиса монитизации Prime Ads (http://primeads.ru)
Note: See TracChangeset for help on using the changeset viewer.