Support » Plugin: WP Photo Album Plus » [Plugin: WP Photo Album Plus] Page drops when activated on page

Viewing 15 replies - 1 through 15 (of 29 total)
  • Also, while I’m at it… How do I use the photos that I uploaded in the normal media library. (Next-Gen has a way to to this.) I would like to use a couple of photos in my text on a page.
    Thanks again,
    Dave

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    The problem you describe has been reported by several users.
    It may start after upgrade of the Thesis theme from version 6 to 7.
    It also has happened with the Twentyten theme.

    I tested all this and could not reproduce the problem.

    However, I made a tiny test plugin, that basically does the same thing as the wppa plugin.

    If you ar willing to do me and other users a favor, please do the following:

    Copy the following code and paste it in a text editor, save it as opajaaptest.php:

    <?php
    /*
    Plugin Name: OpaJaapTest
    Description: Test module
    Version: 3.0.0
    Author: J.N. Breetvelt a.k.a OpaJaap
    Author URI: http://www.opajaap.nl/
    Plugin URI: http://wordpress.org/extend/plugins/
    */
    
    add_action('init', 'ojt_do_filter');
    
    function ojt_do_filter() {
    add_filter('the_content', 'ojt_filter', 99);
    }
    
    function ojt_filter($post) {
    	$post_old = $post;
    	$post_new = '';
    
    	$ojt_pos = strpos($post_old, '%%ojt%%');
    	if (!is_numeric($ojt_pos)) return $post_old;	// Nothing to do here
    	while (is_numeric($ojt_pos)) {
    		$post_new .= ojt_disp(substr($post_old, 0, $ojt_pos));	// Copy BEFORE part
    		$post_old = substr($post_old, $ojt_pos+6);				// Shift BEFORE part out
    		$num = 0;
    		$npos = strpos($post_old, '%%num=');				// Is there a number given?
    		if ($npos) {
    			$wpos = strpos($post_old, '%%ojt%%');
    			if ($npos < $wpos || !$wpos) {					// Yes and it belongs to this occurance
    				$post_old = substr($post_old, $npos+6);		// Shift up to and including %%num= out
    				$len = 5;
    				$num = substr($post_old, 0, $len);			// Find the number
    				while (!is_numeric($num) && $len>0) {
    					$len--;
    					$num = substr($post_old, 0, $len);
    				}
    				$post_old = substr($post_old, $len+2);		// Shift the number and %% out
    			}
    		}
    		$post_new .= ojt_doit($num);
    
    		$ojt_pos = strpos($post_old, '%%ojt%%');
        }
    	$post_new .= ojt_disp($post_old);
    	return $post_new;
    }
    
    function ojt_disp($var) {
    	echo($var);
    }
    
    function ojt_doit($num = 0) {
    
    	echo('<div style="color:#007f00; background-color:#ffff00; padding:6px; text-align:center; font-size:24px; border-style:solid; border-width:2px; width:100%">');
    	echo('This is output ' . $num . ' of the OpaJaapTest Plugin');
    	echo('</div>');
    }
    ?>

    After that, place the file (ftp) in the plugins directory and activate the plugin. You may de-activate wppa to avoid confusions.

    Then, make a post that just contains the following:

    %%ojt%%
    %%num=13%%

    Post or previeuw the post and see what is happening.

    You should see an ugly yellow box INSIDE THE POST with the text:

    This is output 13 of the OpaJaapTest Plugin

    If you see the same box BEFORE the actual page and 100% wide, the problem is there. This first display may vanish right after the full load of the page, however you will still see the shift downwards of the page.

    I am very much interested to know whether the problem is there or not.
    So please test it for us.

    Kind regards,
    OpaJaap

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    The second topic: how to use a single photo in a post or page is currently not implemented, but will be considered as an enhancement request. Thank you.

    Thanks, I’ll get on it when I have a few minutes and get back to you.
    Dave

    OK… refer to http://mercedzoo.com/photos/test-album/

    I reactivated the original album and it still 1/2 way down. The new page has the yellow bar within the window and the page is “normal”.
    Does the album page show 1/2 way down for you?
    Dave

    are you familiar with cPanel? I could email you access and wp admin access if you like and you can experiment with it if you like. I just did a complete cPanel backup of the site as well as an admin plugin backup of the database.
    Dave

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    Hi!

    I do not know what cPanel is, sorry.

    You have the problem with the test plugin, I see (the text only) it a few seconds at the left top corner befor the background comes over it, the same way i see your photoalbums.

    This means the problem has now been pointed down to appear with the test plugin.

    I will supply you an even tinier testplugin and ask you to do the same as with this one, which you can remove now. Thanx

    Here is the code:

    <?php
    /*
    Plugin Name: OpaJaapTest
    Description: Test module
    Version: 1.0.0
    Author: J.N. Breetvelt a.k.a OpaJaap
    Author URI: http://www.opajaap.nl/
    Plugin URI: http://wordpress.org/extend/plugins/
    */
    
    add_action('init', 'ojt_do_filter');
    
    function ojt_do_filter() {
    add_filter('the_content', 'ojt_filter', 99);
    }
    
    function ojt_filter($post) {
    
    	if (substr_count($post, '%%ojt%%') > 0) {
    
    		// $ojtpos = strpos($post, '%%ojt%%');
    
    		$post = substr_replace($post, ojt_doit(), strpos($post, '%%ojt%%'), 7);
    		/* str_replace('%%ojt%%', ojt_doit), $post); */
        }
    	return $post;
    }
    
    function ojt_doit() {
    	echo('<div style="color:#007f00; background-color:#ffff00; padding:6px; text-align:center; font-size:16px; border-style:solid; border-width:2px; width:100%">');
    	echo('This is the output of the OpaJaapTest Plugin');
    	echo('</div>');
    }
    
    ?>

    You now only need to write %%ojt%%

    Hear from you?

    Regards
    OpaJaap

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    Further info: if you use Firefox, you will see the effect in the left upper corner as i described.

    After the text, there is a spurious ‘” />’ that may be the reason that there is not a yellow box also. So, it is not just that your page drops down halfway, there is ouput that should not be there, and in case of the wppa plugin: the more albums you have in your post, the more space will be used.

    Do you know of a (debugging) tool or method to catch all output, either at the server or the client side. That would ease further investigations.

    In Firefox’s firebug, you will find the extraneous output right after the <body> tag.

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    Ok, i have seen them. Are you familiar with firefox firebug?

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    I have 2 screenshots, first during buildup, look at the upper left corner

    http://www.opajaap.nl/thebug.jpg

    the second: look at the left lower corner, the firebug output

    http://www.opajaap.nl/thebug2.jpg

    ok… installed firebug. I think I understand about your first pix. I don’t know how to slow the load to see it.

    your second pix html basically says the same thing as your pic.
    What do I do now?

    (I find this interesting, and learning.)

    oops, word update…
    your second pix firebug html basically says the same thing as mine.
    What do I do now?

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    Now we have proven that ‘the problem’ is NOT a wp-photo-album-plus bug.

    As I have seen before ‘the problem’ can be introduced by an upgrade of a theme (Thesis 6->7). It can also be seen with the twentyten theme.
    When I test it with those themes, it does not appear.

    So, I think someone modifies/customizes the theme or makes some additions that invokes ‘the problem’. You should search for erroneous html and/or programming methods that are not allowed in wp. For instamce, you should always use wp_enqueue_script() and wp_enqueue_style() in stead of hardcoding <script ...></script> etc.

    I can not see with firebug HOW things come into your <head> section, but I can see that there is at least one erroneous thing: the very last <meta> tag contains garbage that looks like css fragments.
    I do not know if this causes ‘the problem’ but you should fix that anyway.

    Overlook your theme’s code addition/modifications throughly because I am pretty sure the origin of ‘the problem’ lays in there.

    Good luck with it.

    (To be continued? until finally fixed, I hope)

    The theme is produced by a program called Artisteer. ver 2.5.0.29918 Standard Edition.
    http://www.artisteer.com/?p=wiki&product_id=4&lang=English
    I have not had any html expertise into it. The program produced the template. I am forwarding this url to the Artisteer team and see if they can figure out what’s up.
    Hopefully, they will contact you for a fix directly.
    I’ll be watching this thread.
    Thanks.
    Dave

Viewing 15 replies - 1 through 15 (of 29 total)
  • The topic ‘[Plugin: WP Photo Album Plus] Page drops when activated on page’ is closed to new replies.