Page 1 of 3

Problem with Caching (was Problem with Lightbox-Plugin)

Posted: Thu Apr 07, 2011 2:43 pm
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?

Re: Probleme mit Lightbox-Plugin

Posted: Thu Apr 07, 2011 3:33 pm
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

Re: Probleme mit Lightbox-Plugin

Posted: Fri Apr 08, 2011 12:21 am
by konus
Yes, I tried that already. :-)

Re: Probleme mit Lightbox-Plugin

Posted: Fri Apr 08, 2011 8:34 am
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.

Re: Probleme mit Lightbox-Plugin

Posted: Fri Apr 08, 2011 8:55 am
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.

Re: Probleme mit Lightbox-Plugin

Posted: Fri Apr 08, 2011 9:26 am
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.

Re: Probleme mit Lightbox-Plugin

Posted: Fri Apr 08, 2011 10:10 am
by konus
Thank you for your investigation. Does this mean, the original plugin is not fully operational without your changes?

Re: Probleme mit Lightbox-Plugin

Posted: Fri Apr 08, 2011 10:32 am
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.

Re: Probleme mit Lightbox-Plugin

Posted: Fri Apr 08, 2011 7:11 pm
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

Re: Probleme mit Lightbox-Plugin

Posted: Fri Apr 08, 2011 9:29 pm
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.

Re: Probleme mit Lightbox-Plugin

Posted: Sat Apr 09, 2011 9:20 am
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.

Re: Probleme mit Lightbox-Plugin

Posted: Sat Apr 09, 2011 9:33 am
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.

Re: Probleme mit Lightbox-Plugin

Posted: Sat Apr 09, 2011 10:46 am
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?

Re: Probleme mit Lightbox-Plugin

Posted: Sat Apr 09, 2011 1:17 pm
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... :|

including prettyPhoto to serendipity_event_lightbox

Posted: Sun Apr 10, 2011 9:07 am
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.