Badly needed: solution for CPG with large # of albums and cats Badly needed: solution for CPG with large # of albums and cats
 

News:

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

Main Menu

Badly needed: solution for CPG with large # of albums and cats

Started by DefenceTalk.com, January 19, 2005, 05:30:05 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DefenceTalk.com

I would be willing to pay for this modification, in this thread:

http://forum.coppermine-gallery.net/index.php?topic=11948.0

Quote from: DefenceTalk.com on November 21, 2004, 09:50:42 PM
One of the user's at Defencetalk.com suggested this idea. I don't know if it would be valid or has been requested before but here goes.

I will use my site as an example to keep things in perspective.

Currently, I have this layout:

>MAIN CATOGRY (country / topic based)
>>Sub-category (airforce)
>>>sub-sub-category (fighters)
>>>>cooresponding albums (F-16)

Now, DT has close to 700 albums, some 300 categories. By the time when all is set and done, we will have close to 1000 albums. Thats when trouble comes when someone tries to upload the pictures. Scrolling through that amount of albums isn't fun.

Here is the idea that user suggested when uploading pics....

When you go on the upload page, it should give you atleast different drop down boxes:

Drop down box 1: >MAIN CATOGRY (country / topic based)
Drop down box 2: >>Sub-category (airforce)
Drop Down box 3: >>>sub-sub-category (fighters)
Drop Down box 4: >>>>cooresponding albums (F-16)

When you would select drop down 1, it should populate drop down 2 with sub-categories, when you select a category in drop down 2, it should populate drop down 3 with sub-sub-category, when you select the sub-sub-cat, it should populate the last drop down(#4) with albums that are in there.

I don't know if it makes sense. If not, I do have a html page which demonstrates this idea....  :-\\

Thanks to one of the team members at CPG by suggesting a mod for sorting albums and categories very nicely (all 700 of them :D ) - which DT is currently using to cover come the above issue. Thanks nibbler!



Reasonable price would be great... 40? 50? 75?  :-\\

Anybody?

Thank you

[edit GauGau]
marked thread as "closed" (2005-03-21), because it has been inactive for more than a month. I guess it was solved then. Next time, please either resolve or bump!
[/edit]
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.defencetalk.com%2Fpictures%2Fsignature_cpg.php&hash=c0098ed5314d39beb9e8799c7c8787a9a0353b45)

Nibbler

Replace your form_alb_list_box function in upload.php with this one:

// The function to create the album list drop down.
function form_alb_list_box($text, $name) {
function DrawLevel($id)
{
global $CONFIG;

$level = "level$id";
$levelnext = ($id == 3) ? 'album' : ("level".($id+1));

if ($id == 3)
$query = "SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} where category ={$_POST['level3']}";
elseif ($id == 0)
$query = "SELECT cid, name FROM {$CONFIG['TABLE_CATEGORIES']} where parent =0";
else
$query = "SELECT cid, name FROM {$CONFIG['TABLE_CATEGORIES']} where parent ={$_POST[$level]}";

if (isset($_POST[$level])){

$result = db_query($query);

$out =  "<select name=\"$levelnext\"" . ($id == 3 ? '' : "onchange=\"this.form.submit();\"") . ">\n";

while ($row = mysql_fetch_row($result))
{
$selected = ($_POST[$levelnext] == $row[0]) ? 'selected="selected"' : '';
$out .=  "<option value=".$row[0]." $selected>".$row[1]."</option>\n";
}

$out .= "</select><br />\n\n";
}
return $out;
}

$_POST['level0'] = 0;
$i = 0;
$out = '';
while ($i < 4) $out .= DrawLevel($i++);

echo <<<EOT
    <tr>
        <td class="tableb">
            $text
        </td>
        <td class="tableb" valign="top">
$out
</td>
</tr>
EOT;
}


That should be a start.

DefenceTalk.com

Thanks Nibbler.

I tried that and getting these errors....

Warning: Invalid argument supplied for foreach() in /home/defence/public_html/pictures/upload.php on line 213
  // Cycle through the User albums
   foreach($user_albums_list as $album) {


Warning: Invalid argument supplied for foreach() in /home/defence/public_html/pictures/upload.php on line 223
// Cycle through the public albums
   foreach($public_albums_list as $album)


Fatal error: Call to undefined function: array_csort() in /home/defence/public_html/pictures/upload.php on line 245
// Sort the pulldown options by category and album name
   $listArray = array_csort($listArray,'cat','title');
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.defencetalk.com%2Fpictures%2Fsignature_cpg.php&hash=c0098ed5314d39beb9e8799c7c8787a9a0353b45)

Nibbler

How exactly are you managing to get errors in a part of the code you are supposed to have replaced with this new version ? That code isn't even supposed to be in the file any more !

DefenceTalk.com

whoops, sorry didn't do it correctly. Well, now its correct and its giving me this error:


Fatal error: Cannot redeclare drawlevel() (previously declared in /home/defence/public_html/pictures/upload.php:160) in /home/defence/public_html/pictures/upload.php on line 160

line 160:
Quotefunction DrawLevel($id)

I turned on the debug mode but page cuts off and no debug info is displayed. Javascript errors when selecting category.

thanks
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.defencetalk.com%2Fpictures%2Fsignature_cpg.php&hash=c0098ed5314d39beb9e8799c7c8787a9a0353b45)