Elxis CMS Forum

Support => General => Topic started by: yiannos on February 05, 2007, 15:15:56

Title: [SOLVED] Images in articles added by users
Post by: yiannos on February 05, 2007, 15:15:56
Hi ALL,

I am developing a site where the content will be contributed by a user. I have designated this user as an Editor in user management.

This user will be writing articles that contain images. The best way for images to appear is to upload them in the media manager and insert them as {mosimage} tags - right?

How is the editor user going to do this? What permissions must he have? Should I put a link in the User Menu to assist them not to have to login to the backend (they cant anyway) and how is this done?

Thank you in advance
Title: Re: Images in articles added by users
Post by: datahell on February 05, 2007, 21:57:49
The best way to insert images inside an article is using the ibrowser plugin of the TinyMCE editor. By default only super administrators are allowed to use the functions bellow from frontend:

upload
create
delete
rename

You can modify iBrowser permissions to allow your desired user group to access all or some of these functions (most secure: only upload). Of course he can select existing images without any modifications.

To do this you will need to modify the "ibrowser.php" file located inside the TinyMCE's plugins folder.

An other way is via the mosimage button. But in this case the user is only capable to select an image from the existing ones.


In general:
In order the editor to open for someone he must have at least one of the following permissions:
'action', 'add', 'users', usertype_here, 'content', 'all'
'action', 'edit', 'users', usertype_here, 'content', 'all'
'action', 'edit', 'users', usertype_here, 'content', 'own'

You will find more information in Elxis Book.
Title: Re: Images in articles added by users
Post by: yiannos on February 08, 2007, 16:25:40
Thank you for your reply,

I changed the file so that frontend users can upload by changing line 37 from

Code: [Select]
$cfg['upload'] = false; to

Code: [Select]
$cfg['upload'] = true;
I now have the button on the plugin that enables me to upload but unfortunately, when I upload an image i get the following error:
Code: [Select]
An error occured during handling upload. Please try again.
This does not happen when the superadmin uploads.

Any ideas?

TIA
Title: Re: Images in articles added by users
Post by: yiannos on February 14, 2007, 14:17:26
I looked into this matter as much as I could. I searched the TimyMCE forums and saw other ppl. debugging the code so (not being a programmer myself) I inserted some echo statements at the lines producing this specific error (er_028) and came up with the result that the error is produced by this code in rfiles.php line 85:

Code: [Select]
if (isset($_FILES['nfile']['name'][0])) {
                        if (!$nfile = uploadImg($clib, $chkT, $selR)) {
                                echo $l->m('er_001') . ': ' . $l->m('er_028');
                        }       
                };

Could smn help me get to the bottom of this? As I said I am no programmer and I feel I have hit a wall since I do not know what to do with my beautiful debugging results.

Thanks again
Title: Re: Images in articles added by users
Post by: yiannos on February 16, 2007, 12:18:59
Anyone?

Please?

 :)
Title: Re: Images in articles added by users
Post by: sonic on February 21, 2007, 15:54:20
I have solution ;)

rfiles.php
line 27--> must be                  $cfg['upload'] = true;



ibrowser.php
line 30 --> must be                $cfg['upload'] = true;


user is public frontend/editor


it's work

;)


Title: Re: Images in articles added by users
Post by: yiannos on February 22, 2007, 14:31:00
SOLVED!

Thank you very much for your answer.!