Not signed in (Sign In)

Categories

Vanilla 1.1.5 is a product of Lussumo. More Information: Documentation, Community Support.

Help keep Vanilla free:
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthorpatie
    • CommentTimeJun 29th 2007
     # 1
    hi

    im looking for syntax highlighter for local developers forum.

    im trying GeshiColor 0.2 but doesnt work me with vanilla 1.1.2 and i dont know why... any idea ?

    or.. Do you know about other syntax highligter ?

    thank you ! (sry for bad english)
    •  
      CommentAuthorWallPhone
    • CommentTimeJun 29th 2007
     # 2
    There is Code prettify but it still has some IE7 bugs that I need to work out.
    • CommentAuthorpatie
    • CommentTimeJun 29th 2007 edited
     # 3
    I don`t know how to use it ? or what ? :( it doesn`t highlighting syntax and i dont know why.i need any other extension ? i have no idea

    for example i add comment

    <code>
    <?php
    echo 'test';
    ?>
    </code>

    and it added as normal text
    (i use firefox)
    •  
      CommentAuthorWallPhone
    • CommentTimeJun 29th 2007
     # 4
    Yes, you need to also install the HTML Formatter
    • CommentAuthorpatie
    • CommentTimeJun 29th 2007 edited
     # 5
    yes i have and i turn it.

    i post this code:
    <code>
    <strong>test</strong>
    </code>

    <code>
    <?php
    echo "test";
    $variable=1;
    </code>

    as Html and syntax is not highlighted :/

    check this screens http://blackhole.sk/~patoman/sh.png
    • CommentAuthorpatie
    • CommentTimeJun 29th 2007
     # 6
    my friend write me right now that "in opera works it"

    but i use firefox 2.0.0.4 and its doesnt work
    •  
      CommentAuthorWallPhone
    • CommentTimeJun 29th 2007
     # 7
    It might be some kind of Javascript conflict with another extension... does it work here for you?
    • CommentAuthorpatie
    • CommentTimeJun 29th 2007
     # 8
    yes its work
    •  
      CommentAuthorWallPhone
    • CommentTimeJun 29th 2007 edited
     # 9
    Then its probably because something is set in the <body onload= tag... its set to be fixed in the next version, but I'm afraid I don't have much time to fix the problem now.

    Someone familiar with Javascript should be able to get it running.
    • CommentAuthorpatie
    • CommentTimeJun 29th 2007 edited
     # 10
    update: its work but check this : http://blackhole.sk/~patoman/err.png

    imho bug is in this line :

    $text = preg_replace('/<(xmp|pre|code).*?<\/\\1>/se', 'str_replace("<br />", "\r\n", "\\0")', $text);
    • CommentAuthorpatie
    • CommentTimeJun 30th 2007
     # 11
    please help its important for me
    • CommentAuthorpatie
    • CommentTimeJul 5th 2007 edited
     # 12
    i have no idea :[
    • CommentAuthorpatie
    • CommentTimeJul 10th 2007
     # 13
    please help. i dont found anything help anywhere :/
    •  
      CommentAuthorWallPhone
    • CommentTimeJul 10th 2007
     # 14
    I have a new version in the works, fixes the IE linebreak bug, as well as some other highlight bugs but its not tested yet--and it still might have conflicts with other extensions, Userinfo Tooltip and CommentLinks are known to keep it from working properly.

    What extensions do you have installed?
    • CommentAuthorpatie
    • CommentTimeJul 10th 2007
     # 15
    Code Prettify 1.0
    Comment Links 1.3.2
    Forum Statistics 0.4.5
    GeshiColor 0.2
    Html Formatter 2.2
    Invite-Only System 0.3.0.a
    Members Page 1.2.1
    Notify 1.2.0
    Poll 1.3
    Quotations 1.6
    Who's Online 1.2
    Yellow Fade 0.1
    kses (X)HTML 0.4

    some of this are inactives ...
    •  
      CommentAuthorWallPhone
    • CommentTimeJul 10th 2007 edited
     # 16
    OK, Comment Links is probably what is keeping it from working.

    Inside extensions/CommentLinks/default.php, around line 53 you will see this:
    if ( strstr(strtolower($Context->BodyAttributes), 'onload=') ) {
    $Context->BodyAttributes = str_replace('onload="', 'onload="BaseUrl=\''. $Context->Configuration['BASE_URL']
    . '\';DefaultFormat=\''. $Default
    . '\';InstalledFormats=Array('. $FormattersCSV
    . ');MenuTitle=\''. htmlentities($Context->GetDefinition('CommentLinks_Copy')) .'\';HideMenus();', $Context->BodyAttributes);
    } else {
    $Context->BodyAttributes .= ' onload="BaseUrl=\''. $Context->Configuration['BASE_URL']
    . '\';DiscussionName=\''. htmlentities($Discussion->Name)
    . '\';DefaultFormat=\''. $Default
    . '\';InstalledFormats=Array('. $FormattersCSV
    . ');MenuTitle=\''. $Context->GetDefinition('CommentLinks_Copy') .'\';HideMenus();" ';
    }

    Cut all that out and replace it with this: $Head->AddString('<script type="text/javascript"><!--//--><![CDATA[//><!--
    function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != &quot;function&quot;) {
    window.onload = func;
    } else {
    window.onload = function() {
    if (oldonload) {
    oldonload();
    }
    func();
    }
    }
    }
    CommentLinks.Init = function() {
    BaseUrl = \''. $Context-&gt;Configuration['BASE_URL'] .'\';
    DefaultFormat = \''. $Default .'\';
    DiscussionName = document.getElementsByTagName(&quot;title&quot;)[0].innerHTML.replace(/^.* - /, \'\');
    InstalledFormats = Array('. $FormattersCSV .');
    MenuTitle= \''. htmlentities($Context-&gt;GetDefinition('CommentLinks_Copy')) . '\';
    HideMenus();
    }
    AddLoadEvent(CommentLinks.Init); //--><!]]></script>');
    •  
      CommentAuthorWallPhone
    • CommentTimeJul 10th 2007
     # 17
    That last function block is getting munged up a bit... escaping > and " when it shouldn't:
    CommentLinks.Init = function() {
    BaseUrl = \''. $Context->Configuration['BASE_URL'] .'\';
    DefaultFormat = \''. $Default .'\';
    DiscussionName = document.getElementsByTagName("title")[0].innerHTML.replace(/^.* - /, \'\');
    InstalledFormats = Array('. $FormattersCSV .');
    MenuTitle= \''. htmlentities($Context->GetDefinition('CommentLinks_Copy')) . '\';
    HideMenus();
    }
    AddLoadEvent(CommentLinks.Init); //--><!]]></script>');
    • CommentAuthorithcy
    • CommentTimeJul 10th 2007
     # 18
    i'm actively working on a new version of geshicolor too.
    • CommentAuthorpatie
    • CommentTimeJul 11th 2007 edited
     # 19
    YES! its works.

    but:
    - variables dont show in higlighted source
    - Notice: Undefined variable: script1 in /data/web/patrik/sub/forum/extensions/CodePrettify/default.php(46) : regexp code on line 1
    - quotes are slashed (i know its security reason but imho its bad way.. use entities or some like)
    •  
      CommentAuthorWallPhone
    • CommentTimeJul 11th 2007
     # 20
    Yay!

    OK, I'm afraid the regexp problem can't be easily fixed until I update the extension in the next day or two, (which also fixes the IE linebreaks) but for those other problems, replace the prettify.js file with this code and see what that does.
    • CommentAuthorpatie
    • CommentTimeJul 11th 2007
     # 21
    same error :/
    • CommentAuthorpatie
    • CommentTimeAug 9th 2007
     # 22
    so ?
Add your comments
    Username Password
  • Format comments as