WP to Twitter - Version 2.0.1

Version Description

  • Bug found with YOURLS short url creation when using multiple sites with one YOURLS installation and short URLS are created using post ID. Added option to disable post_ID as shortURL generating key in YOURLS account settings.
  • Missing semicolon replaced in uninstall.php
Download this release

Release Info

Developer joedolson
Plugin Icon 128x128 WP to Twitter
Version 2.0.1
Comparing to
See all releases

Code changes from version 2.0.0 to 2.0.1

functions.php CHANGED
@@ -165,6 +165,8 @@ $options = array(
165
  'yourlspath'=>get_option( 'yourlspath' ),
166
  'yourlsurl' =>get_option( 'yourlsurl' ),
167
  'yourlslogin'=>get_option( 'yourlslogin' ),
 
 
168
  //twitter api
169
  'jd-twitter-service-name'=>get_option( 'jd-twitter-service-name' ),
170
  'jd-twitter-char-limit'=>get_option( 'jd-twitter-char-limit' ),
165
  'yourlspath'=>get_option( 'yourlspath' ),
166
  'yourlsurl' =>get_option( 'yourlsurl' ),
167
  'yourlslogin'=>get_option( 'yourlslogin' ),
168
+ 'jd_keyword_format'=>get_option( 'jd_keyword_format' ),
169
+
170
  //twitter api
171
  'jd-twitter-service-name'=>get_option( 'jd-twitter-service-name' ),
172
  'jd-twitter-char-limit'=>get_option( 'jd-twitter-char-limit' ),
readme.txt CHANGED
@@ -32,6 +32,11 @@ Translations:
32
 
33
  == Changelog ==
34
 
 
 
 
 
 
35
  = 2.0.0 =
36
 
37
  * Fixed bug introduced in WordPress 2.9 where logged in users could only edit their own profiles and associated issues.
@@ -297,7 +302,7 @@ Only posts which you scheduled or edited *after* installing the plugin will be T
297
 
298
  == Upgrade Notice ==
299
 
300
- This version of WP to Twitter is not compatible with WordPress versions lower than 2.7. Do not upgrade if you are using an older version of WordPress.
301
 
302
  == Screenshots ==
303
 
32
 
33
  == Changelog ==
34
 
35
+ = 2.0.1 =
36
+
37
+ * Bug found with YOURLS short url creation when using multiple sites with one YOURLS installation and short URLS are created using post ID. Added option to disable post_ID as shortURL generating key in YOURLS account settings.
38
+ * Missing semicolon replaced in uninstall.php
39
+
40
  = 2.0.0 =
41
 
42
  * Fixed bug introduced in WordPress 2.9 where logged in users could only edit their own profiles and associated issues.
302
 
303
  == Upgrade Notice ==
304
 
305
+ Versions 2.0.0 and above of WP to Twitter are not compatible with WordPress versions lower than 2.7. Do not upgrade if you are using an older version of WordPress.
306
 
307
  == Screenshots ==
308
 
uninstall.php CHANGED
@@ -87,6 +87,8 @@ delete_option( 'yourlspath' );
87
  delete_option( 'yourlsurl' );
88
  delete_option( 'yourlslogin' );
89
  delete_option( 'jd_replace_character' );
90
- delete_option( 'jd_date_format' )
 
 
91
  }
92
  ?>
87
  delete_option( 'yourlsurl' );
88
  delete_option( 'yourlslogin' );
89
  delete_option( 'jd_replace_character' );
90
+ delete_option( 'jd_date_format' );
91
+ delete_option( 'jd_keyword_format' );
92
+
93
  }
94
  ?>
wp-to-twitter-it_IT.mo CHANGED
Binary file
wp-to-twitter-it_IT.po CHANGED
@@ -7,33 +7,33 @@ msgid ""
7
  msgstr ""
8
  "Project-Id-Version: WP to Twitter in italiano\n"
9
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/wp-to-twitter\n"
10
- "POT-Creation-Date: 2009-12-13 16:56+0000\n"
11
- "PO-Revision-Date: 2009-12-13 19:07+0100\n"
12
- "Last-Translator: Gianni Diurno (aka gidibao) <gidibao@gmail.com>\n"
13
- "Language-Team: Gianni Diurno | http://gidibao.net/ <gidibao@gmail.com>\n"
14
  "MIME-Version: 1.0\n"
15
  "Content-Type: text/plain; charset=UTF-8\n"
16
  "Content-Transfer-Encoding: 8bit\n"
17
  "X-Poedit-Language: Italian\n"
18
  "X-Poedit-Country: ITALY\n"
19
 
20
- #: functions.php:123
21
  msgid "Twitter Password Saved"
22
  msgstr "La password di Twitter è stata salvata"
23
 
24
- #: functions.php:125
25
  msgid "Twitter Password Not Saved"
26
  msgstr "La password di Twitter non é stata salvata"
27
 
28
- #: functions.php:128
29
  msgid "Bit.ly API Saved"
30
  msgstr "La chiave API di Bit.ly é stata salvata."
31
 
32
- #: functions.php:130
33
  msgid "Bit.ly API Not Saved"
34
  msgstr "La chiave API di Bit.ly non é stata salvata."
35
 
36
- #: functions.php:136
37
  msgid "[<a href='options-general.php?page=wp-to-twitter/wp-to-twitter.php'>Hide</a>] If you're experiencing trouble, please copy these settings into any request for support."
38
  msgstr "[<a href='options-general.php?page=wp-to-twitter/wp-to-twitter.php'>Nascondi</a>] Qualora avessi riscontrato dei problemi, allega queste impostazioni alle richieste di supporto."
39
 
@@ -188,7 +188,7 @@ msgid "WP to Twitter Options"
188
  msgstr "Opzioni WP to Twitter"
189
 
190
  #: wp-to-twitter-manager.php:332
191
- #: wp-to-twitter.php:794
192
  msgid "Get Support"
193
  msgstr "Supporto"
194
 
@@ -257,8 +257,8 @@ msgid "Spaces replaced with:"
257
  msgstr "Sostituisci gli spazi con:"
258
 
259
  #: wp-to-twitter-manager.php:392
260
- msgid "Default replacement is an underscore (<code>_</code>)."
261
- msgstr "Il sostituto predefinito é un trattino breve (<code>_</code>)."
262
 
263
  #: wp-to-twitter-manager.php:394
264
  msgid "Maximum number of tags to include:"
@@ -466,67 +466,67 @@ msgstr "Visita la pagina <a href='http://www.joedolson.com/articles/wp-to-twitte
466
 
467
  #. #-#-#-#-# plugin.pot (PACKAGE VERSION) #-#-#-#-#
468
  #. Plugin Name of an extension
469
- #: wp-to-twitter.php:748
470
  msgid "WP to Twitter"
471
  msgstr "WP to Twitter"
472
 
473
- #: wp-to-twitter.php:789
474
  msgid "Twitter Post"
475
  msgstr "Messaggio Twitter"
476
 
477
- #: wp-to-twitter.php:794
478
  msgid " characters.<br />Twitter posts are a maximum of 140 characters; if your Cli.gs URL is appended to the end of your document, you have 119 characters available. You can use <code>#url#</code>, <code>#title#</code>, <code>#post#</code>, <code>#category#</code>, <code>#date#</code>, or <code>#blog#</code> to insert the shortened URL, post title, the first category selected, the post date, or a post excerpt or blog name into the Tweet."
479
  msgstr " caratteri.<br />I messaggi di Twitter possono contenere un massimo di 140 caratteri; un URL generato da Cli.gs posto in coda al messaggio, lascerà disponibili 119 caratteri. Puoi utilizzare <code>#url#</code>, <code>#title#</code>, <code>#post#</code>, <code>#category#</code>, <code>#date#</code> oppure <code>#blog#</code> per inserire nel messaggio l'URL breve, il nome dell'articolo, la prima categoria selezionata, la data dell'articolo, un estratto dell'articolo oppure il nome del blog."
480
 
481
- #: wp-to-twitter.php:794
482
  msgid "Make a Donation"
483
  msgstr "Effettua una donazione"
484
 
485
- #: wp-to-twitter.php:797
486
  msgid "Don't Tweet this post."
487
  msgstr "Non segnalare a Twitter questo articolo."
488
 
489
- #: wp-to-twitter.php:846
490
  msgid "WP to Twitter User Settings"
491
  msgstr "Impostazioni WP to Twitter User"
492
 
493
- #: wp-to-twitter.php:850
494
  msgid "Use My Twitter Account"
495
  msgstr "Utilizza il mio account di Twitter"
496
 
497
- #: wp-to-twitter.php:851
498
  msgid "Select this option if you would like your posts to be Tweeted into your own Twitter account with no @ references."
499
  msgstr "Seleziona questa opzione qualora gradissi che i tuoi articoli siano segnalati al tuo account personale di Twitter senza nessun riferimento @."
500
 
501
- #: wp-to-twitter.php:852
502
  msgid "Tweet my posts into my Twitter account with an @ reference to the site's main Twitter account."
503
  msgstr "Segnala i miei articoli nel mio account di Twitter con un riferimento @ correlato al sito principale dell'account su Twitter."
504
 
505
- #: wp-to-twitter.php:853
506
  msgid "Tweet my posts into the main site Twitter account with an @ reference to my username. (Password not required with this option.)"
507
  msgstr "Segnala i miei articoli al sito principale dell'account su Twitter con un riferimento @ al mio nome utente. (per questa opzione non sarà necessaria la password)"
508
 
509
- #: wp-to-twitter.php:856
510
  msgid "Your Twitter Username"
511
  msgstr "Nome utente Twitter"
512
 
513
- #: wp-to-twitter.php:857
514
  msgid "Enter your own Twitter username."
515
  msgstr "Inserisci il tuo nome utente Twitter"
516
 
517
- #: wp-to-twitter.php:860
518
  msgid "Your Twitter Password"
519
  msgstr "Twitter Password"
520
 
521
- #: wp-to-twitter.php:861
522
  msgid "Enter your own Twitter password."
523
  msgstr "Inserisci la tua password di Twitter"
524
 
525
- #: wp-to-twitter.php:980
526
  msgid "<p>Couldn't locate the settings page.</p>"
527
  msgstr "<p>Non é possibile localizzare la pagina delle impostazioni.</p>"
528
 
529
- #: wp-to-twitter.php:985
530
  msgid "Settings"
531
  msgstr "Impostazioni"
532
 
7
  msgstr ""
8
  "Project-Id-Version: WP to Twitter in italiano\n"
9
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/wp-to-twitter\n"
10
+ "POT-Creation-Date: 2009-12-22 20:09+0000\n"
11
+ "PO-Revision-Date: 2010-02-24 02:08+0100\n"
12
+ "Last-Translator: Gianni Diurno (aka gidibao) <gidibao[at]gmail[dot]com>\n"
13
+ "Language-Team: Gianni Diurno | gidibao.net <gidibao[at]gmail[dot]com>\n"
14
  "MIME-Version: 1.0\n"
15
  "Content-Type: text/plain; charset=UTF-8\n"
16
  "Content-Transfer-Encoding: 8bit\n"
17
  "X-Poedit-Language: Italian\n"
18
  "X-Poedit-Country: ITALY\n"
19
 
20
+ #: functions.php:127
21
  msgid "Twitter Password Saved"
22
  msgstr "La password di Twitter è stata salvata"
23
 
24
+ #: functions.php:129
25
  msgid "Twitter Password Not Saved"
26
  msgstr "La password di Twitter non é stata salvata"
27
 
28
+ #: functions.php:132
29
  msgid "Bit.ly API Saved"
30
  msgstr "La chiave API di Bit.ly é stata salvata."
31
 
32
+ #: functions.php:134
33
  msgid "Bit.ly API Not Saved"
34
  msgstr "La chiave API di Bit.ly non é stata salvata."
35
 
36
+ #: functions.php:140
37
  msgid "[<a href='options-general.php?page=wp-to-twitter/wp-to-twitter.php'>Hide</a>] If you're experiencing trouble, please copy these settings into any request for support."
38
  msgstr "[<a href='options-general.php?page=wp-to-twitter/wp-to-twitter.php'>Nascondi</a>] Qualora avessi riscontrato dei problemi, allega queste impostazioni alle richieste di supporto."
39
 
188
  msgstr "Opzioni WP to Twitter"
189
 
190
  #: wp-to-twitter-manager.php:332
191
+ #: wp-to-twitter.php:811
192
  msgid "Get Support"
193
  msgstr "Supporto"
194
 
257
  msgstr "Sostituisci gli spazi con:"
258
 
259
  #: wp-to-twitter-manager.php:392
260
+ msgid "Default replacement is an underscore (<code>_</code>). Use <code>[ ]</code> to remove spaces entirely."
261
+ msgstr "Il sostituto predefinito é un trattino breve (<code>_</code>). Usa <code>[ ]</code> per rimuovere gli spazi completamente."
262
 
263
  #: wp-to-twitter-manager.php:394
264
  msgid "Maximum number of tags to include:"
466
 
467
  #. #-#-#-#-# plugin.pot (PACKAGE VERSION) #-#-#-#-#
468
  #. Plugin Name of an extension
469
+ #: wp-to-twitter.php:761
470
  msgid "WP to Twitter"
471
  msgstr "WP to Twitter"
472
 
473
+ #: wp-to-twitter.php:806
474
  msgid "Twitter Post"
475
  msgstr "Messaggio Twitter"
476
 
477
+ #: wp-to-twitter.php:811
478
  msgid " characters.<br />Twitter posts are a maximum of 140 characters; if your Cli.gs URL is appended to the end of your document, you have 119 characters available. You can use <code>#url#</code>, <code>#title#</code>, <code>#post#</code>, <code>#category#</code>, <code>#date#</code>, or <code>#blog#</code> to insert the shortened URL, post title, the first category selected, the post date, or a post excerpt or blog name into the Tweet."
479
  msgstr " caratteri.<br />I messaggi di Twitter possono contenere un massimo di 140 caratteri; un URL generato da Cli.gs posto in coda al messaggio, lascerà disponibili 119 caratteri. Puoi utilizzare <code>#url#</code>, <code>#title#</code>, <code>#post#</code>, <code>#category#</code>, <code>#date#</code> oppure <code>#blog#</code> per inserire nel messaggio l'URL breve, il nome dell'articolo, la prima categoria selezionata, la data dell'articolo, un estratto dell'articolo oppure il nome del blog."
480
 
481
+ #: wp-to-twitter.php:811
482
  msgid "Make a Donation"
483
  msgstr "Effettua una donazione"
484
 
485
+ #: wp-to-twitter.php:814
486
  msgid "Don't Tweet this post."
487
  msgstr "Non segnalare a Twitter questo articolo."
488
 
489
+ #: wp-to-twitter.php:863
490
  msgid "WP to Twitter User Settings"
491
  msgstr "Impostazioni WP to Twitter User"
492
 
493
+ #: wp-to-twitter.php:867
494
  msgid "Use My Twitter Account"
495
  msgstr "Utilizza il mio account di Twitter"
496
 
497
+ #: wp-to-twitter.php:868
498
  msgid "Select this option if you would like your posts to be Tweeted into your own Twitter account with no @ references."
499
  msgstr "Seleziona questa opzione qualora gradissi che i tuoi articoli siano segnalati al tuo account personale di Twitter senza nessun riferimento @."
500
 
501
+ #: wp-to-twitter.php:869
502
  msgid "Tweet my posts into my Twitter account with an @ reference to the site's main Twitter account."
503
  msgstr "Segnala i miei articoli nel mio account di Twitter con un riferimento @ correlato al sito principale dell'account su Twitter."
504
 
505
+ #: wp-to-twitter.php:870
506
  msgid "Tweet my posts into the main site Twitter account with an @ reference to my username. (Password not required with this option.)"
507
  msgstr "Segnala i miei articoli al sito principale dell'account su Twitter con un riferimento @ al mio nome utente. (per questa opzione non sarà necessaria la password)"
508
 
509
+ #: wp-to-twitter.php:873
510
  msgid "Your Twitter Username"
511
  msgstr "Nome utente Twitter"
512
 
513
+ #: wp-to-twitter.php:874
514
  msgid "Enter your own Twitter username."
515
  msgstr "Inserisci il tuo nome utente Twitter"
516
 
517
+ #: wp-to-twitter.php:877
518
  msgid "Your Twitter Password"
519
  msgstr "Twitter Password"
520
 
521
+ #: wp-to-twitter.php:878
522
  msgid "Enter your own Twitter password."
523
  msgstr "Inserisci la tua password di Twitter"
524
 
525
+ #: wp-to-twitter.php:997
526
  msgid "<p>Couldn't locate the settings page.</p>"
527
  msgstr "<p>Non é possibile localizzare la pagina delle impostazioni.</p>"
528
 
529
+ #: wp-to-twitter.php:1002
530
  msgid "Settings"
531
  msgstr "Impostazioni"
532
 
wp-to-twitter-manager.php CHANGED
@@ -65,6 +65,7 @@
65
  update_option( 'jd-twitter-service-name', 'Twitter' );
66
  update_option( 'jd-twitter-char-limit', 140 );
67
  update_option( 'jd_use_both_services', '0' );
 
68
 
69
  $message = __("Set your $twitter login information and URL shortener API information to use this plugin!", 'wp-to-twitter');
70
  }
@@ -233,7 +234,14 @@
233
  } else {
234
  $message .= __( "The path to your YOURLS installation is not correct. ",'wp-to-twitter' );
235
  }
236
- }
 
 
 
 
 
 
 
237
  }
238
 
239
  if ( isset($_POST['submit-type']) && $_POST['submit-type'] == 'cligsapi' ) {
@@ -616,7 +624,9 @@ $wp_to_twitter_directory = get_bloginfo( 'wpurl' ) . '/' . PLUGINDIR . '/' . dir
616
  <label for="yourlsapi"><?php _e("Your YOURLS password:", 'wp-to-twitter'); ?> <?php if ( get_option( 'yourlsapi' ) != '') { _e("<em>Saved</em>",'wp-to-twitter'); } ?></label>
617
  <input type="text" name="yourlsapi" id="yourlsapi" size="40" value="" />
618
  </p>
619
-
 
 
620
  <div>
621
  <input type="hidden" name="submit-type" value="yourlsapi" />
622
  </div>
65
  update_option( 'jd-twitter-service-name', 'Twitter' );
66
  update_option( 'jd-twitter-char-limit', 140 );
67
  update_option( 'jd_use_both_services', '0' );
68
+ update_option( 'jd_keyword_format', '1' );
69
 
70
  $message = __("Set your $twitter login information and URL shortener API information to use this plugin!", 'wp-to-twitter');
71
  }
234
  } else {
235
  $message .= __( "The path to your YOURLS installation is not correct. ",'wp-to-twitter' );
236
  }
237
+ }
238
+ if ( $_POST['jd_keyword_format'] != '' ) {
239
+ update_option( 'jd_keyword_format',$_POST['jd_keyword_format'] );
240
+ $message .= __( "YOURLS will use Post ID for short URL slug.",'wp-to-twitter');
241
+ } else {
242
+ update_option( 'jd_keyword_format','' );
243
+ $message .= __( "YOURLS will not use Post ID for the short URL slug.",'wp-to-twitter');
244
+ }
245
  }
246
 
247
  if ( isset($_POST['submit-type']) && $_POST['submit-type'] == 'cligsapi' ) {
624
  <label for="yourlsapi"><?php _e("Your YOURLS password:", 'wp-to-twitter'); ?> <?php if ( get_option( 'yourlsapi' ) != '') { _e("<em>Saved</em>",'wp-to-twitter'); } ?></label>
625
  <input type="text" name="yourlsapi" id="yourlsapi" size="40" value="" />
626
  </p>
627
+ <p>
628
+ <input type="checkbox" name="jd_keyword_format" id="jd_keyword_format" value="1" <?php jd_checkCheckbox( 'jd_keyword_format' ); ?> /> <label for="jd_keyword_format"><?php _e("Use Post ID for YOURLS url slug."); ?></label>
629
+ </p>
630
  <div>
631
  <input type="hidden" name="submit-type" value="yourlsapi" />
632
  </div>
wp-to-twitter.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP to Twitter
4
  Plugin URI: http://www.joedolson.com/articles/wp-to-twitter/
5
  Description: Updates Twitter when you create a new blog post or add to your blogroll using Cli.gs. With a Cli.gs API key, creates a clig in your Cli.gs account with the name of your post as the title.
6
- Version: 2.0.0
7
  Author: Joseph Dolson
8
  Author URI: http://www.joedolson.com/
9
  */
@@ -34,7 +34,7 @@ $jdwp_api_post_status = "http://twitter.com/statuses/update.json";
34
  $jdwp_api_post_status = get_option( 'jd_api_post_status' );
35
  }
36
 
37
- $version = "2.0.0";
38
  $jd_plugin_url = "http://www.joedolson.com/articles/wp-to-twitter/";
39
  $jd_donate_url = "http://www.joedolson.com/donate.php";
40
 
@@ -83,6 +83,8 @@ global $version;
83
  if (get_option( 'jd_max_characters' ) == "" ) {
84
  update_option( 'jd_max_characters', 5 );
85
  }
 
 
86
  }
87
  }
88
 
@@ -243,13 +245,18 @@ function jd_shorten_link( $thispostlink, $thisposttitle, $post_ID ) {
243
  }
244
  $thispostlink .= urlencode("utm_campaign=$this_campaign&utm_medium=twitter&utm_source=twitter");
245
  }
246
-
 
 
 
 
 
247
  // Generate and grab the clig using the Cli.gs API
248
  // cURL alternative contributed by Thor Erik (http://thorerik.net)
249
  switch ( get_option( 'jd_shortener' ) ) {
250
  case 0:
251
  case 1:
252
- $shrink = jd_fetch_url( "http://cli.gs/api/v1/cligs/create?t=snoopy&appid=WP-to-Twitter&url=".$thispostlink."&title=".$thisposttitle."&key=".$cligsapi );
253
  break;
254
  case 2:
255
  $decoded = jd_remote_json( "http://api.bit.ly/shorten?version=2.0.1&longUrl=".$thispostlink."&login=".$bitlylogin."&apiKey=".$bitlyapi."&history=1" );
@@ -270,11 +277,11 @@ function jd_shorten_link( $thispostlink, $thisposttitle, $post_ID ) {
270
  if( file_exists( dirname( get_option( 'yourlspath' ) ).'/load-yourls.php' ) ) { // YOURLS 1.4
271
  global $ydb;
272
  require_once( dirname( get_option( 'yourlspath' ) ).'/load-yourls.php' );
273
- $yourls_result = yourls_add_new_link( $thispostlink, $post_ID );
274
  } else { // YOURLS 1.3
275
  require_once( get_option( 'yourlspath' ) );
276
  $yourls_db = new wpdb( YOURLS_DB_USER, YOURLS_DB_PASS, YOURLS_DB_NAME, YOURLS_DB_HOST );
277
- $yourls_result = yourls_add_new_link( $thispostlink, $post_ID, $yourls_db );
278
  }
279
  if ($yourls_result) {
280
  $shrink = $yourls_result['shorturl'];
@@ -284,7 +291,6 @@ function jd_shorten_link( $thispostlink, $thisposttitle, $post_ID ) {
284
  break;
285
  case 6:
286
  // remote YOURLS installation
287
- $keyword_format = "$post_ID";
288
  $api_url = sprintf( get_option('yourlsurl') . '?username=%s&password=%s&url=%s&format=json&action=shorturl&keyword=%s',
289
  $yourlslogin, $yourlsapi, $thispostlink, $keyword_format );
290
  $json = jd_remote_json( $api_url, false );
3
  Plugin Name: WP to Twitter
4
  Plugin URI: http://www.joedolson.com/articles/wp-to-twitter/
5
  Description: Updates Twitter when you create a new blog post or add to your blogroll using Cli.gs. With a Cli.gs API key, creates a clig in your Cli.gs account with the name of your post as the title.
6
+ Version: 2.0.1
7
  Author: Joseph Dolson
8
  Author URI: http://www.joedolson.com/
9
  */
34
  $jdwp_api_post_status = get_option( 'jd_api_post_status' );
35
  }
36
 
37
+ $version = "2.0.1";
38
  $jd_plugin_url = "http://www.joedolson.com/articles/wp-to-twitter/";
39
  $jd_donate_url = "http://www.joedolson.com/donate.php";
40
 
83
  if (get_option( 'jd_max_characters' ) == "" ) {
84
  update_option( 'jd_max_characters', 5 );
85
  }
86
+ } else if ( version_compare( $version,"2.0.1","<" )) {
87
+ update_option( 'jd_keyword_format', 1 );
88
  }
89
  }
90
 
245
  }
246
  $thispostlink .= urlencode("utm_campaign=$this_campaign&utm_medium=twitter&utm_source=twitter");
247
  }
248
+ // custom word setting
249
+ if ( get_option( 'jd_keyword_format' ) == '1' ) {
250
+ $keyword_format = "$post_ID";
251
+ } else {
252
+ $keyword_format = '';
253
+ }
254
  // Generate and grab the clig using the Cli.gs API
255
  // cURL alternative contributed by Thor Erik (http://thorerik.net)
256
  switch ( get_option( 'jd_shortener' ) ) {
257
  case 0:
258
  case 1:
259
+ $shrink = jd_fetch_url( "http://cli.gs/api/v1/cligs/create?t=wphttp&appid=WP-to-Twitter&url=".$thispostlink."&title=".$thisposttitle."&key=".$cligsapi );
260
  break;
261
  case 2:
262
  $decoded = jd_remote_json( "http://api.bit.ly/shorten?version=2.0.1&longUrl=".$thispostlink."&login=".$bitlylogin."&apiKey=".$bitlyapi."&history=1" );
277
  if( file_exists( dirname( get_option( 'yourlspath' ) ).'/load-yourls.php' ) ) { // YOURLS 1.4
278
  global $ydb;
279
  require_once( dirname( get_option( 'yourlspath' ) ).'/load-yourls.php' );
280
+ $yourls_result = yourls_add_new_link( $thispostlink, $keyword_format );
281
  } else { // YOURLS 1.3
282
  require_once( get_option( 'yourlspath' ) );
283
  $yourls_db = new wpdb( YOURLS_DB_USER, YOURLS_DB_PASS, YOURLS_DB_NAME, YOURLS_DB_HOST );
284
+ $yourls_result = yourls_add_new_link( $thispostlink, $keyword_format, $yourls_db );
285
  }
286
  if ($yourls_result) {
287
  $shrink = $yourls_result['shorturl'];
291
  break;
292
  case 6:
293
  // remote YOURLS installation
 
294
  $api_url = sprintf( get_option('yourlsurl') . '?username=%s&password=%s&url=%s&format=json&action=shorturl&keyword=%s',
295
  $yourlslogin, $yourlsapi, $thispostlink, $keyword_format );
296
  $json = jd_remote_json( $api_url, false );