datiswous
Member
Posts: 299
Joined: Feb 2011
|
Change default upload folder
I think it would be nice if users would be able to specify the upload folder. If users have multiple sites under one domain, it would be handy to have one folder for all their images, pdf's, etc in a different place.
|
|
|
|
Connie
Super Moderator
Posts: 2,686
Joined: Feb 2011
|
Change default upload folder
GetSimple has all a CMS needs and nothing a CMS does not need (generally) ;=)
I think this suggestion will produce a lot of problems with folder permissions etc., I can already imagine the posts here in the forum, asking for help....
Cheers, Connie
|--
Die deutsche GetSimple-Webseite: http://www.Get-Simple.de = the german Get-Simple-Website!
Das deutschsprachige GetSimple-(Unter-)Forum: http://get-simple.info/forums/forumdisplay.php?fid=18
|
|
|
|
ccagle8
Administrator
Posts: 1,847
Joined: Aug 2009
|
Change default upload folder
i haven't tested it, but you should be able to set the define() variable in /admin/inc/common.php to a specific folder. If that works, we can maybe setup a gsconfig option to set an alternative path (just like we did with the /admin/ folder')
- Chris
Thanks for using GetSimple! - Download
Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
|
|
|
|
datiswous
Member
Posts: 299
Joined: Feb 2011
|
Change default upload folder
ccagle8 wrote:i haven't tested it, but you should be able to set the define() variable in /admin/inc/common.php to a specific folder. If that works, we can maybe setup a gsconfig option to set an alternative path (just like we did with the /admin/ folder')
It didn't work but the following code in the upload.php is the cause (I assume).
Code:
if (isset($_GET['path'])) {
$path = str_replace('../','', $_GET['path']);
$path = tsl("../data/uploads/".$path);
$subPath = str_replace('../','', $_GET['path']);
$subFolder = tsl($subPath);
} else {
$path = "../data/uploads/";
$subPath = '';
$subFolder = '';
}
(This post was last modified: 2012-04-02 10:14:15 by netmaster.)
|
|
|
|
benrusso
Junior Member
Posts: 17
Joined: Jan 2012
|
Change default upload folder
Has there been any progress in formally adopting this new feature?
I'd like to change my upload folder, but would like to make sure GS won't throw errors back (as tested by datiswous a year ago). Has anyone else toyed with their upload destinations? OR has GS included something in an update?
Thanks.
|
|
|
|
benrusso
Junior Member
Posts: 17
Joined: Jan 2012
|
Change default upload folder
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
[list=*]
[*]LINE 52: define('GSDATAUPLOADPATH', GSROOTPATH. 'data/public/');[/*]
[/list]
IN admin/upload.php
[list=*]
[*]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[/*]
[/list]
IN admin/image.php
[list=*]
[*]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; ?> ...[/*]
[/list]
IN admin/filebrowser.php
[list=*]
[*]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[/*]
[/list]
NOTE
The substr changes relate to the length of the directory name. Uploads has 7 letters, public has 6 letters (so 16-1=15).
|
|
|
|