coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 permissions => Topic started by: lucasorion on February 28, 2008, 06:12:16 AM

Title: [Solved]: New user, created albums, but can't modify them
Post by: lucasorion on February 28, 2008, 06:12:16 AM
I setup some albums recently, and decided I wanted to rename one, and delete another. When I try to do this, I get "Internal PHP Processing Error (#99911 - q:11) in /usr/home/orionneb/public_html/albums/delete.php"
Can someone help? I did find one mention of it being a problem possibly caused by the host's spam blocking settings misinterpreting the script, but I was able to modify my albums a couple days ago, when I renamed and deleted a few. Though I did that before they had files in them, if that makes any difference.

Thanks
Title: Re: New user, created albums, but can't modify them
Post by: Joachim Müller on February 28, 2008, 08:16:50 AM
Post a link to your gallery for a start.
Title: Re: New user, created albums, but can't modify them
Post by: lucasorion on February 28, 2008, 01:32:46 PM
http://www.orion-nebula.com/albums/index.php
Title: Re: New user, created albums, but can't modify them
Post by: Nibbler on February 28, 2008, 01:55:40 PM
Probably the spam blocker you mention. The code uses an @ symbol, so it might think 123@456 is an email address. This kicked in when you created more than 10 albums. You could try changing the code to use a different symbol or switch to a more sensible webhost.
Title: Re: New user, created albums, but can't modify them
Post by: lucasorion on February 28, 2008, 09:31:37 PM
so if I search the code of a particular php page (looks like delete.php) and replace that character with another one, I can expect it to still work?
I just signed on with this host, and don't want to switch already if this turns out to be the only hiccup.
Title: Re: New user, created albums, but can't modify them
Post by: Nibbler on February 28, 2008, 09:38:25 PM
You can't blindly change the code, that will break it. The parts to change are here:

delete.php


function parse_orig_sort_order($value)
{
    if (!preg_match("/(\d+)@(\d+)/", $value, $matches))
        return false;

    return array('aid' => (int)$matches[1],
        'pos' => (int)$matches[2],
        );
}



               function parse_pic_orig_sort_order($value)
               {
                       if (!preg_match("/(\d+)@(\d+)/", $value, $matches))
                               return false;

                       return array(
                               'aid'   => (int)$matches[1],
                               'pos'   => (int)$matches[2],
                       );
               }


albmgr.php


if (count ($rowset) > 0) foreach ($rowset as $album) {
    $sort_order .= $album['aid'] . '@' . ($i++) . ',';
}


picmgr.php


   if (count ($rowset) > 0) foreach ($rowset as $picture){
      $sort_order .= $picture['pid'].'@'.($i++).',';
   }


Try changing each @ to maybe a colon.

You'll need to change them any time you update Coppermine.
Title: Re: New user, created albums, but can't modify them
Post by: Joachim Müller on February 29, 2008, 07:47:31 AM
Better ask your host to disable this silly feature.
Title: Re: New user, created albums, but can't modify them
Post by: lucasorion on February 29, 2008, 12:45:39 PM
thanks for the help, it worked