Problem with Caching (was Problem with Lightbox-Plugin)

Creating and modifying plugins.
konus
Regular
Posts: 334
Joined: Mon Jun 16, 2008 1:57 pm
Location: Dresden, Germany
Contact:

Problem with Caching (was Problem with Lightbox-Plugin)

Post by konus »

I have two Problems:
1. (maybe temporary): I tried to install serendipity_event_lightbox 1.9.2 from spartacus, but there are some files missing:
Die URL http://netmirror.org/mirror/serendipity ... ion=1.9999 (IP 188.40.113.17) konnte nicht geöffnet werden. Möglicherweise existieren Server- oder Netzwerkprobleme.

(Der Mirror-Speicherort antwortet mit Fehler 403.)
2. Then I downloaded and installed the plugin manually, but found out, that I can't change the script. I normally use Lighbox plus and wanted to test the new script prettyPhoto
All other scripts (beside lightbox plus) did not work. For serendipity_event_livecomment I have JQuery enabled but I think, at least prettyPhoto should work?
Last edited by konus on Mon Jul 02, 2012 4:31 pm, edited 1 time in total.
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Probleme mit Lightbox-Plugin

Post by yellowled »

konus wrote:(Der Mirror-Speicherort antwortet mit Fehler 403.)
You're right, it may be temporary. Then again, 403 smells like wrong permissions (on Spartacus?).
konus wrote:All other scripts (beside lightbox plus) did not work. For serendipity_event_livecomment I have JQuery enabled but I think, at least prettyPhoto should work?
Have you tried to disable jQuery/livecomment temporarily? It is correct that mixing jQuery w/ other library might cause issues, but I think the jQuery plugin uses the noConflict mode which should work fine.

YL
konus
Regular
Posts: 334
Joined: Mon Jun 16, 2008 1:57 pm
Location: Dresden, Germany
Contact:

Re: Probleme mit Lightbox-Plugin

Post by konus »

Yes, I tried that already. :-)
narrenfrei
Regular
Posts: 29
Joined: Mon Jul 05, 2010 6:28 pm
Location: Langschlag (Austria)
Contact:

Re: Probleme mit Lightbox-Plugin

Post by narrenfrei »

Maybe there ist the initializing missing:

Code: Select all

<script type="text/javascript" charset="utf-8">
		$(document).ready(function(){
			$("a[rel^='prettyPhoto']").prettyPhoto();
		});
</script>
I can't find it in the generated source code.
narrenfrei.at
"Die große Stärke der Narren ist es dass sie keine Angst haben, Dummheiten zu sagen." (Jean Cocteau)

Blog-Engine: Serendipity 1.6.2 (PHP 5.2.12-nmm4 @ all-inkl.com)
narrenfrei
Regular
Posts: 29
Joined: Mon Jul 05, 2010 6:28 pm
Location: Langschlag (Austria)
Contact:

Re: Probleme mit Lightbox-Plugin

Post by narrenfrei »

For testing I've inserted

Code: Select all

<script type="text/javascript" charset="utf-8">
      $(document).ready(function() {ldelim}
         $("a[rel^='prettyPhoto']").prettyPhoto();
      {rdelim});
</script>
into the body of index.tpl.
PrettyPhoto works know quite fine.
narrenfrei.at
"Die große Stärke der Narren ist es dass sie keine Angst haben, Dummheiten zu sagen." (Jean Cocteau)

Blog-Engine: Serendipity 1.6.2 (PHP 5.2.12-nmm4 @ all-inkl.com)
narrenfrei
Regular
Posts: 29
Joined: Mon Jul 05, 2010 6:28 pm
Location: Langschlag (Austria)
Contact:

Re: Probleme mit Lightbox-Plugin

Post by narrenfrei »

One more "problem" with prettyPhoto via the Lightbox-Plugin:
The Lightbox-Plugin doesn't contain the images which prettyPhoto.css would like to use.
I have know copied these images from the original prettyPhoto up into my prettyPhoto folder form the Lightbox-Plugin and it works fine.
narrenfrei.at
"Die große Stärke der Narren ist es dass sie keine Angst haben, Dummheiten zu sagen." (Jean Cocteau)

Blog-Engine: Serendipity 1.6.2 (PHP 5.2.12-nmm4 @ all-inkl.com)
konus
Regular
Posts: 334
Joined: Mon Jun 16, 2008 1:57 pm
Location: Dresden, Germany
Contact:

Re: Probleme mit Lightbox-Plugin

Post by konus »

Thank you for your investigation. Does this mean, the original plugin is not fully operational without your changes?
narrenfrei
Regular
Posts: 29
Joined: Mon Jul 05, 2010 6:28 pm
Location: Langschlag (Austria)
Contact:

Re: Probleme mit Lightbox-Plugin

Post by narrenfrei »

There are some problems with different sources:
1) installing problems:
On the mirror the folder prettyPhoto is missing: http://netmirror.org/mirror/serendipity ... _lightbox/
On sourceforge the folder is available:
http://php-blog.cvs.sourceforge.net/vie ... _lightbox/

2) initializing problem:
According to http://www.no-margin-for-errors.com/pro ... mentation/ the prettyPhoto script must be initialized before the closing tag of the html body. I think, this is missing in the Lightbox-Plugin "serendipity_event_lightbox". I've inserted it for testing into my index.tpl, but normally this should be done by the plugin.

3) correct look of the prettyPhoto box:
The pictures, that are used by thy CSS of prettyPhoto, are not in the serendipity_event_lightbox-Folder. Without these pictures prettyPhoto run correctly, but for example the arrows for jumping to the next photo are not visible. I've downloaded the original prettyPhoto and copied the image-folder into the image-folder from the serendipity_event_lightbox plugin. In my case it works.

As I know the team of s9y, I think, the Fixes will be done and copied to Sourceforge quiet immediately.
narrenfrei.at
"Die große Stärke der Narren ist es dass sie keine Angst haben, Dummheiten zu sagen." (Jean Cocteau)

Blog-Engine: Serendipity 1.6.2 (PHP 5.2.12-nmm4 @ all-inkl.com)
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Probleme mit Lightbox-Plugin

Post by garvinhicking »

Hi!

I've only added the prettyPhoto patch which was submitted to the forums here a few days ago. It might be that netmirror did not yet "catch" the updated files.

If someone can provide a patch for what needs to be done, I'd happily commit. I myself have no knowledge about prettyPhoto so I can't really help...

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Mangek
Regular
Posts: 85
Joined: Tue Jun 24, 2008 1:08 am
Location: Sweden
Contact:

Re: Probleme mit Lightbox-Plugin

Post by Mangek »

Almost forgot about that. :oops:

I'm running a slightly modified version of what I submitted (I removed all inclusion of jquery from serendipity_event_lightbox) and run it alongside the jquery plugin without any problems: take a look here.
All other scripts (beside lightbox plus) did not work.
I'm not much a coder, perhaps in my effort to include prettyPhoto I broke the other scripts? I hope not.. :wink:

Edit: I didn't notice your comments on the other thread before commenting here, so let's keep to this one.
narrenfrei
Regular
Posts: 29
Joined: Mon Jul 05, 2010 6:28 pm
Location: Langschlag (Austria)
Contact:

Re: Probleme mit Lightbox-Plugin

Post by narrenfrei »

In my case all 6 Lightbox-Scripts work. (OK, Greybox doesn't work how it should work: it makes an iframe with the whole website instead of the photo. But it works ;-) )

I think there is not much to change:
1) include all prettyPhoto-Recources into the Plugin-Folder
2) make the Lightbox-Plugin (if prettyPhoto is used) insert

Code: Select all

<script type="text/javascript" charset="utf-8">
      $(document).ready(function() {ldelim}
         $("a[rel^='prettyPhoto']").prettyPhoto();
      {rdelim});
</script>
somewhere before closing the body.

Edit:
There should also be somewhere documented, where this initializing code could be find, because with this code you can change the behavior and lookout of prettyPhoto.
narrenfrei.at
"Die große Stärke der Narren ist es dass sie keine Angst haben, Dummheiten zu sagen." (Jean Cocteau)

Blog-Engine: Serendipity 1.6.2 (PHP 5.2.12-nmm4 @ all-inkl.com)
Mangek
Regular
Posts: 85
Joined: Tue Jun 24, 2008 1:08 am
Location: Sweden
Contact:

Re: Probleme mit Lightbox-Plugin

Post by Mangek »

1) But they should be, at least I have all files there. o_o

2) That shouldn't be necessary, what the plugin emits in the <head> for me is this:

Code: Select all

<script type="text/javascript">var prettyphoto_path = "/s9y/plugins/serendipity_event_lightbox/prettyphoto";</script>
<script type="text/javascript" src="/s9y/plugins/serendipity_event_lightbox/prettyphoto/js/jquery.prettyPhoto.js"></script>
<link rel="stylesheet" type="text/css" href="/s9y/plugins/serendipity_event_lightbox/prettyphoto/css/prettyPhoto.css" />
It seems that the jQuery plugin has to be positioned above the lightbox plugin in the event plugins list however, it won't work for me otherwise.

Edit: Ah I suppose you're right. I didn't include any other style than the default however, so I guess one'd have to make a few changes.
narrenfrei
Regular
Posts: 29
Joined: Mon Jul 05, 2010 6:28 pm
Location: Langschlag (Austria)
Contact:

Re: Probleme mit Lightbox-Plugin

Post by narrenfrei »

1) On SourceForge there are missing in the folder "serendipity_event_lightbox/prettyphoto/images/prettyPhoto" the images which are used by prettyPhoto.css

2) That's a little bit strange for me, because http://www.no-margin-for-errors.com/pro ... mentation/ says that the prettyPhoto-Script must be initialized somewhere before the end of the body. Please take a look at the whole source code of your side, because you've also the initialization in your code (http://dirgefornovember.com/s9y/: last lines before </body>)

I've know inserted the following code in line 201 of the serendipity_event_lightbox.php:

Code: Select all

echo '<script type="text/javascript" charset="utf-8">' . "\n" .
$(document).ready(function() {' . "\n" .
'$("a[rel^=\'prettyPhoto\']").prettyPhoto({' . "\n" .
'theme: \'light_square\'' . "\n" . // Here you can insert parameters to customize prettyPhoto, don't forget to escape the ' - more info at http://is.gd/9q3PGd
'});' . "\n" .
'});' . "\n" .
'</script>' . "\n";
As I can see it, it works fine in my case.

Before Garvin changes the Resources on SourceForge, we should think about, where we wont to embed jQuery.
1) directly in the Lightbox-Plugin (as it is know)
2) Or is it in s9y possible to make the Lightbox-Plugin depending on the jQuery-Plugin?
narrenfrei.at
"Die große Stärke der Narren ist es dass sie keine Angst haben, Dummheiten zu sagen." (Jean Cocteau)

Blog-Engine: Serendipity 1.6.2 (PHP 5.2.12-nmm4 @ all-inkl.com)
Mangek
Regular
Posts: 85
Joined: Tue Jun 24, 2008 1:08 am
Location: Sweden
Contact:

Re: Probleme mit Lightbox-Plugin

Post by Mangek »

narrenfrei wrote:Please take a look at the whole source code of your side, because you've also the initialization in your code (http://dirgefornovember.com/s9y/: last lines before </body>)
You're absolutely right, my mistake. I was using prettyPhoto before merging it with the lightbox plugin but had some problems with it which is why I decided to try and get it into the plugin in the first place.

I must have forgotten about that snippet of code. :oops: Looking through my index.tmp I have this code just before </body>:

Code: Select all

{literal}
	<script type="text/javascript" charset="utf-8">
		$(document).ready(function(){
			$("a[rel^='prettyPhoto']").prettyPhoto();
		});
	</script>
{/literal}
I think I remember asking about inserting code some time back and {literal} was suggested.. Now I feel like a fool, no wonder people were having problems with the script and it worked for me... :|
narrenfrei
Regular
Posts: 29
Joined: Mon Jul 05, 2010 6:28 pm
Location: Langschlag (Austria)
Contact:

including prettyPhoto to serendipity_event_lightbox

Post by narrenfrei »

Fine, now we know that we have to insert the initializing code somewhere before closing the body. Best would be, if this is done by the serendipity_event_lightbox.php

The {literal} string is used, if you want to protect code from Smarty-parsing in an tpl-file. For example JS often needs { and } and smarty would identify them as Smarty-Tags. So you can put code which uses {} into a literal-block or you use {ldelim} and {rdelim} if you also want to use Smarty-Tags. (I hope, this is right, because I've also learned only some days ago here in the forum from yellowled.)

1) I think it would be best, if the initializing code get inserted directly before closing the body. But don't know much about the plugin-structure of s9y. (I specify: I know nearly nothing about it!) So if you know, how to get serendipity_event_lightbox.php to insert the code before the closing tag of the body it would be great.

2) Once more the second question: Where should we embed jQuery? I think, it would be the best way, if we use the jQuery-Plugin.
narrenfrei.at
"Die große Stärke der Narren ist es dass sie keine Angst haben, Dummheiten zu sagen." (Jean Cocteau)

Blog-Engine: Serendipity 1.6.2 (PHP 5.2.12-nmm4 @ all-inkl.com)
Post Reply