Changeset 356478
- Timestamp:
- 03/07/2011 06:35:30 AM (15 years ago)
- Location:
- wp-tweet-button/trunk
- Files:
-
- 5 added
- 2 edited
-
inc (added)
-
inc/admstyle.css (added)
-
inc/perpostsettings.inc.php (added)
-
inc/settings.frame.inc.php (added)
-
inc/settings.inc.php (added)
-
readme.txt (modified) (1 diff)
-
wp-tweet-button.php (modified) (29 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-tweet-button/trunk/readme.txt
r355924 r356478 125 125 == Changelog == 126 126 127 = 2.0.6 = 128 * New feature allows admins to set default twitter account, ignoring author settings. 129 127 130 = 2.0.5 = 128 131 * Bugfix related to shortlinks and links on main page. -
wp-tweet-button/trunk/wp-tweet-button.php
r355924 r356478 2 2 /* 3 3 Plugin Name: WP Tweet Button 4 Version: 2.0. 54 Version: 2.0.6 5 5 Plugin URI: http://0xtc.com/plugins/wp-tweet-button 6 6 Description: The WordPress implementation of the official Twitter Tweet Button. … … 37 37 38 38 class wpTweetButton { 39 var $optionsname = 'wp_tweet_button'; 40 var $txtdom = 'wp-tweet-button'; 41 var $readyState = false; 42 var $excerptState = false; 39 var $pluginlabel = 'WP Tweet Button'; 40 var $pluginslug = 'wptweetbutton'; 41 var $optionsname = 'wp_tweet_button'; 42 var $txtdom = 'wp-tweet-button'; 43 var $readyState = false; 44 var $excerptState = false; 43 45 var $postid; 44 46 /** … … 73 75 'tw_btn_text'=>'Tweet', 74 76 'tw_via'=>'', 77 'tw_via_authors'=>'', 75 78 'tw_ga_code'=>'', 76 79 'tw_enable_ga_code'=>'1', … … 283 286 */ 284 287 var $wptbsrv = 'http://wptbsrv.0xtc.com/a/'; 288 var $settingsuri = 'options-general.php?page=wp-tweet-button.php'; 285 289 286 290 /** … … 298 302 } 299 303 304 function tw_get_activepost(){ 305 $activepost = null; 306 if(is_int($this->postid)) { 307 $activepost = get_post($this->postid); 308 } else { 309 global $post; 310 $activepost = $post; 311 } 312 return $activepost; 313 } 314 300 315 /** 301 316 * This function isn't actually used but is left here for historical reasons. Yeah, that's it...historical reasons. … … 417 432 */ 418 433 function tw_get_twitter_name(){ 434 $activepost = $this->tw_get_activepost(); 419 435 $viauser=false; 420 if(is_int($this->postid)) { 421 $post = get_post($this->postid); 422 } else { 423 global $post; 424 } 436 $activepost = $this->tw_get_activepost(); 425 437 if (function_exists('get_user_meta')){ 426 if (get_user_meta($ post->post_author, 'twitter',true)){427 $viauser = get_user_meta($ post->post_author, 'twitter',true);438 if (get_user_meta($activepost->post_author, 'twitter',true) !='' && $this->tw_get_option('tw_via_authors')!='1'){ 439 $viauser = get_user_meta($activepost->post_author, 'twitter',true); 428 440 } else { 429 441 $viauser = $this->tw_get_option('tw_via'); … … 439 451 */ 440 452 function tw_get_text($entitydecode=false){ 441 if(is_int($this->postid)) { 442 $post = get_post($this->postid); 443 } else { 444 global $post; 445 } 446 if (get_post_meta($post->ID, '_twitterrelated_custom_text', true)){ 453 $activepost = $this->tw_get_activepost(); 454 if (get_post_meta($activepost->ID, '_twitterrelated_custom_text', true)){ 447 455 if ($entitydecode){ 448 $button_data_text = html_entity_decode($this->tw_preptext(get_post_meta($ post->ID, '_twitterrelated_custom_text', true)));456 $button_data_text = html_entity_decode($this->tw_preptext(get_post_meta($activepost->ID, '_twitterrelated_custom_text', true))); 449 457 } else { 450 $button_data_text = $this->tw_preptext(get_post_meta($ post->ID, '_twitterrelated_custom_text', true));458 $button_data_text = $this->tw_preptext(get_post_meta($activepost->ID, '_twitterrelated_custom_text', true)); 451 459 } 452 460 } else { 453 461 $tw_text = $this->tw_get_option('tw_text'); 454 if ($tw_text=='entry_title') { $button_data_text = $ post->post_title;}455 if ($tw_text=='page_title') { $button_data_text = $ post->post_title .' - '. get_bloginfo('name');}462 if ($tw_text=='entry_title') { $button_data_text = $activepost->post_title;} 463 if ($tw_text=='page_title') { $button_data_text = $activepost->post_title .' - '. get_bloginfo('name');} 456 464 if ($tw_text=='blog_title') { $button_data_text = get_bloginfo('name');} 457 465 if ($tw_text=='custom_title') { $button_data_text = $this->tw_preptext(stripslashes($this->tw_get_option('tw_text_custom')));} … … 464 472 */ 465 473 function tw_preptext($text){ 466 if(is_int($this->postid)) { 467 $post = get_post($this->postid); 468 } else { 469 global $post; 470 } 474 $activepost = $this->tw_get_activepost(); 471 475 $tmptxt = null; 472 $tmptxt= str_replace('%POSTTITLE%', $ post->post_title, $text);476 $tmptxt= str_replace('%POSTTITLE%', $activepost->post_title, $text); 473 477 $tmptxt= str_replace('%BLOGTITLE%', get_bloginfo('name'), $tmptxt); 474 478 $tmptxt= str_replace('%BLOGHASHTAGS%', $this->tw_get_hash_tags(), $tmptxt); … … 529 533 */ 530 534 function wpTweetButton(){ 531 /*532 if(is_int($this->postid)) {533 $post = get_post($this->postid);534 } else {535 */536 // global $post;537 // $this->postid = $post->ID;538 /* }539 */540 535 $this->options = $this->tw_readoptions(); 541 536 $this->shortenerdata = apply_filters('wp_tweet_button_shortenerdata', $this->shortenerdata); … … 584 579 585 580 if ($uri){ 586 header('location: options-general.php?page=wp-tweet-button.php'.$uri);581 header('location: '.$this->settingsuri.$uri); 587 582 die; 588 583 } 589 584 } else { 590 if ($this->tw_get_option('tw_use_rel_me') == '1' && $this->tw_get_ option('tw_via') !='') {585 if ($this->tw_get_option('tw_use_rel_me') == '1' && $this->tw_get_twitter_name() !='') { 591 586 add_action('wp_head', array(&$this, 'tw_add_rel_me')); 592 587 } … … 676 671 */ 677 672 function tw_get_hash_tags(){ 678 if(is_int($this->postid)) {679 $post = get_post($this->postid);680 } else {681 global $post;682 }683 673 $textsuff = null; 684 674 $posttags = get_the_tags(); … … 695 685 */ 696 686 function tw_get_hash_cats(){ 697 if(is_int($this->postid)) {698 $post = get_post($this->postid);699 } else {700 global $post;701 }702 687 $textsuff = null; 703 688 $posttags = get_the_category(); … … 727 712 */ 728 713 function tw_get_related_text($urenc=false){ 729 if(is_int($this->postid)) { 730 $post = get_post($this->postid); 731 } else { 732 global $post; 733 } 714 $activepost = $this->tw_get_activepost(); 734 715 $text = null; 735 if (get_post_meta($ post->ID, '_twitterrelated', true)) {736 $text = ($urenc) ? urlencode(get_post_meta($ post->ID, '_twitterrelated', true)) : get_post_meta($post->ID, '_twitterrelated', true);716 if (get_post_meta($activepost->ID, '_twitterrelated', true)) { 717 $text = ($urenc) ? urlencode(get_post_meta($activepost->ID, '_twitterrelated', true)) : get_post_meta($activepost->ID, '_twitterrelated', true); 737 718 $text = str_replace('%2C','%E2%80%9A',$text); 738 719 $text = str_replace('+','%20',$text); 739 720 $text = str_replace('%3A',':',$text); 740 721 } elseif 741 (get_post_meta($ post->ID, 'twitterrelated', true)){742 $text = ($urenc) ? urlencode(get_post_meta($ post->ID, 'twitterrelated', true)) : get_post_meta($post->ID, 'twitterrelated', true);722 (get_post_meta($activepost->ID, 'twitterrelated', true)){ 723 $text = ($urenc) ? urlencode(get_post_meta($activepost->ID, 'twitterrelated', true)) : get_post_meta($activepost->ID, 'twitterrelated', true); 743 724 } else { 744 725 if ($this->tw_get_option('tw_rec')) { … … 754 735 */ 755 736 function tw_build_options_data() { 756 if(is_int($this->postid)) { 757 $post = get_post($this->postid); 758 } else { 759 global $post; 760 } 737 $activepost = $this->tw_get_activepost(); 761 738 $textprefix = null; 762 739 $button_data_via=null; … … 771 748 } 772 749 } 773 $tdata = get_post_meta($ post->ID, '_tw_autotweeted',true);750 $tdata = get_post_meta($activepost->ID, '_tw_autotweeted',true); 774 751 if ($tdata !=''){ 775 752 $tdata = explode(':',$tdata ); … … 800 777 */ 801 778 function tw_build_options($bwdata=false) { 802 if(is_int($this->postid)) {803 $post = get_post($this->postid);804 } else {805 global $post;806 }807 779 $textprefix =null; 808 780 if ($bwdata==true && !is_feed()){return false;} … … 879 851 function tw_get_long_url($addtrack=false, $addlang=true) { 880 852 global $my_transposh_plugin; 881 882 if (!in_the_loop() && is_home()){return esc_url(home_url());} 883 884 if(is_int($this->postid)) { 885 $post = get_post($this->postid); 886 } else { 887 global $post; 888 } 853 if (!in_the_loop() && is_home()){return home_url();} 854 $activepost = $this->tw_get_activepost(); 889 855 $perms=null; 890 if (empty($ post->post_title)) {856 if (empty($activepost->post_title)) { 891 857 $perms= esc_url('http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']); 892 858 } else { 893 $perms = trim(get_permalink($ post->ID));859 $perms = trim(get_permalink($activepost->ID)); 894 860 } 895 861 … … 903 869 $tmptxt= str_replace('?', '', $this->tw_get_option('tw_ga_code')); 904 870 $tmptxt= str_replace('+', '', $tmptxt); 905 $tmptxt= str_replace('%POSTID%', $ post->ID, $tmptxt);906 $tmptxt= str_replace('%POSTSLUG%', $ post->post_name, $tmptxt);871 $tmptxt= str_replace('%POSTID%', $activepost->ID, $tmptxt); 872 $tmptxt= str_replace('%POSTSLUG%', $activepost->post_name, $tmptxt); 907 873 $tmptxt= str_replace('%2B', '', $tmptxt); 908 874 $tmptxt= str_replace('%20', '', $tmptxt); … … 931 897 function tw_get_short_url() { 932 898 global $my_transposh_plugin; 933 if(is_int($this->postid)) { 934 $post = get_post($this->postid); 935 } else { 936 global $post; 937 } 938 939 if (!in_the_loop() && is_home()){return esc_url(home_url());} 899 $activepost = $this->tw_get_activepost(); 900 if (!in_the_loop() && is_home()){return home_url();} 940 901 941 902 $perms = $this->tw_get_long_url(true); … … 945 906 $selectedshortener=$this->tw_get_option('tw_url_shortener'); 946 907 if ( 947 // ($post && $post->post_status != 'publish') ||948 908 ($selectedshortener == 'none')) { 949 909 return $perms; … … 956 916 } 957 917 if (function_exists('wp_get_shortlink') && ($selectedshortener == 'wordpress')){ 958 $fetch_url = wp_get_shortlink($ post->ID);918 $fetch_url = wp_get_shortlink($activepost->ID); 959 919 } 960 920 if(!empty($fetch_url)){ … … 993 953 $langext = null; 994 954 $langext = $my_transposh_plugin->target_language; 995 $langarr = get_post_meta($ post->ID, '_twitterrelated_short_url_lang',true);955 $langarr = get_post_meta($activepost->ID, '_twitterrelated_short_url_lang',true); 996 956 if (!is_array($langarr)) $langarr = array(); 997 957 if ( 998 // ($selectedshortener.'_'.$langext != get_post_meta($ post->ID, '_activeshortener',true)) ||958 // ($selectedshortener.'_'.$langext != get_post_meta($activepost->ID, '_activeshortener',true)) || 999 959 (md5($perms) != $langarr[$langext]['hash'])) { 1000 960 if ($langext){ … … 1005 965 $langarr[$langext]['hash'] = md5($perms); 1006 966 if ( !empty( $fetch_url ) && ($fetch_url != $perms) && strstr($fetch_url,'http://') && (!strstr($perms,'preview=true'))) { 1007 if (!update_post_meta($ post->ID, '_activeshortener', $selectedshortener . '_'. $langext)) {1008 add_post_meta($ post->ID, '_activeshortener', $selectedshortener . '_'. $langext);967 if (!update_post_meta($activepost->ID, '_activeshortener', $selectedshortener . '_'. $langext)) { 968 add_post_meta($activepost->ID, '_activeshortener', $selectedshortener . '_'. $langext); 1009 969 } 1010 if (!update_post_meta($ post->ID, '_twitterrelated_short_url_lang', $langarr)) {1011 add_post_meta($ post->ID, '_twitterrelated_short_url_lang', $langarr);970 if (!update_post_meta($activepost->ID, '_twitterrelated_short_url_lang', $langarr)) { 971 add_post_meta($activepost->ID, '_twitterrelated_short_url_lang', $langarr); 1012 972 } 1013 973 } … … 1021 981 } 1022 982 } else { 1023 if (($selectedshortener != get_post_meta($ post->ID, '_activeshortener',true)) ||1024 (md5($perms) != get_post_meta($ post->ID, '_twitterrelated_short_urlHash',true))) {983 if (($selectedshortener != get_post_meta($activepost->ID, '_activeshortener',true)) || 984 (md5($perms) != get_post_meta($activepost->ID, '_twitterrelated_short_urlHash',true))) { 1025 985 if (!(strstr($request_url,'http://' . $_SERVER['SERVER_NAME'])) && ($request_url != '')){ 1026 986 $fetch_url = trim($this->tw_nav_browse($request_url, $method, $POST_data)); 1027 987 } 1028 988 if ( !empty( $fetch_url ) && ($fetch_url != $perms) && strstr($fetch_url,'http://') && (!strstr($perms,'preview=true'))) { 1029 if (!update_post_meta($ post->ID, '_activeshortener', $selectedshortener )) {1030 add_post_meta($ post->ID, '_activeshortener', $selectedshortener);989 if (!update_post_meta($activepost->ID, '_activeshortener', $selectedshortener )) { 990 add_post_meta($activepost->ID, '_activeshortener', $selectedshortener); 1031 991 } 1032 if (!update_post_meta($ post->ID, '_twitterrelated_short_url', $fetch_url)) {1033 add_post_meta($ post->ID, '_twitterrelated_short_url', $fetch_url);992 if (!update_post_meta($activepost->ID, '_twitterrelated_short_url', $fetch_url)) { 993 add_post_meta($activepost->ID, '_twitterrelated_short_url', $fetch_url); 1034 994 } 1035 if (!update_post_meta($ post->ID, '_twitterrelated_short_urlHash', md5($perms))) {1036 add_post_meta($ post->ID, '_twitterrelated_short_urlHash', md5($perms));995 if (!update_post_meta($activepost->ID, '_twitterrelated_short_urlHash', md5($perms))) { 996 add_post_meta($activepost->ID, '_twitterrelated_short_urlHash', md5($perms)); 1037 997 } 1038 998 } 1039 999 } else { 1040 $fetch_url = get_post_meta($ post->ID, '_twitterrelated_short_url'.$langext,true);1000 $fetch_url = get_post_meta($activepost->ID, '_twitterrelated_short_url'.$langext,true); 1041 1001 if ($fetch_url ==''){ 1042 1002 $fetch_url = $perms; … … 1148 1108 function tweetbutton($post,$bwdata=false) { 1149 1109 global $post; 1150 // $thepost = get_post($this->postid);1151 1110 $this->postid = $post->ID; 1152 1111 if (isset($post->ID)){ … … 1181 1140 */ 1182 1141 function tw_drawcss_admin(){ 1183 ?><style type="text/css"> 1184 #wptweetbutton-mbox-general .green {color: #0A0;} 1185 #wptweetbutton-mbox-general .inside {margin:0;} 1186 #wptweetbutton-mbox-general .floatleft180 {width:180px;float:left;} 1187 #wptweetbutton-mbox-general .floatleft100 {width:100px;float:left;} 1188 #wptweetbutton-mbox-general .floatleftm10 {float:left;margin-right:10px;margin-top: 4px;} 1189 #wptweetbutton-mbox-general .tweetbtnc {font-size:100%;display:block;float:left;height:90px;} 1190 #wptweetbutton-mbox-general .floatlm4 {float:left;margin-top:4px;} 1191 #wptweetbutton-mbox-general .floatlml2 {margin-left:2px;width:100px;display:block;float:left;} 1192 #wptweetbutton-mbox-general .floatlmn2 {margin-left:2px;display:block;float:left;} 1193 #wptweetbutton-mbox-general .pad45 {padding:6px;} 1194 #wptweetbutton-mbox-general .w99c29c {width: 99%;color: #444;} 1195 #wptweetbutton-mbox-general .bt1pcs {} 1196 #wptweetbutton-mbox-general .w150 {width: 150px;} 1197 #wptweetbutton-mbox-general .twhdata p {margin:6px 0;} 1198 #wptweetbutton-mbox-general .twhrow label {line-height:15px;font-weight: bold;display: block;} 1199 #wptweetbutton-mbox-general table {border-bottom:1px solid #E3E3E3;} 1200 #wptweetbutton-mbox-general tr td .warning {color: #D00;} 1201 #wptweetbutton-mbox-general tr td input:hover, 1202 #wptweetbutton-mbox-general tr td textarea:hover {background:#f3f7fa;color:#444} 1203 #wptweetbutton-mbox-general tr td input:focus, 1204 #wptweetbutton-mbox-general tr td textarea:focus {background:#EAF2FA;color:#000} 1205 #wptweetbutton-mbox-general td.twhdata label {} 1206 #wptweetbutton-mbox-general .twhdata {background: #fff;vertical-align:top;} 1207 #wptweetbutton-mbox-general .twhrow {background: #f1f1f1;border-bottom: 1px solid #e3e3e3;border-right:1px solid #e3e3e3;width: 115px;} 1208 #wptweetbutton-mbox-general .twhhlp {background: #f1f1f1; width: 200px;color:#565656;padding:6px;border-left:1px solid #e3e3e3;} 1209 </style><?php 1142 echo '<style type="text/css"> 1143 <![CDATA[ '."\r\n"; 1144 require ('inc/admstyle.css'); 1145 echo "\r\n".']]>'."\r\n".'</style>'."\r\n"; 1210 1146 } 1211 1147 … … 1214 1150 */ 1215 1151 function tw_options_page(){ 1216 if( function_exists( 'add_meta_box' )) { 1217 add_meta_box( 'TweetButtonSettings1', 'General settings', array(&$this, 'tw_options_box'), 'wptweetbutton', 'normal'); 1218 ?> 1219 <div id="wptweetbutton-mbox-general" class="wrap"> 1220 <?php screen_icon('options-general'); ?> 1221 <h2>WP Tweet Button</h2> 1222 <?php 1223 wp_nonce_field('wptweetbutton-mbox-general'); 1224 wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false ); 1225 wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false ); 1226 ?> 1227 <div id="poststuff" class="metabox-holder"> 1228 <div id="post-body" class="has-sidebar"> 1229 <div id="post-body-content" class=""> 1230 <?php do_meta_boxes('wptweetbutton', 'normal', null); ?> 1231 </div> 1232 </div> 1233 <p style="clear:both;"></p> 1234 </div> 1235 </div> 1236 <?php 1237 } 1238 } 1239 1240 /** 1241 * Function returns a row on the settings page 1242 */ 1243 function tw_row_head($rh,$lfor=""){ 1244 return ' 1245 <th class="twhrow" scope="row" valign="top"> 1246 <label for="'.$lfor.'"> 1247 '.$rh.' 1248 </label> 1249 </th>'; 1250 } 1251 1152 require ('inc/settings.frame.inc.php'); 1153 } 1154 1252 1155 /** 1253 1156 * Function outputs the settings page contents 1254 1157 */ 1255 1158 function tw_options_box() { 1256 $msg['w3'] = __('W3 Total Cache page cache has been cleared',$this->txtdom); 1257 $msg['sc'] = __('WP Super Cache cleared',$this->txtdom); 1258 $msg['oauthok'] = __('Auto-Tweeting authorized. You can now <a href="#tw_auto_tweet_box">configure</a> Auto-Tweeting.',$this->txtdom); 1259 $msg['oauthdel'] = __('Auto-Tweeting authorization has been removed. Auto-Tweeting has been disabled.',$this->txtdom); 1260 if (isset($_GET['op2'])) if ($_GET['op2']=='w3' || $_GET['op2']=='oauthok' || $_GET['op2']=='oauthdel' || $_GET['op2']=='sc') { 1261 $updmsg = '<p><strong>' . $msg[$_GET['op2']] . '</strong></p>'; 1262 } else { 1263 $updmsg = null; 1264 } 1265 if (isset($_GET['op1'])) if ($_GET['op1']=='1') echo '<div id="message" class="updated fade"><p><strong>' . __('Tweet Button settings have been saved',$this->txtdom) . '</strong></p>'.$updmsg.'</div>'; 1266 if (isset($_GET['op2'])) if ($_GET['op2']=='oauthok' || $_GET['op2']=='oauthdel') echo '<div id="message" class="updated fade">'.$updmsg.'</div>'; 1267 if (isset($_GET['op3'])) if ($_GET['op3']=='fs') echo '<div id="message" class="updated fade"><p><strong>All cached shortlinks have been deleted.</strong></p></div>'; 1268 if (isset($_GET['showdiag'])) if ($_GET['showdiag']=='1') echo '<div id="message" class="updated fade"><pre><strong>' . 'PHP version: ' . phpversion(). '<br />WP Tweet Button configuration: ' .print_r($this->options,true) . '</strong></pre></div>'; 1269 ?> 1270 <form method="post" action="" name="twsettingsform" id="twsettingsform"><?php 1271 if (function_exists('settings_fields')){ 1272 settings_fields('tw-options'); 1273 } else { 1274 wp_nonce_field('update-options'); 1275 $paramstr = ''; 1276 echo '<input type="hidden" name="action" value="update" />'; 1277 echo '<input type="hidden" name="page_options" value="'; 1278 foreach($this->options as $key => $option) { 1279 $paramstr .= $key.','; 1280 } 1281 echo substr($paramstr,0, -1); 1282 echo '" />'; 1283 } 1284 ?> 1285 <div> 1286 <table style="margin:0" class="form-table"> 1287 <tr class="bt1pcs"> 1288 <td class="twhdata" colspan="3" style="background: #E3E3E3;border-top:1px solid #CCC;border-bottom:1px solid #CCC;"> 1289 <p class="submit"> 1290 <input style="width:160px" type="submit" name="Submit" value="<?php _e('Save Changes') ?>" /> 1291 </p> 1292 </td> 1293 </tr> 1294 <tr class="bt1pcs"> 1295 <?php echo $this->tw_row_head(__('Display',$this->txtdom));?> 1296 <td class="twhdata"> 1297 <div style="margin-right:20px;width:160px;" class="floatleft180"> 1298 <label for="tw_where"><?php _e('Position',$this->txtdom); ?></label><br /> 1299 <select name="tw_where" class="w99c29c"> 1300 <option <?php if ($this->tw_get_option('tw_where') == 'before') echo 'selected="selected"'; ?> value="before"><?php _e('Before',$this->txtdom);?></option> 1301 <option <?php if ($this->tw_get_option('tw_where') == 'after') echo 'selected="selected"'; ?> value="after"><?php _e('After',$this->txtdom);?></option> 1302 <option <?php if ($this->tw_get_option('tw_where') == 'beforeandafter') echo 'selected="selected"'; ?> value="beforeandafter"><?php _e('Before and After',$this->txtdom);?></option> 1303 <option <?php if ($this->tw_get_option('tw_where') == 'shortcode') echo 'selected="selected"'; ?> value="shortcode"><?php _e('Shortcode',$this->txtdom);?></option> 1304 <option <?php if ($this->tw_get_option('tw_where') == 'manual') echo 'selected="selected"'; ?> value="manual"><?php _e('Manual',$this->txtdom);?></option> 1305 </select> 1306 </div> 1307 <div class="floatleft180"> 1308 <label for="tw_align"><?php _e('Alignment',$this->txtdom); ?></label><br /> 1309 <select name="tw_align" class="w99c29c"> 1310 <option <?php if ($this->tw_get_option('tw_align') == 'none') echo 'selected="selected"'; ?> value="none"><?php _e('None (Default)',$this->txtdom);?></option> 1311 <option <?php if ($this->tw_get_option('tw_align') == 'right') echo 'selected="selected"'; ?> value="right"><?php _e('Right',$this->txtdom);?></option> 1312 <option <?php if ($this->tw_get_option('tw_align') == 'left') echo 'selected="selected"'; ?> value="left"><?php _e('Left',$this->txtdom);?></option> 1313 <option <?php if ($this->tw_get_option('tw_align') == 'center') echo 'selected="selected"'; ?> value="center"><?php _e('Center',$this->txtdom);?></option> 1314 </select> 1315 </div> 1316 <p style="clear:both;"></p> 1317 <p style="margin:10px 0 0 0"><label><?php _e('Visibility',$this->txtdom);?></label></p> 1318 <div class="floatleft180"> 1319 <input type="checkbox" value="1" <?php if ($this->tw_get_option('tw_display_single') == '1') echo 'checked="checked"'; ?> name="tw_display_single" id="tw_display_single" group="tw_display"/> 1320 <label for="tw_display_single"><?php _e('Posts',$this->txtdom); ?></label> 1321 </div> 1322 <div class="floatleft100"> 1323 <input type="checkbox" value="1" <?php if ($this->tw_get_option('tw_display_page') == '1') echo 'checked="checked"'; ?> name="tw_display_page" id="tw_display_page" group="tw_display"/> 1324 <label for="tw_display_page"><?php _e('Pages',$this->txtdom); ?></label> 1325 </div> 1326 <div class="floatleft180" style="clear:left;"> 1327 <input type="checkbox" value="1" <?php if ($this->tw_get_option('tw_display_front') == '1') echo 'checked="checked"'; ?> name="tw_display_front" id="tw_display_front" group="tw_display"/> 1328 <label for="tw_display_front"><?php _e('Front page (home)',$this->txtdom);?></label> 1329 </div> 1330 <div class="floatleft100"> 1331 <input type="checkbox" value="1" <?php if ($this->tw_get_option('tw_display_feed') == '1') echo 'checked="checked"'; ?> name="tw_display_feed" id="tw_display_feed" group="tw_display"/> 1332 <label for="tw_display_feed"><?php _e('RSS feeds',$this->txtdom);?></label> 1333 </div> 1334 <div class="floatleft180" style="clear:left;"> 1335 <input type="checkbox" value="1" <?php if ($this->tw_get_option('tw_display_archive') == '1') echo 'checked="checked"'; ?> name="tw_display_archive" id="tw_display_archive" group="tw_display"/> 1336 <label for="tw_display_archive"><?php _e('Archives',$this->txtdom);?></label> 1337 </div> 1338 <div class="floatleft100"> 1339 <input type="checkbox" value="1" <?php if ($this->tw_get_option('tw_display_search') == '1') echo 'checked="checked"'; ?> name="tw_display_search" id="tw_display_search" group="tw_display"/> 1340 <label for="tw_display_search"><?php _e('Search',$this->txtdom);?></label> 1341 </div> 1342 <div class="floatleft180" style="clear:left;"> 1343 <input type="checkbox" value="1" <?php if ($this->tw_get_option('tw_display_excerpt') == '1') echo 'checked="checked"'; ?> name="tw_display_excerpt" id="tw_display_excerpt" group="tw_display"/> 1344 <label for="tw_display_excerpt"><?php _e('Excerpts',$this->txtdom);?></label> 1345 </div> 1346 <?php 1347 if (function_exists("bnc_wptouch_is_mobile")) { 1348 ?> 1349 <div class="floatleft180"> 1350 <input type="checkbox" value="1" <?php if ($this->tw_get_option('tw_display_mobile') == '1') echo 'checked="checked"'; ?> name="tw_display_mobile" id="tw_display_mobile" /> 1351 <label for="tw_display_mobile"><?php _e('Mobile (WPTouch)',$this->txtdom); ?></label> 1352 </div> 1353 <?php 1354 } 1355 ?> 1356 <div class="floatleft180" style="clear:left;"> 1357 <input type="checkbox" value="1" <?php if ($this->tw_get_option('tw_ex_after_home') == '1') echo 'checked="checked"'; ?> name="tw_ex_after_home" id="tw_ex_after_home" group="tw_display"/> 1358 <label for="tw_ex_after_home"><?php _e('No After on Front page',$this->txtdom);?></label> 1359 </div> 1360 <p style="clear:both;"></p> 1361 <?php 1362 $selectedPT = $this->tw_get_option('tw_post_type_exclude'); 1363 if (!is_array($selectedPT))$selectedPT=array(); 1364 $args=array('public' => true, '_builtin' => false); 1365 $output = 'objects'; 1366 $post_types=get_post_types($args,$output); 1367 if (!empty($post_types)){?> 1368 <p style="clear:both;margin:20px 0 0 0"><?php _e('You can also EXCLUDE the Tweet Button from custom post types by checking them here.',$this->txtdom);?></p><?php 1369 foreach ($post_types as $name => $post_type ) { 1370 echo '<div class="floatleft180"><label><input type="checkbox" name="tw_post_type_exclude[]" '.(in_array($name,$selectedPT) ? 'checked="checked" ' : '').'value="'.$name.'" /> ' . $post_type->label .'</label></div>'; 1371 } 1372 } ?> 1373 <p style="clear:both;"></p> 1374 </td> 1375 <td class="twhdata twhhlp"> 1376 <p style="text-align:center;margin-bottom:20px;"> 1377 <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8YYQTCLT37SEG" title="Donate via paypal"> 1378 <img src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG_global.gif" border="0" alt="PayPal - The safer, easier way to pay online!"/> 1379 </a> 1380 </p> 1381 <p> 1382 <?php _e('Set your look-and-feel preferences.',$this->txtdom); ?> 1383 </p> 1384 <p> 1385 <?php _e('The <strong>"No After on Front page"</strong> option allows you to use "Before and After" placement and the "Front page" placement but exclude the button from the bottom of posts on the front page.',$this->txtdom); ?> 1386 </p> 1387 </td> 1388 </tr> 1389 <tr class="bt1pcs"> 1390 <?php echo $this->tw_row_head(__('Tweet Button style',$this->txtdom));?> 1391 <td class="twhdata"> 1392 <div style="float:left;margin-right:10px;"> 1393 <input type="radio" value="vertical" class="floatleftm10" <?php if ($this->tw_get_option('tw_count') == 'vertical') echo 'checked="checked"'; ?> name="tw_count" id="tw_count_vertical" group="tw_count"/> 1394 <label for="tw_count_vertical" class="tweetbtnc" style="border-right: 1px solid #E3E3E3;width:70px;background:transparent url('<?php echo WP_PLUGIN_URL; ?>/wp-tweet-button/tweetv.png') no-repeat 0 24px"><?php _e('Vertical',$this->txtdom);?></label> 1395 </div> 1396 <div style="float:left;margin-right:10px;"> 1397 <input type="radio" value="horizontal" class="floatleftm10" <?php if ($this->tw_get_option('tw_count') == 'horizontal') echo 'checked="checked"'; ?> name="tw_count" id="tw_count_horizontal" group="tw_count"/> 1398 <label for="tw_count_horizontal" class="tweetbtnc" style="border-right: 1px solid #E3E3E3;width:120px;background:transparent url('<?php echo WP_PLUGIN_URL; ?>/wp-tweet-button/tweeth.png') no-repeat 0 24px"><?php _e('Horizontal',$this->txtdom);?></label> 1399 </div> 1400 <div style="float:left;"> 1401 <input type="radio" value="none" class="floatleftm10" <?php if ($this->tw_get_option('tw_count') == 'none') echo 'checked="checked"'; ?> name="tw_count" id="tw_count_none" group="tw_count" /> 1402 <label for="tw_count_none" class="tweetbtnc" style="width:60px;background:transparent url('<?php echo WP_PLUGIN_URL; ?>/wp-tweet-button/tweetn.png') no-repeat 0 24px"><?php _e('No count',$this->txtdom);?></label> 1403 </div> 1404 </td> 1405 <td class="twhdata twhhlp"> 1406 <p> 1407 </p> 1408 </td> 1409 </tr> 1410 <tr class="bt1pcs"> 1411 <?php 1412 if (function_exists('get_user_meta')){ 1413 echo $this->tw_row_head(__('Default Twitter username',$this->txtdom),'tw_via'); 1414 } else { 1415 echo $this->tw_row_head(__('Twitter username',$this->txtdom),'tw_via'); 1416 } 1417 ?> 1418 <td class="twhdata"> 1419 <input class="pad45 w99c29c" type="text" value="<?php echo $this->tw_get_option('tw_via'); ?>" name="tw_via" id="tw_via" /><br /> 1420 </td> 1421 <td class="twhdata twhhlp"> 1422 <?php 1423 if (function_exists('get_user_meta')){?> 1424 <p> 1425 <?php _e('Authors can also configure their own Twitter accounts on their <a href="profile.php" title="your profile page">profile</a> page.',$this->txtdom); ?> 1426 </p> 1427 <?php 1428 } ?> 1429 </td> 1430 </tr> 1431 <tr class="bt1pcs"> 1432 <?php echo $this->tw_row_head(__('Referral format',$this->txtdom),'tw_text_format');?> 1433 <td class="twhdata"> 1434 <input class="floatlm4" type="radio" value="VIA" <?php if ($this->tw_get_option('tw_text_format') == 'VIA') echo 'checked="checked"'; ?> name="tw_text_format" id="tw_text_format_via" group="tw_text_format"/> 1435 <label class="floatlmn2" style="width:160px;" for="tw_text_format_via"><?php _e('{text} {link} via {@user}',$this->txtdom);?></label> 1436 <input class="floatlm4" type="radio" value="RT" <?php if ($this->tw_get_option('tw_text_format') == 'RT') echo 'checked="checked"'; ?> name="tw_text_format" id="tw_text_format_rt" group="tw_text_format"/> 1437 <label class="floatlmn2" style="width:150px;" for="tw_text_format_rt"><?php _e('RT {@user} {text} {link}',$this->txtdom);?></label> 1438 </td> 1439 <td class="twhdata twhhlp"> 1440 </td> 1441 </tr> 1442 <tr class="bt1pcs"> 1443 <?php echo $this->tw_row_head(__('Default Tweet text',$this->txtdom),'tw_text');?> 1444 <td class="twhdata"> 1445 <input class="" type="radio" value="entry_title" <?php if ($this->tw_get_option('tw_text') == 'entry_title') echo 'checked="checked"'; ?> name="tw_text" id="tw_text_entry_title" group="tw_text"/> 1446 <label class="" for="tw_text_entry_title"><?php _e('Entry title e.g., "Pictures Of My Cat"',$this->txtdom);?></label><br /> 1447 <input class="" type="radio" value="page_title" <?php if ($this->tw_get_option('tw_text') == 'page_title') echo 'checked="checked"'; ?> name="tw_text" id="tw_text_page_title" group="tw_text"/> 1448 <label class="" for="tw_text_page_title"><?php _e('Page title e.g., "Pictures of my cat - My Wordpress Blog"',$this->txtdom);?></label><br /> 1449 <input class="" type="radio" value="blog_title" <?php if ($this->tw_get_option('tw_text') == 'blog_title') echo 'checked="checked"'; ?> name="tw_text" id="tw_text_blog_title" group="tw_text"/> 1450 <label class="" for="tw_text_blog_title"><?php _e('Blog title e.g., "My Wordpress Blog"',$this->txtdom);?></label><br /> 1451 <input class="" type="radio" value="custom_title" onclick="var fnow=document.getElementById('tw_text_custom');fnow.focus();" <?php if ($this->tw_get_option('tw_text') == 'custom_title') echo 'checked="checked"'; ?> name="tw_text" id="tw_text_custom_title" group="tw_text" /> 1452 <label class="" for="tw_text_custom_title" onclick="var fnow=document.getElementById('tw_text_custom');fnow.focus();"><?php _e('Custom text',$this->txtdom);?></label><br /> 1453 <textarea class="pad45" style="font-size: 11px;width:300px" type="text" name="tw_text_custom" id="tw_text_custom"><?php if ($this->tw_get_option('tw_text_custom')) echo stripslashes($this->tw_get_option('tw_text_custom')); ?></textarea> 1454 </td> 1455 <td class="twhdata twhhlp"> 1456 <p><strong><?php _e('Tags for custom text:',$this->txtdom);?></strong></p> 1457 <p> 1458 <code>%POSTTITLE%</code> - <?php _e('The post\'s title.',$this->txtdom);?><br /> 1459 <code>%BLOGTITLE%</code> - <?php _e('The blog\'s name.',$this->txtdom);?> 1460 <code>%BLOGHASHTAGS%</code> - <?php _e('#Hash tags generated using blog tags.',$this->txtdom);?> 1461 <code>%BLOGHASHCATS%</code> - <?php _e('#Hash tags generated using blog categories.',$this->txtdom);?> 1462 </p> 1463 <p><?php _e('Setting a tweet text for specific posts will override this default selection.',$this->txtdom);?></p> 1464 </td> 1465 </tr> 1466 <tr class="bt1pcs"> 1467 <?php echo $this->tw_row_head(__('Auto-Tweeting',$this->txtdom),'tw_auto_tweet_box');?> 1468 <td class="twhdata"><a href="#" id="tw_auto_tweet_box" name="tw_auto_tweet_box"></a> 1469 <?php 1470 if ($this->tw_get_option('tw_auto_tweet_token') == '' || $this->tw_get_option('tw_auto_tweet_token_secret') == ''){ 1471 echo '<p>' . __ ('Before you can configure Auto-Tweeting you must first authorize an account. Once you have authorized an account, return here to configure Auto-Tweeting.',$this->txtdom).'</p>'; 1472 echo '<p><a href="'.$this->wptbsrv.'?do=login&return_url='.urlencode(admin_url().'options-general.php?page=wp-tweet-button.php').'" class="button">'.__ ('Authorize',$this->txtdom).'</a></p>'; 1473 } else { 1474 echo '<p><a href="'.$this->wptbsrv.'?do=logout&return_url='.urlencode(admin_url().'options-general.php?page=wp-tweet-button.php').'" class="button">'.__ ('Remove authorization data',$this->txtdom).'</a></p>'; 1475 echo '<p>'. __ ('Auto-tweets will be posted by: ',$this->txtdom).'<span class="dark"><strong>'.$this->tw_get_option('tw_auto_tweet_via').'</strong></span></p>'; 1476 ?> 1477 <input type="hidden" value="<?php echo $this->tw_get_option('tw_auto_tweet_via');?>" name="tw_auto_tweet_via" /> 1478 <input type="hidden" value="<?php echo $this->tw_get_option('tw_auto_tweet_token');?>" name="tw_auto_tweet_token" /> 1479 <input type="hidden" value="<?php echo $this->tw_get_option('tw_auto_tweet_token_secret');?>" name="tw_auto_tweet_token_secret" /> 1480 <input type="checkbox" value="1" <?php 1481 if ($this->tw_get_option('tw_auto_tweet_token') == '' || $this->tw_get_option('tw_auto_tweet_token_secret') == '') echo 'disabled="disabled"'; 1482 if ($this->tw_get_option('tw_auto_tweet_posts') == '1') echo 'checked="checked"'; 1483 ?> name="tw_auto_tweet_posts" id="tw_auto_tweet_posts" /> 1484 <label for="tw_auto_tweet_posts"><?php _e('Auto-tweet posts',$this->txtdom); ?></label><br /> 1485 1486 <input type="checkbox" value="1" <?php 1487 if ($this->tw_get_option('tw_auto_tweet_token') == '' || $this->tw_get_option('tw_auto_tweet_token_secret') == '') echo 'disabled="disabled"'; 1488 if ($this->tw_get_option('tw_auto_tweet_pages') == '1') echo 'checked="checked"'; 1489 ?> name="tw_auto_tweet_pages" id="tw_auto_tweet_pages" /> 1490 <label for="tw_auto_tweet_pages"><?php _e('Auto-tweet pages',$this->txtdom); ?></label><br /> 1491 <p> 1492 <?php _e('If the tweet text + url is too long ',$this->txtdom);?> 1493 <select name="tw_auto_tweet_strip" id="tw_auto_tweet_strip"> 1494 <option value="url" <?php if ($this->tw_get_option('tw_auto_tweet_strip') == 'url') echo 'selected="selected"'; ?>><?php _e('remove the URL',$this->txtdom);?></option> 1495 <option value="text" <?php if ($this->tw_get_option('tw_auto_tweet_strip') == 'text') echo 'selected="selected"'; ?>><?php _e('remove the text',$this->txtdom);?></option> 1496 <option value="stext" <?php if ($this->tw_get_option('tw_auto_tweet_strip') == 'stext') echo 'selected="selected"'; ?>><?php _e('shorten the text',$this->txtdom);?></option> 1497 <option value="tryall" <?php if ($this->tw_get_option('tw_auto_tweet_strip') == 'tryall') echo 'selected="selected"'; ?>><?php _e('try anything that works',$this->txtdom);?></option> 1498 <option value="notweet" <?php if ($this->tw_get_option('tw_auto_tweet_strip') == 'notweet') echo 'selected="selected"'; ?>><?php _e('do not auto-tweet',$this->txtdom);?></option> 1499 </select> 1500 </p><?php 1501 } ?> 1502 1503 </td> 1504 <td class="twhdata twhhlp"> 1505 <p> 1506 <?php _e ('Auto-Tweeting will allow your blog to send out a tweet when a post is published or saved. By default auto tweets are sent out only once but can be repeated from the post edit page.',$this->txtdom);?> 1507 </p> 1508 <p> 1509 <?php _e ('It is recommended to select a URL shortener before enabling Auto-Tweeting.',$this->txtdom);?> 1510 </p> 1511 </td> 1512 </tr> 1513 <tr class="bt1pcs"> 1514 <?php echo $this->tw_row_head(__('Default recommended Twitter user',$this->txtdom),'tw_rec');?> 1515 <td class="twhdata"> 1516 <input class="pad45 w99c29c" type="text" value="<?php echo $this->tw_get_option('tw_rec'); ?>" name="tw_rec" id="tw_rec" /><br /> 1517 <label for="tw_rec_desc"><?php _e('Description',$this->txtdom);?></label><br /> 1518 <input class="pad45 w99c29c" type="text" value="<?php echo $this->tw_get_option('tw_rec_desc'); ?>" name="tw_rec_desc" id="tw_rec_desc"/> 1519 <p><?php _e ('After the user tweets the entry, Twitter will allow the user to follow a recommended users. Set a default recommended user here. You can also recommend Twitter users individually in posts and pages using the Tweet Button options.',$this->txtdom);?></p> 1520 </td> 1521 <td class="twhdata twhhlp"> 1522 <p> 1523 <?php _e ('Twitter recommendations configured in posts override these default settings.',$this->txtdom);?> 1524 </p> 1525 </td> 1526 </tr> 1527 <tr class="bt1pcs"> 1528 <?php echo $this->tw_row_head(__('Container style',$this->txtdom),'tw_style_c');?> 1529 <td class="twhdata"> 1530 <input class="pad45 w99c29c" type="text" value="<?php echo htmlspecialchars($this->tw_get_option('tw_style_c')); ?>" name="tw_style_c" id="tw_style_c" /> 1531 </td> 1532 <td class="twhdata twhhlp" rowspan="1"> 1533 <p><?php _e ('Use the container style box to add additional CSS properties to the DIV surrounding the Tweet Button.',$this->txtdom);?> 1534 </p> 1535 </td> 1536 </tr> 1537 <tr class="bt1pcs"> 1538 <?php echo $this->tw_row_head(__('Tweet Button language',$this->txtdom),'tw_lang');?> 1539 <td class="twhdata"> 1540 <select id="tw_lang" name="tw_lang" style="" class="w99c29c"> 1541 <option value="en" <?php if ($this->tw_get_option('tw_lang') == 'en') echo 'selected="selected"'; ?>><?php _e('English',$this->txtdom);?></option> 1542 <option value="fr" <?php if ($this->tw_get_option('tw_lang') == 'fr') echo 'selected="selected"'; ?>><?php _e('French',$this->txtdom);?></option> 1543 <option value="de" <?php if ($this->tw_get_option('tw_lang') == 'de') echo 'selected="selected"'; ?>><?php _e('German',$this->txtdom);?></option> 1544 <option value="es" <?php if ($this->tw_get_option('tw_lang') == 'es') echo 'selected="selected"'; ?>><?php _e('Spanish',$this->txtdom);?></option> 1545 <option value="ja" <?php if ($this->tw_get_option('tw_lang') == 'ja') echo 'selected="selected"'; ?>><?php _e('Japanese',$this->txtdom);?></option> 1546 </select> 1547 </td> 1548 <td class="twhdata twhhlp" rowspan="2"> 1549 <p><?php _e('This is the language that the button will render in on your website.',$this->txtdom);?></p> 1550 </td> 1551 </tr> 1552 <tr class="bt1pcs"> 1553 <?php echo $this->tw_row_head(__('Rel metatag',$this->txtdom),'tw_rel_meta');?> 1554 <td class="twhdata"> 1555 <input class="pad45 w99c29c" type="text" value="<?php echo htmlspecialchars($this->tw_get_option('tw_rel_meta')); ?>" name="tw_rel_meta" id="tw_rel_meta" /> 1556 </td> 1557 </tr> 1558 <tr class="bt1pcs"> 1559 <?php echo $this->tw_row_head(__('Tweet link text',$this->txtdom),'tw_btn_text');?> 1560 <td class="twhdata"> 1561 <input class="pad45 w99c29c" type="text" value="<?php echo htmlspecialchars($this->tw_get_option('tw_btn_text')); ?>" name="tw_btn_text" id="tw_btn_text" /> 1562 </td> 1563 <td class="twhdata twhhlp"> 1564 <p><?php _e('The text of the link before it is made into a button by Javascript. Clearing this field will prevent non-javascript clients from seeing the tweet link.',$this->txtdom);?></p> 1565 </td> 1566 </tr> 1567 <tr class="bt1pcs"> 1568 <?php echo $this->tw_row_head(__('URL Shortener',$this->txtdom),'tw_url_shortener');?> 1569 <td class="twhdata" style="border-top:1px solid #fff;"> 1570 <select id="tw_url_shortener" name="tw_url_shortener" style="" class="w99c29c"> 1571 <?php 1572 $shrtnr = $this->tw_get_option('tw_url_shortener'); 1573 foreach ($this->shortenerdata as $name=>$alias){ 1574 if ($alias['enabled'] != 'false'){ 1575 echo '<option '.(($shrtnr == $name) ? 'selected="selected" ':'').'value="'.$name.'">'. $alias['label'] .'</option>'."\r\n"; 1576 } 1577 } 1578 ?> 1579 <?php if (function_exists('permalink_to_twitter_link')){?><option <?php if ($shrtnr == 'tflp') echo 'selected="selected"'; ?> value="tflp">Twitter Friendly Links Plugin</option><?php } ?> 1580 <?php if (function_exists('wp_get_shortlink')){?><option <?php if ($shrtnr == 'wordpress') echo 'selected="selected"'; ?> value="wordpress">Wordpress 3 shortener function</option><?php } ?> 1581 <?php if (function_exists('wp_ozh_yourls_raw_url')){?><option <?php if ($shrtnr == 'yourls') echo 'selected="selected"'; ?> value="yourls">YOURLS Plugin</option><?php } ?> 1582 </select> <br /> 1583 <p style="width:230px;margin-right:10px;float:left;"><strong><?php _e('Limitations',$this->txtdom);?></strong><br /><?php _e('If you select a shortener from the list, Twitter will still wrap the shortened URL with its own short URL. (t.co)',$this->txtdom);?></p> 1584 <p style="width:230px;float:left;"><strong><?php _e('Usernames and API Keys', $this->txtdom);?></strong><br /><?php _e ('Some URL shortening services may require(*) usernames and/or API key.',$this->txtdom);?></p> 1585 <br style="clear:both" /> 1586 <input type="checkbox" value="1" name="tw_flush_cached_shortlinks" id="tw_flush_cached_shortlinks" /> 1587 <label for="tw_flush_cached_shortlinks"><?php _e('Delete all previously saved shortlinks when I save.',$this->txtdom); ?></label><br /> 1588 <input type="checkbox" value="1" <?php if ($this->tw_get_option('tw_no_https_shortlinks') == '1') echo 'checked="checked"'; ?> name="tw_no_https_shortlinks" id="tw_no_https_shortlinks" /> 1589 <label for="tw_no_https_shortlinks"><?php _e('Do not shrink HTTPS URLs.',$this->txtdom); ?></label><br /> 1590 </td> 1591 <td class="twhdata twhhlp" crowspan="<?php echo ($this->shortenerdata['tinyarrow']['enabled']!='false') ? '7' : '6';?>" valign="top" style="border-top:1px solid #fff;"> 1592 </td> 1593 </tr> 1594 <?php if (function_exists('wp_get_shortlink')){?> 1595 <tr class="bt1pcs"> 1596 <?php echo $this->tw_row_head(__('Wordpress 3.0 shortener',$this->txtdom));?> 1597 <td class="twhdata"> 1598 <input type="checkbox" value="1" <?php if ($this->tw_get_option('tw_strip_www') == '1') echo 'checked="checked"'; ?> name="tw_strip_www" id="tw_strip_www" /> 1599 <label for="tw_strip_www"><?php _e('Remove the "www." prefix from my domain.',$this->txtdom); ?></label><br /> 1600 <?php 1601 if (function_exists('stats_get_option')) {?> 1602 <input type="checkbox" value="1" <?php if ($this->tw_get_option('tw_no_wporg') == '1') echo 'checked="checked"'; ?> name="tw_no_wporg" id="tw_no_wporg" /> 1603 <label for="tw_no_wporg"><?php _e('Disable the WP.org shortener.',$this->txtdom); ?></label><br /> 1604 <?php } ?> 1605 </td> 1606 <td class="twhdata twhhlp" crowspan="<?php echo ($this->shortenerdata['tinyarrow']['enabled']!='false') ? '7' : '6';?>" valign="top" style="border-top:1px solid #fff;"> 1607 </td> 1608 </tr> 1609 <?php } ?> 1610 <?php 1611 foreach ($this->shortenerdata as $name=>$values){ 1612 $labelinput =''; 1613 if ($values['enabled'] != 'false'){ 1614 if (is_array($values['params'])){ 1615 foreach ($values['params'] as $item=>$props){ 1616 if (is_array($props)){ 1617 if ($props['value'] != ''){ 1618 $labelinput .= ' 1619 <p> 1620 <label for="'.$props['value'].'">'.__($props['name'],$this->txtdom).'</label>'.(($props['important']==true) ? '*' : '').'<br /> 1621 <input class="pad45 w99c29c" type="text" value="'.$this->tw_get_option($props['value']).'" name="'.$props['value'].'" id="'.$props['value'].'"/> 1622 </p>'; 1623 } 1624 } 1625 } 1626 } 1627 } 1628 if ($labelinput !=''){ 1629 echo '<tr class="bt1pcs">'.$this->tw_row_head($values['label']).'<td class="twhdata">'; 1630 echo $labelinput; 1631 echo '</td><td class="twhdata twhhlp"> </td></tr>'; 1632 } 1633 } 1634 if ($this->shortenerdata['tinyarrow']['enabled'] != 'false'){?> 1635 <tr class="bt1pcs"> 1636 <?php echo $this->tw_row_head('TinyArro.ws'); 1637 $tw_url_shortener_tinyarrow_host = $this->tw_get_option('tw_url_shortener_tinyarrow_host'); 1638 ?> 1639 <td> 1640 <!-- p> 1641 <label for="tw_url_shortener_tinyarrow_user"><?php _e('UserID',$this->txtdom);?></label> 1642 <input class="pad45 w99c29c" type="text" value="<?php echo $this->tw_get_option('tw_url_shortener_tinyarrow_user');?>" name="tw_url_shortener_tinyarrow_user" id="tw_url_shortener_tinyarrow_user"/> 1643 </p --> 1644 <p> 1645 <label for="tw_url_shortener_tinyarrow_host"><?php _e('Host',$this->txtdom);?></label> 1646 <select style="font-size:200%" id="tw_url_shortener_tinyarrow_host" name="tw_url_shortener_tinyarrow_host" style="" class="w99c29c"> 1647 <?php 1648 foreach ($this->tinyarrow_hosts as $host=>$alias){ 1649 echo '<option '. (($tw_url_shortener_tinyarrow_host == $host) ? 'selected="selected" ':'').'value="'. $host .'">'.$alias.'</option>'."\r\n"; 1650 } 1651 ?> 1652 </select> 1653 </td> 1654 <td class="twhdata twhhlp"> 1655 </td> 1656 </tr> 1657 <?php } ?> 1658 <tr class="bt1pcs"> 1659 <?php echo $this->tw_row_head(__('Advanced',$this->txtdom),'tw_bwdata_attr');?> 1660 <td class="twhdata" style="border-top:1px solid #ccc;"> 1661 <label for="tw_hook_prio"><?php _e('Filter hook priority. <span class="warning">Only change this value if you know what you\'re doing!</span> (Default is 75)',$this->txtdom); ?></label><br /> 1662 <select name="tw_hook_prio" id="tw_hook_prio" title="<?php echo $this->tw_get_option('tw_hook_prio');?>" class="w99c29c"> 1663 <option value="75">75 (Default)</option> 1664 <option <?=($this->tw_get_option('tw_hook_prio')=='101')?'selected="selected"':'';?> value="101">101</option> 1665 <option <?=($this->tw_get_option('tw_hook_prio')=='501')?'selected="selected"':'';?> value="501">501</option> 1666 <option <?=($this->tw_get_option('tw_hook_prio')=='1001')?'selected="selected"':'';?> value="1001">1001</option> 1667 </select> 1668 <script type="text/javascript"> 1669 jQuery(document).ready(function(){ 1670 var ddl = document.getElementById( 'tw_hook_prio' ); 1671 var theOption = new Option; 1672 var x; 1673 var i; 1674 for(i = 3; i < 74; i++) { 1675 var theOption = new Option; 1676 x = i + 1; 1677 if (x == ddl.title){theOption.selected=true;} 1678 theOption.text = x; 1679 theOption.value = x; 1680 ddl.options[i+1] = theOption; 1681 } 1682 }); 1683 </script> 1684 <input type="checkbox" value="1" <?php if ($this->tw_get_option('tw_bwdata_attr') == '1') echo 'checked="checked"'; ?> name="tw_bwdata_attr" id="tw_bwdata_attr" /> 1685 <label for="tw_bwdata_attr"><?php _e('Build Tweet Button with HTML5 data attributes.',$this->txtdom); ?></label><br /> 1686 <input type="checkbox" value="1" <?php if ($this->tw_get_option('tw_url_samecount') == '1') echo 'checked="checked"'; ?> name="tw_url_samecount" id="tw_url_samecount" /> 1687 <label for="tw_url_samecount"><?php _e('Display the same tweet count across all shorteners.',$this->txtdom); ?></label><br /> 1688 <input type="checkbox" value="1" <?php if ($this->tw_get_option('tw_use_rel_me') == '1') echo 'checked="checked"'; ?> name="tw_use_rel_me" id="tw_use_rel_me" /> 1689 <label for="tw_use_rel_me"><?php _e('Add rel="me" to <head>. (Overrides referral format to \'via {user}\')',$this->txtdom); ?></label><br /> 1690 <input type="checkbox" value="1" <?php if ($this->tw_get_option('tw_add_rel_shortlink') == '1') echo 'checked="checked"'; ?> name="tw_add_rel_shortlink" id="tw_add_rel_shortlink" /> 1691 <label for="tw_add_rel_shortlink"><?php _e('Add rel="shortlink" to <head>',$this->txtdom); ?></label><br /> 1692 <input type="checkbox" value="1" <?php if ($this->tw_get_option('tw_force_manual') == '1') echo 'checked="checked"'; ?> name="tw_force_manual" id="tw_force_manual" /> 1693 <label for="tw_force_manual"><?php _e('Force manual placement.',$this->txtdom); ?></label><br /> 1694 <input type="checkbox" value="1" <?php if ($this->tw_get_option('tw_script_infooter') == '1') echo 'checked="checked"'; ?> name="tw_script_infooter" id="tw_script_infooter" /> 1695 <label for="tw_script_infooter"><?php _e('Place script in footer.',$this->txtdom); ?></label><br /> 1696 <input type="checkbox" value="1" <?php if ($this->tw_get_option('tw_nostyle_feed') == '1') echo 'checked="checked"'; ?> name="tw_nostyle_feed" id="tw_nostyle_feed" /> 1697 <label for="tw_nostyle_feed"><?php _e('No styles in feeds.',$this->txtdom); ?></label><br /> 1698 <?php 1699 if (function_exists('w3tc_pgcache_flush')) { 1700 ?> 1701 <input <?php if ($this->tw_get_option('tw_flush_cache') == '1') echo 'checked="checked"'; ?> type="checkbox" value="1" name="tw_flush_cache" id="tw_flush_cache" /> 1702 <label for="tw_flush_cache"><?php _e('Clear the W3 Total Cache when I save.',$this->txtdom); ?></label> 1703 <br /> 1704 <?php 1705 } else if (function_exists('wp_cache_clear_cache')) { 1706 ?> 1707 <input type="checkbox" value="1" name="tw_flush_cache" id="tw_flush_cache" /> 1708 <label <?php if ($this->tw_get_option('tw_flush_cache') == '1') echo 'checked="checked"'; ?> for="tw_flush_cache"><?php _e('Clear the WP Super Cache when I save.',$this->txtdom); ?></label> 1709 <br /> 1710 <?php 1711 } 1712 ?> 1713 <input type="checkbox" value="1" <?php if ($this->tw_get_option('tw_enable_ga_code') == '1') echo 'checked="checked"'; ?> name="tw_enable_ga_code" id="tw_enable_ga_code" /> 1714 <label for="tw_enable_ga_code"><?php _e('Add Google Analytics campaign tracking code to links.',$this->txtdom); ?></label><br /> 1715 <?php _e('You can use <code>%POSTID%</code> and <code>%POSTSLUG%</code> in this field but no spaces, no + and no domain names. Simply enter the URL parameters. Example:<br /> 1716 <code>utm_source=twitter&utm_medium=twt&utm_campaign=%POSTSLUG%</code>',$this->txtdom); ?><br /> 1717 <label for="tw_ga_code"><?php _e('Google Analytics tracking code',$this->txtdom); ?></label><br /> 1718 <input class="pad45 w99c29c" type="text" value="<?php echo htmlspecialchars($this->tw_get_option('tw_ga_code')); ?>" name="tw_ga_code" id="tw_ga_code" /><br /> 1719 <input type="checkbox" value="1" <?php if ($this->tw_get_option('tw_debug') == '1') echo 'checked="checked"'; ?> name="tw_debug" id="tw_debug" /> 1720 <label for="tw_debug"><?php _e('Debug mode (NOT INTENDED FOR LIVE ENVIRONMENTS).',$this->txtdom); ?></label><br /> 1721 </td> 1722 <td style="border-top: 1px solid #fff;border-bottom: 1px solid #CCC;" class="twhdata twhhlp" valign="top" style=""> 1723 <p><strong><?php _e('Filter hook priority',$this->txtdom); ?></strong></p> 1724 <p><?php _e('Hook priority allows you to change the order in which the button is placed in relation to other plugins. It should only be used if you\'re having trouble displaying the Tweet Button in a custom template. Use 7,8,9 or 10 to get your desired result. Changing this value may break the formatting of the button.',$this->txtdom); ?></p> 1725 </td> 1726 </tr> 1727 <tr class="bt1pcs"> 1728 <td class="twhdata" colspan="3" style="background:#E3E3E3;border-top:1px solid #CCC;border-bottom:1px solid #CCC;"> 1729 <p class="submit"> 1730 <input style="width:160px" type="submit" name="Submit" value="<?php _e('Save Changes') ?>" /> 1731 </p> 1732 </td> 1733 </tr> 1734 </table> 1735 <p style="clear:both;"></p> 1736 </div> 1737 </form> 1738 <div style="float:right"> 1739 <form action="https://www.paypal.com/cgi-bin/webscr" method="post"><p><input type="hidden" name="cmd" value="_s-xclick"><input type="hidden" name="hosted_button_id" value="8YYQTCLT37SEG"><input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG_global.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online."><img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"></p></form> 1740 </div> 1741 <p style="margin-left:20px;"> 1742 <?php echo sprintf(__("<a href='%1\$s' class='button'>Show settings for diagnostics</a>"), 'options-general.php?page=wp-tweet-button.php&showdiag=1');?> 1743 <?php echo sprintf(__("<a href='%1\$s' target='_blank' class='button'>Report a bug</a>"), 'http://0xtc.com/plugins/wp-tweet-button');?> 1744 <?php echo sprintf(__("<a href='%1\$s' target='_blank' class='button'>Hire the author</a>"), 'http://0xtc.com/contact');?> 1745 </p> 1746 <p style="margin-left:20px;margin-top:20px;"> 1747 <a href="http://twitter.com/share" 1748 data-url="http://wordpress.org/extend/plugins/wp-tweet-button/" 1749 data-text="Loving the WP Tweet Button plugin for #WordPress" 1750 data-lang="<?php echo $this->tw_get_option('tw_lang');?>" 1751 data-via="" 1752 data-related="TCorp:The Author of the WP Tweet Button plugin." 1753 data-count="horizontal" 1754 data-counturl="http://wordpress.org/extend/plugins/wp-tweet-button/" 1755 rel="nofollow" 1756 class="twitter-share-button"> 1757 </a> 1758 </p> 1759 <p style="clear:both;"></p> 1760 <?php 1159 require ('inc/settings.inc.php'); 1160 } 1161 1162 /** 1163 * Function outputs the per-post settings dialog. 1164 */ 1165 function tw_post_tweet_button_box() { 1166 require ('inc/perpostsettings.inc.php'); 1761 1167 } 1762 1168 … … 1929 1335 1930 1336 /** 1931 * Function outputs the per-post settings dialog.1932 */1933 function tw_post_tweet_button_box() {1934 if(is_int($this->postid)) {1935 $post = get_post($this->postid);1936 } else {1937 global $post;1938 }1939 $tw_do_not_send_auto_tweet = get_post_meta($post->ID,'_tw_do_not_send_auto_tweet',true);1940 $tw_exclude_tweet_button = get_post_meta($post->ID,'_exclude_tweet_button',true);1941 $tw_twitter_related_user = get_post_meta($post->ID,'_twitterrelated_user',true);1942 $tw_twitter_related_desc = get_post_meta($post->ID,'_twitterrelated_desc',true);1943 $tw_post_custom_text = get_post_meta($post->ID,'_twitterrelated_custom_text',true);1944 1945 ?><script type="text/javascript">1946 jQuery(document).ready(function(){1947 jQuery('#wpTweetButtonPostOp .head').click(function() {1948 jQuery(this).next().slideToggle("slow");1949 return false;1950 }).next().hide();1951 });1952 </script><div id="wpTweetButtonPostOp">1953 <p class="head" style="margin:0 0 10px 5px"><a href="#"><?php _e('Tweet Button options',$this->txtdom);?></a></p>1954 <div>1955 <p style="margin:0;"><?php _e('If this post is related to a Twitter user, the Tweet Button can be enhanced by adding the Twitter account as a recommended user.',$this->txtdom);?></p>1956 <div class="misc-pub-section">1957 <label for="tw_twitter_related_user" style="width:80px;float:left;padding:5px 0"><?php _e('Username:',$this->txtdom);?></label>1958 <input class="pad45" style="width:165px;text-align:left;" type="text" value="<?php echo $tw_twitter_related_user; ?>" name="tw_twitter_related_user" id="tw_twitter_related_user"/> <br />1959 <label for="tw_twitter_related_desc" style="width:80px;float:left;padding:5px 0"><?php _e('Description:',$this->txtdom);?></label>1960 <input class="pad45" style="width:165px;text-align:left;" type="text" value="<?php echo $tw_twitter_related_desc; ?>" name="tw_twitter_related_desc" id="tw_twitter_related_desc"/>1961 </div>1962 <div class="misc-pub-section">1963 <p style="margin:0;"><?php _e('Enter an optional custom tweet for this post.',$this->txtdom);?></p>1964 <label for="tw_post_custom_text" style="width:80px;float:left;padding:5px 0"><?php _e('Tweet text:',$this->txtdom);?></label>1965 <textarea class="pad45" style="width:165px;font-size: 11px;" name="tw_post_custom_text" id="tw_post_custom_text"/><?php echo $tw_post_custom_text; ?></textarea>1966 </div>1967 <div class="misc-pub-section">1968 <img src="<?php echo WP_PLUGIN_URL; ?>/wp-tweet-button/tweetn.png" id="tw_tweet_button_image" style="float:right;margin:-3px 10px 0 10px"/>1969 <input style="min-width:20px;" onclick="var twimgp=document.getElementById('tw_tweet_button_image');twimgp.style.display=(this.checked)?'none':'block';" type="checkbox" value="1" <?php if ($tw_exclude_tweet_button == '1') echo 'checked="checked"'; ?> name="tw_exclude_tweet_button" id="tw_exclude_tweet_button"/>1970 <label for="tw_exclude_tweet_button"><?php _e('Disable Tweet Button',$this->txtdom);?></label><br />1971 <input style="min-width:20px;" type="checkbox" value="1" name="tw_clear_short_cache_post" id="tw_clear_short_cache_post"/>1972 <label for="tw_clear_short_cache_post"><?php _e('Clear shortlink cache',$this->txtdom);?></label><br />1973 <?php1974 if ($this->tw_get_option('tw_auto_tweet_token') != '' && $this->tw_get_option('tw_auto_tweet_token_secret') != ''){1975 if (strstr(get_post_meta($post->ID, '_tw_autotweeted',true),':') != false){?>1976 <input style="min-width:20px;" type="checkbox" value="1" name="tw_send_auto_tweet_again" id="tw_send_auto_tweet_again"/>1977 <label for="tw_send_auto_tweet_again"><?php _e('Auto-tweet again',$this->txtdom);?></label><br />1978 <?php1979 $tdata = get_post_meta($post->ID, '_tw_autotweeted',true);1980 $tdata = explode(':',$tdata );1981 $tid = $tdata[0];1982 $tname = $tdata[1];1983 $turl = 'http://twitter.com/'.$tdata[1].'/status/'.$tdata[0];1984 echo '<p><a href="'.$turl.'" target="_blank">'.__('View corresponding tweet',$this->txtdom).'</a></p>';1985 } else { ?>1986 <input <?php if ($tw_do_not_send_auto_tweet == '1') echo 'checked="checked"'; ?> style="min-width:20px;" type="checkbox" value="1" name="tw_do_not_send_auto_tweet" id="tw_do_not_send_auto_tweet"/>1987 <label for="tw_do_not_send_auto_tweet"><?php _e('Do not Auto-Tweet',$this->txtdom);?></label><br />1988 <?php }1989 }1990 ?>1991 </div>1992 </div></div><p style="clear:both;"></p><?php1993 }1994 1995 /**1996 1337 * Function hooks per-post settings dialog 1997 1338 */ … … 2033 1374 */ 2034 1375 function tw_options() { 2035 add_options_page( 'WP Tweet Button', 'WP Tweet Button', 8, basename(__FILE__), array(&$this, 'tw_options_page'));1376 add_options_page($this->pluginlabel, $this->pluginlabel, 8, basename(__FILE__), array(&$this, 'tw_options_page')); 2036 1377 } 2037 1378
Note: See TracChangeset
for help on using the changeset viewer.