Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: /userpics/userid => /userpics/mod/userid  (Read 3145 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

(http://www.mozilla.org/products/firefox/buttons/getfirefox_small.png)

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.017 seconds with 18 queries.