forum.coppermine-gallery.net

Support => cpg1.5 plugins => cpg1.5.x Support => cpg1.5 plugin contributions => Topic started by: Αndré on February 04, 2010, 01:57:44 pm

Title: Add all pictures/files from a particular album to your favorites for cpg1.5.x
Post by: Αndré on February 04, 2010, 01:57:44 pm
This plugin adds an icon to the thumbnail view title row (next to the album name). When you click on that icon, all files of the current album will be added to your favorites.

It's a port of that cpg1.4.x plugin (http://forum.coppermine-gallery.net/index.php/topic,59203.0.html).


If you want to remove all files from your favorites, have a look at that plugin (http://forum.coppermine-gallery.net/index.php/topic,68037.0.html).
Title: Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
Post by: xandy71 on June 28, 2010, 05:09:57 pm
Hallo

This plugin did not work for me with a theme called dark_velvet. No icon, maybe if you have time you can test it.
Thank you
Title: Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
Post by: Joachim Müller on June 28, 2010, 06:20:15 pm
Board rules / Forum policies: Post Links (http://forum.coppermine-gallery.net/index.php/topic,55415.msg270616.html#msg270616)
Title: Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
Post by: xandy71 on June 28, 2010, 06:37:14 pm
Board rules / Forum policies: Post Links (http://forum.coppermine-gallery.net/index.php/topic,55415.msg270616.html#msg270616)

what's the problem?
you want a link to my gallery hear it is http://www.a-system.at/gallery/login.php (http://www.a-system.at/gallery/login.php)
Title: Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
Post by: Αndré on June 28, 2010, 06:48:04 pm
Updated regex to reflect changes of r7245 in version 1.1 (attached to initial post).
Title: Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
Post by: xandy71 on June 28, 2010, 07:43:54 pm
Updated regex to reflect changes of r7245 in version 1.1 (attached to initial post).

Thank you Αndré

Now this really great plugin work's perfectly !!!

have a nice day
Title: Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
Post by: Kazna on August 06, 2010, 04:35:42 pm
Hello, i try the plugin and see it work when i click "add album to my favorites", but then i attempt to remove favorites by re-clicking the button again, it shows error "Critical error. There was an error while processing a database query", I can't remove the whole album from my favorites then.
I'm using the latest version of Coppermine, 1.5.6. I got the errors with Hardwire and Curve themes, but not yet try it with others.
Title: Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
Post by: Αndré on August 06, 2010, 07:40:52 pm
then i attempt to remove favorites by re-clicking the button again
That's no feature of the plugin. It currently only adds whole albums.
Title: Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
Post by: Snowcamper on August 16, 2010, 11:40:16 pm
First of all: sorry for this newbie question, but I just don't get this plugin running...

Which files of your posted zip-file do I have to put into my plugin/album_addfav folder?

I've downloaded

cpg1.4.x_plugin_album-addfav_v1.2.zip and your
cpg1.5.x_plugin_album_addfav_v1.1.zip

I replaced the following files from cpg1.4.x by the files from cpg1.5.x:
album_addfav --> add
codebase  --> codebase
configuration --> configuration

I uploaded the files and installed the plugin. But it doesn't work: when I click on the album thumbnail/title, I just get a blank page...

I'm using Coppermine 1.5.8, curve theme and only one other plugin: LightBox NotesFor.net (lightbox_notes_for_net): v3.1. Haven't changed anything else. To post a link to my gallery wouldn't help you, as I secured it with an additional .htaccess Login...

Your help would really be appreciated!  :)
Title: Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
Post by: Αndré on August 17, 2010, 08:21:24 am
I'm using Coppermine 1.5.8

[..]

I've downloaded

cpg1.4.x_plugin_album-addfav_v1.2.zip
Nonsense. All you have to do is to download the package attached here (cpg1.5.x_plugin_album_addfav_v1.1.zip) and install it as explained in the docs.
Title: Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
Post by: Snowcamper on August 17, 2010, 12:39:29 pm
All you have to do is to download the package attached here (cpg1.5.x_plugin_album_addfav_v1.1.zip) and install it as explained in the docs.
Well, that's what I've done first, but that didn't work either... as I've seen that there are many files more in the cpg1.4.x-Version, I came to the idea described above (because I thought, there would be some files missing in the new Version).

The .htaccess file can't be the problem either, as I removed it and run the gallery without. I even deactivated the other plugin, but that didn't help too.

I forgot some detail in the first question: I changed in my template.html (curve theme) the line 33 (clicking on coppermine-logo leads to another page than index.html). I rechanged it, but that didn't help too...
Title: Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
Post by: Αndré on August 17, 2010, 03:10:32 pm
I just installed that plugin on my testbed and it works as expected. Please post a link to your gallery and describe what exactly you are doing.
Title: Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
Post by: Snowcamper on August 17, 2010, 04:57:44 pm
Ok, here's the link:
http://schneela.markus-zollinger.ch/gallery/ (as I've written above, it's .htaccess-secured).

I created a test user account for you. I'll send you the login data if you want it (I'll surely not post it here...).

Log:
-I installed coppermine 1.5.6. (changed the template.html as mentioned above)
-I did the upgrade to 1.5.8. (following http://documentation.coppermine-gallery.net/en/upgrading.htm, did NOT upload any themes but "curve")
-I installed LightBox NotesFor.net (following http://forum.coppermine-gallery.net/index.php?topic=54654.0, using "Methode 2" ->FTP)
- Added a .htaccess-file containing password protection and the following:
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule> (because the flash upload didn't work before)
-I installed your plugin as described above
- Did the testing as described in my posts above
- Asked you for help...
Title: Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
Post by: Αndré on August 17, 2010, 05:08:38 pm
I don't need a log, but a description how you determine that the plugin doesn't work. Does the new icon appear? What happens when you click on it? All I found was
Quote
when I click on the album thumbnail/title, I just get a blank page
so I assume the plugin breaks your gallery (i.e. the thumbnail.php pages)? I don't want to guess further, so please provide some information I can work with.
Title: Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
Post by: Snowcamper on August 17, 2010, 05:14:14 pm
Sorry about that, I didnt understand what you wanted from me.

It's exactly how you described it: the plugin seems to break the thumbnail.php page.
When I click von the album thumbnail/title, i see just a blank page under the adress (example)
http://schneela.markus-zollinger.ch/gallery/thumbnails.php?album=1

There's no new icon.

If you want the login, I'll send it to you...
Title: Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
Post by: Snowcamper on August 23, 2010, 07:10:16 am
André, did you get my two e-mails? Just asking here because I didn't get an answer so far...
Title: Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
Post by: papukaija on August 23, 2010, 10:52:21 pm
André, did you get my two e-mails? Just asking here because I didn't get an answer so far...

Please follow this board rule: [11] Board rules / Forum policies: Post publicly (http://forum.coppermine-gallery.net/index.php/topic,55415.msg270619.html#msg270619). In addition, you should remove the password protection for better support.
Title: Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
Post by: Snowcamper on August 24, 2010, 08:29:23 am
Please follow this board rule: [11] Board rules / Forum policies: Post publicly (http://forum.coppermine-gallery.net/index.php/topic,55415.msg270619.html#msg270619). In addition, you should remove the password protection for better support.

I'm aware of the board rules! André wrote me a private message about a week ago so we can share the information needed (username+passwd for test account).
I just wrote this message above because I didn't get any answer until now...
Title: Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
Post by: Αndré on August 24, 2010, 08:14:06 pm
I received two mails, but currently have no time to look into any issues, as I'm on the road and have limited time and a very poor internet connection.
Title: Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
Post by: Snowcamper on August 24, 2010, 09:09:19 pm
Ok, perfect! Thanks for the confirmation.  :)
Title: Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
Post by: Αndré on August 30, 2010, 02:00:13 pm
On your gallery I can confirm that the thumbnail pages results in blank pages. I cannot confirm that behavior in my testbed, so you're on your own. Have a look at the codebase.php file. There's just one important line:
Code: [Select]
$html = preg_replace('/(<td style="vertical-align:top" class="statlink">.*<h2>)(.*)(<\/h2>.*<\/td>)/Usi', '\\1\\2 <a href="index.php?file=album_addfav/add&amp;aid='.$superCage->get->getInt('album').'" title="Add all pictures of this album to your favorites"><img src="images/icons/favorites.png" border="0" style="display:inline" /></a>\\3', $html, 1, $count);
Try to figure out what the problem is and report back.
Title: Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
Post by: Snowcamper on August 30, 2010, 09:56:04 pm
Hmm, well thanks for having a look at it. Sadly, I have no time to take care of the problem right now, as I'm pretty busy. Maybe I'll have a look at it in about 2 months!
Title: Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
Post by: jief78 on September 23, 2010, 10:59:04 pm
Hi,
I have the same problem, when the plugin is activated
when i clik on an album it give me a blank page, the source code is completly blank to!
can you help me please!
I'm sorry for my english!
Title: Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
Post by: Αndré on September 24, 2010, 09:00:13 am
jief78,
I cannot confirm that behavior in my testbed, so you're on your own. Have a look at the codebase.php file. There's just one important line:
Code: [Select]
$html = preg_replace('/(<td style="vertical-align:top" class="statlink">.*<h2>)(.*)(<\/h2>.*<\/td>)/Usi', '\\1\\2 <a href="index.php?file=album_addfav/add&amp;aid='.$superCage->get->getInt('album').'" title="Add all pictures of this album to your favorites"><img src="images/icons/favorites.png" border="0" style="display:inline" /></a>\\3', $html, 1, $count);
Try to figure out what the problem is and report back.
Maybe it helps if you increase the PHP memory limit. Maybe you find something in the error logs.
Title: Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
Post by: jief78 on September 24, 2010, 12:41:05 pm
hi, thank you for trying to help me!
what do you mean when you say error log?
because in the log folder i just found "acces", "config", "global", and "security" not "error"!

the "important line" is exactly the same in my "codebase.php"

Can i send you some of my server files to help you helping me?

an other time sorry for my english!

thank you

JIEF
Title: Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
Post by: Αndré on September 24, 2010, 01:32:53 pm
what do you mean when you say error log?
because in the log folder i just found "acces", "config", "global", and "security" not "error"!
I mean the log files that your server may write. Depends on your web space if you have access to those files or not.


the "important line" is exactly the same in my "codebase.php"
Yes of course. Please have a look at that file. That's the only line which manipulates the output. I used a regular expression to place the button directly behind the album title. You can of course use simpler functions such as str_replaces which requires also less performance.


Can i send you some of my server files to help you helping me?
No, sorry. Instead:
increase the PHP memory limit
Title: Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
Post by: Αndré on October 31, 2010, 03:58:28 pm
Blank thumbnail page issue fixed in version 1.2 (attached to initial post).
Title: Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
Post by: Snowcamper on November 02, 2010, 08:24:32 am
Oooooooh perfect!!! Thank you so much!!!  :D :D
Title: Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
Post by: Αndré on November 11, 2010, 01:32:37 pm
Version 1.3 fixes an error message when you try to add all pictures/files twice. Additionally a confirmation message has been added.
Title: Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
Post by: Jeroen07 on March 23, 2011, 09:07:16 pm
Hello,

I used the trick to add a full album to your favorites, so that you can download it. It works great, but I have one album:

I can not download big albums: when they have more then 300 pictures and I add the complete map to favorites, i can not the download the .rar: it only downloads a little .rar file from 200 bytes with nothing in it...

Title: Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
Post by: Αndré on March 24, 2011, 08:59:32 am
That's not related to this plugin. Please try the solution from that thread (http://forum.coppermine-gallery.net/index.php/topic,70627.msg345566.html#msg345566). If you still have problems please start a new thread in the appropriate board.
Title: Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
Post by: Jeroen07 on March 24, 2011, 08:47:26 pm
That's not related to this plugin. Please try the solution from that thread (http://forum.coppermine-gallery.net/index.php/topic,70627.msg345566.html#msg345566). If you still have problems please start a new thread in the appropriate board.

That works. Thanks for the great support!
Title: Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
Post by: pols1337 on January 14, 2012, 03:01:34 am
Dear Andre,

I've successfully installed this plug-in.  However, the icon to add album to favorite does not appear for me on my customized "i-feel-dirty" theme.  It does show on the default "curve" and "dark velvet" theme, so I'm kind of confused.  Other plug-ins, such as the icon to remove all pictures from favorites, work correctly.

See screenshots.

universeofmen.com/gallery/  -- NSFW
test256
oxdeadbeef16

Can you advise?

pols1337
Title: Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
Post by: Αndré on January 18, 2012, 02:15:23 pm
The table header is different, so we have to adjust the regex pattern.

Open codebase.php, find
Code: [Select]
(<td style="vertical-align:top" class="statlink">.*<h2>)and replace with
Code: [Select]
(<td width="100%" class="statlink">.*<h2>)(not tested).
Title: Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
Post by: pols1337 on January 18, 2012, 10:00:11 pm
This works.  Thanks
Title: Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
Post by: pols1337 on January 25, 2012, 12:58:21 am
Hi Andre,

Suggestion: you should probably remove the icon "Add all pictures from album" when you are already in My Favorites.

Otherwise, you are adding your favorite pictures to favorites again! 

See picture.

pols1337 

Title: Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
Post by: Αndré on January 25, 2012, 09:03:00 am
I wasn't able to reproduce that behavior in my gallery, but this should fix that issue for you. Open codebase.php, find
Code: [Select]
$superCage = Inspekt::makeSuperCage();and below, add
Code: [Select]
    if (!$superCage->get->getInt('album')) {
        return $html;
    }

Please report if that works, so I can release a new version.
Title: Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
Post by: pols1337 on January 26, 2012, 02:43:50 am
Yes, it works.  This is what my final code looks like:

Code: [Select]
function album_addfav_html($html) {
    $superCage = Inspekt::makeSuperCage();
    if (!$superCage->get->getInt('album')) {
        return $html;
    }

See attached for "before" and "after" picture from My Favorites.
Title: Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
Post by: Αndré on January 26, 2012, 10:59:54 am
Version 1.4 (attached to initial post) fixes the issue pols1337 reported.