Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Change default upload folder
#1
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.
Reply
#2
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
|--

Das deutschsprachige GetSimple-(Unter-)Forum:   http://get-simple.info/forums/forumdisplay.php?fid=18
Reply
#3
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!
Reply
#4
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 = '';
}
Reply
#5
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.
Reply
#6
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
  • 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).
Reply
#7
Thanks for that.

Is there any reason why the upload path is hard coded and not using GSDATAUPLOADPATH ?
Reply
#8
It does in 3.4
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#9
Big Grin 
(2017-12-09, 00:37:28)shawn_a Wrote: It does in 3.4

Thanks Shawn, I had a play around with it last night and almost got there! [Image: biggrin.gif]

But I can wait for 3.4.
Reply
#10
Very interested in changing the default download folder
Is getsimple 3.4 still in development as of March 2024 ?
there is a version 3.3.18 php8 => https://getsimplecms.ru/
what happens to Lead Developer @Shawn_a ?
Reply
#11
(2024-03-07, 02:45:44)jjancel Wrote: Very interested in changing the default download folder
Is getsimple 3.4 still in development as of March 2024 ?
there is a version 3.3.18 php8 => https://getsimplecms.ru/
what happens to Lead Developer @Shawn_a ?

I can not confirm, but I believe Shawn had to step away from dev. do to health issues. No word if or when he will be returning.
Both branches v3.3.16 & v3.4 were last updated in 2020 some time.

The latest version posted on the RU site, is a recent version that @multicolor and myself have been developing to provide compatibility with the latest versions of PHP, as well as new features, added responsive admin and frontend templates, as well as a new repo with plugins that have been tested to work on the lastet php. The latest version at the time of posting this is 3.3.19.1, you can find more info here: https://getsimple-ce.ovh/ or by visiting the GitHub page.

Regarding the download folder, I have never needed to look at this before, so I dont have an answer for you.


GS Community Edition with php8.x compatibility, new features and much more!  Support Me


Reply
#12
thank you for your reply
I'm looking for a plugin to download media into subfolders
either by date or by page URL
a bit like Worpress
because I have more than 500 pages with 2000 images
in a single folder it's a disaster to manage
Reply
#13
You know you can manually make folders via the Files tab, right? Wink

I dont know wordpress, but maybe it would create folder based on page slug? Because there could more pages with uploads o the same day.

I will think about this and see if there is an easy solution. Maybe there is a ckeditor plugin already.


GS Community Edition with php8.x compatibility, new features and much more!  Support Me


Reply
#14
Good morning
I have just developed a "Featured_Image" plugin to allow you to attach an image to each page.
Saving a selected image is only possible on an already existing page because the page link is used to create a subfolder that will contain the image.
The image will be renamed "featured_image.jpg" and copied to a subfolder named with the page's "url" link.

How can I share it with the GetSimple community?
If you find an error contact me!


Attached Files
.zip   featured_image.zip (Size: 85.81 KB / Downloads: 1)
Reply
#15
Hello
I have just developed a Regenerate Thumbnails plugin to allow you to regenerate all thumbnails of all uploaded images in your data/downloads folder and subfolder.
This is useful in situations such as:
The thumbnail size has changed and you want previous uploads to have a thumbnail of this size.
You've moved to a new GetSimple theme that uses thumbnail images of different sizes.
To free up space on the server, you can delete old, unused thumbnails from the data/thumbs folder and subfolder.
How can I share it with the GetSimple community?
If you find an error contact me!


http://get-simple.info/forums/showthread...Thumbnails
Reply
#16
@jjancel
Super! Thanks for your contribution.
I will try to test these tomorrow if I can and add them to the CE downloads page as soon as I can.


GS Community Edition with php8.x compatibility, new features and much more!  Support Me


Reply
#17
(2024-04-29, 05:41:50)jjancel Wrote: How can I share it with the GetSimple community?
If you find an error contact me!

If you go to the "Add-Ons" page, in the sidebar on the right, just above the search field, you will find two options, Manage Your Files & Add a New File. Those will let you upload your new plugins to this site and add some info about them.


GS Community Edition with php8.x compatibility, new features and much more!  Support Me


Reply
#18
(2024-04-29, 05:47:24)jjancel Wrote: Hello
I have just developed a Regenerate Thumbnails plugin to allow you to regenerate all thumbnails of all uploaded images in your data/downloads folder and subfolder.
This is useful in situations such as:
The thumbnail size has changed and you want previous uploads to have a thumbnail of this size.
You've moved to a new GetSimple theme that uses thumbnail images of different sizes.
To free up space on the server, you can delete old, unused thumbnails from the data/thumbs folder and subfolder.
How can I share it with the GetSimple community?
If you find an error contact me!


http://get-simple.info/forums/showthread...Thumbnails

I made a very small change in your Regenerate_Thumbnails plugin to also display the image after...


Attached Files
.zip   regenerate_thumbnails.zip (Size: 1.45 KB / Downloads: 1)


GS Community Edition with php8.x compatibility, new features and much more!  Support Me


Reply
#19
great i was wondering how to use fancybox
thank you for your improvement
I'm going to see how to use it in the "Featured Image" plugin
because for the moment I use "Lightbox plugin" with "I18N_Special_Pages".
Reply
#20
(2024-04-29, 19:51:03)jjancel Wrote: great i was wondering how to use fancybox
thank you for your improvement
I'm going to see how to use it in the "Featured Image" plugin
because for the moment I use "Lightbox plugin" with "I18N_Special_Pages".

ok it doesn't work on frontend
If someone has an idea !
THANK
Reply
#21
Can you post a link or some code. Not sure how you are trying to implement this.
I am guessing you are talking about using lightbox on the frontend?
I have not looked at "Featured Image" yet.
Are you adding jquery and lightbox to the site template?

All though it does not create its own folders for images, I use i18n Custom Fields to manage main images for pages.


[Image: a3a5fca8-c964-4bd5-807f-956e2e8c277c]


GS Community Edition with php8.x compatibility, new features and much more!  Support Me


Reply




Users browsing this thread: 1 Guest(s)