| Author |
Message |
nam

Joined: 23 Dec 2006 Posts: 141
|
|
impreovement needed in image uploader |
|
I think the image manager needs some improvements:
- When you upload an image but anther image with the same file name is there, it does not notify and just replaces the images. It should show a message and stop such problem.
- I prefer to have all the images of all the users in the same folder, but there is a problem, that anyone can remove/rename images even if they are uploaded by the administrator. This is dangerous and I want that only administaor could remove images, or others could delete the images which uploaded by themselves.
|
|
| Mon Sep 29, 2008 1:04 am |
|
 |
Guest
|
|
|
Please login to hide the ads.
|
|
|
|
 |
nam

Joined: 23 Dec 2006 Posts: 141
|
|
|
|
Still waiting for an answer from someone.
|
|
| Sun Oct 05, 2008 6:32 pm |
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2857 Location: Germany |
|
|
|
1. Change this:
 |  | if ((file_exists($folder.'/'.$image) and $overwrite) or $allowed_upload){ |
to this:
 |  | if ($allowed_upload){
if(file_exists($folder.'/'.$image) and !$overwrite){exit($image.' already exists.');} |
2. Change this:
 |  | if ($member['level'] > 2 and ($action == 'remove' or $action == 'rename')){
$action = '';
} |
to this:
 |  | if ($member['level'] > 1 and ($action == 'remove' or $action == 'rename')){
$action = '';
} |
|
|
| Thu Oct 09, 2008 5:38 pm |
|
 |
nam

Joined: 23 Dec 2006 Posts: 141
|
|
|
|
Thank you very much.
Problem one is over.
But the second problem is although somehow solved, but not in a nice way, because still a writer can see the "remove", "rename", "move to" text buttons but when click on them, nothing show up.
Either these buttons should not be shown to users who do not have permission to use, or at least a message should be displayed saying they are not authorized to do so.
|
|
| Thu Oct 09, 2008 10:31 pm |
|
 |
nam

Joined: 23 Dec 2006 Posts: 141
|
|
|
|
I played a bit more and discovered more problems with your code:
- Now every file you upload (even if it does not exist on the server) the message ". already exists." is shown, although actaully is uploaded.
- Now when you upload more than one image at once, nothing will be uploaded if only one file among them is already exist.
|
|
| Thu Oct 09, 2008 10:49 pm |
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2857 Location: Germany |
|
|
|
I can understand you. But unfortunately, I don't have the time to modify the script until you are completely satisfied.
To only show the button to the admin do it like this:
 |  | <?php
if($member['level'] == 1){ //You can change the number: 1 = Admin, 2 = Editor, 3 = Writer, 4 = Commenter
?>
Here comes the button code.
<?php
}
?> |
The buttons are around line 630.
|
|
| Fri Oct 10, 2008 6:57 pm |
|
 |
nam

Joined: 23 Dec 2006 Posts: 141
|
|
|
|
Thanks, I will try,
But what about this problem:
- Now every file I upload (even if it does not exist on the server) the message ". already exists." is shown, although actaully it is uploaded.
|
|
| Fri Oct 10, 2008 9:55 pm |
|
 |
nam

Joined: 23 Dec 2006 Posts: 141
|
|
|
|
 |  |
- Now every file I upload (even if it does not already exist on the server) the message ". already exists." is shown, although actaully it is uploaded. |
I am still unable to solve this problem which is very annoying. Anyone can help please?
|
|
| Tue Oct 14, 2008 5:24 pm |
|
 |
nam

Joined: 23 Dec 2006 Posts: 141
|
|
|
|
Dear FI-DD, may I have your attention to this problem? I think there is a small problem which I can't figure out from your code.
 |  |  |  |
- Now every file I upload (even if it does not already exist on the server) the message ". already exists." is shown, although actaully it is uploaded. |
I am still unable to solve this problem which is very annoying. Anyone can help please? |
|
|
| Thu Oct 16, 2008 7:59 pm |
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2857 Location: Germany |
|
|
|
You already have my attention for the last 45 minutes.
It seems to be a bigger problem because I'm not able to solve it. I'm afraid you have to change it back as it was before. Sorry.
|
|
| Thu Oct 16, 2008 8:07 pm |
|
 |
nam

Joined: 23 Dec 2006 Posts: 141
|
|
|
|
 |  | You already have my attention for the last 45 minutes.
It seems to be a bigger problem because I'm not able to solve it. I'm afraid you have to change it back as it was before. Sorry. |
Thank you very much for your time and attention. I will go with it, no problem if the message is displayed each time I upload an image.
|
|
| Thu Oct 16, 2008 8:23 pm |
|
 |
|