Advanced search  

News:

cpg1.5.46 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter recently discovered vulnerabilities. It is important that all users who run version cpg1.5.44 or older update to this latest version as soon as possible.
[more]

Pages: [1] 2   Go Down

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

0 Members and 1 Guest are viewing this topic.

Αndré

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

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, 11:01:11 AM by Joachim Müller »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • 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: 15277
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
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 152
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
http://www.mess-hall.co.uk/
Gallery, blog/news and PS3 gaming forum

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15277
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: 15277
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
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 152
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
http://www.mess-hall.co.uk/
Gallery, blog/news and PS3 gaming forum

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15277
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, 03: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: 15277
Re: Add all pictures/files from a particular album to your favorites
« Reply #11 on: March 01, 2010, 04: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, 04: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: 15277
Re: Add all pictures/files from a particular album to your favorites
« Reply #13 on: March 01, 2010, 04: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, 05: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: 15277
Re: Add all pictures/files from a particular album to your favorites
« Reply #15 on: March 01, 2010, 05: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, 06: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: 15277
Re: Add all pictures/files from a particular album to your favorites
« Reply #17 on: March 01, 2010, 06: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, 06: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: 15277
Re: Add all pictures/files from a particular album to your favorites
« Reply #19 on: March 02, 2010, 09: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.087 seconds with 21 queries.