Add all pictures/files from a particular album to your favorites Add all pictures/files from a particular album to your favorites
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Add all pictures/files from a particular album to your favorites

Started by Αndré, April 27, 2009, 08:45:39 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Αndré

Because a user asked in the german support board, if there exists a plugin that can add all pictures from an album to your favorites, I created this small plugin.

It adds a star icon to the thumbnail view title row (next to the album name). When you click on that star, all files of the current album are added to your favorites.


[Edit GauGau 2010-03-03]
This plugin has been added to the subversion repository: http://coppermine.svn.sourceforge.net/viewvc/coppermine/branches/cpg1.4.x/plugins/album_addfav

It has been updated as well to reflect the version checking routines in the plugin manager that are meant to make sure that galleries don't break because of plugins installed that aren't meant for that particular version of the gallery.

Download: https://sourceforge.net/projects/coppermine/files/Plugins/1.4.x/cpg1.4.x_plugin_album-addfav_v1.2.zip/download
[/Edit]

Joachim Müller

Nice one - created a corresponding record on the plugins page and added the file to the downloads section at sf.net.

Jens_LA

Hi,
i've got a little problem with downloading larger zip files (e.g. flv videos). I'd like to custumize the plugin to add only jpg's files to the favourites.
eenemeenemuu already explained that the according code line in album_addfav.php is:
$result = cpg_db_query("SELECT pid FROM {$CONFIG['TABLE_PICTURES']} WHERE aid = {$_GET['album']}");

How do i exactly have to modify the code line to only add jpg files to the favourites?

Thanks a lot!

Jens

Αndré

In album_addfav.php, change
$result = cpg_db_query("SELECT pid FROM {$CONFIG['TABLE_PICTURES']} WHERE aid = {$_GET['album']}");
to
$result = cpg_db_query("SELECT pid FROM {$CONFIG['TABLE_PICTURES']} WHERE aid = {$_GET['album']} AND filename LIKE '%.jpg'");

Deus

eenemeenemuu I cant see any stars, can you post a screenshot of where the star is supposed to appear please?
Also, it's not dependent on a certain theme is it?

Thank you,
Darron.
https://daz-stuff.uk
DJ tutorials, E-Bikes, Movies and videogames.
(https://daz-stuff.uk/daz/signature.png)

Αndré

Please review my first post. There is a screenshot and version 1.1 attached.

If it still doesn't work for your theme, please post a link to your gallery.

benidorm365

i have the same problem....ive installed the plugin, but nothing has come up

can someone please tell me what im doing wrong!!
my website is....
www.benidorm365.com

thanks

Αndré

The plugin searches for the string:
<td width="100%" class="statlink">*</td>
(which encloses be the album name as seen in the screenshot) and add the star behind the album name.

Quote from: Deus on May 13, 2009, 03:18:47 AM
Also, it's not dependent on a certain theme is it?
Quote from: benidorm365 on May 13, 2009, 08:47:27 PM
my website is....
www.benidorm365.com
It works for at least all standard themes. If I should work with your custom theme, I need access to the thumbnail page to have a look of the html output.


Deus

it worked this time, thank you.
Although I did have to create an album in plugins called /album_addfav and copy all the plugin files into there.

;D
https://daz-stuff.uk
DJ tutorials, E-Bikes, Movies and videogames.
(https://daz-stuff.uk/daz/signature.png)

Αndré

Quote from: Deus on May 14, 2009, 02:35:55 AM
Although I did have to create an album in plugins called /album_addfav and copy all the plugin files into there.
Sorry, my fault. Plugin package updated in first post.

peterlustig

Hi, I can't get this plugin to run on my page (www.familie-delling.de/pict; use ID: "temp", PW. "nopwd" to log in).
When trying to install, I just get the error message "There was an error while processing a database query." Any idea what this could be?

Thanks a lot for your help!

Best, Peter

Αndré

Please enable debug mode and copy the real error message.

peterlustig

Wow -- thanks a lot for the quick reaction!

ok, mayby I have to go for the longer story. I already had the plugin installed once, but whenever clicking on an album afterwards I just got a totally blank page as result. That's why I de-installed the plugin.
Now I when wanted to re-install, I had the problem described above, and thanks to your hint of using debug mode, I got the following error message:

While executing query "insert into cpg14x_plugins (name, path,priority)  values ("Album Addfav","album_addfav2",6);" on 0

mySQL error: Doppelter Eintrag 'Album Addfav' f�r Schl�ssel 'name'

[the German mySQL error says that the key in 'Album Addfav' is doubled] Thus, I assumed that the previous un-install wasn't well completed, so I deleted the folder 'album_addfav' in the \plugin subdir and re-copied it. Now the plugin could be installed, at least the plugin-mgr says so, but I have the known problem blank albums again. I even don't get any output of the debugging console on those blank pages -- maybe you could have a look at it yourself?

Vielen Dank bereits für Deine Hilfe!!

Αndré

Please delete the appropriate database entry. Now you should be able to install the plugin.

peterlustig

sorry, I am a perfect newbie. Which entry would I have to erase? And how can I do this?

Αndré

You have to use a database management tool like phpMyAdmin or MySQLDumper. Then go to the table 'plugins' and erase the Album Addfav row.

peterlustig

ok, I did so, deleted the Album addfav row via myPHPadmin, uninstalled addfav and then re-installed -- and the same problem is persisting, I get blank white pages when clicking on an album after reinstall.

Αndré

It's not possible to uninstall a plugin that has been deleted in the database. After deleting the database record, this plugin is automatically uninstalled.

Anyway, I assume you are doing something wrong. The plugin works without any problems in my gallery. Do you use some other plugins? How do you upload the plugin (http, ftp)?

peterlustig

sorry, should have been more exact in my description: had the "addfav"-line deleted via myPHP and then deleted the "album_addfav" directory via ftp.
then uploaded again (a newly unzipped version of the directory "album_addfav") to the plugin folder, installed via pluginmanager, and voila, blank pages are back.

yes, I use some other plugins, but the problem persist also after uninstalling ALL plugins, and only having addfav installed.

Αndré

Please open plugins/album_addfav/codebase.php and replace the whole function album_addfav_html with
function album_addfav_html($html) {
    $html = str_replace('<td class="sortorder_cell">', '<td><a href="index.php?file=album_addfav/album_addfav&album='.$_GET['album'].'" title="Add album to favorites"><img src="plugins/album_addfav/favorites.png" border="0" /></a>&emsp;</td><td class="sortorder_cell">', $html, $count);
    return $html;
}