• Resolved HowardParsons

    (@howardparsons)


    I’m just getting started w/ WP Photo Album Plus and I’m probably doing something wrong but I decided to post here with the hope that some one will show me the error of my ways.

    I presently have 2 Albums, one of which I want to use with a Post. I’m using the following short code:
    [wppa type=”slideonly” album=”2″ size=”450″][/wppa]

    Nothing terribly complicated there but when I use it in my post, I get Album 1 displayed and Album 2 displayed just below it. Obviously, I only want to show Album 2 but why do I get Albums 1 and 2.

    So what am I doing wrong? What setting have I overlooked? I’ve tried this with scripting but still get the same result.

    Howard Parsons

    http://wordpress.org/extend/plugins/wp-photo-album-plus/

Viewing 9 replies - 16 through 24 (of 24 total)
  • Thread Starter HowardParsons

    (@howardparsons)

    I’ve been in IT for 39 years so I don’t mind beating on this until we find the problem. I’ve been using 4.9.7 since you released it.

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    That is great. I started with ALGOL60, remember? FORTRAN was rocket science…

    in wppa-filter.php on line 300 it reads:

    // Count (internally to wppa_albums)

    You might putting a diagnostic there:

    echo 'Album='.$wppa['start_album'];

    I wonder if it says 2 or nothing ( with the [wppa ] shortcode of course )

    At line 276 it should happen…

    case 'slideonly':
    			$wppa['start_album'] = $album;

    Thread Starter HowardParsons

    (@howardparsons)

    Hi!
    I put in the debug statement & got “Album = “

    I then put a debug statement at line 267 & got nothing.

    Finally, I put 3 statements before the “switch” statement & got the following:

    Start of switch
    type = generic
    album =

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    So the problem is here:
    Line 226:

    extract( shortcode_atts( array(
    		'type'  	=> 'generic',
    		'album' 	=> '',
    		'photo' 	=> '',
    		'size'		=> '',
    		'align'		=> ''
    	), $atts ) );

    either extract() or shortcode_atts() doesn’t do its job on your system.

    Add this on line 225: print_r($atts); as diagnostic to see if wppa_shortcodes() gets his args.

    It looks we have found a wp bug ( in do_shortcode(); ??? ).

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    I discovered that forgetting a space between the “value” and the next keyword is lethal:

    Right:

    [wppa keyword="value" keyword="value" keyword="value"][/wppa]

    Wrong:

    [wppa keyword="value"keyword="value"keyword="value"][/wppa]

    Two more debugging suggestions:

    • put in wp-config.php:

      define('WP_DEBUG', true);

      This might produce usefull errormessages.

    • Re-install WP
    Thread Starter HowardParsons

    (@howardparsons)

    Here are the results of the debug statement on line 225:
    Array ( [0] => type=”slideonly” [1] => album=”2″ [size] => 450 )

    I put in some echo statements following the extract just to confirm:
    $type = generic
    $album =
    $size = 450

    WP_Debug produced errors in 2 other plug-ins:
    Notice: Undefined variable: iwp_action in /home/content/t/h/e/theparsonage/html/HTP/wp-content/plugins/better-wp-security/inc/secure.php on line 22

    Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already sent (output started at /home/content/t/h/e/theparsonage/html/HTP/wp-content/plugins/better-wp-security/inc/secure.php:22) in /home/content/t/h/e/theparsonage/html/HTP/wp-content/plugins/merlic-user-registration/merlic-user-registration.php on line 24

    Finally, I put so,e debug statements in shortcodes_php & here is what I got:
    Array ( [0] => type=”slideonly” [1] => album=”2″ [size] => 450 ) Entering shortcode_atts
    $name = type
    Default \\ No value found for $name
    $name = album
    Default
    $name = photo
    Default
    $name = size
    $atts[$name] = 450
    $name = align
    Default
    Leaving shortcode_atts
    $type = generic
    $album =
    $size = 450

    It looks like the size is the only thing making it through.

    Howard

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    I found it …..!

    The slideonly and 2 are surrounded by texturized quotes. Look carefully:

    Here are the results of the debug statement on line 225:
    Array ( [0] => type=”slideonly” [1] => album=”2″ [size] => 450 )

    You typed the shortcode in the visual editor. You better use the shortcode generator, or type it in the html (text) editor.

    Pls read this doc page. If you get a blank dialogbox, re-install wppa+ i patched a spurious error. ( You will not loose any photo or album data or setting when you de-activate and delete the plugin, do so and re-install from the plugins page. )

    Remove the WP_DEBUG define ( put // in font, for the next time you need it ) Don’t worry about the 2 warnings.

    Thread Starter HowardParsons

    (@howardparsons)

    Well, Well! The answer was in front of us all along. I apologise for taking up your valuable time for a problem with such a simple answer.

    In the first post, I said

    I’m probably doing something wrong . . .

    and it appears that I was right about that bit. I need to send you a few Euros within the next couple of days.

    Howard

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    Thank you for your donation.

    Sometimes things are too close to one to see it right…

    I updated the documentation trying to prevent future victims of this pitfall: http://wppa.opajaap.nl/shortcode-reference/

    Case closed.

Viewing 9 replies - 16 through 24 (of 24 total)
  • The topic ‘Another Newbie Question’ is closed to new replies.