Skip to content
This repository has been archived by the owner on Jan 27, 2018. It is now read-only.

Commit

Permalink
Fixes control-hiding
Browse files Browse the repository at this point in the history
  • Loading branch information
dlanger committed Jan 24, 2012
1 parent 3333859 commit b0a0b60
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 25 deletions.
9 changes: 8 additions & 1 deletion readme.txt
Expand Up @@ -111,6 +111,10 @@ link decorations are all styled by the theme that's in use.
* Added auto-advancing slideshow support
* Controls are now their own CSS classes (thanks to ThomasBuxo)

= 1.3 =
* Sizing (image vs. DIV) bug fixed (thanks to kitchin)
* Supports exclude filter to match Gallery shortcode and hiding of controls (thanks to robcolburn)

== Upgrade Notice ==

= 1.0 =
Expand All @@ -120,4 +124,7 @@ Initial upload to Wordpress.org.
This version allows the use of all Cycle translations. Adds support for internationalization. Upgrades the version of Cycle Lite used to properly hide non-displayed elements and their links.

= 1.2 =
This version supports auto-advancing slideshows, as well as improved internals and more customizable CSS.
This version supports auto-advancing slideshows, as well as improved internals and more customizable CSS.

= 1.3 =
In this version, the size of the containing div is much more accurate, removing problems some users had with too much whitespace. Support for excluding certain images, as well as hiding the controls, is added.
50 changes: 26 additions & 24 deletions simpleslider.php
Expand Up @@ -94,17 +94,18 @@ function sss_handle_shortcode( $attrs ) {
'image&post_parent=' . get_the_ID() .
'&orderby=menu_order&order=ASC' );


print_r(shortcode_atts( $defaults,
$attrs));

// Don't load anything or start processing if there are no
// images to display.
if( empty($images) )
return '';

if( !empty($attrs['exclude']) ) {
$exclude = explode(',', $attrs['exclude']);
foreach ($exclude as $image_id) {
unset($images[trim($image_id)]);
if( ! empty( $attrs[ 'exclude' ] ) ) {
$exclude = explode(',', $attrs[ 'exclude' ]);
foreach ( $exclude as $image_id ) {
unset( $images[ trim( $image_id ) ] );
}
}

Expand Down Expand Up @@ -152,29 +153,30 @@ function sss_handle_shortcode( $attrs ) {
}

$resp .= "</div>\n";

if ( true == $show_counter )
$image_counter = '<div class="simpleslider_counter"><span ' .
"id=\"{$slider_show_id}" .
'_count">1</span>/' . count($images) . '</div>';
else
$image_counter = '';

$resp .= '<div class="simpleslider_controls">';

// Controls
if ( true == $show_controls ) {
$resp .= "\n".'<div class="simpleslider_controls">';
if ( true == $show_controls )
$resp .= "<a href=\"#\" id=\"{$slider_show_id}_prev\" " .
"title=\"Previous Image\" class=\"simpleslider_link prev\">◄ " .
__( 'Prev.', 'simple_slideshow' ) . "</a> ";

if ( true == $show_counter ) {
$resp .= '&nbsp; <div class="simpleslider_counter"><span id="' .
$slider_show_id . '_count">1</span>/' . count($images) . '</div>';
}

$resp .= "&nbsp; <a href=\"#\" id=\"{$slider_show_id}_next\" " .
"title=\"Next Image\" class=\"simpleslider_link next\">" .
__( 'Prev.', 'simple_slideshow' ) . "</a> " .
"&nbsp;";

$resp .= ${image_counter};

if ( true == $show_controls)
$resp .= "&nbsp; <a href=\"#\" id=\"{$slider_show_id}_next\" " .
"title=\"Next Image\" class=\"simpleslider_link next\">" .
__( 'Next', 'simple_slideshow' ) . " ►</a>";
$resp .= '</div>';

} elseif ( true == $show_counter ) {
$resp .= "\n".'<div class="simpleslider_counter"><span id="' .
$slider_show_id . '_count">1</span>/' . count($images) .
'</div>';
}

$resp .= "</div>\n";


// JavaScript
Expand Down

0 comments on commit b0a0b60

Please sign in to comment.