Absolute URL for Images and not HREF

Last post 08-18-2011, 12:24 AM by Adam. 5 replies.
Sort Posts: Previous Next
  •  11-09-2009, 7:59 AM 56979

    Absolute URL for Images and not HREF

    Hi
     
    I am hovaing problems with Absolute URL regarding images and HREF links  
     
    Take this example HTML 
    <a href="#section1">Example Link</a>
    <br />
    <img name="" src="http://cutesoft.net/example-image.jpg"/>

    Then if $editor->URLType="Absolute"; then your editor will change the source of both the href and the image src to the something like

    <a href="http://www.example.com#section1">Example Link</a>
    <br />
    <img name="" src="http://www.example.com/example-image.jpg"/>
    But I don't want the href to be changed, only the image src. So the resulting code should actually be:
    <a href="#section1">Example Link</a>
    <br />
    <img name="" src="http://www.example.com/example-image.jpg"/>
    There are many examples I can think of that the requires the href left as is and the image src to be changed. This is especially true when using anchor tags.
     
    So is it possible to do this and if not would you be willing to add this feature. 
     
    Thanks
    Sam  
  •  11-09-2009, 10:08 AM 56981 in reply to 56979

    Re: Absolute URL for Images and not HREF

  •  05-06-2011, 7:03 PM 67464 in reply to 56981

    Re: Absolute URL for Images and not HREF

    I disagree.
     
    If you are using ABSOLUTE URLs, the whole friggin URL gets put at the beginning of an anchor link. IT SHOULDN'T BE THIS WAY, BUT IT IS.
    THIS IS SO STUPID. I have to use the ABSOLUTE URL setting for other reasons, but now I can never use a jump anchor link (like "back to top" or "next section", etc), because the stupid editor puts the whole absolute URL (of the EDITOR!!!!) at the beginning of links that start with #. This is not useful, EVER.
     
     
    Even in ABSOLUTE mode, the editor should IGNORE ANY LINKS THAT START WITH #. 
     
     
    <a name="test"></a> 
     . . .
     <a href="#test">jump to test</a> 
     
     
    that link above becomes: 
     
    <a href="http://blahblahblah.com/1111/22222/editor/?mode=edit&status=abc&acct=xyz&blah=kjhdfkjsfkjshlkhdfljf#test">jumptotest</a> 
     
    this URL is of no use to the final audience, they don't need a link to my editor, thanks.
  •  05-09-2011, 10:07 AM 67496 in reply to 67464

    Re: Absolute URL for Images and not HREF

    Dear cosmonaut,
     
    Please follow steps:
     
    1. Save the following code to edithtml.php, and copy it to your cuteeditor installation folder
     
    <?php include_once("cuteeditor_files/include_CuteEditor.php") ; ?>
    <html> 
        <head>  
     </head>
        <body>
     <form name="theForm" action="Edithtml.php?postback=true" method="post">
              <?php
                    $editor=new CuteEditor();
                    $editor->ID="Editor1";
                    $editor->EditCompleteDocument=true;
                    $editor->URLType="Absolute";
                    if (@$_GET["postback"]!="true")
                   {
                    $editor->LoadHTML("document.html");
                          $editor->Draw();
                   }
                    else
                    {
                    $editor->SaveFile("document.html");
                    echo "this is atest";
                          $editor->Draw();
                    }
                    $editor=null;               
                    //use $_POST["Editor1"]to retrieve the data
                ?>
                    <textarea name="textbox1" rows="2" cols="20" id="textbox1" style="font-family:Arial;height:250px;width:730px;">
                          <?php echo @stripslashes($_POST["Editor1"]) ;?>
                </textarea> 
      </form>
     </body>
    </html>
     
    2. Run this example, and then replace the html code with the following one:
     
    <a name="test"></a>
    . . .
    <a href="#test">jump to test</a>
     
    3. Switch back to "Normal"
    4. Test it again, you will find href will not be changed, I have tested this today.
    You can download latest version and test this based on the latest version.
     
    Thank you for asking
  •  05-10-2011, 6:18 PM 67531 in reply to 67496

    Re: Absolute URL for Images and not HREF

    works as expected in IE, but not in Firefox.
  •  08-18-2011, 12:24 AM 69655 in reply to 56979

    Re: Absolute URL for Images and not HREF

View as RSS news feed in XML