Add all pictures/files from a particular album to your favorites for cpg1.5.x - Page 2 Add all pictures/files from a particular album to your favorites for cpg1.5.x - Page 2
 

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 for cpg1.5.x

Started by Αndré, February 04, 2010, 01:57:44 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Αndré

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

Snowcamper

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!

jief78

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!

Αndré

jief78,
Quote from: Αndré on August 30, 2010, 02:00:13 PM
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:
$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.

jief78

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

Αndré

Quote from: jief78 on September 24, 2010, 12:41:05 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.


Quote from: jief78 on September 24, 2010, 12:41:05 PM
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.


Quote from: jief78 on September 24, 2010, 12:41:05 PM
Can i send you some of my server files to help you helping me?
No, sorry. Instead:
Quote from: Αndré on September 24, 2010, 09:00:13 AM
increase the PHP memory limit

Αndré

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

Snowcamper


Αndré

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

Jeroen07

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


Αndré

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.

Jeroen07

Quote from: Αndré on March 24, 2011, 08:59:32 AM
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!

pols1337

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

Αndré

The table header is different, so we have to adjust the regex pattern.

Open codebase.php, find
(<td style="vertical-align:top" class="statlink">.*<h2>)
and replace with
(<td width="100%" class="statlink">.*<h2>)
(not tested).

pols1337


pols1337

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 


Αndré

I wasn't able to reproduce that behavior in my gallery, but this should fix that issue for you. Open codebase.php, find
$superCage = Inspekt::makeSuperCage();
and below, add
    if (!$superCage->get->getInt('album')) {
        return $html;
    }


Please report if that works, so I can release a new version.

pols1337

Yes, it works.  This is what my final code looks like:

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.

Αndré

Version 1.4 (attached to initial post) fixes the issue pols1337 reported.