/userpics/userid => /userpics/mod/userid /userpics/userid => /userpics/mod/userid
 

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

/userpics/userid => /userpics/mod/userid

Started by GGallery, June 10, 2004, 01:02:54 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

GGallery

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)
;


hyperion

#1
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.    
&quot;Then, Fletch,&quot; that bright creature said to him, and the voice was very kind, &quot;let&#039;s begin with level flight . . . .&quot;

-Richard Bach, Jonathan Livingston Seagull

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.mozilla.org%2Fproducts%2Ffirefox%2Fbuttons%2Fgetfirefox_small.png&hash=9f6d645801cbc882a52f0ee76cfeda02625fc537)

GGallery

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 ;)