Changeset 1129760
- Timestamp:
- 04/07/2015 05:40:45 PM (11 years ago)
- Location:
- free-counter
- Files:
-
- 2 edited
-
tags/1.1/plugin.php (modified) (2 diffs)
-
trunk/plugin.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
free-counter/tags/1.1/plugin.php
r1129319 r1129760 19 19 // data result 20 20 static private $result = ""; 21 21 22 22 // counter data 23 23 static private $data_counter = array(); 24 24 // file name for cache 25 25 static private $file_hash = ""; 26 26 //flag activate 27 27 static private $activate = true; 28 29 /**30 * @method on_activate - this method to adding the default option for the widget and plugin31 *32 */33 static function on_activate()34 {35 if (self::check_site()) {36 $data_post = array("action" => "create_new_counter", "site_url" => get_option('siteurl'));37 if ($result = self::sendToServer($data_post)) {38 if (isset($result['status']) && $result['status'] == "ok" &&39 isset($result['default_image']) && isset($result['default_hidden']) &&40 isset($result['code']) && isset($result['images'])) {41 add_option(_PREFIX . 'counter_id', $result['counter_id'], '', true);42 add_option(_PREFIX . 'default_image', $result['default_image'], '', true);43 add_option(_PREFIX . 'default_hidden', $result['default_hidden'], '', true);44 add_option(_PREFIX . 'counter_code', $result['code']);45 add_option(_PREFIX . 'image_color', $result['image_color']);46 add_option(_PREFIX . 'images', $result['images'], '', true);47 add_option(_PREFIX . 'email', $result['email'], '', true);48 add_option(_PREFIX . 'password', $result['password'], '', true);49 self::$data_counter['counter_id'] = $result['counter_id'];50 self::$data_counter['images'] = $result['images'];51 }52 }53 }54 }55 28 56 29 /** … … 119 92 } 120 93 } 94 /** 95 * @method on_activate - this method to adding the default option for the widget and plugin 96 * 97 */ 98 static function on_activate() 99 { 100 if (self::check_site()) { 101 $data_post = array("action" => "create_new_counter", "site_url" => get_option('siteurl')); 102 if ($result = self::sendToServer($data_post)) { 103 if (isset($result['status']) && $result['status'] == "ok" && 104 isset($result['default_image']) && isset($result['default_hidden']) && 105 isset($result['code']) && isset($result['images'])) { 106 add_option(_PREFIX . 'counter_id', $result['counter_id'], '', true); 107 add_option(_PREFIX . 'default_image', $result['default_image'], '', true); 108 add_option(_PREFIX . 'default_hidden', $result['default_hidden'], '', true); 109 add_option(_PREFIX . 'counter_code', $result['code']); 110 add_option(_PREFIX . 'image_color', $result['image_color']); 111 add_option(_PREFIX . 'images', $result['images'], '', true); 112 add_option(_PREFIX . 'email', $result['email'], '', true); 113 add_option(_PREFIX . 'password', $result['password'], '', 'yes'); 114 115 self::$data_counter['images'] = $result['images']; 116 self::$data_counter['counter_id'] = $result['counter_id']; 117 } 118 } 119 } 120 } 121 121 122 122 private static function getWeekDates() -
free-counter/trunk/plugin.php
r1129319 r1129760 19 19 // data result 20 20 static private $result = ""; 21 21 22 22 // counter data 23 23 static private $data_counter = array(); 24 24 // file name for cache 25 25 static private $file_hash = ""; 26 26 //flag activate 27 27 static private $activate = true; 28 29 /**30 * @method on_activate - this method to adding the default option for the widget and plugin31 *32 */33 static function on_activate()34 {35 if (self::check_site()) {36 $data_post = array("action" => "create_new_counter", "site_url" => get_option('siteurl'));37 if ($result = self::sendToServer($data_post)) {38 if (isset($result['status']) && $result['status'] == "ok" &&39 isset($result['default_image']) && isset($result['default_hidden']) &&40 isset($result['code']) && isset($result['images'])) {41 add_option(_PREFIX . 'counter_id', $result['counter_id'], '', true);42 add_option(_PREFIX . 'default_image', $result['default_image'], '', true);43 add_option(_PREFIX . 'default_hidden', $result['default_hidden'], '', true);44 add_option(_PREFIX . 'counter_code', $result['code']);45 add_option(_PREFIX . 'image_color', $result['image_color']);46 add_option(_PREFIX . 'images', $result['images'], '', true);47 add_option(_PREFIX . 'email', $result['email'], '', true);48 add_option(_PREFIX . 'password', $result['password'], '', true);49 self::$data_counter['counter_id'] = $result['counter_id'];50 self::$data_counter['images'] = $result['images'];51 }52 }53 }54 }55 28 56 29 /** … … 119 92 } 120 93 } 94 /** 95 * @method on_activate - this method to adding the default option for the widget and plugin 96 * 97 */ 98 static function on_activate() 99 { 100 if (self::check_site()) { 101 $data_post = array("action" => "create_new_counter", "site_url" => get_option('siteurl')); 102 if ($result = self::sendToServer($data_post)) { 103 if (isset($result['status']) && $result['status'] == "ok" && 104 isset($result['default_image']) && isset($result['default_hidden']) && 105 isset($result['code']) && isset($result['images'])) { 106 add_option(_PREFIX . 'counter_id', $result['counter_id'], '', true); 107 add_option(_PREFIX . 'default_image', $result['default_image'], '', true); 108 add_option(_PREFIX . 'default_hidden', $result['default_hidden'], '', true); 109 add_option(_PREFIX . 'counter_code', $result['code']); 110 add_option(_PREFIX . 'image_color', $result['image_color']); 111 add_option(_PREFIX . 'images', $result['images'], '', true); 112 add_option(_PREFIX . 'email', $result['email'], '', true); 113 add_option(_PREFIX . 'password', $result['password'], '', 'yes'); 114 115 self::$data_counter['images'] = $result['images']; 116 self::$data_counter['counter_id'] = $result['counter_id']; 117 } 118 } 119 } 120 } 121 121 122 122 private static function getWeekDates()
Note: See TracChangeset
for help on using the changeset viewer.