Plugin Directory

Changeset 428457


Ignore:
Timestamp:
08/25/2011 04:38:49 AM (15 years ago)
Author:
taehan
Message:

umrp 1.4.1 edit-1

Location:
u-more-recent-posts
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • u-more-recent-posts/tags/1.4.1/inc/script.js

    r428453 r428457  
    6363        nav = $t.find('.umrp-nav');
    6464       
    65         var list_pos = list.position();
    66         progress.css({top: list_pos.top});
     65        if( progress.length ){
     66            var list_pos = list.position();
     67            progress.css({top: list_pos.top});
     68        }
    6769    }
    6870   
  • u-more-recent-posts/tags/1.4.1/u-more-recent-posts.php

    r428453 r428457  
    7272            'current_postid' => $_POST['current_postid'],
    7373        );
    74         $this->the_list_for_widget( $args );
     74        echo $this->get_the_list_for_widget( $args );
    7575        break;
    7676       
     
    8282            'options' => (array) $_POST['options'],
    8383        );
    84         $this->the_list_for_shortcode( $args );
     84        echo $this->get_the_list_for_shortcode( $args );
    8585        break;
    8686       
     
    9696}
    9797
    98 function the_list_for_widget( $args ){
     98function get_the_list_for_widget( $args ){
    9999    if( empty($args['widget_id']) )
    100100        return false;
    101101    $args['options'] = $this->get_widget_option( $args['widget_id'] );
    102102    $args['cookie_key'] = 'wp-'.$args['widget_id'].'-paged';
    103     echo $this->get_the_list($args);
    104 }
    105 
    106 function the_list_for_shortcode( $args ){
     103    return $this->get_the_list($args);
     104}
     105
     106function get_the_list_for_shortcode( $args ){
    107107    if( empty($args['widget_id']) )
    108108        return false;
    109109    $args['cookie_key'] = 'wp-'.$args['widget_id'].'-paged';
    110     echo $this->get_the_list( $args );
     110    return $this->get_the_list( $args );
    111111}
    112112
     
    293293        'options' => $opts,
    294294    );
    295     ?>
    296     <div class="umrp-shortcode" id="<?php echo $id?>">
    297         <?php if( $opts['title'] ){ ?>
    298         <h3 class="umrp-title"><?php echo $opts['title']?></h3>
    299         <?php } ?>
    300         <div id="<?php echo $id?>-container" class="umrp-container <?php echo $container_class?>">
    301             <?php echo $this->the_list_for_shortcode($args);?>
    302             <!--<?php echo json_encode($opts)?>-->
    303         </div>
    304     </div>
    305     <?php
     295   
     296    $ret = '<div class="umrp-shortcode" id="'.$id.'">';
     297    if( $opts['title'] )
     298        $ret .= '<h3 class="umrp-title">'.$opts['title'].'</h3>';
     299    $ret .= '<div id="'.$id.'-container" class="umrp-container '.$container_class.'">';
     300    $ret .= $this->get_the_list_for_shortcode($args);
     301    $ret .= '<!--'.json_encode($opts).'-->';
     302    $ret .= '</div>';
     303    $ret .= '</div>';
     304    return $ret;
    306305}
    307306
     
    415414   
    416415    <div id="umrp-<?php echo $id?>-container" class="umrp-container <?php echo $container_class?>">
    417         <?php $umrp->the_list_for_widget( $args );?>
     416        <?php echo $umrp->get_the_list_for_widget( $args );?>
    418417    </div>
    419418   
  • u-more-recent-posts/trunk/inc/script.js

    r428453 r428457  
    6363        nav = $t.find('.umrp-nav');
    6464       
    65         var list_pos = list.position();
    66         progress.css({top: list_pos.top});
     65        if( progress.length ){
     66            var list_pos = list.position();
     67            progress.css({top: list_pos.top});
     68        }
    6769    }
    6870   
  • u-more-recent-posts/trunk/u-more-recent-posts.php

    r428453 r428457  
    7272            'current_postid' => $_POST['current_postid'],
    7373        );
    74         $this->the_list_for_widget( $args );
     74        echo $this->get_the_list_for_widget( $args );
    7575        break;
    7676       
     
    8282            'options' => (array) $_POST['options'],
    8383        );
    84         $this->the_list_for_shortcode( $args );
     84        echo $this->get_the_list_for_shortcode( $args );
    8585        break;
    8686       
     
    9696}
    9797
    98 function the_list_for_widget( $args ){
     98function get_the_list_for_widget( $args ){
    9999    if( empty($args['widget_id']) )
    100100        return false;
    101101    $args['options'] = $this->get_widget_option( $args['widget_id'] );
    102102    $args['cookie_key'] = 'wp-'.$args['widget_id'].'-paged';
    103     echo $this->get_the_list($args);
    104 }
    105 
    106 function the_list_for_shortcode( $args ){
     103    return $this->get_the_list($args);
     104}
     105
     106function get_the_list_for_shortcode( $args ){
    107107    if( empty($args['widget_id']) )
    108108        return false;
    109109    $args['cookie_key'] = 'wp-'.$args['widget_id'].'-paged';
    110     echo $this->get_the_list( $args );
     110    return $this->get_the_list( $args );
    111111}
    112112
     
    293293        'options' => $opts,
    294294    );
    295     ?>
    296     <div class="umrp-shortcode" id="<?php echo $id?>">
    297         <?php if( $opts['title'] ){ ?>
    298         <h3 class="umrp-title"><?php echo $opts['title']?></h3>
    299         <?php } ?>
    300         <div id="<?php echo $id?>-container" class="umrp-container <?php echo $container_class?>">
    301             <?php echo $this->the_list_for_shortcode($args);?>
    302             <!--<?php echo json_encode($opts)?>-->
    303         </div>
    304     </div>
    305     <?php
     295   
     296    $ret = '<div class="umrp-shortcode" id="'.$id.'">';
     297    if( $opts['title'] )
     298        $ret .= '<h3 class="umrp-title">'.$opts['title'].'</h3>';
     299    $ret .= '<div id="'.$id.'-container" class="umrp-container '.$container_class.'">';
     300    $ret .= $this->get_the_list_for_shortcode($args);
     301    $ret .= '<!--'.json_encode($opts).'-->';
     302    $ret .= '</div>';
     303    $ret .= '</div>';
     304    return $ret;
    306305}
    307306
     
    415414   
    416415    <div id="umrp-<?php echo $id?>-container" class="umrp-container <?php echo $container_class?>">
    417         <?php $umrp->the_list_for_widget( $args );?>
     416        <?php echo $umrp->get_the_list_for_widget( $args );?>
    418417    </div>
    419418   
Note: See TracChangeset for help on using the changeset viewer.