htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: htmlArea 2: htmlArea 2 & 3 archive (read only): htmlArea v2.0 - Add-Ons:
(ASP) Combined Insert Link and Link to File.


The htmlArea 2 & 3 editors have been discontinued.

We've made these forums available as a read-only reference and knowledge-base for people using or developing editors based on htmlArea 2 or 3.

Anyone who is interested in taking over version 2 or 3 is free to do so. All we ask is that you choose a new name that doesn't have "htmlarea" in it to avoid confusion with this site. We'll even give you a link in the directory to make it easier for people to find you. If you are developing or hosting an htmlArea based-editor under a new name, please submit it to our directory.

 


eisa
User

May 14, 2003, 1:04 PM

Post #1 of 20 (27913 views)
Shortcut
(ASP) Combined Insert Link and Link to File. Can't Post

Description:
Combined Insert Link and Link to File for ASP. Replaces the original insert_link.html file. Made for version 2.*

You can make links the normal way by typing in the links, or you can browse for a file to link to. If you browse for a file and chooses that file, the target-value will automatically be set to _blank. See the readme-file for better explanation. You can use images as a link, also with the target="_blank" value (which was a problem with the first version of insert_link.html).

Two versions:
  1. link_and_DB_insert_file.zip: Choose this version if you have downloaded and are using my previous database-version. http://www.interactivetools.com/forum/forum.cgi?post=9863
  2. link_and_browse_link_to_file.zip: Choose this version if you wan't to browse for files on your server. For those who have downloaded my earlier version of Link to File it was some problems with the preview function, this are now improved and should work.


Credits:
I'm not the brain behind this so credits should be given to the right persons. The file insert_file.html was once insert_file.php made by taurentius. Then Barry Hunter added his link-code which turned the file into a combined Insert Link/Link to File version. I have only stripped away all PHP-related stuff and added the target=_blank functionality.

Enough talk, demo here

Non-ASP users:
insert_file.html is plain html, and if you look into the file that transfers the value to the insert_file.html it shouldn't be to hard to understand how it's working. Then it shouldn't be to complicated to fit this into either your ex. CFM or PHP-solution.

// EiSa //

http://www.savio.no/htmlarea/example.asp | Webdesign


(This post was edited by eisa on May 18, 2003, 9:27 AM)
Attachments: link_and_DB_insert_file.zip (21.6 KB)
  link_and_browse_link_to_file.zip (20.3 KB)


Benjamin
Staff


May 15, 2003, 10:56 AM

Post #2 of 20 (27887 views)
Shortcut
Re: [eisa] (ASP) Combined Insert Link and Link to File. [In reply to] Can't Post

Nice work, Eisa! Thanks for posting!
Ben
interactivetools.com


Randy_23
User

May 15, 2003, 1:51 PM

Post #3 of 20 (27881 views)
Shortcut
Re: [Benjamin] (ASP) Combined Insert Link and Link to File. [In reply to] Can't Post

Excellent EiSa!

I'll use your mod for sure Cool

BR / Pat!


ozinm
User

Jun 2, 2003, 6:59 AM

Post #4 of 20 (27746 views)
Shortcut
Installation notes? [In reply to] Can't Post

Congrats! The demo at http://www.savio.no/htmlarea/example.asp looks fantastic.

One problem tho - I seem to be getting into a mess configuring the mod for my system.

Could you post up a step by step walkthrough of what needs to be editing in each file, what permissions should be set and what directories need to be created to get the thing running.

Personally, I've got a linux web server using chilliASP that I have FTP access to which might complicate things slightly Crazy.

Thanks for all your help - it's very much appreciated.


ozinm
User

Jun 2, 2003, 12:53 PM

Post #5 of 20 (27728 views)
Shortcut
Re: [ozinm] Installation notes? [In reply to] Can't Post

OK here's what I've got so far (let me know if I'm doing anything wrong):
  1. In the root create the following folders:
    /Components/
    /files/
    /files/images/
    /files/documents/
    /htmlarea/
    /htmlarea/Database/
    /htmlarea/images/
    /htmlarea/popups/
    /htmlarea/popups/formmgr/
    /htmlarea/smileys/
  2. copy ImgDatabase.asp to /Components/
  3. remove the 1 form last line of the example.asp (the "<!-- include file" one) so you can use the example file for testing.
  4. copy all the files (apart from the ImgDatabase.asp) into the /htmlarea/ structure


The problem I'm having is when I use the image for file link buttons I'm getting the following errors:

Image insert popup error:


ADODB.Recordset.1 error '80004005'
SQLState: IM002
Native Error Code: 0
[INTERSOLV][ODBC lib] Data source name not found and no default driver specified
/htmlarea/popups/imagelist.asp, line 42
/htmlarea/popups/filelist.asp, line 42


File insert popup error:


ADODB.Recordset.1 error '80004005'
SQLState: IM002
Native Error Code: 0
[INTERSOLV][ODBC lib] Data source name not found and no default driver specified
/htmlarea/popups/filelist.asp, line 42


Any ideas or suggestions on how I resolve the problem or at least work out what it is?

All the best

Marc.


eisa
User

Jun 2, 2003, 5:10 PM

Post #6 of 20 (27719 views)
Shortcut
Re: [ozinm] Installation notes? [In reply to] Can't Post

It look's like I have been doing this to quick, I'm sorry that something could be messey...

What I think it's wrong is this:

copy ImgDatabase.asp to /Connections/

not to /Components/

Hope this helps, if not I will see if I find some time to write a step for step explanation.

// EiSa //

http://www.savio.no/htmlarea/example.asp | Webdesign


ozinm
User

Jun 2, 2003, 5:16 PM

Post #7 of 20 (27717 views)
Shortcut
Re: [eisa] Installation notes? [In reply to] Can't Post

sorry I meant Connections.

I was just bashing out structure from memory and didn't read it back!

Any other clue what it might be?

I've got a sneeking suspission that it could be because webserver is a vurtual server hosting multiple websites and the local path for my area may not start at /


eisa
User

Jun 2, 2003, 5:31 PM

Post #8 of 20 (27715 views)
Shortcut
Re: [ozinm] Installation notes? [In reply to] Can't Post

Well, it could be some problems with this (help-text from MX):

If you use Microsoft Access, the database file (.mdb) might be locked. The lock might be due to a DSN with a different name accessing the database. In Windows Explorer, search for the lock file (.ldb) in the folder containing the database file (.mdb) and delete the .ldb file. If another DSN is pointing to the same database file, you may want to delete the DSN to prevent the error in the future. Be sure to reboot the computer after making these changes.

Or it could be some problems with the include:
  • If your server is an Apache web server, choose Virtual. (This is the default choice in Dreamweaver.) In Apache, Virtual works in all cases, while File works only in some cases.
  • If your server is a Microsoft Internet Information Server (IIS), choose File. (Virtual works with IIS only in certain specific circumstances.) Unfortunately, IIS won’t allow you to include a file in a folder above the current folder in the folder hierarchy, unless special software has been installed on the server. If you need to include a file from a folder higher in the folder hierarchy on an IIS server, ask your system administrator if the necessary software is installed.


  • Or perhaps you need another kind of connectionstring because of the chilliASP (don't know because I have never used it):

    http://www.connectionstrings.com/

    http://www.savio.no/htmlarea/example.asp | Webdesign


    ozinm
    User

    Jun 3, 2003, 6:22 AM

    Post #9 of 20 (27691 views)
    Shortcut
    Re: [eisa] Installation notes? [In reply to] Can't Post

    OK,

    As I'm not v'good at this back end database stuff I might ask a lot of stupid questions - please bare with me Crazy.

    I've done a little web browsing and (in general terms) it looks like you need to setup an ODBC link on the server in order to get ASP to read the database.

    Is this correct?

    If so I might be fubar'd as I've only got FTP access.


    eisa
    User

    Jun 3, 2003, 10:42 AM

    Post #10 of 20 (27680 views)
    Shortcut
    Re: [ozinm] Installation notes? [In reply to] Can't Post

    Do a search with Google and I think you will find some useful answers. What I found is that the Access Database must reside on Microsoft Windows. If you don't have that opportunity I guess you will need to build the functions with mySQL or something instead.

    http://wwws.sun.com/software/chilisoft/datasheet.html#4

    http://www.savio.no/htmlarea/example.asp | Webdesign


    ozinm
    User

    Jun 3, 2003, 11:11 AM

    Post #11 of 20 (27678 views)
    Shortcut
    Re: [eisa] Installation notes? [In reply to] Can't Post

    OK,

    starting to get somewhere.

    The server has mySQL on it and I've got access to a web interface for creating new databases and tables on it.

    What I guess I need now is:
    1. a list of the tables & fields stored in the original .mdb file (I think I saw them somewhere in your readme's - I'll dig through them later)
    2. the connection string for the table I'll create in mySQL
    3. wether I need to bribe one of the server admins to set up a ODBC thingy on the server or notCrazy


    If anyone has any usefull info on the above please lob it my way - it'll be very gratefully received.

    Whatever happens I'll let you know how I get on in case there's someone else who needs it.

    Thanks for all your help.


    ozinm
    User

    Jun 3, 2003, 11:30 AM

    Post #12 of 20 (27676 views)
    Shortcut
    Re: [ozinm] Installation notes? [In reply to] Can't Post

    Got the answer to item 3.

    I don't need to do stuff to the server because I dont have to set up an ODBC data source.

    Read the excerpt I found below:


    Creating an OLE DB connection

    Creating a direct OLE DB connection can improve the speed of your connection by eliminating the ODBC layer between your Web application and the database. If you don't specify an OLE DB provider for your database, ASP uses the default OLE DB provider for ODBC drivers to communicate with an ODBC driver, which in turn communicates with the database. By using a database-specific OLE DB provider, you eliminate the ODBC middleman.


    I think this is what eisa's been doing all along with his (her?) connection string and I just didn't know enough to realize it.


    c5m
    New User

    Jun 20, 2003, 1:29 PM

    Post #13 of 20 (27544 views)
    Shortcut
    Re: [ozinm] Installation notes? [In reply to] Can't Post

    hi eisa...thanks for the asp code...i was able to install them successfully...

    i may be asking too much, but could i also borrow your code which parses the values from htmlarea text field? just checking if its okay with you....otherwise, i will just have to write my own code...thanks just the same...


    eisa
    User

    Jun 21, 2003, 6:52 AM

    Post #14 of 20 (27530 views)
    Shortcut
    Re: [c5m] Installation notes? [In reply to] Can't Post

    I'm not sure if I understand you correct, but you are looking for some code that makes it possible to save/update the text in the htmlArea-field?

    http://www.savio.no/htmlarea/example.asp | Webdesign


    rodegier
    Novice

    Aug 21, 2003, 10:13 AM

    Post #15 of 20 (27149 views)
    Shortcut
    Re: [eisa] Installation notes? [In reply to] Can't Post

    Can you please give me the output of the following files:

    browsefile.asp
    dirwalk.asp

    If i know the output of these files, i know how to make a php-script so it works in php.

    Already thanks,

    Roderik van de Logt
    the Netherlands

    (so my english must be very poor)


    eisa
    User

    Aug 21, 2003, 12:08 PM

    Post #16 of 20 (27145 views)
    Shortcut
    Re: [rodegier] Installation notes? [In reply to] Can't Post

    I'm not sure what you mean with output, because the output of these files will be http://www.mydomain.com/foldername/mydocument.doc and I guess that this isn't what you are looking for..

    dirwalk.asp is a file which makes it possible to browse for files in ASP, browsefile.asp is the file that transfer the URL-value to insert_file.html. If you allready have a php-file that makes it possible to browse for files you can forget the dirwalk.asp file. Then you should concentrate on this code in browsefile.asp (line 19-20):
    Line 19:
    strPath = "http://" & Request("HTTP_HOST") & "/" & Replace(CutRootFolder(strPath), "\", "/")
    Line 20:
    Response.Write "<a href=""javascript:"" onClick=""top.document.forms[0].elements['txtDescription'].value='" & strName &"';top.document.forms[0].elements['txtFileName'].value='" & strPath & "';top.document.forms[0].elements['target'].value='_blank';"">" & strName & "</a>"
    What happens in line 19 is this: It inserts the domain-name (Request("HTTP_HOST")) and replaces \ with / in the URL (if you don't replace \ you will get problems with the Javascript.

    In line 20 this happens: (NB! Since this is ASP all normal " (quotes) are written with double quotes.) strName is the filename of the file (myfile.doc). ['txtDescription'].value= will transfer this value into the txtDescription-field in insert_file.html.
    strPath is the URL to the file (created in line 19). txtFileName will transfer this value into the txtFileName-field in insert_file.htm.

    If I remove the ASP-coding from line 20 it will look something like this:
    <a href="javascript:" onClick="top.document.forms[0].elements['txtDescription'].value='mydocument.doc';top.document.forms[0].elements['txtFileName'].value='http://www.mydomain.com/myfolder/mydocument.doc';top.document.forms[0].elements['target'].value='_blank'">mydocument.doc</a>

    Don't know if this answer your question, but hopefully it makes you come closer to your solution.

    http://www.savio.no/htmlarea/example.asp | Webdesign


    rodegier
    Novice

    Aug 22, 2003, 3:38 AM

    Post #17 of 20 (27132 views)
    Shortcut
    Re: [eisa] Installation notes? [In reply to] Can't Post

    Thank you very, very much!

    It al works. I only needed to edit browsefile.asp! All the content of the website is in a database, so the only thing i needed to do was making a script that makes the link for all the pages in the database.:

    this is my browsefile.php:

    <html>
    <head>
    <title>Browse For Documents</title>
    <link href="../../css/css.css" rel="stylesheet" type="text/css">
    </head>

    <body bgcolor="white">
    <p class=maintekst>
    <?
    include('../../libraries/mysql.inc.php');
    $sql = "SELECT naam, id FROM pages ORDER BY naam ASC";
    $result = mysql_query($sql);
    while($row = mysql_fetch_object($result))
    {
    echo "<a href=\"javascript:\" onClick=\"top.document.forms[0].elements['txtDescription'].value='". $row->naam . "';top.document.forms[0].elements['txtFileName'].value='http://localhost/wifi4all/index.php?page=" . $row->id . "';top.document.forms[0].elements['target'].value='_self'\">". $row->naam . "</a><br>\n";
    }
    ?>
    </p>
    </body>
    </html>

    It all works perfectly no!

    Thanks


    eisa
    User

    Aug 22, 2003, 9:17 AM

    Post #18 of 20 (27120 views)
    Shortcut
    Re: [rodegier] Installation notes? [In reply to] Can't Post

    Glad you got it working! I use a database solution myself (in ASP).

    Don't know what the naam look's like in your database, but if the naam contains ' you need to replace it with `or " if not you will get problems with the javascript.

    http://www.savio.no/htmlarea/example.asp | Webdesign


    cfcsvanberg
    New User

    Jun 22, 2004, 5:37 AM

    Post #19 of 20 (24563 views)
    Shortcut
    Re: [eisa] Installation notes? [In reply to] Can't Post

    I have some problems getting this nice mod to work. I have installed it according to the instructions (as far as I can tell), but it just opens the regular old link-popup when I click the button. I can't understand why it would do that, since the instructions to open that popup are completely removed from the script.

    If anyone has any experience of this same problem, I'd appreciate to hear about it, and if you found a solution.

    Thanks in advance!


    eisa
    User

    Jun 26, 2004, 8:17 AM

    Post #20 of 20 (24453 views)
    Shortcut
    Re: [cfcsvanberg] Installation notes? [In reply to] Can't Post

    If you make changes to the javascript it isn't enough to refresh the page, you also need to delete your temp-files, and sometimes close and re-open the browser.

    http://www.savio.no/htmlarea/example.asp | Webdesign

     
     
     


    Search for (options)