adsense-amp.php
1 year ago
pro-placements.php
1 year ago
repeat-the-position.php
1 year ago
upgrade-link.php
6 years ago
pro-placements.php
97 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Pro placements upgrade notice. |
| 4 | * |
| 5 | * @package Advanced_Ads |
| 6 | * TODO: move the array somewhere else. |
| 7 | */ |
| 8 | |
| 9 | use AdvancedAds\Admin\Upgrades; |
| 10 | |
| 11 | $pro_placements = [ |
| 12 | // ad injection on random position. |
| 13 | 'post_content_random' => [ |
| 14 | 'title' => __( 'Random Paragraph', 'advanced-ads' ), |
| 15 | 'description' => __( 'After a random paragraph in the main content.', 'advanced-ads' ), |
| 16 | 'image' => ADVADS_BASE_URL . 'admin/assets/img/placements/content-random.png', |
| 17 | ], |
| 18 | // ad injection above the post headline. |
| 19 | 'post_above_headline' => [ |
| 20 | 'title' => __( 'Above Headline', 'advanced-ads' ), |
| 21 | 'description' => __( 'Above the main headline on the page (<h1>).', 'advanced-ads' ), |
| 22 | 'image' => ADVADS_BASE_URL . 'admin/assets/img/placements/content-above-headline.png', |
| 23 | ], |
| 24 | // ad injection in the middle of a post. |
| 25 | 'post_content_middle' => [ |
| 26 | 'title' => __( 'Content Middle', 'advanced-ads' ), |
| 27 | 'description' => __( 'In the middle of the main content based on the number of paragraphs.', 'advanced-ads' ), |
| 28 | 'image' => ADVADS_BASE_URL . 'admin/assets/img/placements/content-middle.png', |
| 29 | ], |
| 30 | // ad injection at a hand selected element in the frontend. |
| 31 | 'custom_position' => [ |
| 32 | 'title' => __( 'Custom Position', 'advanced-ads' ), |
| 33 | 'description' => __( 'Attach the ad to any element in the frontend.', 'advanced-ads' ), |
| 34 | 'image' => ADVADS_BASE_URL . 'admin/assets/img/placements/custom-position.png', |
| 35 | ], |
| 36 | // ad injection between posts on archive and category pages. |
| 37 | 'archive_pages' => [ |
| 38 | 'title' => __( 'Post Lists', 'advanced-ads' ), |
| 39 | 'description' => __( 'Display the ad between posts on post lists, e.g. home, archives, search etc.', 'advanced-ads' ), |
| 40 | 'image' => ADVADS_BASE_URL . 'admin/assets/img/placements/post-list.png', |
| 41 | ], |
| 42 | 'background' => [ |
| 43 | 'title' => __( 'Background Ad', 'advanced-ads' ), |
| 44 | 'description' => __( 'Background of the website behind the main wrapper.', 'advanced-ads' ), |
| 45 | 'image' => ADVADS_BASE_URL . 'admin/assets/img/placements/background.png', |
| 46 | ], |
| 47 | ]; |
| 48 | // BuddyBoss & BuddyPress. |
| 49 | if ( defined( 'BP_PLATFORM_VERSION' ) ) { // BuddyBoss. |
| 50 | $pro_placements['buddypress'] = [ |
| 51 | 'title' => __( 'BuddyBoss Content', 'advanced-ads' ), |
| 52 | 'description' => __( 'Display ads on BuddyBoss related pages.', 'advanced-ads' ), |
| 53 | 'image' => ADVADS_BASE_URL . 'admin/assets/img/placements/buddyboss-icon.png', |
| 54 | ]; |
| 55 | } elseif ( class_exists( 'BuddyPress', false ) ) { // BuddyPress. |
| 56 | $pro_placements['buddypress'] = [ |
| 57 | 'title' => __( 'BuddyPress Content', 'advanced-ads' ), |
| 58 | 'description' => __( 'Display ads on BuddyPress related pages.', 'advanced-ads' ), |
| 59 | 'image' => ADVADS_BASE_URL . 'admin/assets/img/placements/buddypress-icon.png', |
| 60 | ]; |
| 61 | } |
| 62 | // bbPress. |
| 63 | if ( class_exists( 'bbPress', false ) ) { |
| 64 | $pro_placements['bbpress'] = [ |
| 65 | 'title' => __( 'bbPress Content', 'advanced-ads' ), |
| 66 | 'description' => __( 'Display ads in content created with bbPress.', 'advanced-ads' ), |
| 67 | 'image' => ADVADS_BASE_URL . 'admin/assets/img/placements/bbpress-reply.png', |
| 68 | ]; |
| 69 | } |
| 70 | |
| 71 | ?> |
| 72 | <?php |
| 73 | if ( is_array( $pro_placements ) ) : |
| 74 | foreach ( $pro_placements as $key => $placement ) : |
| 75 | ?> |
| 76 | <div class="advads-form-type"> |
| 77 | <label class="advads-button advads-pro-link"> |
| 78 | <span class="advads-button-text"> |
| 79 | <?php |
| 80 | if ( isset( $placement['image'] ) ) { |
| 81 | echo '<img src="' . esc_attr( $placement['image'] ) . '" alt="' . esc_attr( $placement['title'] ) . '"/>'; |
| 82 | } else { |
| 83 | echo '<strong>' . esc_html( $placement['title'] ) . '</strong><br/><p class="description">' . esc_html( $placement['description'] ) . '</p>'; |
| 84 | } |
| 85 | ?> |
| 86 | </span> |
| 87 | </label> |
| 88 | <p class="advads-form-description"> |
| 89 | <strong><?php echo esc_html( $placement['title'] ); ?></strong> |
| 90 | <br/><?php echo esc_html( $placement['description'] ); ?> |
| 91 | </p> |
| 92 | </div> |
| 93 | <?php endforeach; ?> |
| 94 | <div class="clear"></div> |
| 95 | <h4><?php Upgrades::upgrade_link( __( 'Get all placements with All Access', 'advanced-ads' ), 'https://wpadvancedads.com/add-ons/all-access/', 'upgrades-pro-placements' ); ?></h4> |
| 96 | <?php endif; ?> |
| 97 |