Sociable - Version 2.9.3

Version Description

Download this release

Release Info

Developer joostdevalk
Plugin Icon wp plugin Sociable
Version 2.9.3
Comparing to
See all releases

Code changes from version 2.9.1 to 2.9.3

i18n/sociable-zh_TW.mo ADDED
Binary file
i18n/sociable-zh_TW.po ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: sociable\n"
4
+ "POT-Creation-Date: \n"
5
+ "PO-Revision-Date: 2008-03-03 19:57+0800\n"
6
+ "Last-Translator: Hugo <aa@kimo.com.tw>\n"
7
+ "Language-Team: Hugo5688 <hugo5688@gmail.com>\n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=utf-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "X-Poedit-Language: Chinese\n"
12
+ "X-Poedit-Country: TAIWAN\n"
13
+ "X-Poedit-SourceCharset: utf-8\n"
14
+ "X-Poedit-KeywordsList: __;_e\n"
15
+ "X-Poedit-Basepath: /home/malaprop/proj/sociable\n"
16
+ "X-Poedit-SearchPath-0: .\n"
17
+
18
+ #: sociable.php:387
19
+ msgid "These icons link to social bookmarking sites where readers can share and discover new web pages."
20
+ msgstr "這些圖示將會連結到社交網站,並且可以分享給讀者們"
21
+
22
+ #: sociable.php:482
23
+ msgid "Share and Enjoy:"
24
+ msgstr "Share and Enjoy:"
25
+
26
+ #: sociable.php:565
27
+ msgid "Sociable tried to check for updates but failed. This might be the way PHP is set up, or just random network issues. Please <a href=\"http://push.cx/sociable\">visit the Sociable website</a> to update manually if needed."
28
+ msgstr "Sociable 嘗試更新但失敗了. 這有可能是PHP設定的方式, 或是網路方面的問題. 如果您需要的話請瀏覽<a href=\"http://push.cx/sociable\"> Sociable 的網站</a> 來手動更新."
29
+
30
+ #: sociable.php:586
31
+ msgid "A <a href=\"http://push.cx/sociable\">new version of Sociable is available</a>"
32
+ msgstr "<a href=\"http://push.cx/sociable\">新版本的 Sociable 已經可以下載</a>"
33
+
34
+ #: sociable.php:586
35
+ msgid "as of "
36
+ msgstr "自"
37
+
38
+ #: sociable.php:595
39
+ msgid "Couldn't find wp-content/plugins folder. Please make sure WordPress is installed correctly."
40
+ msgstr "無法找到 wp-content/plugins 資料夾. 請確認 WordPress 已經正確的安裝完成."
41
+
42
+ #: sociable.php:597
43
+ msgid "Can't find sociable folder."
44
+ msgstr "無法找到 sociable 資料夾"
45
+
46
+ #: sociable.php:603
47
+ msgid "Can't find folder:"
48
+ msgstr "無法找到資料夾:"
49
+
50
+ #: sociable.php:605
51
+ msgid "Can't find file:"
52
+ msgstr "無法找到檔案:"
53
+
54
+ #: sociable.php:619
55
+ msgid "Restored all settings to defaults."
56
+ msgstr "復原所有選項至原始設定"
57
+
58
+ #: sociable.php:646
59
+ msgid "Saved changes."
60
+ msgstr "已儲存變更"
61
+
62
+ #: sociable.php:650
63
+ msgid "In your plugins/sociable folder, you must have these files:"
64
+ msgstr "在您的 plugins/sociable 資料夾內必需有以下檔案:"
65
+
66
+ #: sociable.php:674
67
+ msgid "Sociable Options"
68
+ msgstr "Sociable 選項"
69
+
70
+ #: sociable.php:676
71
+ msgid "Drag and drop sites to reorder them. Only the sites you check will appear publicly."
72
+ msgstr "您可以重新的拖曳來排列這些站點。只有您勾選的站點才會公開地出現在您的網站上。"
73
+
74
+ #: sociable.php:708
75
+ msgid "Change the text displayed in front of the icons below. For complete customization, edit <kbd>sociable.css</kbd> in the Sociable plugin directory."
76
+ msgstr "編輯出現在圖示之前的文字。如果想要自定更多部份,請編輯在 plugin / Sociable 底下的 <kbd>sociable.css</kbd>"
77
+
78
+ #: sociable.php:715
79
+ msgid "The icons appear at the end of each blog post, and posts may show on many different types of pages. Depending on your theme and audience, it may be tacky to display icons on all types of pages."
80
+ msgstr "圖示會出現在每篇文章的最底下,而且文章可能會顯示在許多不同類型的頁面上,這取決於您的佈景與讀者,而且有可能會出現在所有類型的頁面裡。"
81
+
82
+ #: sociable.php:718
83
+ msgid "Front page of the blog"
84
+ msgstr "在頁面前端顯示"
85
+
86
+ #: sociable.php:719
87
+ msgid "Individual blog posts"
88
+ msgstr "顯示在單篇文章"
89
+
90
+ #: sociable.php:720
91
+ msgid "Individual WordPress \"Pages\""
92
+ msgstr "顯示在單獨頁面"
93
+
94
+ #: sociable.php:721
95
+ msgid "Category archives"
96
+ msgstr "顯示在分類彙整"
97
+
98
+ #: sociable.php:722
99
+ msgid "Date-based archives"
100
+ msgstr "顯示在日期彙整"
101
+
102
+ #: sociable.php:723
103
+ msgid "Search results"
104
+ msgstr "顯示在搜尋結果"
105
+
106
+ #: sociable.php:727
107
+ msgid "Save Changes"
108
+ msgstr "儲存變更"
109
+
110
+ #: sociable.php:728
111
+ msgid "Restore Built-in Defaults"
112
+ msgstr "還原內建的原始設定"
113
+
114
+ #: sociable.php:733
115
+ msgid "Automatic Updates"
116
+ msgstr "自動更新"
117
+
118
+ #: sociable.php:735
119
+ msgid "Sociable checks for new versions when you bring up this page. (At most once per week.)"
120
+ msgstr "當您開啟此頁面 Sociable 會檢查是否有較新的版本 (最多每星期一次)"
121
+
122
+ #: sociable.php:738
123
+ msgid "This copy of Sociable is from"
124
+ msgstr "此版的 Sociable 是從"
125
+
126
+ #: sociable.php:739
127
+ msgid "Last checked on"
128
+ msgstr "上一次檢查為"
129
+
130
+ #: sociable.php:744
131
+ msgid "<a href=\"http://push.cx/sociable\">Sociable</a> is copyright 2006 by <a href=\"http://push.cx/\">Peter Harkins</a>, released under the GNU GPL version 2 or later. If you like Sociable, please send a link my way so other folks can find out about it. If you have any problems or good ideas, <a href=\"mailto:ph@malaprop.org\">mail me</a>."
132
+ msgstr "<a href=\"http://push.cx/sociable\">Sociable</a> is copyright 2006 by <a href=\"http://push.cx/\">Peter Harkins</a>, released under the GNU GPL version 2 or later. If you like Sociable, please send a link my way so other folks can find out about it. If you have any problems or good ideas, <a href=\"mailto:ph@malaprop.org\">mail me</a>."
133
+
images/leonaut.gif ADDED
Binary file
images/myspace.png ADDED
Binary file
readme.txt CHANGED
@@ -3,22 +3,24 @@ Contributors: joostdevalk
3
  Donate link: http://yoast.com/donate/
4
  Tags: social, bookmark, bookmarks, bookmarking, social bookmarking, social bookmarks
5
  Requires at least: 2.2
6
- Tested up to: 2.5.1
7
- stable tag: 2.9.1
8
 
9
- Automatically add links on your posts to popular social bookmarking sites.
10
 
11
  == Description ==
12
- Automatically add links on your posts to popular social bookmarking sites like Facebook, Mixx, StumbleUpon, Digg and many many others.
13
 
14
  More info:
15
 
16
- * [Sociable](http://yoast.com/wordpress/sociable/).
17
  * Read more about [WordPress SEO](http://yoast.com/articles/wordpress-seo/) so you can get the most out of this plugin.
18
  * Check out the other [Wordpress plugins](http://yoast.com/wordpress/) by the same author.
19
 
20
  **Changelog**
21
 
 
 
22
  * 2.9.1 Fixed bug where jQuery UI would be loaded twice.
23
  * 2.9 Removed Tool-Man in favor of jQuery, thx to Martin Joosse.
24
  * 2.8.4 Bugfixes.
3
  Donate link: http://yoast.com/donate/
4
  Tags: social, bookmark, bookmarks, bookmarking, social bookmarking, social bookmarks
5
  Requires at least: 2.2
6
+ Tested up to: 2.6
7
+ stable tag: 2.9.3
8
 
9
+ Automatically add links on your posts, pages and RSS feed to your favorite social bookmarking sites.
10
 
11
  == Description ==
12
+ Automatically add links to your favorite social bookmarking sites on your posts, pages and in your RSS feed. You can choose from 99 different social bookmarking sites!
13
 
14
  More info:
15
 
16
+ * More info on [Sociable](http://yoast.com/wordpress/sociable/), with info on how to add sites to it, and how to integrate it into your WordPress in other ways.
17
  * Read more about [WordPress SEO](http://yoast.com/articles/wordpress-seo/) so you can get the most out of this plugin.
18
  * Check out the other [Wordpress plugins](http://yoast.com/wordpress/) by the same author.
19
 
20
  **Changelog**
21
 
22
+ * 2.9.3 Added Leonaut, MySpace, fixed plugin description, added option to disable Sociable on a per post basis, added option to display sociable on tag pages, added extra security to config page, fixed print button, fixed Twitter functionality.
23
+ * 2.9.2 Added Swedish and Chinese localisations, thx to [Mikael Jorhult](http://www.mishkin.se/) and [Hugo Chen](http://take-ez.com/)
24
  * 2.9.1 Fixed bug where jQuery UI would be loaded twice.
25
  * 2.9 Removed Tool-Man in favor of jQuery, thx to Martin Joosse.
26
  * 2.8.4 Bugfixes.
sociable.php CHANGED
@@ -2,8 +2,8 @@
2
  /*
3
  Plugin Name: Sociable
4
  Plugin URI: http://yoast.com/wordpress/sociable/
5
- Description: Automatically add links on your posts to popular <a href="http://www.maxpower.ca/bookmarking">social bookmarking sites</a>. Go to Options -> Sociable for setup.
6
- Version: 2.9.1
7
  Author: Joost de Valk
8
  Author URI: http://yoast.com/
9
 
@@ -259,6 +259,11 @@ $sociable_known_sites = Array(
259
  'url' => 'http://laaik.it/NewStoryCompact.aspx?uri=PERMALINK&amp;headline=TITLE&amp;cat=5e082fcc-8a3b-47e2-acec-fdf64ff19d12',
260
  ),
261
 
 
 
 
 
 
262
  'LinkArena' => Array(
263
  'favicon' => 'linkarena.gif',
264
  'url' => 'http://linkarena.com/bookmarks/addlink/?url=PERMALINK&amp;title=TITLE',
@@ -319,6 +324,11 @@ $sociable_known_sites = Array(
319
  'url' => 'http://myshare.url.com.tw/index.php?func=newurl&amp;url=PERMALINK&amp;desc=TITLE',
320
  ),
321
 
 
 
 
 
 
322
  'N4G' => Array(
323
  'favicon' => 'n4g.gif',
324
  'url' => 'http://www.n4g.com/tips.aspx?url=PERMALINK&amp;title=TITLE',
@@ -479,12 +489,12 @@ $sociable_known_sites = Array(
479
 
480
  'TwitThis' => Array(
481
  'favicon' => 'twitter.png',
482
- 'url' => 'http://twitthis.com/twit?url=PERMALINK',
483
  ),
484
 
485
  'Upnews' => Array(
486
  'favicon' => 'upnews.gif',
487
- 'url' => 'http://www.upnews.it/submit?url=PERMALINK&title=TITLE',
488
  ),
489
 
490
  'Webnews.de' => Array(
@@ -585,6 +595,7 @@ $sociable_files = Array(
585
  'images/kickit.png',
586
  'images/kirtsy.gif',
587
  'images/laaikit.png',
 
588
  'images/linkagogo.png',
589
  'images/linkarena.gif',
590
  'images/linkedin.png',
@@ -597,6 +608,7 @@ $sociable_files = Array(
597
  'images/mixx.png',
598
  'images/muti.png',
599
  'images/myshare.png',
 
600
  'images/n4g.gif',
601
  'images/netvouz.png',
602
  'images/newsvine.png',
@@ -643,7 +655,12 @@ $sociable_files = Array(
643
  );
644
 
645
  function sociable_html($display=Array()) {
646
- global $sociable_known_sites, $sociablepluginpath, $wp_query;
 
 
 
 
 
647
 
648
  $active_sites = get_option('sociable_active_sites');
649
 
@@ -677,10 +694,16 @@ function sociable_html($display=Array()) {
677
 
678
  $rss = urlencode(get_bloginfo('ref_url'));
679
 
680
- $html .= "\n<div class=\"sociable\">\n<div class=\"sociable_tagline\">\n";
681
- $html .= stripslashes(get_option("sociable_tagline"));
682
- // $html .= "\n\t<span>" . __("These icons link to social bookmarking sites where readers can share and discover new web pages.", 'sociable') . "</span>";
683
- $html .= "\n</div>\n<ul>\n";
 
 
 
 
 
 
684
 
685
  foreach($display as $sitename) {
686
  // if they specify an unknown or inactive site, ignore it
@@ -703,11 +726,11 @@ function sociable_html($display=Array()) {
703
  }
704
  $link = "<li>";
705
  $link .= "<a rel=\"nofollow\"";
706
- if (get_option('sociable_usetargetblank')) {
707
  $link .= " target=\"_blank\"";
708
  }
709
  $link .= " href=\"$url\" title=\"$description\">";
710
- $link .= "<img src=\"$imagepath{$site['favicon']}\" title=\"$description\" alt=\"$description\" class=\"sociable-hovers";
711
  if ($site['class'])
712
  $link .= " sociable_{$site['class']}";
713
  $link .= "\" />";
@@ -734,6 +757,7 @@ if (is_array($sociable_contitionals) and in_array(true, $sociable_contitionals))
734
  (is_single() and $conditionals['is_single']) or
735
  (is_page() and $conditionals['is_page']) or
736
  (is_category() and $conditionals['is_category']) or
 
737
  (is_date() and $conditionals['is_date']) or
738
  (is_search() and $conditionals['is_search'])) {
739
  $content .= sociable_html();
@@ -797,6 +821,7 @@ function sociable_restore_config($force=False) {
797
  'is_single' => True,
798
  'is_page' => True,
799
  'is_category' => False,
 
800
  'is_date' => False,
801
  'is_search' => False,
802
  'is_feed' => False,
@@ -819,9 +844,9 @@ function sociable_admin_head() {
819
  global $sociablepluginpath, $wp_version;
820
 
821
  if ($wp_version < "2.6") {
 
 
822
  ?>
823
- <script language="JavaScript" type="text/javascript" src="<?php echo $sociablepluginpath; ?>jquery/jquery.js"></script>
824
- <?php } ?>
825
  <script language="JavaScript" type="text/javascript" src="<?php echo $sociablepluginpath; ?>jquery/ui.core.js"></script>
826
  <script language="JavaScript" type="text/javascript" src="<?php echo $sociablepluginpath; ?>jquery/ui.sortable.js"></script>
827
  <script language="JavaScript" type="text/javascript"><!--
@@ -878,15 +903,68 @@ function sociable_upload_errors() {
878
  return false;
879
  }
880
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
881
  // The admin page
882
  function sociable_submenu() {
883
  global $sociable_known_sites, $sociable_date, $sociable_files, $sociablepluginpath;
884
 
885
  // update options in db if requested
886
  if ($_REQUEST['restore']) {
 
887
  sociable_restore_config(True);
888
  sociable_message(__("Restored all settings to defaults.", 'sociable'));
889
  } else if ($_REQUEST['save']) {
 
890
  // update active sites
891
  $active_sites = Array();
892
  if (!$_REQUEST['active_sites'])
@@ -953,6 +1031,10 @@ function sociable_submenu() {
953
  // display options
954
  ?>
955
  <form action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post">
 
 
 
 
956
 
957
  <div class="wrap">
958
  <h2><?php _e("Sociable Options", 'sociable'); ?></h2>
@@ -990,7 +1072,7 @@ function sociable_submenu() {
990
  </th>
991
  <td>
992
  <?php _e("Change the text displayed in front of the icons below. For complete customization, edit <kbd>sociable.css</kbd> in the Sociable plugin directory.", 'sociable'); ?><br/>
993
- <input type="text" name="tagline" value="<?php echo htmlspecialchars($tagline); ?>" />
994
  </td>
995
  </tr>
996
  <tr>
@@ -1004,6 +1086,7 @@ function sociable_submenu() {
1004
  <input type="checkbox" name="conditionals[is_single]"<?php echo ($conditionals['is_single']) ? ' checked="checked"' : ''; ?> /> <?php _e("Individual blog posts", 'sociable'); ?><br/>
1005
  <input type="checkbox" name="conditionals[is_page]"<?php echo ($conditionals['is_page']) ? ' checked="checked"' : ''; ?> /> <?php _e('Individual WordPress "Pages"', 'sociable'); ?><br/>
1006
  <input type="checkbox" name="conditionals[is_category]"<?php echo ($conditionals['is_category']) ? ' checked="checked"' : ''; ?> /> <?php _e("Category archives", 'sociable'); ?><br/>
 
1007
  <input type="checkbox" name="conditionals[is_date]"<?php echo ($conditionals['is_date']) ? ' checked="checked"' : ''; ?> /> <?php _e("Date-based archives", 'sociable'); ?><br/>
1008
  <input type="checkbox" name="conditionals[is_search]"<?php echo ($conditionals['is_search']) ? ' checked="checked"' : ''; ?> /> <?php _e("Search results", 'sociable'); ?><br/>
1009
  <input type="checkbox" name="conditionals[is_feed]"<?php echo ($conditionals['is_feed']) ? ' checked="checked"' : ''; ?> /> <?php _e("RSS feed items", 'sociable'); ?><br/>
@@ -1050,4 +1133,5 @@ if (get_option('sociable_usecss_set_once') != true) {
1050
  update_option('sociable_usecss_set_once', true);
1051
  }
1052
 
1053
- ?>
 
2
  /*
3
  Plugin Name: Sociable
4
  Plugin URI: http://yoast.com/wordpress/sociable/
5
+ Description: Automatically add links on your posts, pages and RSS feed to your favorite social bookmarking sites. Go to <a href="options-general.php?page=Sociable">Settings -> Sociable</a> for setup.
6
+ Version: 2.9.3
7
  Author: Joost de Valk
8
  Author URI: http://yoast.com/
9
 
259
  'url' => 'http://laaik.it/NewStoryCompact.aspx?uri=PERMALINK&amp;headline=TITLE&amp;cat=5e082fcc-8a3b-47e2-acec-fdf64ff19d12',
260
  ),
261
 
262
+ 'Leonaut' => Array(
263
+ 'favicon' => 'leonaut.gif',
264
+ 'url' => 'http://www.leonaut.com/submit.php?url=PERMALINK&amp;title=TITLE'
265
+ ),
266
+
267
  'LinkArena' => Array(
268
  'favicon' => 'linkarena.gif',
269
  'url' => 'http://linkarena.com/bookmarks/addlink/?url=PERMALINK&amp;title=TITLE',
324
  'url' => 'http://myshare.url.com.tw/index.php?func=newurl&amp;url=PERMALINK&amp;desc=TITLE',
325
  ),
326
 
327
+ 'MySpace' => Array(
328
+ 'favicon' => 'myspace.png',
329
+ 'url' => 'http://www.myspace.com/Modules/PostTo/Pages/?u=PERMALINK&amp;t=TITLE',
330
+ ),
331
+
332
  'N4G' => Array(
333
  'favicon' => 'n4g.gif',
334
  'url' => 'http://www.n4g.com/tips.aspx?url=PERMALINK&amp;title=TITLE',
489
 
490
  'TwitThis' => Array(
491
  'favicon' => 'twitter.png',
492
+ 'url' => 'http://twitter.com/home?status=PERMALINK',
493
  ),
494
 
495
  'Upnews' => Array(
496
  'favicon' => 'upnews.gif',
497
+ 'url' => 'http://www.upnews.it/submit?url=PERMALINK&amp;title=TITLE',
498
  ),
499
 
500
  'Webnews.de' => Array(
595
  'images/kickit.png',
596
  'images/kirtsy.gif',
597
  'images/laaikit.png',
598
+ 'images/leonaut.gif',
599
  'images/linkagogo.png',
600
  'images/linkarena.gif',
601
  'images/linkedin.png',
608
  'images/mixx.png',
609
  'images/muti.png',
610
  'images/myshare.png',
611
+ 'images/myspace.png',
612
  'images/n4g.gif',
613
  'images/netvouz.png',
614
  'images/newsvine.png',
655
  );
656
 
657
  function sociable_html($display=Array()) {
658
+ global $sociable_known_sites, $sociablepluginpath, $wp_query, $post;
659
+
660
+ $sociableooffmeta = get_post_meta($post->ID,'sociableoff',true);
661
+ if ($sociableooffmeta == "true") {
662
+ return "";
663
+ }
664
 
665
  $active_sites = get_option('sociable_active_sites');
666
 
694
 
695
  $rss = urlencode(get_bloginfo('ref_url'));
696
 
697
+ $html .= "\n<div class=\"sociable\">\n";
698
+
699
+ $tagline = get_option("sociable_tagline");
700
+ if ($tagline != "") {
701
+ $html .= "<div class=\"sociable_tagline\">\n";
702
+ $html .= stripslashes($tagline);
703
+ $html .= "\n</div>";
704
+ }
705
+
706
+ $html .= "\n<ul>\n";
707
 
708
  foreach($display as $sitename) {
709
  // if they specify an unknown or inactive site, ignore it
726
  }
727
  $link = "<li>";
728
  $link .= "<a rel=\"nofollow\"";
729
+ if (get_option('sociable_usetargetblank') && $site['url'] != 'javascript:window.print();') {
730
  $link .= " target=\"_blank\"";
731
  }
732
  $link .= " href=\"$url\" title=\"$description\">";
733
+ $link .= "<img src=\"".$imagepath.$site['favicon']."\" title=\"$description\" alt=\"$description\" class=\"sociable-hovers";
734
  if ($site['class'])
735
  $link .= " sociable_{$site['class']}";
736
  $link .= "\" />";
757
  (is_single() and $conditionals['is_single']) or
758
  (is_page() and $conditionals['is_page']) or
759
  (is_category() and $conditionals['is_category']) or
760
+ (is_tag() and $conditionals['is_tag']) or
761
  (is_date() and $conditionals['is_date']) or
762
  (is_search() and $conditionals['is_search'])) {
763
  $content .= sociable_html();
821
  'is_single' => True,
822
  'is_page' => True,
823
  'is_category' => False,
824
+ 'is_tag' => False,
825
  'is_date' => False,
826
  'is_search' => False,
827
  'is_feed' => False,
844
  global $sociablepluginpath, $wp_version;
845
 
846
  if ($wp_version < "2.6") {
847
+ echo '<script language="JavaScript" type="text/javascript" src="'.$sociablepluginpath.'jquery/jquery.js"></script>';
848
+ }
849
  ?>
 
 
850
  <script language="JavaScript" type="text/javascript" src="<?php echo $sociablepluginpath; ?>jquery/ui.core.js"></script>
851
  <script language="JavaScript" type="text/javascript" src="<?php echo $sociablepluginpath; ?>jquery/ui.sortable.js"></script>
852
  <script language="JavaScript" type="text/javascript"><!--
903
  return false;
904
  }
905
 
906
+ function sociable_meta() {
907
+ global $post;
908
+ $sociableoff = false;
909
+ $sociableoffmeta = get_post_meta($post->ID,'sociableoff',true);
910
+ if ($sociableoffmeta == "true") {
911
+ $sociableoff = true;
912
+ }
913
+ ?>
914
+ <input type="checkbox" name="sociableoff" <?php if ($sociableoff) { echo 'checked="checked"'; } ?>/> Sociable disabled?
915
+ <?php
916
+ }
917
+
918
+ function sociable_option() {
919
+ global $post;
920
+ $sociableoff = false;
921
+ $sociableoffmeta = get_post_meta($post->ID,'sociableoff',true);
922
+ if ($sociableoffmeta == "true") {
923
+ $sociableoff = true;
924
+ }
925
+ if ( current_user_can('edit_posts') ) { ?>
926
+ <fieldset id="sociableoption" class="dbx-box">
927
+ <h3 class="dbx-handle">Sociable</h3>
928
+ <div class="dbx-content">
929
+ <input type="checkbox" name="sociableon" <?php if ($sociableoff) { echo 'checked="checked"'; } ?>/> Sociable disabled?
930
+ </div>
931
+ </fieldset>
932
+ <?php
933
+ }
934
+ }
935
+
936
+ function sociable_meta_box() {
937
+ // Check whether the 2.5 function add_meta_box exists, and if it doesn't use 2.3 functions.
938
+ if ( function_exists('add_meta_box') ) {
939
+ add_meta_box('sociable','Sociable','sociable_meta','post');
940
+ add_meta_box('sociable','Sociable','sociable_meta','page');
941
+ } else {
942
+ add_action('dbx_post_sidebar', 'sociable_option');
943
+ add_action('dbx_page_sidebar', 'sociable_option');
944
+ }
945
+ }
946
+ add_action('admin_menu', 'sociable_meta_box');
947
+
948
+ function sociable_insert_post($pID) {
949
+ if (isset($_POST['sociableoff'])) {
950
+ add_post_meta($pID,'sociableoff',"true", true) or update_post_meta($pID, 'sociableoff', "true");
951
+ } else {
952
+ add_post_meta($pID,'sociableoff',"false", true) or update_post_meta($pID, 'sociableoff', "false");
953
+ }
954
+ }
955
+ add_action('wp_insert_post', 'sociable_insert_post');
956
+
957
  // The admin page
958
  function sociable_submenu() {
959
  global $sociable_known_sites, $sociable_date, $sociable_files, $sociablepluginpath;
960
 
961
  // update options in db if requested
962
  if ($_REQUEST['restore']) {
963
+ check_admin_referer('sociable-config');
964
  sociable_restore_config(True);
965
  sociable_message(__("Restored all settings to defaults.", 'sociable'));
966
  } else if ($_REQUEST['save']) {
967
+ check_admin_referer('sociable-config');
968
  // update active sites
969
  $active_sites = Array();
970
  if (!$_REQUEST['active_sites'])
1031
  // display options
1032
  ?>
1033
  <form action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post">
1034
+ <?php
1035
+ if ( function_exists('wp_nonce_field') )
1036
+ wp_nonce_field('sociable-config');
1037
+ ?>
1038
 
1039
  <div class="wrap">
1040
  <h2><?php _e("Sociable Options", 'sociable'); ?></h2>
1072
  </th>
1073
  <td>
1074
  <?php _e("Change the text displayed in front of the icons below. For complete customization, edit <kbd>sociable.css</kbd> in the Sociable plugin directory.", 'sociable'); ?><br/>
1075
+ <input size="80" type="text" name="tagline" value="<?php echo htmlspecialchars($tagline); ?>" />
1076
  </td>
1077
  </tr>
1078
  <tr>
1086
  <input type="checkbox" name="conditionals[is_single]"<?php echo ($conditionals['is_single']) ? ' checked="checked"' : ''; ?> /> <?php _e("Individual blog posts", 'sociable'); ?><br/>
1087
  <input type="checkbox" name="conditionals[is_page]"<?php echo ($conditionals['is_page']) ? ' checked="checked"' : ''; ?> /> <?php _e('Individual WordPress "Pages"', 'sociable'); ?><br/>
1088
  <input type="checkbox" name="conditionals[is_category]"<?php echo ($conditionals['is_category']) ? ' checked="checked"' : ''; ?> /> <?php _e("Category archives", 'sociable'); ?><br/>
1089
+ <input type="checkbox" name="conditionals[is_tag]"<?php echo ($conditionals['is_tag']) ? ' checked="checked"' : ''; ?> /> <?php _e("Tag listings", 'sociable'); ?><br/>
1090
  <input type="checkbox" name="conditionals[is_date]"<?php echo ($conditionals['is_date']) ? ' checked="checked"' : ''; ?> /> <?php _e("Date-based archives", 'sociable'); ?><br/>
1091
  <input type="checkbox" name="conditionals[is_search]"<?php echo ($conditionals['is_search']) ? ' checked="checked"' : ''; ?> /> <?php _e("Search results", 'sociable'); ?><br/>
1092
  <input type="checkbox" name="conditionals[is_feed]"<?php echo ($conditionals['is_feed']) ? ' checked="checked"' : ''; ?> /> <?php _e("RSS feed items", 'sociable'); ?><br/>
1133
  update_option('sociable_usecss_set_once', true);
1134
  }
1135
 
1136
+ require_once("yoast-posts.php");
1137
+ ?>
yoast-posts.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (!class_exists('YoastPosts')) {
4
+ class YoastPosts {
5
+
6
+ // Class initialization
7
+ function YoastPosts() {
8
+ if (isset($_GET['show_yoast_widget'])) {
9
+ if ($_GET['show_yoast_widget'] == "true") {
10
+ update_option( 'show_yoast_widget', 'noshow' );
11
+ } else {
12
+ update_option( 'show_yoast_widget', 'show' );
13
+ }
14
+ }
15
+
16
+ // Add the widget to the dashboard
17
+ add_action( 'wp_dashboard_setup', array(&$this, 'register_widget') );
18
+ add_filter( 'wp_dashboard_widgets', array(&$this, 'add_widget') );
19
+ }
20
+
21
+ // Register this widget -- we use a hook/function to make the widget a dashboard-only widget
22
+ function register_widget() {
23
+ wp_register_sidebar_widget( 'yoast_posts', __( 'Yoast - Tweaking Websites', 'yoast-posts' ), array(&$this, 'widget'), array( 'all_link' => 'http://yoast.com/', 'feed_link' => 'http://yoast.com/feed/', 'edit_link' => 'options.php' ) );
24
+ }
25
+
26
+ // Modifies the array of dashboard widgets and adds this plugin's
27
+ function add_widget( $widgets ) {
28
+ global $wp_registered_widgets;
29
+ if ( !isset($wp_registered_widgets['yoast_posts']) ) return $widgets;
30
+ array_splice( $widgets, 2, 0, 'yoast_posts' );
31
+ return $widgets;
32
+ }
33
+
34
+ function widget($args) {
35
+ $show = get_option('show_yoast_widget');
36
+ if ($show != 'noshow') {
37
+ extract( $args, EXTR_SKIP );
38
+ echo $before_widget.$before_title.$widget_name.$after_title;
39
+ echo '<a href="http://yoast.com/"><img style="margin: 0 0 5px 5px;" src="http://yoast.com/images/yoast-logo-rss.png" align="right" alt="Yoast"/></a>';
40
+ include_once(ABSPATH . WPINC . '/rss.php');
41
+ $rss = fetch_rss('http://feeds.feedburner.com/joostdevalk');
42
+ $items = array_slice($rss->items, 0, 2);
43
+ ?>
44
+ <?php if (empty($items)) echo '<li>No items</li>';
45
+ else
46
+ foreach ( $items as $item ) : ?>
47
+ <a style="font-size: 14px; font-weight:bold;" href='<?php echo $item['link']; ?>' title='<?php echo $item['title']; ?>'><?php echo $item['title']; ?></a> <span style="font-size: 14px; color: #aaa;"><?php echo date('j F Y',strtotime($item['pubdate'])); ?></span><br/>
48
+ <?php echo substr($item['summary'],0,strpos($item['summary'], "This is a post from")); ?>
49
+ <br/>
50
+ <?php endforeach;
51
+ echo '<p style="float:right;"><a href="?show_yoast_widget=true">Remove this widget</a></p>';
52
+ echo $after_widget;
53
+ }
54
+ }
55
+ }
56
+
57
+ // Start this plugin once all other plugins are fully loaded
58
+ add_action( 'plugins_loaded', create_function( '', 'global $YoastPosts; $YoastPosts = new YoastPosts();' ) );
59
+ }
60
+ ?>