XP Publisher Wizard creating some weird directory names... - Page 2 XP Publisher Wizard creating some weird directory names... - Page 2
 

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

XP Publisher Wizard creating some weird directory names...

Started by jeeplaw, October 27, 2003, 11:52:13 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bruz

Quote from: "wormie_dk"Its to reduce number of images pr. folder.

I have modified my own xp_publish as follows:
line 756:

    if (USER_ID && !defined('SILLY_SAFE_MODE')) {
        if (USER_IS_ADMIN && ($category != (USER_ID + FIRST_USER_CAT))) {
            $filepath = 'wpw-' . $album;
        } else {
            $filepath = $CONFIG['userpics'] . (USER_ID + FIRST_USER_CAT);
        }
        $dest_dir = $CONFIG['fullpath'] . $filepath;

The thing changed is:  $filepath = 'wpw-' . $album;

Works fine on my host and creates dirs called wpw-albumnumber

Hi wormie_dk,
this works fine for me, but I'd like to have the album name instead of the album number - any idea how to get this?
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.kingbruz.de%2FFotos%2Fsignatur_cpg.php&hash=b7bf1fbae41c2d8c534416d10d32fe51619697d7)

get your statistik-hack here

wormie_dk

I don't have time to look into it right now but if you know a little about mysql and php you should look at the xp publish file around line 741

        $result = db_query("SELECT category FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid='$album' and category = '" . (USER_ID + FIRST_USER_CAT) . "'");
        if (mysql_num_rows($result) == 0) simple_die(ERROR, $lang_db_input_php['unknown_album'], __FILE__, __LINE__);
        $row = mysql_fetch_array($result);
        mysql_free_result($result);
        $category = $row['category'];

The name of the album should be somwhere in the $row variable and you can use this instead of $album

Gonzo

Even if you initially get filesystem names perfectly aligned with album names, renaming albums or moving files between albums will get you out of sync right away.