Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 13 of 13

Thread: Preview Help

  1. #1
    Join Date
    Mar 2007
    Posts
    452

    Grin Preview Help

    how can i preview bbcodes in ams web object ???

  2. #2
    Join Date
    May 2006
    Posts
    5,380
    you will need to translate it in to html, like the fourm software dose

    heres a link to a tool that can help with the tag conversion
    http://hometown.aol.co.uk/JRMC137/BBCode2HTML/index.htm

    and look up string.replace in the manual, eg:
    Code:
    strText = String.Replace(strText, "{LEFT}", "<p align=left>", false);
    strText = String.Replace(strText, "{/LEFT}", "</p>", false);
    Open your eyes to Narcissism, Don't let her destroy your life!!

  3. #3
    Join Date
    Mar 2007
    Posts
    452

    Grin

    Code:
    strText = String.Replace(strText, "{LEFT}", "<p align=left>", false);
    strText = String.Replace(strText, "{/LEFT}", "</p>", false);
    where will i use the string.raplace code ??? on button click of preview button or somewhere else ???

  4. #4
    Join Date
    May 2006
    Posts
    5,380
    on button click of preview button

    yup, then write the string to a temp html file and preview it in the browser
    Open your eyes to Narcissism, Don't let her destroy your life!!

  5. #5
    Join Date
    Mar 2007
    Posts
    452
    Code:
    strText = String.Replace(strText, "[LEFT]", "<p align=left>", false);
    strText = String.Replace(strText, "[/LEFT]", "</p>", false);
    
    
    result = Input.GetText("Input1");
    TextFile.WriteFromString("C:\\temp_preview.html", "<HTML>"..result.."</HTML>", false);
    File.OpenURL("C:\\temp_preview.html", SW_SHOWNORMAL);

    so if i have that code in preview button what else i have to do to convert "[LEFT]", "[/LEFT]" to "<p align=left>", "</p>" ????
    do i have to add anything to "C:\\temp_preview.html" ???

  6. #6
    Join Date
    May 2006
    Posts
    5,380
    you have nothing there calling the string.replace

    1st, you get the text from the input
    2nd, you translate the bbcode to html
    3rd, you write the translated text to the html file and preview it

    like this
    PHP Code:
    strText Input.GetText("Input1");-- get the text
    strText 
    String.Replace(strText"[left]""<p align=left>"false);-- translate
    strText 
    String.Replace(strText"[/left]""</p>"false);-- translate
    TextFile
    .WriteFromString("C:\\temp_preview.html","<HTML>"..strText.."</HTML>",false);-- write the html file
    File
    .OpenURL("C:\\temp_preview.html"SW_SHOWNORMAL);-- show the preview 
    Open your eyes to Narcissism, Don't let her destroy your life!!

  7. #7
    Join Date
    Mar 2007
    Posts
    452

    Grin

    thanks Rizlauk i got it

    another question what will i do for ???

    Code:
    [COLOR="Red"]GoOgle[/COLOR]
    Code:
    [SIZE="6"]GoOgle[/SIZE]
    Code:
    [font="Arial"]GoOgLe[/font]
    Last edited by GoOgLe; 03-25-2007 at 04:25 PM.

  8. #8
    Join Date
    May 2006
    Posts
    5,380
    do the same

    strText = String.Replace(strText, "[color=", "<font color=", false);


    but the last 2 should be like this to pick up on the tags that have been missed

    strText = String.Replace(strText, "[", "<", false);
    strText = String.Replace(strText, "]", ">", false);
    Open your eyes to Narcissism, Don't let her destroy your life!!

  9. #9
    Join Date
    Mar 2007
    Posts
    452
    thanks Rizlauk

    can also help me with the ordered and unordered please ???

    Code:
    <ol>
    	<li>GoOgLe</li>
    </ol>
    <ul>
    	<li>GoOgLe</li>
    </ul>
    that works fine for ordered but what will i do for unordered ????
    strText = String.Replace(strText, "[LIST=1]", "<ol>", false);-- translate
    strText = String.Replace(strText, "[/LIST]", "</ol>", false);-- translate
    strText = String.Replace(strText, "[*]", "<il>", false);-- translate
    Last edited by GoOgLe; 03-26-2007 at 12:08 AM.

  10. #10
    Join Date
    Mar 2007
    Posts
    452
    i managed it but please correct me if i am wrong...

    Code:
    strText = String.Replace(strText, "[LIST]", "<ul>", false);-- translate
    strText = String.Replace(strText, "/LIST]", "</ul>", false);-- translate
    strText = String.Replace(strText, "[*]", "<li>", false);-- translate
    Code:
    strText = String.Replace(strText, "[list=1]", "<ol>", false);-- translate
    strText = String.Replace(strText, "[/list]", "</ol>", false);-- translate
    strText = String.Replace(strText, "[*]", "<il>", false);-- translate

  11. #11
    Join Date
    Mar 2007
    Posts
    452
    Code:
    [PHP]$myvar = 'Hello World!';
    for ($i = 0; $i < 10; $i++)
    {
        echo $myvar . "\n";
    }[/PHP]
    can u help with that please ???? what's the convertion of this code in html ???
    Last edited by GoOgLe; 03-26-2007 at 12:55 AM.

  12. #12
    Join Date
    May 2005
    Posts
    1,115
    Code:
    strText = String.Replace(strText, "[ php]", "<? ", false);-- translate
    strText = String.Replace(strText, "[ /php]", " ?>", false);-- translate
    NOTICE: Remove space in the [ php] tag in your coding... the board is confused with this code in my post.
    Last edited by bule; 03-26-2007 at 01:41 AM.
    Never know what life is gonna throw at you.
    (Based on a true story.)

  13. #13
    Join Date
    Mar 2007
    Posts
    452
    thanks alot blue

Similar Threads

  1. is it possible to preview bbcode with AMS
    By GoOgLe in forum AutoPlay Media Studio 6.0
    Replies: 1
    Last Post: 03-23-2007, 02:40 PM
  2. INFO: The Difference Between Preview and Build
    By Support in forum AutoPlay Menu Studio 3.0
    Replies: 0
    Last Post: 10-29-2002, 12:22 PM
  3. Page Preview and buttons ?
    By RAZS in forum AutoPlay Menu Studio 3.0
    Replies: 2
    Last Post: 12-13-2001, 01:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts