Changeset 807770
- Timestamp:
- 11/20/2013 08:56:46 PM (12 years ago)
- Location:
- g-crossposting/trunk
- Files:
-
- 1 added
- 4 edited
- 1 moved
-
admin.php (modified) (12 diffs)
-
g-crossposting.php (moved) (moved from g-crossposting/trunk/gplus-crosspost.php) (7 diffs)
-
lang/g-crossposting-de_DE.mo (modified) (previous)
-
lang/g-crossposting-de_DE.po (added)
-
lang/g-crossposting.pot (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
g-crossposting/trunk/admin.php
r805313 r807770 12 12 } 13 13 14 require_once dirname(__FILE__).'/gplus-crosspost.php';15 16 14 // register our admin actions 17 15 add_action('admin_init', 'g_crossposting_register_options'); … … 24 22 if (array_key_exists('g_crossposting_manual_import', $_GET)) { 25 23 g_crossposting_update(); 26 g_crossposting_add_error('g_crossposting_err_import', __( "Manual import of Google+ activities done."));24 g_crossposting_add_error('g_crossposting_err_import', __('Manual import of Google+ activities done.', 'g-crossposting')); 27 25 } 28 26 … … 42 40 if (function_exists('add_submenu_page')) { 43 41 // add menu entry for config page 44 add_submenu_page('options-general.php', __('Google+ Crossposting Configuration' ), __('Google+ Crossposting'), 'manage_options', 'g-crossposting-key-config', 'g_crossposting_conf');42 add_submenu_page('options-general.php', __('Google+ Crossposting Configuration', 'g-crossposting'), __('Google+ Crossposting', 'g-crossposting'), 'manage_options', 'g-crossposting-key-config', 'g_crossposting_conf'); 45 43 } 46 44 } … … 54 52 55 53 // add a section around our options 56 add_settings_section('g_crossposting_section_main', 'Authentication Settings', 'g_crossposting_section_main_text', 'g_crossposting');57 add_settings_section('g_crossposting_section_options', 'Setup Options', 'g_crossposting_section_options_text', 'g_crossposting');54 add_settings_section('g_crossposting_section_main', __('Authentication Settings', 'g-crossposting'), 'g_crossposting_section_main_text', 'g_crossposting'); 55 add_settings_section('g_crossposting_section_options', __('Setup Options', 'g-crossposting'), 'g_crossposting_section_options_text', 'g_crossposting'); 58 56 59 57 // add field for each option 60 add_settings_field('g_crossposting_gplusid', __('Your Google+ ID' ), 'g_crossposting_gplusid_field', 'g_crossposting', 'g_crossposting_section_main');61 add_settings_field('g_crossposting_apikey', __('Your Google API key' ), 'g_crossposting_apikey_field', 'g_crossposting', 'g_crossposting_section_main');62 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 add_settings_field('g_crossposting_category', __('Category to use for imported Google+ activities' ), 'g_crossposting_category_field', 'g_crossposting', 'g_crossposting_section_options');64 add_settings_field('g_crossposting_comment', __('Enable comments on imported Google+ activities' ), 'g_crossposting_comment_field', 'g_crossposting', 'g_crossposting_section_options');65 add_settings_field('g_crossposting_maxactivities', __('Maximum number of new activities to import' ), 'g_crossposting_maxactivities_field', 'g_crossposting', 'g_crossposting_section_options');66 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');67 add_settings_field('g_crossposting_addcanonical', __('Add canonical meta tag pointing to Google+' ), 'g_crossposting_addcanonical_field', 'g_crossposting', 'g_crossposting_section_options');58 add_settings_field('g_crossposting_gplusid', __('Your Google+ ID', 'g-crossposting'), 'g_crossposting_gplusid_field', 'g_crossposting', 'g_crossposting_section_main'); 59 add_settings_field('g_crossposting_apikey', __('Your Google API key', 'g-crossposting'), 'g_crossposting_apikey_field', 'g_crossposting', 'g_crossposting_section_main'); 60 add_settings_field('g_crossposting_user', __('Wordpress user to set as author of imported Google+ activities', 'g-crossposting'), 'g_crossposting_author_field', 'g_crossposting', 'g_crossposting_section_options'); 61 add_settings_field('g_crossposting_category', __('Category to use for imported Google+ activities', 'g-crossposting'), 'g_crossposting_category_field', 'g_crossposting', 'g_crossposting_section_options'); 62 add_settings_field('g_crossposting_comment', __('Enable comments on imported Google+ activities', 'g-crossposting'), 'g_crossposting_comment_field', 'g_crossposting', 'g_crossposting_section_options'); 63 add_settings_field('g_crossposting_maxactivities', __('Maximum number of new activities to import', 'g-crossposting'), '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'), 'g_crossposting_titlelen_field', 'g_crossposting', 'g_crossposting_section_options'); 65 add_settings_field('g_crossposting_addcanonical', __('Add canonical meta tag pointing to Google+', 'g-crossposting'), 'g_crossposting_addcanonical_field', 'g_crossposting', 'g_crossposting_section_options'); 68 66 } 69 67 … … 155 153 function g_crossposting_section_main_text() { 156 154 echo '<p>'; 157 _e( "The following settings specify your Google+ ID and your Google API key. Without those settings, the plugin won't work.");155 _e('The following settings specify your Google+ ID and your Google API key. Without those settings, the plugin won\'t work.', 'g-crossposting'); 158 156 echo '</p>'; 159 157 } … … 164 162 function g_crossposting_section_options_text() { 165 163 echo '<p>'; 166 _e( "The following settings let you configure the behaviour of this plugin.");164 _e('The following settings let you configure the behaviour of this plugin.', 'g-crossposting'); 167 165 echo '</p>'; 168 166 } … … 177 175 // trim Google API key 178 176 $new_input['apikey'] = trim($input['apikey']); 179 180 // if API key and Google+ are given, check if they are valid181 if (! empty($new_input['gplusid']) && ! empty($new_input['apikey'])) {182 if (g_crossposting_api_activities_list($new_input['gplusid'], $new_input['apikey'], 1) == null) {183 // at least one of both must be wrong184 $new_input['gplusid'] = '';185 $new_input['apikey'] = '';186 }187 }188 177 189 178 // validate number of maximum activities to import … … 191 180 if (! g_crossposting_check_maxactivities($new_input['maxactivities'])) { 192 181 $new_input['maxactivities'] = 1; 193 g_crossposting_add_error('g_crossposting_err_maxactivities', __( "The maximum number of activities to import must be a number between 1 and 100."));182 g_crossposting_add_error('g_crossposting_err_maxactivities', __('The maximum number of activities to import must be a number between 1 and 100.', 'g-crossposting')); 194 183 } 195 184 … … 198 187 if (! g_crossposting_check_titlelen($new_input['titlelen'])) { 199 188 $new_input['titlelen'] = 0; 200 g_crossposting_add_error('g_crossposting_err_titlelen', __( "The maximum length of post title should be a number between 0 and 100."));189 g_crossposting_add_error('g_crossposting_err_titlelen', __('The maximum length of post title should be a number between 0 and 100.', 'g-crossposting')); 201 190 } 202 191 … … 242 231 ?> 243 232 <div class="wrap"> 244 <h2><?php _e('Google+ Crossposting Configuration' ); ?></h2>233 <h2><?php _e('Google+ Crossposting Configuration', 'g-crossposting'); ?></h2> 245 234 <form action="options.php" method="post"> 246 235 <?php … … 249 238 ?> 250 239 <p class="submit"> 251 <input type="submit" class='button-primary' name="Submit" value="<?php _e('Save Changes' )?> »" />240 <input type="submit" class='button-primary' name="Submit" value="<?php _e('Save Changes', 'g-crossposting') ?> »" /> 252 241 </p> 253 242 </form> … … 255 244 // add link to start manual mass import 256 245 echo '<div id="g-crossposting-manual-import"><strong>'; 257 _e('Manual mass import:' );246 _e('Manual mass import:', 'g-crossposting'); 258 247 echo '</strong> <a href="?page=g-crossposting-key-config&g_crossposting_manual_import=true">'; 259 _e('manually check for new activities and import them' );248 _e('manually check for new activities and import them', 'g-crossposting'); 260 249 echo '</a></div>'; 261 250 /* -
g-crossposting/trunk/g-crossposting.php
r805313 r807770 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.46 Version: 1.2.0 7 7 Author: Sebastian Stein 8 8 Author URI: http://sebstein.hpfsc.de/ 9 9 Text Domain: g-crossposting 10 Domain Path: /lang /10 Domain Path: /lang 11 11 License: GPL2 12 12 */ … … 36 36 } 37 37 38 // load text domain for translations 39 load_plugin_textdomain('g-crossposting', false, basename(dirname(__FILE__)).'/lang'); 40 38 41 // load admin UI only if current user is an admin 39 42 if (is_admin()) { 40 43 require_once dirname(__FILE__).'/admin.php'; 41 44 } 42 43 // load text domain for translations44 load_plugin_textdomain('g-crossposting', false, basename(dirname(__FILE__)).'/lang');45 45 46 46 // add our own 5 minute scheduler … … 87 87 $schedules['5minutes'] = array( 88 88 'interval' => 300, 89 'display' => __('Once every 5 minutes' ),89 'display' => __('Once every 5 minutes', 'g-crossposting'), 90 90 ); 91 91 … … 292 292 $att_article = null; 293 293 $att_url = null; 294 if ( $activity->object->attachments) {294 if (isset($activity->object->attachments)) { 295 295 foreach ($activity->object->attachments as $attachment) { 296 296 switch ($attachment->objectType) { 297 297 case 'article': 298 298 $att_title = $attachment->displayName; 299 $att_article = $attachment->content;300 299 $att_url = $attachment->url; 300 301 $att_article = ""; 302 if (isset($attachment->content)) { 303 $att_article = $attachment->content; 304 } 305 301 306 if (isset($attachment->image, $attachment->image->url)) { 302 307 $att_photo = $attachment->image->url; … … 325 330 $post_content .= '</div>'; 326 331 } 327 $post_content .= '<div class="g-crossposting-backlink"><a href="'.$activity->url.'" target="_blank"> This was posted on Google+…</a></div>';332 $post_content .= '<div class="g-crossposting-backlink"><a href="'.$activity->url.'" target="_blank">'.__('This was posted on Google+', 'g-crossposting').'</a></div>'; 328 333 329 334 … … 334 339 $post_title = $att_title; 335 340 } else { 336 $post_title = 'Google+ post: No title available…';341 $post_title = __('Google+ post: No title available…', 'g-crossposting'); 337 342 } 338 343 // shorten post title if required … … 420 425 function g_crossposting_check_category($given_category) { 421 426 $cat_obj = get_category($given_category); 422 if ( $cat_obj&& $given_category == $cat_obj->cat_ID) {427 if (isset($cat_obj) && isset($cat_obj->cat_ID) && $given_category == $cat_obj->cat_ID) { 423 428 return TRUE; 424 429 } -
g-crossposting/trunk/lang/g-crossposting.pot
r445012 r807770 1 # Copyright (C) 201 02 # This file is distributed under the same license as the package.1 # Copyright (C) 2013 Google+ Crossposting 2 # This file is distributed under the same license as the Google+ Crossposting package. 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: \n"5 "Project-Id-Version: Google+ Crossposting 1.2.0\n" 6 6 "Report-Msgid-Bugs-To: http://wordpress.org/tag/g-crossposting\n" 7 "POT-Creation-Date: 201 1-09-28 21:59:12+00:00\n"7 "POT-Creation-Date: 2013-11-20 16:47:09+00:00\n" 8 8 "MIME-Version: 1.0\n" 9 9 "Content-Type: text/plain; charset=UTF-8\n" 10 10 "Content-Transfer-Encoding: 8bit\n" 11 "PO-Revision-Date: 201 0-MO-DA HO:MI+ZONE\n"11 "PO-Revision-Date: 2013-MO-DA HO:MI+ZONE\n" 12 12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 13 13 "Language-Team: LANGUAGE <[email protected]>\n" 14 14 15 #: gplus-crosspost.php:71 15 #. #-#-#-#-# g-crossposting.pot (Google+ Crossposting 1.2.0) #-#-#-#-# 16 #. Plugin Name of the plugin/theme 17 #: admin.php:26 18 msgid "Manual import of Google+ activities done." 19 msgstr "" 20 21 #: admin.php:54 22 msgid "Authentication Settings" 23 msgstr "" 24 25 #: admin.php:55 26 msgid "Setup Options" 27 msgstr "" 28 29 #: admin.php:44 admin.php:244 30 msgid "Google+ Crossposting Configuration" 31 msgstr "" 32 33 #: admin.php:44 34 msgid "Google+ Crossposting" 35 msgstr "" 36 37 #: admin.php:60 38 msgid "Your Google+ ID" 39 msgstr "" 40 41 #: admin.php:61 42 msgid "Your Google API key" 43 msgstr "" 44 45 #: admin.php:62 46 msgid "Wordpress user to set as author of imported Google+ activities" 47 msgstr "" 48 49 #: admin.php:63 50 msgid "Category to use for imported Google+ activities" 51 msgstr "" 52 53 #: admin.php:64 54 msgid "Enable comments on imported Google+ activities" 55 msgstr "" 56 57 #: admin.php:65 58 msgid "Maximum number of new activities to import" 59 msgstr "" 60 61 #: admin.php:66 62 msgid "Maximum length of imported title (set to 0 for full length)" 63 msgstr "" 64 65 #: admin.php:67 66 msgid "Add canonical meta tag pointing to Google+" 67 msgstr "" 68 69 #: admin.php:157 70 msgid "The following settings specify your Google+ ID and your Google API key. Without those settings, the plugin won't work." 71 msgstr "" 72 73 #: admin.php:166 74 msgid "The following settings let you configure the behaviour of this plugin." 75 msgstr "" 76 77 #: admin.php:193 78 msgid "The maximum number of activities to import must be a number between 1 and 100." 79 msgstr "" 80 81 #: admin.php:200 82 msgid "The maximum length of post title should be a number between 0 and 100." 83 msgstr "" 84 85 #: admin.php:249 86 msgid "Save Changes" 87 msgstr "" 88 89 #: admin.php:257 90 msgid "Manual mass import:" 91 msgstr "" 92 93 #: admin.php:259 94 msgid "manually check for new activities and import them" 95 msgstr "" 96 97 #: g-crossposting.php:89 16 98 msgid "Once every 5 minutes" 17 99 msgstr "" 18 100 19 #: admin.php:2420 msgid " Manual import of Google+ activities done."101 #: g-crossposting.php:327 102 msgid "This was posted on Google+…" 21 103 msgstr "" 22 104 23 #: admin.php:42 admin.php:22624 msgid "Google+ Crossposting Configuration"105 #: g-crossposting.php:336 106 msgid "Google+ post: No title available…" 25 107 msgstr "" 26 108 27 # : admin.php:4228 msgid " Google+ Crossposting"109 #. Plugin URI of the plugin/theme 110 msgid "http://wordpress.org/extend/plugins/g-crossposting/" 29 111 msgstr "" 30 112 31 # : admin.php:5832 msgid " Your Google+ ID"113 #. Description of the plugin/theme 114 msgid "Imports your public Google+ activities in your Wordpress blog." 33 115 msgstr "" 34 116 35 # : admin.php:6036 msgid " Your Google API key"117 #. Author of the plugin/theme 118 msgid "Sebastian Stein" 37 119 msgstr "" 38 120 39 # : admin.php:6140 msgid " Wordpress user to set as author of imported Google+ activities"121 #. Author URI of the plugin/theme 122 msgid "http://sebstein.hpfsc.de/" 41 123 msgstr "" 42 43 #: admin.php:6244 msgid "Category to use for imported Google+ activities"45 msgstr ""46 47 #: admin.php:6348 msgid "Enable comments on imported Google+ activities"49 msgstr ""50 51 #: admin.php:6452 msgid "Maximum number of new activities to import"53 msgstr ""54 55 #: admin.php:6556 msgid "Add canonical meta tag pointing to Google+"57 msgstr ""58 59 #: admin.php:14760 msgid ""61 "The following settings specify your Google+ ID and your Google API key. "62 "Without those settings, the plugin won't work."63 msgstr ""64 65 #: admin.php:15666 msgid "The following settings let you configure the behaviour of this plugin."67 msgstr ""68 69 #: admin.php:16870 msgid "You provided an invalid Google+ ID."71 msgstr ""72 73 #: admin.php:17574 msgid "You provided an invalid Google API key."75 msgstr ""76 77 #: admin.php:18278 msgid ""79 "The maximum number of activities to import must be a number between 1 and "80 "100."81 msgstr ""82 83 #: admin.php:23384 msgid "Save Changes"85 msgstr ""86 87 #: admin.php:23988 msgid "Manual mass import:"89 msgstr ""90 91 #: admin.php:24192 msgid "manually check for new activities and import them"93 msgstr "" -
g-crossposting/trunk/readme.txt
r805313 r807770 1 1 === Google+ Crossposting === 2 2 Contributors: sebstein 3 Donate link: http://www.icrc.org/eng/4 Tags: google, googleplus, posts 3 Donate link: bitcoin:18dNV4mZyQMDdgd1ebe2Gm4f9MNZMLuNNb 4 Tags: google, googleplus, posts, g+ 5 5 Requires at least: 3.0.0 6 6 Tested up to: 3.7.1 7 Stable tag: 1. 1.47 Stable tag: 1.2.0 8 8 9 9 Imports your public Google+ activities in your Wordpress blog. … … 103 103 == Changelog == 104 104 105 = 1.2.0 = 106 107 * plugin can now be translated 108 * provide German translation 109 105 110 = 1.1.4 = 106 111
Note: See TracChangeset
for help on using the changeset viewer.