Plugin Directory

Changeset 742327


Ignore:
Timestamp:
07/17/2013 03:21:20 PM (13 years ago)
Author:
stariy
Message:

update

Location:
wp-sns-share/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • wp-sns-share/trunk/sharebar_functions.php

    r625146 r742327  
    5555        $text = "\n\n<!-- wp-sns-share part begin -->\n";
    5656        $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";
    6060        $use_tiny = 0;
    6161        if(isset($options['tiny']['tinyurl']) && isset($options['tiny']['sinaurl'])){
     
    7676                $tiny = '';
    7777            }
    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";
    7979        }
    8080        $line = '<div width="95%" style="border-top:1px dotted #D4D0C8;height:1px"></div>'."\n";
     
    104104                    $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";
    105105                    $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".
    107107                                "<em style=\"$cover_style\"></em>\n</li>\n";
    108108                }
     
    111111        }
    112112        $text .= "</ul>\n";
    113         $text .= "<g:plusone></g:plusone>\n";
    114113        $text .= "</div>\n";
    115114        if($options['output']['hr'] == 1){
  • wp-sns-share/trunk/sync_functions.php

    r625146 r742327  
    258258   
    259259    function WPSNSShare_getIMG($content){
     260        $imgNo = intval($_POST['WPSNSShare_widget_imgno']);
     261        if($imgNo == 0) $imgNo = 1;
    260262        $pattern="/<[img|IMG].*?src=[\'|\"](.*?(?:[\.gif|\.jpg|\.png]))[\'|\"].*?[\/]?>/";
    261263        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];
    264277    }
    265278   
     
    293306        echo '<p>
    294307            <input type="radio" name="WPSNSShare_widget_sync" value="1" checked="checked" onclick="document.getElementById(\'WPSNSShare_widget_sync_choose\').style.display=\'none\'" /> 默认设置&nbsp;&nbsp;
    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=\'\'" /> 自主选择
    296309            </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>';
    298312        if($option['sync']['sina']['oauth_token']){
    299313            echo '<input type="checkbox" value="1" checked="checked" name="WPSNSShare_widget_sync_sina" /> 新浪&nbsp;&nbsp;';
     
    309323        }
    310324        echo '</p>';
     325        echo '<p>';
     326        echo '选择要同步第几张图片:<input name="WPSNSShare_widget_imgno" size="3" value="1" />';
     327        echo '</p>';
     328        echo '</div>';
    311329    }
    312330   
  • wp-sns-share/trunk/wp-sns-share.js

    r625146 r742327  
    2525                    item_a.onmouseover = function(e){
    2626                        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';
    3432                    };
    3533                    item_a.onmouseout = function(e){
    3634                        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';
    4440                    };
    4541                }
  • wp-sns-share/trunk/wp-sns-share.php

    r625146 r742327  
    8484//自动输出SNS图标横栏
    8585if($options['output']['auto'] == 1){
    86     add_filter('the_content', 'WPSNSShare_filter_insert');
     86    add_filter('the_content', 'WPSNSShare_filter_insert', 99);
    8787}
    8888
Note: See TracChangeset for help on using the changeset viewer.