forum.coppermine-gallery.net

No Support => Modifications/Add-Ons/Hacks => Mods: Uploading => Topic started by: atpeace on December 23, 2005, 11:15:45 am

Title: MOD : Last album uploaded to auto select
Post by: atpeace on December 23, 2005, 11:15:45 am
Hi,

Added some small code to auto select the last album uploaded to.

In upload.php search for :

Code: [Select]
    $sel_album = isset($_GET['album']) ? $_GET['album'] : 0;
Add below :

Code: [Select]
    //if no album is preselected & user is logged in check dB for last picture upload and set dropdown var to found album
    if (($sel_album == 0) && USER_ID) {
        $result = cpg_db_query("SELECT aid FROM {$CONFIG['TABLE_PICTURES']} WHERE owner_id = " . USER_ID . " ORDER BY pid DESC LIMIT 1");
if (mysql_num_rows($result)) {
            $row = mysql_fetch_array($result);
            $sel_album = $row['aid'];
        }
        mysql_free_result($result);
    }
never coded any php before if there is something horrible here plz change / nuke :)
Title: Re: MOD : Last album uploaded to auto select
Post by: LilAngel on January 02, 2006, 03:33:24 pm
Works like a charm, tested on 1.4.2 :)
Title: Re: MOD : Last album uploaded to auto select
Post by: joeboxer on November 03, 2006, 05:21:35 am
Glad I found this fix.

But I'm surprised that this feature/option has not been built into 1.4.

Joe
Title: Re: MOD : Last album uploaded to auto select
Post by: tmcdos on December 02, 2006, 09:00:15 pm
You can also change $_GET to be $_REQUEST - does not make harm ...
Title: Re: MOD : Last album uploaded to auto select
Post by: Joachim Müller on December 03, 2006, 12:10:27 pm
@joeboxer: this mod has been created after cpg1.4.x, so how could it possibly have gone into cpg1.4.x. There's no use ranting about missing features here anyway.

@tmcdos: as suggested on the other thread you started, it does make a difference what var you use. Please do not spread this piece of advice, as it is wrong.
Title: V1.4.18 Last album uploaded to auto select
Post by: beber38 on April 23, 2008, 02:24:47 pm
Hello,

I have update my coppermine version from 1.4.14 to 1.4.18.

Before I used this very pratical "add-on" for automatic select album with multiple upload :

http://forum.coppermine-gallery.net/index.php/topic,25456.0.html (http://forum.coppermine-gallery.net/index.php/topic,25456.0.html)

But it's not working with the new version.

An idea ?

** Since this is not a plugin question your post is merged with the thread of the mod you are having a problem with.
Title: Re: MOD : Last album uploaded to auto select
Post by: beber38 on May 05, 2008, 02:19:51 pm
Nobody know how make it ?
Title: Re: MOD : Last album uploaded to auto select
Post by: Iced Coffee on August 23, 2008, 10:39:48 am
Why isn't this function in the new version? I think this should be useful, right?

I tried with cpg 1.4.18 but it does not work.
Title: Re: MOD : Last album uploaded to auto select
Post by: Joachim Müller on August 24, 2008, 04:32:09 pm
this mod has been created after cpg1.4.x, so how could it possibly have gone into cpg1.4.x. There's no use ranting about missing features here anyway.
New features do not go into maintenance releases.