Problem with Caching (was Problem with Lightbox-Plugin)

Creating and modifying plugins.
User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: including prettyPhoto to serendipity_event_lightbox

Post by garvinhicking » Mon Apr 11, 2011 9:22 am

Hi!

Putting js before </body> is more of a recommendation. To patch up the plugin like this might IMHO not be necessary, we could simply add it here:

Code: Select all

// prettyPhoto code
elseif ($type == 'prettyPhoto') {
  echo '<script type="text/javascript">var prettyphoto_path = "' . $pluginDir . '/prettyphoto";</script>' . "\n";
  echo '<script type="text/javascript" src="' . $pluginDir . '/prettyphoto/js/jquery-1.4.4.min.js"></script>' . "\n";
  echo '<script type="text/javascript" src="' . $pluginDir . '/prettyphoto/js/jquery.prettyPhoto.js"></script>' . "\n";
  echo '<link rel="stylesheet" type="text/css" href="' . $pluginDir.  '/prettyphoto/css/prettyPhoto.css" />' . "\n";
  echo '<script type="text/javascript" charset="utf-8">$(document).ready(function(){ $("a[rel^='prettyPhoto']").prettyPhoto();});</script>' . "\n";
Since currentlyl ightbox runs without an external jquery plugin, ideally it should be solved by simply adding a "if (class_exists('serendipity_event_jquery')" check, so that if jquery plugin is loaded, the lightboxplugin does not emit its own jquery.

Now you mentioned files were missing frmo the lightbox-prettyphoto thing. Which ones exactly? Then we can put all of this in a new version of the plugin.

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/

User avatar
narrenfrei
Regular
Posts: 29
Joined: Mon Jul 05, 2010 6:28 pm
Location: Langschlag (Austria)
Contact:

Re: Probleme mit Lightbox-Plugin

Post by narrenfrei » Mon Apr 11, 2011 11:20 am

Hi Garvin,
your code suggestion is the same (except some customizations), as I have now running on my blog. For me it looks OK. The if-check for jQuery is a great and simple idea! I have set some escapes and build in the if-check:

Code: Select all

// prettyPhoto code
   elseif ($type == 'prettyPhoto') {
   echo '<script type="text/javascript">var prettyphoto_path = "' . $pluginDir . '/prettyphoto";</script>' . "\n";
      if (class_exists('serendipity_event_jquery')) {}
      else {echo '<script type="text/javascript" src="' . $pluginDir . '/prettyphoto/js/jquery-1.4.4.min.js"></script>' . "\n";}
   echo '<script type="text/javascript" src="' . $pluginDir . '/prettyphoto/js/jquery.prettyPhoto.js"></script>' . "\n";
   echo '<link rel="stylesheet" type="text/css" href="' . $pluginDir.  '/prettyphoto/css/prettyPhoto.css" />' . "\n";
   echo '<script type="text/javascript" charset="utf-8">$(document).ready(function(){ $("a[rel^=\'prettyPhoto\']").prettyPhoto();});</script>' . "\n";
   }
I've tested the code on my blog.

I would suggest, to unzip the whole prettyPhoto download (http://www.no-margin-for-errors.com/dem ... ed_3.1.zip) into the "prettyphoto" folder from the plugin. So all customizations and themes would be reachable and it would be easy to update pretty photo if necessary. Maybe it would be better to delete the example-files? I've made a version without the example-files: http://dl.dropbox.com/u/746957/prettyPhoto.zip
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)

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Probleme mit Lightbox-Plugin

Post by garvinhicking » Mon Apr 11, 2011 2:10 pm

Hi!

Great! I just committed the suggested changes!

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/

User avatar
narrenfrei
Regular
Posts: 29
Joined: Mon Jul 05, 2010 6:28 pm
Location: Langschlag (Austria)
Contact:

Re: Probleme mit Lightbox-Plugin

Post by narrenfrei » Mon Apr 11, 2011 4:19 pm

I've copied the updated version from SourceForge over the installed version in my blog. As I can see, everything works fine.
How often gets netmirror.org updated? Because the folder "prettyPhoto" is still missing there.
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)

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Probleme mit Lightbox-Plugin

Post by garvinhicking » Tue Apr 12, 2011 11:09 am

Hi!

Sadly the ZIP file that was uploaded here contained 770 permissions, so the files that were put to netmirror had no read privileges. I now adjusted those... :)

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/

User avatar
Mangek
Regular
Posts: 85
Joined: Tue Jun 24, 2008 1:08 am
Location: Sweden
Contact:

Re: Probleme mit Lightbox-Plugin

Post by Mangek » Tue Apr 12, 2011 3:34 pm

garvinhicking wrote:Sadly the ZIP file that was uploaded here contained 770 permissions, so the files that were put to netmirror had no read privileges. I now adjusted those... :)
Seems like I'm nothing but trouble, eh. :lol:

Glad you guys are sorting the quirks out though. :)

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Probleme mit Lightbox-Plugin

Post by garvinhicking » Wed Apr 13, 2011 10:37 am

Hi Mangek!

No, no! quite the contrary - your effort was great, without it we wouldn't have this option now. :-)

Best 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/

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

Re: Probleme mit Lightbox-Plugin

Post by konus » Wed Apr 13, 2011 10:43 am

Since I started this thread, I would like to give some feedback:

1. First of all - THANK YOU all for your help, it is a fantastic teamwork here!

2. PrettyPhoto looks really good, I think I will switch.

3. I found the reason, for the following problem
konus wrote:... 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. ...

The problem was: I have the plugin serendipity_event_entryproperties installed and caching enabled. Switching the Lighbox script changes the entries in the header, but not the automatically inserted rel='lightbox[lightbox_group_entry_681]' to rel='prettyPhoto[681]' in the image links in the body.

I wonder, if it would be possible to use the same rel= name in all scripts? This way, a change of the script would not conflict with caching.

Question: I remember that serendipity_event_entryproperties should always be the last plugin. Would it be helpful to put serendipity_event_lightbox after this? If yes, would it make sense?

User avatar
narrenfrei
Regular
Posts: 29
Joined: Mon Jul 05, 2010 6:28 pm
Location: Langschlag (Austria)
Contact:

Re: Probleme mit Lightbox-Plugin

Post by narrenfrei » Wed Apr 13, 2011 2:20 pm

konus wrote:I wonder, if it would be possible to use the same rel= name in all scripts? This way, a change of the script would not conflict with caching.
I think, that would mean that we would have to adapt the Javascripts. So a later update of this scripts would be not so easy, as it is now.

For your question about the ranking of the plugins, I can't say anything, because I don't know.
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)

User avatar
narrenfrei
Regular
Posts: 29
Joined: Mon Jul 05, 2010 6:28 pm
Location: Langschlag (Austria)
Contact:

Re: Probleme mit Lightbox-Plugin

Post by narrenfrei » Thu Apr 14, 2011 8:35 am

There is a new version of PrettyPhoto out. http://www.no-margin-for-errors.com/blo ... aring-win/

There are two new features (deep links and social sharing) an some bug-fixes.

@Garvin:
How should we handle with such updates? Shall we always inform you to update it? Or is there another way, so that you don't have to do so much?

Franz
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)

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Probleme mit Lightbox-Plugin

Post by garvinhicking » Mon Apr 18, 2011 9:36 am

Hi!

Thanks for the notice! That is the best way to go, I think. It's not so much work for me (5 minutes) :)

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/

User avatar
narrenfrei
Regular
Posts: 29
Joined: Mon Jul 05, 2010 6:28 pm
Location: Langschlag (Austria)
Contact:

Re: Probleme mit Lightbox-Plugin

Post by narrenfrei » Wed Apr 27, 2011 9:33 am

Hi, I think with the old problem with the permissions of the prettyphoto folder. At netmirror.org the folder isn't visible and during the update via Spartacus I get the following message for all files of PrettyPhoto "Der Mirror-Speicherort antwortet mit Fehler 403."
garvinhicking wrote:Sadly the ZIP file that was uploaded here contained 770 permissions, so the files that were put to netmirror had no read privileges. I now adjusted those... :)
Franz
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)

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Probleme mit Lightbox-Plugin

Post by garvinhicking » Wed Apr 27, 2011 4:09 pm

Hi!

That's true, I'm sorry. Fixed :)

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/

User avatar
narrenfrei
Regular
Posts: 29
Joined: Mon Jul 05, 2010 6:28 pm
Location: Langschlag (Austria)
Contact:

Re: Probleme mit Lightbox-Plugin

Post by narrenfrei » Fri May 06, 2011 8:03 am

In my case all scripts are working fine. Could you give as a link to your blog?

Edit: Look's like someone has deleted the post on which I had answered.
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)

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

How to delete the cache of serendipity_event_entryproperties

Post by konus » Thu Jun 28, 2012 5:32 pm

Long time ago, but the problem is the same, so sorry for digging up an old thread of mine :-)

In a blog of a friend, I changed the lightbox script (serendipity_event_lightbox) from 'lightbox_plus' to 'pretty_photo'. After the change, all articles had no working lightbox. I found out, that it is because of the use of caching in serendipity_event_entryproperties. Unfortunately disabling caching does not solve the problem, because in the table entryproperties are still the entries for ep_cache_% and they are still in use ?!?

In earlier discussions I found the hint to hit the "Cache all entries" menu option, but I do not have such a button in my admin panel. Is this link still available in Serendipity 1.6.2?

Image

So is there an easy way to delete the cache or render it invalid? Or do I really have to do it with SQL?

Some thoughts:
  1. I read that after an installation of a new plugin, the plugin can render the cache invalid by themself. I think, it would be a good idea to enable the lightbox plugin to do the same after changing a lighbox-script?
  2. May be it would be a good idea too to delete the ep_cache_% entries if caching is swichted to be disabled?

Post Reply