sNews Forum

Previous sNews versions => sNews 1.5 RC and pre-release => sNews 1.5 RC2 version => Topic started by: mosh on October 21, 2006, 03:52:01 pm

Title: image_folder
Post by: mosh on October 21, 2006, 03:52:01 pm
hey :)
i am doing translation to hebrew for the latest version 1527 rc2.

there is a line missing:
Quote
$l['image_folder'] = 'img';
should it be added or just leave it out ?

thanks 4 all the great work you do :)
Title: image_folder
Post by: Patric Ahlqvist on October 21, 2006, 04:02:07 pm
I'm not exactly sure of why, but you do not need that one... ;) So leave it out.
Title: image_folder
Post by: mosh on October 21, 2006, 05:07:07 pm
cool ty :)
Title: image_folder
Post by: edsil on October 29, 2006, 01:08:32 am
Hi out there!!!
euh, I dont know if this question goes here, but I see tha MO was asking about the missing
$l['image_folder'] = 'img';

So I have a problem about it: when I go to the files settings and want to see the files, I have all kind of files and not just the "img" folder... I mean I have access to all kind of files...
How to arrange this and just to get acces to the "img" folder? :/

Thanks for help!!

PS: I'm using the 1.5 RC2 version :D
Title: image_folder
Post by: Keyrocks on October 29, 2006, 03:33:38 pm
When I downloaded and un-zipped my sNews 1.5.27 RC2 package, I found there were no folders in it for any files, not even an img folder. I assume yours was the same. So you need to create the folders you want in your root directory... the folder in which you installed your package's files. So... it is a matter of creating a folder structure that suits your needs. In my case, I started with:
- images folder - for images only used in the template itself,
- img folder - for images used in articles,
- includes folder - for files that are inserted into an article with the include function button,
- css - for css stylesheets used in addition to the default style.css file
... and so on. All folders in the root directory will be visible to you.
Title: image_folder
Post by: edsil on October 30, 2006, 05:36:05 am
:/ huummm... ok I see... personally I prefer to get access  just to the img folder, cause for now like it is, all images and files are visible, you can click on the css style sheet for exemple... and you can erase it!!! (that could be a terrific accident!!!)
well it is just my opinion, but I think this setting just must show the image folder and/or documents folders (or like you want to call it if you have PDF files and images, etc), because it is a little confuse (and could be dangerous) when you see all this kind of documents... ;)
There is a way to show just ONE and specific folder ???

thanks for your help keyrocks  :)
Title: image_folder
Post by: Keyrocks on October 30, 2006, 03:13:28 pm
Yes, I agree... there is the risk that a person not knowing what is going on there might accidentally mess up or delete an important file. It is not a problem for developers, but this "view all" capacity would be quite confusing to non-savvy clients. We'll need Mika or Luka to tell us how we might go about restricting what gets viewed in this panel.
Title: image_folder
Post by: Mika on October 30, 2006, 05:02:02 pm
This has to be done manually because every hosting company has their own set of default files and folders essential for proper website functioning.

Find function filelist() inside snews.php file, and make changes according to your presonal preferences. Blue text is just an example found on my server
Quote
// FILELIST FUNCTION
function filelist($mode, $path, $depth = 0) {
# by default, ignored enities are cgi-bin, .htaccess, Thumbs.db
/*
add/remove all the folders and/ or files you DON'T want in your file listing (exclusion by name)
note: do not remove those single and double dots at the end of the line
*/
   $ignore = array('cgi-bin', '.htaccess', 'perl', 'ftp', 'awstats', '.', '..', 'Thumbs.db');
# by default, ignored file types are php and html
/*
add/remove all file extensions you DON'T want in your file listing  (exclusion by file type)
*/
   $extension = array('php', 'htm', 'xml', 'xsl', 'css', 'pl', 'html');
...
after you've done editing, file list will hide all the files and folders previously defined
Title: image_folder
Post by: Keyrocks on October 30, 2006, 05:15:53 pm
Thanks Mika. @Edsil - give this a try and see if it works... and let us know how you make out. :)
Title: image_folder
Post by: edsil on October 31, 2006, 07:46:34 am
:D
"I think I'm dumb... or maybe just happy..." (like Kurt Cobain said in one of his songs)
Yeap, after, some kind of 30 minutes I found "the thing" and... IT WORKS!!!!  :D  I'm really happy
It was on the:
$ignore = array('cgi-bin', '.htaccess', 'perl', 'ftp', 'awstats', '.', '..', 'Thumbs.db');

after the 'Thumbs.db' I added other folder names and it works perfect

YOU ROCK MIKA!!!!  ;)

Thanks a lot
Title: image_folder
Post by: Mika on October 31, 2006, 08:03:09 am
:)
Title: image_folder
Post by: edsil on October 31, 2006, 10:08:13 am
HI again  :)
just to say, that now is more easy to get acces to two different folders, for exemple.
One with just images and other one with just documents (kind of PDF files or others).
I really like it  ;)
Title: image_folder
Post by: mininovax on November 28, 2006, 03:58:41 pm
The only problem that I have with the file upload feature is that it is not secure.

I have an image upload function that only allows five different image types. Even renaming it, you cannot change the extension. This is pretty secure for me.

However, with this file upload feature, someone could upload a "NASTY" php code that could potentially wipe out all of your files on your server.

You can upload any type of file with SNEWS, so be warned that you might want to find a way to disable this if your system has more than an administrator running it...