Insert File link not working in htmlarea

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
Greg
Power Poster
Power Poster
Posts: 598
Joined: Sun Sep 26, 2004 6:15 pm
Location: Saskatchewan - Canada

Insert File link not working in htmlarea

Post by Greg »

In creating a content page using the 'insert a link' to a file the wrong path is inserted. I have a file uploads/training/document.doc the link created in htmlarea is training/document.doc the uploads part is missing in the link.

Anyone have a fix ? :cry:

Forgot to add - I checked the config.php file and the paths to the uploads directory are correct.
:mrgreen:
Greg
Greg
Power Poster
Power Poster
Posts: 598
Joined: Sun Sep 26, 2004 6:15 pm
Location: Saskatchewan - Canada

Insert File link not working in htmlarea

Post by Greg »

Thanks to rummy posting the other bug (60) I figured it out:
htmlarea/plugins/insertfile/config.php
Line 159

Code: Select all

$MY_LINK_FORMAT         = '<SPAN CLASS="filelink"><IMG SRC="_editor_urlplugins/InsertFile/IF_ICON" ALT="IF_URL" BORDER="0"> <A HREF=' .$MY_URL_TO_OPEN_FILE. 'IF_URL>IF_CAPTION</A>  </SPAN> ';
I also added the htm extension in lines 61 and 69
Greg
Greg
Power Poster
Power Poster
Posts: 598
Joined: Sun Sep 26, 2004 6:15 pm
Location: Saskatchewan - Canada

Insert File link not working in htmlarea

Post by Greg »

This almost works.


Does not handle files with spaces in the file name ???

htmlarea is a very frustrating tool!
Greg
Greg
Power Poster
Power Poster
Posts: 598
Joined: Sun Sep 26, 2004 6:15 pm
Location: Saskatchewan - Canada

Insert File link not working in htmlarea

Post by Greg »

Fixed right this time :D :D :D

Simple solution:

Added 'uploads' to line 159 of htmlarea/plugins/insertfile/config.php

$MY_LINK_FORMAT = ' IF_CAPTION  IF_SIZE  IF_DATE ';

Now filenames with spaces even work !!
Greg
Post Reply

Return to “Developers Discussion”