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 for cpg1.5.x  (Read 22640 times)

0 Members and 1 Guest are viewing this topic.

Αndré

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

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

Snowcamper

  • Coppermine newbie
  • Offline Offline
  • Posts: 12

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

jief78

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
« Reply #22 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!
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15415
Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
« Reply #23 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.
Logged

jief78

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
« Reply #24 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
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15415
Re: Add all pictures/files from a particular album to your favorites for cpg1.5.x
« Reply #25 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
Logged

Αndré

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

Blank thumbnail page issue fixed in version 1.2 (attached to initial post).
Logged

Snowcamper

  • Coppermine newbie
  • Offline Offline
  • Posts: 12

Oooooooh perfect!!! Thank you so much!!!  :D :D
Logged

Αndré

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

Version 1.3 fixes an error message when you try to add all pictures/files twice. Additionally a confirmation message has been added.
Logged

Jeroen07

  • Coppermine newbie
  • Offline Offline
  • Posts: 7

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

Logged

Αndré

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

That's not related to this plugin. Please try the solution from that thread. If you still have problems please start a new thread in the appropriate board.
Logged

Jeroen07

  • Coppermine newbie
  • Offline Offline
  • Posts: 7

That's not related to this plugin. Please try the solution from that thread. If you still have problems please start a new thread in the appropriate board.

That works. Thanks for the great support!
Logged

pols1337

  • Coppermine frequent poster
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 240

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
Logged

Αndré

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

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

pols1337

  • Coppermine frequent poster
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 240

This works.  Thanks
Logged

pols1337

  • Coppermine frequent poster
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 240

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 

Logged

Αndré

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

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

pols1337

  • Coppermine frequent poster
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 240

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

Αndré

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

Version 1.4 (attached to initial post) fixes the issue pols1337 reported.
Logged
Pages: 1 [2]   Go Up
 

Page created in 0.04 seconds with 20 queries.