Changeset 2956613
- Timestamp:
- 08/22/2023 08:30:11 AM (3 years ago)
- Location:
- setupad/trunk
- Files:
-
- 3 edited
-
public/includes/ad-placement/the-content.php (modified) (2 diffs)
-
readme.txt (modified) (4 diffs)
-
setupad.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
setupad/trunk/public/includes/ad-placement/the-content.php
r2954187 r2956613 462 462 function setupad_between_list_items($content, $setupad_rows) { 463 463 464 preg_match_all('/<(li|dt|dd)[^>]*>.*?<\/\1>/s', $content, $matches); 464 preg_match_all('/<(ul|ol|dl)[^>]*>.*?(<(li|dt|dd)[^>]*>.*?<\/\2>.*?)*<\/\1>/s', $content, $matches); 465 465 466 if (empty($matches[0])) 466 467 return $content; 467 $content_block = $matches[0]; 468 469 $list_block = $matches[0]; 470 $list_type_block = $matches[1]; 468 471 469 472 foreach ( $setupad_rows as $row ) { 473 470 474 if (!$row->setupad_insertion_pages || !in_array(setupad_page_check(),explode(',',$row->setupad_insertion_pages))) continue; //page check 471 475 if (setupad_url_inclusions($row->setupad_url_inclusions)) continue; // URL Inclusions - Prioritize whitelisting before blacklisting … … 478 482 $positions = setupad_get_positions($position, true, true); 479 483 480 if ($repeated_position) { 481 for ($i = 0; $i <= count($content_block); $i++) { 482 if ($row->setupad_starting_position > $i+1) continue; //Skip until starting position 483 if (($i - $row->setupad_starting_position) % $repeated_position == 0 && $i) { 484 foreach($list_block as $index => $list){ 485 486 preg_match_all('/<(li|dt|dd)[^>]*>.*?<\/\1>/s', $list, $matches); 487 $list = $matches[0]; 488 array_unshift($list, '<'. $list_type_block[$index] . '>'); 489 490 if ($repeated_position) { 491 for ($i = 0; $i <= count($list); $i++) { 492 493 if ($row->setupad_starting_position > $i+1) continue; //Skip until starting position 494 if (($i - $row->setupad_starting_position) % $repeated_position == 0 && $i) { 495 $adContents = setupad_get_ad_contents($row); 496 497 if (!empty($list[$i]) && $adContents) { 498 $list[$i] .= '</li></dt></dd>' . $adContents; 499 } 500 } 501 } 502 } else { 503 foreach ($positions as $position) { 484 504 $adContents = setupad_get_ad_contents($row); 485 505 486 if (!empty($ content_block[$i -1]) && $adContents) {487 $ content_block[$i - 1] .= '</li></dt></dd>' .$adContents;506 if (!empty($list[$position+1]) && $adContents) { 507 $list[$position+1] .= $adContents; 488 508 } 489 509 } 490 510 } 491 } else { 492 foreach ($positions as $position) { 493 $adContents = setupad_get_ad_contents($row); 494 495 if (!empty($content_block[$position]) && $adContents) { 496 $content_block[$position] .= $adContents; 497 } 498 } 499 } 500 } 501 } 502 511 512 $list[] .= '</'. $list_type_block[$index] .'>'; 513 514 $list_block[$index] = implode("", $list); 515 516 } 517 } 518 } 503 519 $merged_content = ''; 504 520 505 $original_content_parts = preg_split('/<( li|dt|dd)[^>]*>.*?<\/\1>/s', $content);521 $original_content_parts = preg_split('/<(ul|ol|dl)[^>]*>.*?(<(li|dt|dd)[^>]*>.*?<\/\2>.*?)*<\/\1>/s', $content); 506 522 507 523 foreach ($original_content_parts as $i => $original_part) { 508 524 $merged_content .= $original_part; 509 525 510 if (isset($ content_block[$i])) {511 $merged_content .= $ content_block[$i];526 if (isset($list_block[$i])) { 527 $merged_content .= $list_block[$i]; 512 528 } 513 529 } -
setupad/trunk/readme.txt
r2954221 r2956613 1 === Setupad ===1 === Setupad WP Ads === 2 2 3 3 Contributors: setupad 4 Tags: setupad, setupad ads, ads inserter, ads, advertising, adsense, ad manager4 Tags: setupad, setupad ads, Setupad WP Ads, ads, Wordpress Ads, adsense, ad manager 5 5 Requires at least: 4.4 6 6 Tested up to: 6.3 7 Stable tag: 1.4. 17 Stable tag: 1.4.2 8 8 Requires PHP: 5.6 9 9 License: GPLv2 or later … … 14 14 == Description == 15 15 16 Looking for an ultimate solution for managing and displaying ads on your WordPress site? Look no further! Introducing the Setupad W ordPress plugin – a simple and powerful toolsuitable for both beginners in website monetization and experienced website owners.16 Looking for an ultimate solution for managing and displaying ads on your WordPress site? Look no further! Introducing the Setupad WP Ads – a simple and powerful plugin for WordPress suitable for both beginners in website monetization and experienced website owners. 17 17 18 18 With this plugin, you can: 19 19 20 * Insert all kinds of ads, including Google AdSense and Google Ad Manager (GAM), through code snippets. 20 21 * Insert ad placements (HTML/JS) or images in multiple positions, including before and after posts, content, paragraphs, images, comments, and excerpts. 21 22 * Insert placements on different pages and choose which devices to display them on (desktop, tablet, mobile). … … 33 34 Want to know what the best part is? Our plugin comes with all these advanced features completely free of charge. 34 35 35 Get the Setupad W ordPress pluginand take full control over your ad management today!36 Get the Setupad WP Ads plugin for your WordPress site and take full control over your ad management today! 36 37 37 38 [Full feature list and documentation](https://setupad.github.io/Setupad-WP-Plugin-Documentation/features) … … 78 79 == Changelog == 79 80 81 = 1.4.2 = 82 - Name change 83 - Bug fixes 84 80 85 = 1.4.1 = 81 86 - insertion between list items -
setupad/trunk/setupad.php
r2954221 r2956613 1 1 <?php 2 2 /** 3 * @package Setupad 4 * @version 1.4. 13 * @package Setupad WP Ads 4 * @version 1.4.2 5 5 */ 6 6 /* 7 Plugin Name: Setupad 7 Plugin Name: Setupad WP Ads 8 8 Description: Simple and powerful ad insertion and management tool for WordPress users with built-in integration with Setupad header bidding monetization platform. 9 9 Author: Setupad 10 Version: 1.4. 110 Version: 1.4.2 11 11 Author URI: https://setupad.com/ 12 12 */
Note: See TracChangeset
for help on using the changeset viewer.