Advanced search  

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

Pages: [1] 2   Go Down

Author Topic: Add all pictures/files from a particular album to your favorites  (Read 51441 times)

0 Members and 1 Guest are viewing this topic.

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764

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]
« Last Edit: March 03, 2010, 10:01:11 am by Joachim Müller »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Add all pictures/files from a particular album to your favorites
« Reply #1 on: April 27, 2009, 10:46:02 am »

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

Jens_LA

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
Re: Add all pictures/files from a particular album to your favorites
« Reply #2 on: April 28, 2009, 06:39:27 pm »

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:
Code: [Select]
$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
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Add all pictures/files from a particular album to your favorites
« Reply #3 on: April 28, 2009, 07:13:50 pm »

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

Deus

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 153
    • DJ-Daz
Re: Add all pictures/files from a particular album to your favorites
« Reply #4 on: May 13, 2009, 03:18:47 am »

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.
Logged
https://daz-stuff.uk
DJ tutorials, E-Bikes, Movies and videogames.
(https://daz-stuff.uk/daz/signature.png)

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Add all pictures/files from a particular album to your favorites
« Reply #5 on: May 13, 2009, 08:19:21 am »

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.
Logged

benidorm365

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Add all pictures/files from a particular album to your favorites
« Reply #6 on: May 13, 2009, 08:47:27 pm »

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
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Add all pictures/files from a particular album to your favorites
« Reply #7 on: May 13, 2009, 09:19:03 pm »

The plugin searches for the string:
Code: [Select]
<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.

Also, it's not dependent on a certain theme is it?
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.

Logged

Deus

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 153
    • DJ-Daz
Re: Add all pictures/files from a particular album to your favorites
« Reply #8 on: May 14, 2009, 02:35:55 am »

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
Logged
https://daz-stuff.uk
DJ tutorials, E-Bikes, Movies and videogames.
(https://daz-stuff.uk/daz/signature.png)

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Add all pictures/files from a particular album to your favorites
« Reply #9 on: May 14, 2009, 06:37:50 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.
Logged

peterlustig

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 50
Re: Add all pictures/files from a particular album to your favorites
« Reply #10 on: March 01, 2010, 02:29:38 pm »

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
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Add all pictures/files from a particular album to your favorites
« Reply #11 on: March 01, 2010, 03:00:01 pm »

Please enable debug mode and copy the real error message.
Logged

peterlustig

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 50
Re: Add all pictures/files from a particular album to your favorites
« Reply #12 on: March 01, 2010, 03:20:06 pm »

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!!
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Add all pictures/files from a particular album to your favorites
« Reply #13 on: March 01, 2010, 03:52:14 pm »

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

peterlustig

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 50
Re: Add all pictures/files from a particular album to your favorites
« Reply #14 on: March 01, 2010, 04:08:05 pm »

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Add all pictures/files from a particular album to your favorites
« Reply #15 on: March 01, 2010, 04:21:40 pm »

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

peterlustig

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 50
Re: Add all pictures/files from a particular album to your favorites
« Reply #16 on: March 01, 2010, 05:10:37 pm »

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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Add all pictures/files from a particular album to your favorites
« Reply #17 on: March 01, 2010, 05:46:26 pm »

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)?
Logged

peterlustig

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 50
Re: Add all pictures/files from a particular album to your favorites
« Reply #18 on: March 01, 2010, 05:54:12 pm »

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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Add all pictures/files from a particular album to your favorites
« Reply #19 on: March 02, 2010, 08:56:57 am »

Please open plugins/album_addfav/codebase.php and replace the whole function album_addfav_html with
Code: [Select]
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;
}
Logged
Pages: [1] 2   Go Up
 

Page created in 0.029 seconds with 20 queries.