Advanced search  

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]

Pages: [1]   Go Down

Author Topic: /userpics/userid => /userpics/mod/userid  (Read 3147 times)

0 Members and 1 Guest are viewing this topic.

GGallery

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 61
/userpics/userid => /userpics/mod/userid
« 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)
;
 
Logged

hyperion

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 1317
  • - retired -
Re: /userpics/userid => /userpics/mod/userid
« Reply #1 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.    
« Last Edit: June 10, 2004, 02:08:06 am by hyperion »
Logged
&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://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.mozilla.org%2Fproducts%2Ffirefox%2Fbuttons%2Fgetfirefox_small.png&hash=9f6d645801cbc882a52f0ee76cfeda02625fc537)

GGallery

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 61
Re: /userpics/userid => /userpics/mod/userid
« Reply #2 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 ;)
Logged
Pages: [1]   Go Up
 

Page created in 0.014 seconds with 18 queries.