forum.coppermine-gallery.net

Support => Older/other versions => cpg1.2 Standalone Support => Topic started by: GGallery on June 10, 2004, 01:02:54 am

Title: /userpics/userid => /userpics/mod/userid
Post by: GGallery on June 10, 2004, 01:02:54 am
Hi, I am trying to change the userpic directory layout from /userpics/xxxxx to /userpics/yyy/xxxxxx with yyy = userid % 1000
so I can handle some 300k+ users without having the filesystem slowing everything down

in db_input.php I found:

        // Pictures are moved in a directory named 10000 + USER_IDM
        if (USER_ID && !defined('SILLY_SAFE_MODE')) {M
            $filepath = $CONFIG['userpics'] . (USER_ID + FIRST_USER_CAT); //////// <=== modify this
            $dest_dir = $CONFIG['fullpath'] . $filepath;M
            if (!is_dir($dest_dir)) {M
                mkdir($dest_dir, octdec($CONFIG['default_dir_mode']));M

Is this the only code that I would have to modify? (I'd modify it to :   
            $filepath = $CONFIG['userpics'] . (USER_ID + FIRST_USER_CAT) % 1000 . '/' .  (USER_ID + FIRST_USER_CAT)
;
 
Title: Re: /userpics/userid => /userpics/mod/userid
Post by: hyperion on June 10, 2004, 01:54:33 am
Yes, but the code repeats in some other locations depending on the version you are using.  Check upload.php and xp_publisher.php, too.

When you finish making all your modifications, could you post a list of the changes? It would be nice to see what you suggest for optimization in heavy use environments.    
Title: Re: /userpics/userid => /userpics/mod/userid
Post by: GGallery on June 10, 2004, 02:31:37 am
thx for the quick reply... yeah I am marking all my changes already and will make a diff later and explain the changes.

coppermines code isexcellent and I enjoy hacking thru it so far ;)