ad-display-metabox.php
12 years ago
ad-group-ads-inline-form.php
12 years ago
ad-group-edit.php
12 years ago
ad-group.php
11 years ago
ad-inject-metabox.php
12 years ago
ad-main-metabox.php
12 years ago
ad-parameters-metabox.php
12 years ago
ad-visitor-metabox.php
12 years ago
ad_info.php
11 years ago
admin.php
12 years ago
debug.php
12 years ago
index.php
12 years ago
placements.php
11 years ago
settings.php
12 years ago
placements.php
86 lines
| 1 | <?php |
| 2 | /** |
| 3 | * the view for the placements page |
| 4 | */ |
| 5 | ?> |
| 6 | |
| 7 | <div class="wrap"> |
| 8 | <?php if ($error) : ?> |
| 9 | <div id="message" class="error"><p><?php echo $error; ?></p></div> |
| 10 | <?php endif; ?> |
| 11 | <?php if ($success) : ?> |
| 12 | <div id="message" class="updated"><p><?php echo $success; ?></p></div> |
| 13 | <?php endif; ?> |
| 14 | <?php screen_icon(); ?> |
| 15 | <h1><?php echo esc_html(get_admin_page_title()); ?></h1> |
| 16 | <p class="description"><?php _e('Placements are physically places in your theme and posts. You can use them if you plan to change ads and ad groups on the same place without the need to change your templates.', ADVADS_SLUG); ?></p> |
| 17 | <h2><?php _e('Create a new placement', ADVADS_SLUG); ?></h2> |
| 18 | <form method="POST" action="" class="advads-placements-new-form"> |
| 19 | <label for="advads-placement-name"><?php _e('Name', ADVADS_SLUG); ?></label> |
| 20 | <input id="advads-plcement-name" name="advads[placement][name]" type="text" value=""/><br/> |
| 21 | <label for="advads-placement-slug"><?php _e('ID', ADVADS_SLUG); ?></label> |
| 22 | <input id="advads-plcement-slug" name="advads[placement][slug]" type="text" value=""/> |
| 23 | <p class="description"><?php _e('Individual identifier. Allowed are alphanumeric signs (lower case) and hyphen.', ADVADS_SLUG); ?></p> |
| 24 | <p class=""><?php _e('You can assign Ads and Groups after you created the placement.', ADVADS_SLUG); ?></p> |
| 25 | <input type="submit" class="button button-primary" value="<?php _e('Save New Placement', ADVADS_SLUG); ?>"/> |
| 26 | </form> |
| 27 | <?php if(isset($placements) && is_array($placements)) : ?> |
| 28 | <h2><?php _e('Placements', ADVADS_SLUG); ?></h2> |
| 29 | <a onclick="advads_toggle('#advads-ad-place-display-info')"><?php _e('How to use an Ad Placement?', ADVADS_SLUG); ?></a> |
| 30 | <div id="advads-ad-place-display-info" style="display: none;"> |
| 31 | <p><?php printf(__('Examples on how to use an ad placement? Find more help and examples in the <a href="%s" target="_blank">manual</a>', ADVADS_SLUG), 'http://wpadvancedads.com/advanced-ads/manual/placements/'); ?></p> |
| 32 | <h4><?php _e('shortcode', ADVADS_SLUG); ?></h4> |
| 33 | <p class="description"><?php _e('To use an ad placement with the ID skyscraper_left in content fields', ADVADS_SLUG); ?></p> |
| 34 | <pre><input type="text" onclick="this.select();" style="width: 400px;" value='[the_ad_placement id="skyscraper_left"]'/></pre> |
| 35 | <h4><?php _e('template', ADVADS_SLUG); ?></h4> |
| 36 | <p class="description"><?php _e('To use an ad placement with the ID skyscraper_left in template files', ADVADS_SLUG); ?></p> |
| 37 | <pre><input type="text" onclick="this.select();" style="width: 400px;" value='the_ad_placement("skyscraper_left");'/></pre> |
| 38 | </div> |
| 39 | <form method="POST" action=""> |
| 40 | <table class="advads-placements-table"> |
| 41 | <thead> |
| 42 | <tr> |
| 43 | <th><?php _e('Slug', ADVADS_SLUG); ?></th> |
| 44 | <th><?php _e('Name', ADVADS_SLUG); ?></th> |
| 45 | <th><?php _e('Item', ADVADS_SLUG); ?></th> |
| 46 | <th><?php _e('Options', ADVADS_SLUG); ?></th> |
| 47 | </tr> |
| 48 | </thead> |
| 49 | <tbody> |
| 50 | <?php foreach($placements as $_placement_slug => $_placement) : ?> |
| 51 | <tr> |
| 52 | <th><?php echo $_placement_slug; ?></th> |
| 53 | <td><?php echo $_placement['name']; ?></td> |
| 54 | <td> |
| 55 | <?php $items = Advads_Ad_Placements::items_for_select(); ?> |
| 56 | <select name="advads[placements][<?php echo $_placement_slug; ?>][item]"> |
| 57 | <option value=""><?php _e('--empty--', ADVADS_SLUG); ?></option> |
| 58 | <?php if(isset($items['ads'])) : ?> |
| 59 | <optgroup label="<?php _e('Ads', ADVADS_SLUG); ?>"> |
| 60 | <?php foreach($items['ads'] as $_item_id => $_item_title) : ?> |
| 61 | <option value="<?php echo $_item_id; ?>" <?php if(isset($_placement['item'])) selected($_item_id, $_placement['item']); ?>><?php echo $_item_title; ?></option> |
| 62 | <?php endforeach; ?> |
| 63 | </optgroup> |
| 64 | <?php endif; ?> |
| 65 | <?php if(isset($items['groups'])) : ?> |
| 66 | <optgroup label="<?php _e('Ad Groups', ADVADS_SLUG); ?>"> |
| 67 | <?php foreach($items['groups'] as $_item_id => $_item_title) : ?> |
| 68 | <option value="<?php echo $_item_id; ?>" <?php if(isset($_placement['item'])) selected($_item_id, $_placement['item']); ?>><?php echo $_item_title; ?></option> |
| 69 | <?php endforeach; ?> |
| 70 | </optgroup> |
| 71 | <?php endif; ?> |
| 72 | </select> |
| 73 | </td> |
| 74 | <td> |
| 75 | <input type="checkbox" id="adsads-placements-item-delete" name="advads[placements][<?php echo $_placement_slug; ?>][delete]" value="1"/> |
| 76 | <label for="adsads-placements-item-delete"><?php _e('remove placement', ADVADS_SLUG); ?></label> |
| 77 | </td> |
| 78 | </tr> |
| 79 | <?php endforeach; ?> |
| 80 | </tbody> |
| 81 | </table> |
| 82 | <input type="submit" class="button button-primary" value="<?php _e('Save Placements', ADVADS_SLUG); ?>"/> |
| 83 | </form> |
| 84 | <?php endif; ?> |
| 85 | </div> |
| 86 |