'; $lastposts = get_posts( 'numberposts=-1' ); $navi .= ''; if ( $attached_to ) $arr_params_option['swid'] = $attached_to; else unset($arr_params_option['swid']); $navi .= '' . sprintf( __( '%s images', 'shiword' ), $count ) . ''; if ( $paged == 2 ) { $navi .= '«'; } if ( $paged > 2 ) { $arr_params['swpaged'] = ( $paged - 1 ); $navi .= '«'; } if ( ( $count / $paged ) > 1 ) { $navi .= ''; $navi .= '' . sprintf( __( 'of %s', 'shiword' ), ceil( $count / $ppp ) ) . ''; } if ( $count > ( $paged * $ppp ) ) { $arr_params['swpaged'] = ( $paged + 1 ); $navi .= '»'; } $navi .= ''; return $navi; } function shiword_media_library() { $paged = isset( $_GET['swpaged'] ) ? (int)$_GET['swpaged'] : 1; $attached_to = isset( $_GET['swid'] ) ? (int)$_GET['swid'] : null; $ppp = 21; $args = array( 'post_type' => 'attachment', 'numberposts' => -1, 'post_mime_type' => 'image', 'post_status' => null, 'post_parent' => $attached_to ); $attachments = get_posts( $args ); $navi = shiword_media_navi( $paged, $ppp, count($attachments), $attached_to ); $attachments = array_slice( $attachments, ( ( $paged - 1 ) * $ppp ), $ppp ); echo $navi; if ($attachments) { ?>
ID, 'thumbnail' ); ?>
ID ); ?>
> <?php echo bloginfo( 'name' ); ?> - <?php _e('Images Library','shiword'); ?>