Changeset 491862
- Timestamp:
- 01/18/2012 09:12:18 PM (14 years ago)
- Location:
- g-crossposting/trunk
- Files:
-
- 3 edited
-
admin.php (modified) (11 diffs)
-
gplus-crosspost.php (modified) (6 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
g-crossposting/trunk/admin.php
r482762 r491862 11 11 exit; 12 12 } 13 14 require_once dirname(__FILE__).'/gplus-crosspost.php'; 13 15 14 16 // register our admin actions … … 70 72 */ 71 73 function g_crossposting_gplusid_field() { 72 $options = g et_option('g_crossposting_options');74 $options = g_crossposting_get_settings(); 73 75 echo "<input id='g_crossposting_gplusid' name='g_crossposting_options[gplusid]' size='59' maxlength='21' type='text' value='{$options['gplusid']}' />"; 74 76 } … … 78 80 */ 79 81 function g_crossposting_apikey_field() { 80 $options = g et_option('g_crossposting_options');82 $options = g_crossposting_get_settings(); 81 83 echo "<input id='g_crossposting_apikey' name='g_crossposting_options[apikey]' size='59' maxlength='39' type='text' value='{$options['apikey']}' />"; 82 84 } … … 86 88 */ 87 89 function g_crossposting_maxactivities_field() { 88 $options = g et_option('g_crossposting_options');90 $options = g_crossposting_get_settings(); 89 91 echo "<input id='g_crossposting_maxactivities' name='g_crossposting_options[maxactivities]' size='59' maxlength='3' type='text' value='{$options['maxactivities']}' />"; 90 92 } … … 94 96 */ 95 97 function g_crossposting_titlelen_field() { 96 $options = g et_option('g_crossposting_options');98 $options = g_crossposting_get_settings(); 97 99 echo "<input id='g_crossposting_titlelen' name='g_crossposting_options[titlelen]' size='59' maxlength='3' type='text' value='{$options['titlelen']}' />"; 98 100 } … … 102 104 */ 103 105 function g_crossposting_addcanonical_field() { 104 $options = g et_option('g_crossposting_options');106 $options = g_crossposting_get_settings(); 105 107 echo "<input id='g_crossposting_addcanonical' name='g_crossposting_options[addcanonical]' type='checkbox' value='true'"; 106 108 if ($options['addcanonical'] == 'true') { … … 114 116 */ 115 117 function g_crossposting_category_field() { 116 $options = g et_option('g_crossposting_options');118 $options = g_crossposting_get_settings(); 117 119 $selected = $options['category']; 118 120 $option_str = 'hide_empty&name=g_crossposting_options[category]&id=g_crossposting_category'; … … 127 129 */ 128 130 function g_crossposting_comment_field() { 129 $options = g et_option('g_crossposting_options');131 $options = g_crossposting_get_settings(); 130 132 echo "<input id='g_crossposting_comment' name='g_crossposting_options[comment]' type='checkbox' value='true'"; 131 133 if ($options['comment'] == 'true') { … … 139 141 */ 140 142 function g_crossposting_author_field() { 141 $options = g et_option('g_crossposting_options');143 $options = g_crossposting_get_settings(); 142 144 $selected = $options['author']; 143 145 $option_str = 'name=g_crossposting_options[author]&id=g_crossposting_author&who=author&who=authors'; … … 188 190 if (g_crossposting_api_activities_list($new_input['gplusid'], $new_input['apikey'], 1) == null) { 189 191 // at least one of both must be wrong 190 $new_input['gplusid'] = '';191 $new_input['apikey'] = '';192 // $new_input['gplusid'] = ''; 193 // $new_input['apikey'] = ''; 192 194 } 193 195 } … … 266 268 echo '</a></div>'; 267 269 /* 268 $options = g et_option('g_crossposting_options');270 $options = g_crossposting_get_settings(); 269 271 270 272 // get latest Google+ activities -
g-crossposting/trunk/gplus-crosspost.php
r482762 r491862 4 4 Plugin URI: http://wordpress.org/extend/plugins/g-crossposting/ 5 5 Description: Imports your public Google+ activities in your Wordpress blog. 6 Version: 1.1. 06 Version: 1.1.1 7 7 Author: Sebastian Stein 8 8 Author URI: http://sebstein.hpfsc.de/ … … 54 54 55 55 // get our options 56 $options = g et_option('g_crossposting_options');56 $options = g_crossposting_get_settings(); 57 57 58 58 // register an action for wp_head() hook with high priority so that we can still … … 65 65 // bind _update function to update action triggered as a scheduled event 66 66 add_action('g_crossposting_update_action', 'g_crossposting_update'); 67 68 /** 69 * gets setup options from DB and adds some default values in case a setting is 70 * missing 71 */ 72 function g_crossposting_get_settings() { 73 $options = get_option('g_crossposting_options'); 74 75 if (! isset($options['titlelen']) || empty($options['titlelen'])) { 76 $options['titlelen'] = 0; 77 update_option('g_crossposting_options', $options); 78 } 79 80 return $options; 81 } 67 82 68 83 /** … … 145 160 */ 146 161 function g_crossposting_is_enabled() { 147 $options = g et_option('g_crossposting_options');162 $options = g_crossposting_get_settings(); 148 163 149 164 if (! g_crossposting_check_gplusid($options['gplusid'])) { … … 231 246 function g_crossposting_get_new_activities() { 232 247 // load options 233 $options = g et_option('g_crossposting_options');248 $options = g_crossposting_get_settings(); 234 249 $last_activity_id = get_option('g_crossposting_last_activity_id', null); 235 250 … … 281 296 282 297 // get options to configure way how activities get imported 283 $options = g et_option('g_crossposting_options');298 $options = g_crossposting_get_settings(); 284 299 285 300 // prepare data for new post -
g-crossposting/trunk/readme.txt
r482762 r491862 5 5 Requires at least: 3.0.0 6 6 Tested up to: 3.3.0 7 Stable tag: 1.1. 07 Stable tag: 1.1.1 8 8 9 9 Imports your public Google+ activities in your Wordpress blog. … … 88 88 == Changelog == 89 89 90 = 1.1.1 = 91 * API key and G+ ID don't get removed anymore in case plugin is unable to connect to the G+ API; it seems that this now happens more often even if all settings are correct; a future version will need a better error reporting mechanism, but unfortunately Wordpress doesn't provide a convenient API for reporting configuration errors to the users and so the plugin will need to come up with an own mechanism 92 * fix a small bug of posts not getting loaded in case no length of title was specified 93 90 94 = 1.1.0 = 91 95 * make sure to post on Google+ that you are using this plugin!!!
Note: See TracChangeset
for help on using the changeset viewer.