Changeset 742327
- Timestamp:
- 07/17/2013 03:21:20 PM (13 years ago)
- Location:
- wp-sns-share/trunk
- Files:
-
- 4 edited
-
sharebar_functions.php (modified) (4 diffs)
-
sync_functions.php (modified) (3 diffs)
-
wp-sns-share.js (modified) (1 diff)
-
wp-sns-share.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wp-sns-share/trunk/sharebar_functions.php
r625146 r742327 55 55 $text = "\n\n<!-- wp-sns-share part begin -->\n"; 56 56 $text .= '<div class="WPSNS_main" style="margin:20px 0;">'."\n"; 57 $text .= '<input id="wp-sns-share-desc" type="hidden" value="'. trim($desc).'" />';58 $text .= '<input id="wp-sns-share-blog" type="hidden" value="'.trim(get_option('blogname')).'" />' ;59 $text .= '<input id="wp-sns-share-from" type="hidden" value="'.$from.'" />' ;57 $text .= '<input id="wp-sns-share-desc" type="hidden" value="'.$desc.'" />'."\n"; 58 $text .= '<input id="wp-sns-share-blog" type="hidden" value="'.trim(get_option('blogname')).'" />'."\n"; 59 $text .= '<input id="wp-sns-share-from" type="hidden" value="'.$from.'" />'."\n"; 60 60 $use_tiny = 0; 61 61 if(isset($options['tiny']['tinyurl']) && isset($options['tiny']['sinaurl'])){ … … 76 76 $tiny = ''; 77 77 } 78 $text .= '<input id="wp-sns-share-tiny" type="hidden" value="'.$tiny.'" />' ;78 $text .= '<input id="wp-sns-share-tiny" type="hidden" value="'.$tiny.'" />'."\n"; 79 79 } 80 80 $line = '<div width="95%" style="border-top:1px dotted #D4D0C8;height:1px"></div>'."\n"; … … 104 104 $cover_style = "width:26px;height:26px;top:2px;left:-5px;display:none;position:absolute;background:transparent url(".SHARESNS_IMAGE_HOME."/icons.png) no-repeat 0 {$b_pos}px"; 105 105 $text .= "<li class=\"WPSNS_item\" style=\"$li_style\">\n". 106 "<a href=\"javascript:void(0)\" title=\"$title\" onclick=\"$onclick\" style=\"$icon_style\"></a> ".106 "<a href=\"javascript:void(0)\" title=\"$title\" onclick=\"$onclick\" style=\"$icon_style\"></a>\n". 107 107 "<em style=\"$cover_style\"></em>\n</li>\n"; 108 108 } … … 111 111 } 112 112 $text .= "</ul>\n"; 113 $text .= "<g:plusone></g:plusone>\n";114 113 $text .= "</div>\n"; 115 114 if($options['output']['hr'] == 1){ -
wp-sns-share/trunk/sync_functions.php
r625146 r742327 258 258 259 259 function WPSNSShare_getIMG($content){ 260 $imgNo = intval($_POST['WPSNSShare_widget_imgno']); 261 if($imgNo == 0) $imgNo = 1; 260 262 $pattern="/<[img|IMG].*?src=[\'|\"](.*?(?:[\.gif|\.jpg|\.png]))[\'|\"].*?[\/]?>/"; 261 263 preg_match_all($pattern, $content, $m); 262 if(count($m[0]) == 0) return ''; 263 return $m[1][0]; 264 $imgs = $m[1]; 265 $count = count($imgs); 266 $imglist = array(); 267 for($i = 0;$i < $count;$i++){ 268 if(stripos($imgs[$i], 'wp-includes') > 0){ 269 continue; 270 } 271 $imglist[] = $imgs[$i]; 272 } 273 $count = count($imglist); 274 if($count == 0) return ''; 275 else if($count < $imgNo) return $imglist[$count - 1]; 276 else return $imglist[$imgNo - 1]; 264 277 } 265 278 … … 293 306 echo '<p> 294 307 <input type="radio" name="WPSNSShare_widget_sync" value="1" checked="checked" onclick="document.getElementById(\'WPSNSShare_widget_sync_choose\').style.display=\'none\'" /> 默认设置 295 <input type="radio" name="WPSNSShare_widget_sync" value="2" onclick="document.getElementById(\'WPSNSShare_widget_sync_choose\').style.display=\'\'" /> 选择(将跳过默认设置)308 <input type="radio" name="WPSNSShare_widget_sync" value="2" onclick="document.getElementById(\'WPSNSShare_widget_sync_choose\').style.display=\'\'" /> 自主选择 296 309 </p>'; 297 echo '<p id="WPSNSShare_widget_sync_choose" style="display:none">'; 310 echo '<div id="WPSNSShare_widget_sync_choose" style="display:none">'; 311 echo '<p>'; 298 312 if($option['sync']['sina']['oauth_token']){ 299 313 echo '<input type="checkbox" value="1" checked="checked" name="WPSNSShare_widget_sync_sina" /> 新浪 '; … … 309 323 } 310 324 echo '</p>'; 325 echo '<p>'; 326 echo '选择要同步第几张图片:<input name="WPSNSShare_widget_imgno" size="3" value="1" />'; 327 echo '</p>'; 328 echo '</div>'; 311 329 } 312 330 -
wp-sns-share/trunk/wp-sns-share.js
r625146 r742327 25 25 item_a.onmouseover = function(e){ 26 26 var evt = window.event ? window.event.srcElement : e.target; 27 evt.nextSibling.style.display = ''; 28 // if(document.all){ 29 // window.event.srcElement.nextSibling.style.display = ''; 30 // } 31 // else{ 32 // e.target.nextSibling.style.display = ''; 33 // } 27 var ee = evt; 28 while(ee.nodeType != 1 || ee.tagName.toLowerCase() != 'em'){ 29 ee = ee.nextSibling; 30 } 31 ee.style.display = 'block'; 34 32 }; 35 33 item_a.onmouseout = function(e){ 36 34 var evt = window.event ? window.event.srcElement : e.target; 37 evt.nextSibling.style.display = 'none'; 38 // if(document.all){ 39 // window.event.srcElement.nextSibling.style.display = 'none'; 40 // } 41 // else{ 42 // e.target.nextSibling.style.display = 'none'; 43 // } 35 var ee = evt; 36 while(ee.nodeType != 1 || ee.tagName.toLowerCase() != 'em'){ 37 ee = ee.nextSibling; 38 } 39 ee.style.display = 'none'; 44 40 }; 45 41 } -
wp-sns-share/trunk/wp-sns-share.php
r625146 r742327 84 84 //自动输出SNS图标横栏 85 85 if($options['output']['auto'] == 1){ 86 add_filter('the_content', 'WPSNSShare_filter_insert' );86 add_filter('the_content', 'WPSNSShare_filter_insert', 99); 87 87 } 88 88
Note: See TracChangeset
for help on using the changeset viewer.