Changeset 1851532
- Timestamp:
- 04/03/2018 08:03:23 AM (8 years ago)
- Location:
- prime-ads/trunk
- Files:
-
- 3 edited
-
inc/services/AdsHelper.php (modified) (3 diffs)
-
prime-ads.php (modified) (5 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
prime-ads/trunk/inc/services/AdsHelper.php
r1849088 r1851532 221 221 222 222 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 ''; 225 224 226 $blockId = $blockId[ 1];225 $blockId = $blockId[0]; 227 226 if(!in_array($blockId, $this->rsyaIds)) return ''; 228 227 return '<figure data-turbo-ad-id="ad_place_' . array_search($blockId, $this->rsyaIds) . '"></figure>'; … … 270 269 foreach ($links[0] as $key => $value){ 271 270 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); 273 272 }else{ 274 273 $template = str_replace($value, '', $template); … … 382 381 $template = str_replace("{{image_$num}}", PrimeAds::$ADS_UPLOADS_URL.$tizer->image, $template); 383 382 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'; 385 384 $ttizer = (array) $tizer; 386 385 $ttizer['url'] = $url; -
prime-ads/trunk/prime-ads.php
r1849088 r1851532 3 3 Plugin Name: Prime Ads 4 4 Description: Вывод рекламы с сервиса Prime Ads 5 Version: 2.1. 85 Version: 2.1.9 6 6 Author: Proffit 7 7 Author URI: http://proffit.guru/ … … 19 19 use AdsNS\SxGeo\SxGeo; 20 20 21 define('ADS_VERSION', '2.1. 8');21 define('ADS_VERSION', '2.1.9'); 22 22 define('ADS_DB_VERSION', '2.1.8'); 23 23 define('ADS_PATH', realpath(__DIR__)); … … 88 88 'index.php?ads_type=$matches[1]&ads_id=$matches[2]', 89 89 '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' ); 90 94 $ads_flushed = get_option('ads-flushed'); 91 95 if(!$ads_flushed || $ads_flushed != 'yes'){ … … 154 158 function parseRequest( &$wp ) 155 159 { 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']])){ 159 162 $types = get_option('ads-types'); 160 } 163 if(!$types){ 164 $this->generateTypes(); 165 $types = get_option('ads-types'); 166 } 167 } 168 161 169 if (array_key_exists('ads_type', $wp->query_vars) && 162 170 array_key_exists('ads_id', $wp->query_vars)){ … … 371 379 global $wpdb; 372 380 $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"); 374 382 if(!$blocks) return array(); 375 383 $ids = array(); 376 384 377 385 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]; 381 388 } 382 389 $ids = array_unique($ids); -
prime-ads/trunk/readme.txt
r1849088 r1851532 7 7 Requires at least: 4.0 8 8 Tested up to: 4.7 9 Stable tag: 2.1. 89 Stable tag: 2.1.9 10 10 11 11 Ответная часть сервиса монитизации Prime Ads (http://primeads.ru)
Note: See TracChangeset
for help on using the changeset viewer.