Changeset 38509
- Timestamp:
- 04/05/08 21:37:34 (3 months ago)
- Files:
-
- ad-minister/trunk/ad-minister-functions.php (modified) (1 diff)
- ad-minister/trunk/ad-minister-js.php (deleted)
- ad-minister/trunk/ad-minister-settings.php (modified) (2 diffs)
- ad-minister/trunk/ad-minister.php (modified) (3 diffs)
- ad-minister/trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
ad-minister/trunk/ad-minister-functions.php
r38383 r38509 7 7 */ 8 8 function administer_main() { 9 global $wpdb; 10 11 // Auto install 12 if (!get_option('administer_post_id') || !administer_ok_to_go()) { 13 $_POST = array(); 14 15 // Does it exist already? 16 $sql = "select count(*) from $wpdb->posts where post_type='administer'"; 17 $nbr = $wpdb->get_var($sql) + 1; 18 19 // Create a new one 20 $_POST['post_title'] = 'Ad-minister Data Holder ' . $nbr; 21 $_POST['post_type'] = 'administer'; 22 $_POST['content'] = 'This post holds your Ad-minister data'; 23 $id = wp_write_post(); 24 update_option('administer_post_id', $id); 25 } 9 26 10 27 // Check that our statistics is set up ad-minister/trunk/ad-minister-settings.php
r38383 r38509 53 53 // See what post we're attached to 54 54 $the_page = get_page(get_option('administer_post_id')); 55 $title = ($the_page->post_author) ? __('The content is currently attached to post/page ID <strong>', 'ad-minister') . get_option('administer_post_id') . "</strong> entitled '" . $the_page->post_title . "'. | <a href='#' onclick=\" alert('" . __('Warning! Changing the ID will cause the positions and content to dissapear. Please do proceed with caution.', 'ad-minister') . "'); $('view_ad_post_id').hide(); $('edit_ad_post_id').show(); return false; \">" . __('Change', 'ad-minister') . "</a>" : '';55 $title = ($the_page->post_author) ? __('The content is currently attached to post/page ID <strong>', 'ad-minister') . get_option('administer_post_id') . "</strong> entitled '" . $the_page->post_title . "'. | <a href='#' onclick=\" alert('" . __('Warning! Changing the ID will cause the positions and content to dissapear. Please do proceed with caution.', 'ad-minister') . "'); jQuery('#view_ad_post_id').hide(); jQuery('#edit_ad_post_id').show(); return false; \">" . __('Change', 'ad-minister') . "</a>" : ''; 56 56 $this_page = get_option('siteurl') . '/wp-admin/edit.php?page=ad-minister/ad-minister.php'; 57 57 ?> … … 67 67 <th scope="row" valign="top"><?php _e('Setup', 'ad-minister'); ?></th> 68 68 <td> 69 <?php _e('The content attaches itself to a post or page. Specify the ID of the post or page that you want the content to be attached to. Make sure this is not a page that you are likely to delete.', 'ad-minister'); ?>69 <?php _e('The Ad-minister data attaches itself to a post or page with a given ID. There is little reason to change this.', 'ad-minister'); ?> 70 70 <div id="view_ad_post_id" ><?php echo $title; ?></div> 71 <div id="edit_ad_post_id" <?php if ($title) echo 'style="display: none"'; ?>><?php _e('ID of page to attach the adsto', 'ad-minister'); ?>: <input type="text" name="administer_post_id" value="<?php echo get_option('administer_post_id'); ?>" style="width: 30px;" /></div>71 <div id="edit_ad_post_id" <?php if ($title) echo 'style="display: none"'; ?>><?php _e('ID of page to attach the Ad-minister data to', 'ad-minister'); ?>: <input type="text" name="administer_post_id" value="<?php echo get_option('administer_post_id'); ?>" style="width: 30px;" /></div> 72 72 </td> 73 73 </tr> ad-minister/trunk/ad-minister.php
r38383 r38509 2 2 /* 3 3 Plugin Name: Ad-minister 4 Version: 0.5 4 Version: 0.5.1 5 5 Plugin URI: http://labs.dagensskiva.com/plugins/ad-minister/ 6 6 Author URI: http://labs.dagensskiva.com/ … … 90 90 91 91 function administer_queue_scripts () { 92 global $wpdb; 93 94 // Auto install 95 if (!get_option('administer_post_id') || !administer_ok_to_go()) { 96 $_POST = array(); 97 98 // Does it exist already? 99 $sql = "select count(*) from $wpdb->posts where post_type='administer'"; 100 $nbr = $wpdb->get_var($sql) + 1; 101 102 // Create a new one 103 $_POST['post_title'] = 'Ad-minister Data Holder ' . $nbr; 104 $_POST['post_type'] = 'administer'; 105 $_POST['content'] = 'This post holds your Ad-minister data'; 106 $id = wp_write_post(); 107 update_option('administer_post_id', $id); 108 } 92 109 93 110 // Default tab is 'content' … … 125 142 } 126 143 127 add_action('admin_init' , 'administer_pre_queue_scripts') 144 add_action('admin_init' , 'administer_pre_queue_scripts'); 128 145 129 146 ?> ad-minister/trunk/readme.txt
r38374 r38509 5 5 Requires at least: 2.5 6 6 Tested up to: 2.5 7 Stable tag: 0.5 7 Stable tag: 0.5.1 8 8 9 9 A complete system for handling advertising, including ad-rotation (with weights), scheduling and support for theme widgets. … … 19 19 * Statistic available in template (e.g. for advertiser, on a password protected page) 20 20 * Optional wrapper code for each position 21 * Automatic setup 21 22 22 23 For more information on how to use this plugin see [http://labs.dagensskiva.com/plugins/ad-minister/](http://labs.dagensskiva.com/plugins/ad-minister/ "labs.dagensskiva.com")
