Welcome to Geeklog, Anonymous Sunday, May 19 2024 @ 06:49 pm EDT

Geeklog Forums

Contribute story and images for standard users


Status: offline

tsetsefly

Forum User
Newbie
Registered: 09/29/06
Posts: 3
curious
GL v1.4.0sr5-1
If I want to allow any logged in user to contribute a story and be able to add pictures, what is the best way to do that ?

With fckeditor on as admin or someone in the story editor group, they can use the 4 or 5 slots available to Browse, upload an image and use the [image1] in the story. If I want to allow any logged in user to be able to do that same function (upload an image with the story), how can I set that up ? I would prefer not to make every user a story admin. Have read there are issues with the img tag and security but if I only allow logged in users to add strories then I am not worried about the security aspect from them.

I want to allow more than just making the img tag available, want to allow them to Browse and select an image from their PC and upload and place in the story.

Thanks for any help,

I have looked at the image browser in the fckeditor (mountain icon), and I see an area where you can enter a URL, but do not see any way a user could browse, select a local image off PC and upload with the story. The Browse and [image1] method seems easy enough if I could enable that for any contributor (again, I limit that by only logged in users in config)
 Quote

Status: offline

Blaine

Forum User
Moderator
Registered: 07/16/02
Posts: 1232
Location:Canada
You can modify the configuration for the toolbar that is used for the non-story editor when contributing new content. Adding the image icon and a few other toollbar options will assist your trusted members. You will also need to edit the main site config.php to allow the new HTML tags required for the more advanced formatting options.

The toolbars are defined in the fckeditor/myconfig.js file and we used the toolbar called 'editor-toolbar1' for comments and new story content. Adding the 'Image' option for example adds the image feature to the toolbar. Just need to ensure you do a fresh reload of your browser to re-load the new editor and test again. As long as your posting in HTML mode - the editor will appear.

If you want to use a different editor toolbar, you can change the one used or create a new definition in the FCKeditor setup file /javascript/submitstory/fckeditor.js

Geeklog components by PortalParts -- www.portalparts.com
 Quote

Status: offline

tsetsefly

Forum User
Newbie
Registered: 09/29/06
Posts: 3
Thank you for the quick reply. I also needed to add the FCKConfig.ImageUpload option that was commented out in fckconfig.js. It still doesn't upload due I am sure to permission issues, I see a number of changes that need to be made to allow write access documented on the fckeditor site. I also see references made to :
ImageUploadURL = FCKConfig.BasePath + filemanager/upload/php/upload.php?Type=Image

I don't see that filemanager in that path on the GL directories.

Is it possible to setup the standard GL image upload method for regular users to contribute stories; where you use the browse button and put [image1] in the article ? That would be fine for me. As admin I see this method is enabled but not for the non-(admin/storyadmin) user. If I could, then I would just disable the 'mountain' icon in the toolbar and have people add images with the image1, image2 method; its simpler than all the options and configurations with the fckeditor image browser.

Thanks again,
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
The file manager had to be removed from the FCKeditor version that we're shipping with 1.4.0 due to a security issue. It will be back in 1.4.1.

bye, Dirk
 Quote

Status: offline

tsetsefly

Forum User
Newbie
Registered: 09/29/06
Posts: 3
ahhh....

I downloaded 1.4.1 beta and dropped the filemanager folder into 1.4.0 to test it and the upload image works ! Was just missing the filemanger files in the 1.4.0 I had.

Thanks a lot for the help,
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Hmm, I'm surprised that this works. Geeklog 1.4.1 will ship with FCKeditor 2.3.1, while 1.4.0 comes with FCKeditor 2.1 - and there were quite a few changes required to integrate the new FCKeditor version ...

bye, Dirk
 Quote

Status: offline

Benta

Forum User
Regular Poster
Registered: 03/11/05
Posts: 80
Question about the file manager, then:

In the normal article or story.php, the image handling works like this:

You upload the images, GL checks which ones that are used and places them in the data base is everything is OK.

What is in the database field is actually the ABSOLUTE PATH to the image with image tags and all, not the tag you enter. I guess it is done that way so that GL doesn't have to parse the tags more than once.

This is pretty annoying for me because I have an intranet site with different names depending on where you are (the company IT group isn't great) around the firewalls.

It is also annoying when you move a site, because you have to change all stories with images in the SQL dump file. OK, that's easy but annoying.

It is possible to change to code in a simple way by changing what is placed in the databas in story.php, so that a relative path is in there instead, but then you can't see the images when you re-edit the story, because that is done from the admin directory.

The nicest would be if the code could be changed so that the tags were stored in the database instead of the paths. Is that how it works in the new FCK-editior?
 Quote

Status: offline

Blaine

Forum User
Moderator
Registered: 07/16/02
Posts: 1232
Location:Canada
Quote by Benta: The nicest would be if the code could be changed so that the tags were stored in the database instead of the paths. Is that how it works in the new FCK-editior?
This is true but FCKeditor is just an HTML editor and thus the content includes the full path as in an IMG tag.

It is possible to parse the content when saving it to remove the full path and use a tag which is then replaced on viewing but will add more string processing overhead. Something to consider for the future. I have a script I've used in the past to replace URL's in story content for a site move and will try and post it on my site (note to self).
Geeklog components by PortalParts -- www.portalparts.com
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by Benta: What is in the database field is actually the ABSOLUTE PATH to the image with image tags and all, not the tag you enter. I guess it is done that way so that GL doesn't have to parse the tags more than once.

There's already a bug report for this (and a pretty old one at that). I feel we painted ourselves into a corner there (especially when you also consider this bug). I don't see a good way out of that corner currently (or rather, I like none of the alternatives suggested so far).

bye, Dirk
 Quote

Benta

Anonymous
Quote by Dirk:
There's already a bug report for this (and a pretty old one at that). I feel we painted ourselves into a corner there (especially when you also consider this bug). I don't see a good way out of that corner currently (or rather, I like none of the alternatives suggested so far).


If I get it right, the problem is that you don't like the extra string processing that would be induced by replacing the tags at display time?

If GL at the time of editing the story placed its own tags (i.e replaced whatever the user wrote with its own hard coded tags) that don't need a lot of checking or parsing so that simple calls to strreplace would do the job, then the load on the processor wouldn't be hard - in particular with the job of sending the picture itself.
 Quote

All times are EDT. The time is now 06:49 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content