Changeset 405265
- Timestamp:
- 07/06/2011 09:11:07 AM (15 years ago)
- Location:
- zamango-money-extractor/trunk
- Files:
-
- 4 edited
-
readme.txt (modified) (2 diffs)
-
zmg_admin.php (modified) (4 diffs)
-
zmg_money_extractor.php (modified) (22 diffs)
-
zmg_money_extractor_defaults.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
zamango-money-extractor/trunk/readme.txt
r268373 r405265 6 6 Tested up to: 3.0 7 7 Donate link: http://www.zamango.com 8 Version: 1. 39 Stable tag: 1. 38 Version: 1.4 9 Stable tag: 1.4 10 10 11 11 'Zamango Money Extractor' creates your own casual games storefront with content provided by top content publishers. … … 99 99 100 100 == Changelog == 101 102 = 1.4 = 103 * Bugfix: Fix long update delays 104 * Bugfix: Fix duplicate entries in WP 3.1.3+ 101 105 102 106 = 1.3 = -
zamango-money-extractor/trunk/zmg_admin.php
r229447 r405265 224 224 if (preg_match("/wp-admin\/plugins\.php/", $_SERVER['REQUEST_URI'])) 225 225 register_deactivation_hook($this->filename, 226 array($this, 'deactivate'));226 array($this, 'deactivate')); 227 227 } 228 228 … … 230 230 function fetch_options() 231 231 { 232 if (!$this->hook) return false; 232 if (!$this->hook) 233 return false; 233 234 234 235 $options = get_option($this->hook); … … 243 244 function save_options() 244 245 { 245 if (!$this->hook) return false; 246 if (!$this->hook) 247 return false; 246 248 247 249 update_option($this->hook, $this->options); … … 251 253 function validate_params() 252 254 { 253 if (!$this->hook) return false; 255 if (!$this->hook) 256 return false; 254 257 255 258 foreach ($this->default_options as $opt_name => $option) 256 259 { 257 $error = (isset($option["error"])) ?258 __($option["error"], $this->hook) :259 __("Not defined or invalid parameter",260 $this->top_hook);260 $error = (isset($option["error"])) 261 ? __($option["error"], $this->hook) 262 : __("Not defined or invalid parameter", 263 $this->top_hook); 261 264 262 265 if (isset($option["stoper"]) && $option["stoper"]()) -
zamango-money-extractor/trunk/zmg_money_extractor.php
r299254 r405265 5 5 Description: Creates casual games storefront at your WordPress. 6 6 Author: Zamango 7 Version: 1. 37 Version: 1.4 8 8 Requires at least: 2.8 9 9 Author URI: http://www.zamango.com/ … … 19 19 { 20 20 var $hook = 'zmg-money-extractor'; 21 var $version = '1. 3';21 var $version = '1.4'; 22 22 var $page_title = 'Money Extractor'; 23 23 var $menu_title = 'Money Extractor'; … … 31 31 $this->chunk_size = 20; 32 32 $this->max_realgames = 6; 33 $this->update_period = 12;34 33 $this->channels_root = 'http://account.zamango.com/channels/'; 35 34 $this->zmg_cached_categories = array(); … … 110 109 $this->options = get_option($this->hook); 111 110 112 if ($this->options['clear_options']) delete_option($this->hook); 111 if ($this->options['clear_options']) 112 delete_option($this->hook); 113 113 114 114 wp_clear_scheduled_hook('zmg_auto_update'); … … 134 134 add_action('the_excerpt', array($this, 'zmg_process_permalink')); 135 135 add_action('the_content', array($this, 'zmg_process_relgames')); 136 add_action('the_excerpt_rss', array($this, 'zmg_process_permalink')); 136 137 137 138 add_action('zmg_auto_update', array($this, 'zmg_auto_update')); … … 157 158 $this->zmg_auto_update_posts(); 158 159 $this->save_options(); 159 160 wp_schedule_single_event(time() +161 3600 * $this->options['update_period'],162 'zmg_auto_update');163 160 } 164 161 … … 194 191 { 195 192 $item = $items[$i]; 193 194 $item['guid'] = 'http://' . $item['guid']; 196 195 197 196 $this->zmg_update_last_pubdate($item); … … 240 239 $url .= '&limit='; 241 240 $url .= isset($_POST['zmg_chunk_size']) 242 ? $_POST['zmg_chunk_size']241 ? $_POST['zmg_chunk_size'] 243 242 : $this->chunk_size; 244 243 … … 293 292 : $item['guid']); 294 293 $post_meta['zmg_company'] = trim($item['zmg:company']); 295 $post_meta['zmg_sysreq'] = trim($item['zmg:sysreq']); 294 $post_meta['zmg_sysreq'] = $item['zmg:sysreq'] 295 ? trim($item['zmg:sysreq']) 296 : ''; 296 297 $post_meta['zmg_image50'] = $item['zmg:image50']; 297 298 $post_meta['zmg_image100'] = $item['zmg:image']; … … 304 305 $post_meta['zmg_small_screenshot3'] = $item['zmg:small_screenshot3']; 305 306 $post_meta['zmg_categories'] = $item['zmg:categories']; 306 $post_meta['zmg_desc_80'] = $item['zmg:desc_80'] ? 307 trim($item['zmg:desc_80']) : ''; 308 $post_meta['zmg_desc_250'] = $item['description'] ? 309 trim($item['description']) : ''; 310 $post_meta['zmg_desc_2000'] = $item['zmg:desc_2000'] ? 311 trim($item['zmg:desc_2000']) : ''; 307 $post_meta['zmg_desc_80'] = $item['zmg:desc_80'] 308 ? trim($item['zmg:desc_80']) 309 : ''; 310 $post_meta['zmg_desc_250'] = $item['description'] 311 ? trim($item['description']) 312 : ''; 313 $post_meta['zmg_desc_2000'] = $item['zmg:desc_2000'] 314 ? trim($item['zmg:desc_2000']) 315 : ''; 312 316 $post_meta['zmg_platform'] = $item['zmg:platform']; 313 317 $post_meta['zmg_visible'] = $item['zmg:visible']; … … 369 373 'excerpt'); 370 374 if (!$post['ID']) 375 { 371 376 $post['post_title'] = $this->zmg_process_template($post_meta, 372 377 'post_name'); 378 } 379 373 380 $this->zmg_insert_post_custom($post); 374 381 … … 576 583 } 577 584 585 foreach ($guids as &$guid) 586 { 587 $guid = 'http://' . $guid; 588 } 589 578 590 $in = implode("','", $guids); 579 591 … … 596 608 { 597 609 $post = $posts[$i]; 610 $post['guid'] = preg_replace('/^http:\/\//', '', 611 $post['guid']); 598 612 599 613 $url = get_permalink($post['ID']); … … 1021 1035 function plugin_option_page_content() 1022 1036 { 1023 1024 1037 if (isset($_POST['ZMG_UPDATE'])) 1025 1038 { … … 1036 1049 else 1037 1050 { 1038 wp_clear_scheduled_hook('zmg_auto_update');1039 1051 $this->zmg_process_rss(); 1040 1052 $this->save_options(); 1041 wp_schedule_single_event(time() + 3600 *1042 $this->options['update_period'],1043 'zmg_auto_update');1044 1053 } 1045 1054 } … … 1056 1065 else 1057 1066 { 1058 wp_clear_scheduled_hook('zmg_auto_update');1059 wp_schedule_single_event(time() + 3600 *1060 $this->options['update_period'],1061 'zmg_auto_update');1062 1063 1067 $this->save_options(); 1064 1068 echo $this->disappearing_message( … … 1070 1074 elseif (isset($_POST['ZMG_NEXT'])) 1071 1075 { 1072 wp_clear_scheduled_hook('zmg_auto_update');1073 1076 $this->zmg_process_rss(); 1074 1077 $this->save_options(); 1075 wp_schedule_single_event(time() + 3600 *1076 $this->options['update_period'],1077 'zmg_auto_update');1078 1078 } 1079 1079 elseif (isset($_POST['ZMG_DELETE'])) 1080 1080 { 1081 wp_clear_scheduled_hook('zmg_auto_update');1082 1081 $this->zmg_delete_posts(isset($_POST['except_modified'])); 1083 wp_schedule_single_event(time() + 3600 *1084 $this->options['update_period'],1085 'zmg_auto_update');1086 1087 1082 $this->save_options(); 1088 1083 $this->zmg_show_options_page(); … … 1111 1106 function zmg_process_rss() 1112 1107 { 1108 wp_clear_scheduled_hook('zmg_auto_update'); 1109 1110 wp_schedule_event(time() + 3600 * 12, 1111 'twicedaily', 1112 'zmg_auto_update'); 1113 1113 1114 if (!defined('WP_IMPORTING')) 1114 1115 define('WP_IMPORTING', true); … … 1120 1121 if (!defined('DOING_AUTOSAVE')) 1121 1122 define('DOING_AUTOSAVE', true); 1122 1123 wp_clear_scheduled_hook('zmg_auto_update');1124 1123 1125 1124 $start_time = microtime(1); … … 1201 1200 { 1202 1201 $item = $items[$i]; 1202 1203 $item['guid'] = 'http://' . $item['guid']; 1203 1204 1204 1205 $this->zmg_update_last_pubdate($item); … … 1539 1540 ); 1540 1541 1541 $rows = array(); 1542 $row = array(); 1543 1544 $html = __('Autoupdate period (hours)', $this->hook); 1545 1542 $rows = array(); 1543 $row = array(); 1544 $html = __('Maximum related games number in post', $this->hook); 1546 1545 $row[] = $this->elem($html); 1547 1548 $html = $this->text('update_period',1549 $this->options['update_period'], '',1550 'zmg_short');1551 1552 if ($this->errors['update_period'])1553 $html .= $this->error_message(1554 __($this->errors['update_period'], $this->hook));1555 1556 $row[] = $this->elem($html);1557 $rows[] = $this->elem($row);1558 $row = array();1559 1560 $html = __('Maximum related games number in post', $this->hook);1561 1562 $row[] = $this->elem($html);1563 1564 1546 $html = $this->text('max_relgames', 1565 1547 $this->options['max_relgames'], '', … … 1998 1980 $rows = array(); 1999 1981 $row = array(); 2000 $html = __('Autoupdate period (hours)', $this->hook); 2001 2002 $row[] = $this->elem($html); 2003 2004 $html = $this->text('update_period', 2005 $this->options['update_period'], '', 2006 'zmg_short'); 2007 2008 if ($this->errors['update_period']) 2009 $html .= $this->error_message( 2010 __($this->errors['update_period'], $this->hook)); 2011 2012 $row[] = $this->elem($html); 2013 $rows[] = $this->elem($row); 2014 $row = array(); 2015 2016 $html = __('Maximum related games number in post', $this->hook); 2017 1982 1983 $html = __('Maximum related games number in post', $this->hook); 2018 1984 $row[] = $this->elem($html); 2019 1985 -
zamango-money-extractor/trunk/zmg_money_extractor_defaults.php
r229447 r405265 61 61 "last_pubdate" => array( 62 62 "default" => 0 63 ),64 "update_period" => array(65 "default" => $this->update_period,66 "min" => 067 63 ), 68 64 "max_relgames" => array(
Note: See TracChangeset
for help on using the changeset viewer.