2012-09-07, 08:39:06
I don't know if anyone has documented this yet, but this is how I almost successfully changed the admin code to accept a new "upload" directory. I say almost because I haven't really done an extensive test, but everything works so far. Using the changes below, I am able to add/edit/delete directories, upload/delete files, and use the file browser feature of the WYSIWYG system.
If this is truly all that was needed to be done (again, I haven't tested it extensively), then some simple changes to the code in the next release can give people the opportunity to change their uploads directory more easily. It would be nice to simply use the GSDATAUPLOADPATH definition.
NOTE: I'm changing the upload directory from uploads to public in GS version 3.1.2.
IN admin/inc/common.php
IN admin/upload.php
IN admin/image.php
IN admin/filebrowser.php
NOTE
The substr changes relate to the length of the directory name. Uploads has 7 letters, public has 6 letters (so 16-1=15).
If this is truly all that was needed to be done (again, I haven't tested it extensively), then some simple changes to the code in the next release can give people the opportunity to change their uploads directory more easily. It would be nice to simply use the GSDATAUPLOADPATH definition.
NOTE: I'm changing the upload directory from uploads to public in GS version 3.1.2.
IN admin/inc/common.php
- LINE 52: define('GSDATAUPLOADPATH', GSROOTPATH. 'data/public/');
IN admin/upload.php
- LINE 20: $path = tsl("../data/public/".$path);
- LINE 24: $path = "../data/public/";
- LINE 64: ... <a href="'. $SITEURL .'data/public/'.$subFolder.$base.'">'. $SITEURL .'data/public/'.$subFolder.$base.'</a>';
- LINE 196: echo '<div class="h5 clearfix"><div class="crumbs">/ <a href="upload.php">public</a> / ';
- LINE 236: $adm = substr($path . $upload['name'] , 15); // used to be 16
IN admin/image.php
- LINE 25: $src_folder = '../data/public/';
- LINE 73: ... <?php echo tsl($SITEURL) .'data/public/'. $subPath. $src; ?> ...
- LINE 77: ... <?php echo tsl($SITEURL) .'data/public/'. $subPath. $src; ?> ...
- LINE 78: ... <?php echo tsl($SITEURL) .'data/public/'. $subPath. $src; ?> ...
- LINE 81: ... <?php echo tsl($SITEURL) .'data/public/'. $subPath. $src; ?> ...
IN admin/filebrowser.php
- LINE 18: $path = (isset($_GET['path'])) ? "../data/public/".$_GET['path'] : "../data/public/";
- LINE 27: $fullPath = $sitepath . "data/public/";
- LINE 129: $adm = substr($path . $upload['name'] , 15); // used to be 16
NOTE
The substr changes relate to the length of the directory name. Uploads has 7 letters, public has 6 letters (so 16-1=15).