Advanced search  

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

Pages: [1]   Go Down

Author Topic: Badly needed: solution for CPG with large # of albums and cats  (Read 5029 times)

0 Members and 1 Guest are viewing this topic.

DefenceTalk.com

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 230
    • http://www.defencetalk.com
Badly needed: solution for CPG with large # of albums and cats
« on: January 19, 2005, 05:30:05 pm »

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

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

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]
[/b]
« Last Edit: March 21, 2005, 08:38:48 am by GauGau »
Logged
(http://www.defencetalk.com/pictures/signature_cpg.php)

Nibbler

  • Guest
Re: Badly needed: solution for CPG with large # of albums and cats
« Reply #1 on: January 19, 2005, 08:19:17 pm »

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

Code: [Select]
// 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.
Logged

DefenceTalk.com

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 230
    • http://www.defencetalk.com
Re: Badly needed: solution for CPG with large # of albums and cats
« Reply #2 on: January 20, 2005, 01:51:30 am »

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
Code: [Select]
  // 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
Code: [Select]
// 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
Code: [Select]
// Sort the pulldown options by category and album name
    $listArray = array_csort($listArray,'cat','title');
Logged
(http://www.defencetalk.com/pictures/signature_cpg.php)

Nibbler

  • Guest
Re: Badly needed: solution for CPG with large # of albums and cats
« Reply #3 on: January 20, 2005, 06:06:44 pm »

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

DefenceTalk.com

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 230
    • http://www.defencetalk.com
Re: Badly needed: solution for CPG with large # of albums and cats
« Reply #4 on: January 21, 2005, 10:41:01 pm »

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:
Quote
function DrawLevel($id)

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

thanks
Logged
(http://www.defencetalk.com/pictures/signature_cpg.php)
Pages: [1]   Go Up
 

Page created in 0.025 seconds with 19 queries.