1
goffy
Development XoopsImageManager
  • 2012/3/22 18:48

  • goffy

  • Just can't stay away

  • Posts: 535

  • Since: 2010/12/27


Hi

I worked a little bit on XoopsImageManager and made following changes:
1) For each categorie you can define a seperate upload-directory (non-existing folders will be created)
2) user can define, whether an uploaded picture will be private or visible for all users with uploadpermission in this category
3) plugin XoopsImageManager for TinyMCE was adopted


Reasons:
- I want clear structure for saving images
- I want know, who loads up an image


Detailed infos about my solution you can find in changelog-file.


Two questions to xoops core team:
1) what do you think about implementing in xoops core?
2) I couldn't solve one problem in XoopsImageManager for TinyMCE: If I insert a picture via XoopsImageManager in the textbox, it will be placed always on the beginning of the text, not on the last position of the cursor. With XoopsCode it works, but I can't see the differences.

The files you can download from
http://naturfreunde-hochburg-ach.at/downloads/hack_xoopsimagemanager.zip

Comments/Suggestions are welcome
Goffy

2
Peekay
Re: Development XoopsImageManager
  • 2012/3/23 9:15

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


Quote:

goffy wrote:

1) ... non-existing folders will be created


I cannot try this myself at present, but will that work with PHP Safe-mode on?

Safe-mode was removed in PHP 5.3, but hosts running earlier versions generally have it switched on. I found it will prevent scripts from creating folders, or it will work and the folder will be owned by Apache so you cannot use it properly.

There's some info on it here.

The image permissions feature sounds a great idea. Does that allow group permissions?
A thread is for life. Not just for Christmas.

3
goffy
Re: Development XoopsImageManager
  • 2012/3/23 13:57

  • goffy

  • Just can't stay away

  • Posts: 535

  • Since: 2010/12/27


Hi Peekay


For creating folders I use:
if(!is_dir($path_uploads)) {
     
mkdir($path_uploads0777);
     
chmod($path_uploads0777);
     
copy(XOOPS_ROOT_PATH."/uploads/index.html"$path_uploads."index.html");
}

As I know, it should work

The permission to handle a category is managed per group (was already in the past).
The permission to handle an image is managed per user (thats new).
Explanation:
1) I create a category "mycat1"
2) I create a group "mygroup1"
3) I give mygroup1 full access right to mycat1

Possibility 1
I (as member of mygroup1) declare a picture as public in mycat1: each user, which is member of mygroup1, has full access (right to see in the list, to edit or to delete) to my picture

Possibility 2
I (as member of mygroup1) declare a picture as private in mycat1: all other users have no access to my picture (also no right to see in the list). Of course, if I use the picture e.g. in an article, everybody can see it.

Possibility 3
To say, I allow other users of mycat1 to see the picture in the list, but to give them no right to edit or delete, is not possible at the moment. If it is wished, that can be implemented

I hope, it is clear now

Any other commetns or suggestions?

Login

Who's Online

230 user(s) are online (158 user(s) are browsing Support Forums)


Members: 0


Guests: 230


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits