Changeset 38509

Show
Ignore:
Timestamp:
04/05/08 21:37:34 (3 months ago)
Author:
henrikmelin
Message:

Now it sets up automatically.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • ad-minister/trunk/ad-minister-functions.php

    r38383 r38509  
    77*/ 
    88function 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      } 
    926 
    1027      // Check that our statistics is set up 
  • ad-minister/trunk/ad-minister-settings.php

    r38383 r38509  
    5353      // See what post we're attached to 
    5454      $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>" : ''; 
    5656      $this_page = get_option('siteurl') . '/wp-admin/edit.php?page=ad-minister/ad-minister.php'; 
    5757?> 
     
    6767      <th scope="row" valign="top"><?php _e('Setup', 'ad-minister'); ?></th> 
    6868      <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'); ?> 
    7070            <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 ads to', '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> 
    7272      </td> 
    7373 </tr> 
  • ad-minister/trunk/ad-minister.php

    r38383 r38509  
    22/* 
    33Plugin Name: Ad-minister 
    4 Version: 0.5 
     4Version: 0.5.1 
    55Plugin URI: http://labs.dagensskiva.com/plugins/ad-minister/ 
    66Author URI: http://labs.dagensskiva.com/ 
     
    9090 
    9191function 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      } 
    92109 
    93110      // Default tab is 'content' 
     
    125142} 
    126143 
    127 add_action('admin_init' , 'administer_pre_queue_scripts') 
     144add_action('admin_init' , 'administer_pre_queue_scripts'); 
    128145 
    129146?> 
  • ad-minister/trunk/readme.txt

    r38374 r38509  
    55Requires at least: 2.5 
    66Tested up to: 2.5 
    7 Stable tag: 0.5 
     7Stable tag: 0.5.1 
    88 
    99A complete system for handling advertising, including ad-rotation (with weights), scheduling and support for theme widgets.  
     
    1919*     Statistic available in template (e.g. for advertiser, on a password protected page) 
    2020*     Optional wrapper code for each position 
     21*     Automatic setup 
    2122 
    2223For 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")