Changeset 482762
- Timestamp:
- 12/31/2011 01:19:39 PM (14 years ago)
- Location:
- g-crossposting/trunk
- Files:
-
- 3 edited
-
admin.php (modified) (4 diffs)
-
gplus-crosspost.php (modified) (4 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
g-crossposting/trunk/admin.php
r445382 r482762 57 57 // add field for each option 58 58 add_settings_field('g_crossposting_gplusid', __('Your Google+ ID'), 'g_crossposting_gplusid_field', 'g_crossposting', 'g_crossposting_section_main'); 59 // https://code.google.com/apis/console/60 59 add_settings_field('g_crossposting_apikey', __('Your Google API key'), 'g_crossposting_apikey_field', 'g_crossposting', 'g_crossposting_section_main'); 61 60 add_settings_field('g_crossposting_user', __('Wordpress user to set as author of imported Google+ activities'), 'g_crossposting_author_field', 'g_crossposting', 'g_crossposting_section_options'); … … 63 62 add_settings_field('g_crossposting_comment', __('Enable comments on imported Google+ activities'), 'g_crossposting_comment_field', 'g_crossposting', 'g_crossposting_section_options'); 64 63 add_settings_field('g_crossposting_maxactivities', __('Maximum number of new activities to import'), 'g_crossposting_maxactivities_field', 'g_crossposting', 'g_crossposting_section_options'); 64 add_settings_field('g_crossposting_titlelen', __('Maximum length of imported title (set to 0 for full length)'), 'g_crossposting_titlelen_field', 'g_crossposting', 'g_crossposting_section_options'); 65 65 add_settings_field('g_crossposting_addcanonical', __('Add canonical meta tag pointing to Google+'), 'g_crossposting_addcanonical_field', 'g_crossposting', 'g_crossposting_section_options'); 66 66 } … … 88 88 $options = get_option('g_crossposting_options'); 89 89 echo "<input id='g_crossposting_maxactivities' name='g_crossposting_options[maxactivities]' size='59' maxlength='3' type='text' value='{$options['maxactivities']}' />"; 90 } 91 92 /** 93 * output the input field for the maximum length of post title 94 */ 95 function g_crossposting_titlelen_field() { 96 $options = get_option('g_crossposting_options'); 97 echo "<input id='g_crossposting_titlelen' name='g_crossposting_options[titlelen]' size='59' maxlength='3' type='text' value='{$options['titlelen']}' />"; 90 98 } 91 99 … … 190 198 $new_input['maxactivities'] = 1; 191 199 g_crossposting_add_error('g_crossposting_err_maxactivities', __("The maximum number of activities to import must be a number between 1 and 100.")); 200 } 201 202 // validate maximum length of title field 203 $new_input['titlelen'] = trim($input['titlelen']); 204 if (! g_crossposting_check_titlelen($new_input['titlelen'])) { 205 $new_input['titlelen'] = 0; 206 g_crossposting_add_error('g_crossposting_err_titlelen', __("The maximum length of post title should be a number between 0 and 100.")); 192 207 } 193 208 -
g-crossposting/trunk/gplus-crosspost.php
r445383 r482762 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. 0.16 Version: 1.1.0 7 7 Author: Sebastian Stein 8 8 Author URI: http://sebstein.hpfsc.de/ … … 175 175 // go on validating remaining settings 176 176 if (! g_crossposting_check_maxactivities($options['maxactivities'])) { 177 return FALSE; 178 } 179 180 if (! g_crossposting_check_titlelen($options['titlelen'])) { 177 181 return FALSE; 178 182 } … … 323 327 324 328 // set title for post 325 // TODO Make this a setting?326 329 if ($activity->title) { 327 $post_title = substr($activity->title, 0, 35).'…';330 $post_title = $activity->title; 328 331 } else if ($att_title) { 329 $post_title = substr($att_title, 0, 35).'…';332 $post_title = $att_title; 330 333 } else { 331 334 $post_title = 'Google+ post: No title available…'; 335 } 336 // shorten post title if required 337 if ($options['titlelen'] > 0 && strlen($post_title) > $options['titlelen']) { 338 $post_title = substr($post_title, 0, $options['titlelen']).'…'; 332 339 } 333 340 … … 405 412 406 413 /** 414 * maximum length of post title to import 415 * 416 * @return true if this is set to a number from 0 to 100 417 */ 418 function g_crossposting_check_titlelen($given_titlelen) { 419 // must be number from 0 to 100 420 if (!is_numeric($given_titlelen) || $given_titlelen < 0 || $given_titlelen > 100) { 421 return FALSE; 422 } 423 424 return TRUE; 425 } 426 427 /** 407 428 * simple binary option whether canonical tag should be added 408 429 * -
g-crossposting/trunk/readme.txt
r445383 r482762 4 4 Tags: google, googleplus, posts 5 5 Requires at least: 3.0.0 6 Tested up to: 3. 2.17 Stable tag: 1. 0.16 Tested up to: 3.3.0 7 Stable tag: 1.1.0 8 8 9 9 Imports your public Google+ activities in your Wordpress blog. … … 50 50 1. There you are, it is written next to the API key label. 51 51 52 It might be that there no key yet, but a button to generate one. In that case, 53 click the button first. There should also be a *Generate new key* link on this 54 page. 52 It might be that there is no key yet, but a button to generate one. In that 53 case, click the button first. There should also be a *Generate new key* link on 54 this page. 55 56 Important: Don't forget to activate your key! It is not enough to just generate 57 one, but you need to activate it on those Google pages, too. 58 59 = I can't set my Google+ ID or Google API key in the setting form. Why do they disappear? = 60 61 After you entered a Google+ ID or Google API key in the settings form of this 62 plugin and confirm your change, the plugin will try to access your public 63 Google+ profile. For this purpose, it uses the Google+ ID and the Google API key 64 you provided. If access fails, one of both or even both of them must be wrong. 65 However, the plugin can't determine which one is wrong. Therefore, it removes 66 both settings again to show you that something must have been wrong. 67 68 = Everything is set up properly, but it doesn't import anything? = 69 70 This plugin only imports your public Google+ activities. It won't access your 71 private posts on Google+, which you only shared with some circles. If you have 72 never posted anything in public, this plugin won't import anything to your blog. 73 74 This should prevent that people make something public by accident. If you want 75 something to also appear in your blog, make sure to share it with the public 76 first! 77 78 = Post titles are still shortened, even if I set length to 0 (meaning unlimited length)? = 79 80 Google+ itself limits the length of a post title. If you set 0 for the length of 81 the post title, the plugin will import the whole title provided by Google+. If 82 Google+ shortens your title, there is nothing this plugin can do. 55 83 56 84 == Screenshots == … … 59 87 60 88 == Changelog == 89 90 = 1.1.0 = 91 * make sure to post on Google+ that you are using this plugin!!! 92 * feature: set length of title of imported posts 93 * docs: extended list of frequently asked questions 61 94 62 95 = 1.0.1 =
Note: See TracChangeset
for help on using the changeset viewer.