Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Html Formatter

2456

Comments

  • Found a fringe case (possibly, could be something else...) but when I use the <_< smiley in my forum with Html Formatter turned on I get odd results. Is this Html Formatter causing it or something else? Disabling the extension stops the error occurring.

    Same problems occur here :/ Any way to solve it?
  • mattmatt ✭✭
    You can easily add auto-conversion of html links as follows:

    1. Add:
    $sReturn = $this->AutoLink($sReturn);
    Above:
    return $sReturn;
    in function Execute()

    2. Add (code taken from the Extended Text Formatter):
    function AutoLink($String) { $String = str_replace(array(""","&"),array('"','&'),$String); $String = preg_replace( "/ (?<!<a href=\") (?<!\")(?<!\">) ((https?|ftp):\/\/) ([\@a-z0-9\x21\x23-\x27\x2a-\x2e\x3a\x3b\/;\x3f-\x7a\x7e\x3d]+) /msxi", "<a href=\"$0\" target=\"_blank\" rel=\"nofollow\">$0</a>", $String); return $String; }
    Between the Execute function and the VideoLink function.

    That's it!
  • Uploaded version 2.0.5 of Html Formatter.
  • @stash: should be fixed.
  • Excellent plugin SirNot
  • Lovely thanks SirNot :)
  • hi there, is there a way to make html default when writing an entry?
  • its a simple matter to have the radio button be selected by default if instead of text, however, I looked on the addon code and cant find where the radio buttons are created.. maybe someone with addon creation experience can help us out
  • The forum should remember what formatter you used last time. Select HTML and it should stay that way till you change it.
  • ah right, now that i think about it, it does do that... so unless you want to turn off text formatter, or absolutely need it to be html default first time, it should be best as is
  • ah, nice way to implement it, thanks
  • I'm trying to set a discussion format from the Janine extension. I'm using this code: $Configuration['JanineDiscFormat'] = 'HTML'; Everything else works, but the posts still end up in text format and I have to manually change them. Any help on how to get Html as the format on an automatically created post?
  • well it'd be nice if I could tell what this 'janine' extension did without having to go look it up, but assuming it has something to do with setting the formatter type, I think you'd want 'Html' (note the cases).
  • heh thats funny considering that Janine is the most discussed add-on or topic at whole lately :)

    its a blog thingy :)
  • well I was actually not-so-subtely hinting that using better-suited names for extensions might make things easier for everyone.
  • A round of apologies to all involved.
    Janine is an extension to automatically create a new Vanilla discussion and associate it with a post on a blog. Right now Janine only supports recent versions of WordPress, but in theory it could be easily extended to work with just about any blog or content management system.
    I actually did try "Html" as well, in case it was case sensitive, but the same thing resulted.
  • Well, how stupid. I tried lower case again, just in case, and it worked. Something else was wrong last time I tested and I guess I never tried lower-case again with the other fixes. Thanks.
  • Is there a way that scripts can only be added by the admin but viewed by all.
    or a way to have safe javascript like the one from google that allows embedding of google gadgets in ur webpage.
  • Hi folks. I've a found a solution to something which was bugging me since a while: YouTube videos keep a white background. His this is quite ugly on a non-white background, but there's an easy fix.

    Replace this, at line 122:
    case 'youtube' : return ('<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/'.$ID.'"></param>'. '<embed src="http://www.youtube.com/v/'.$ID.'" type="application/x-shockwave-flash" width="425" height="350"></embed>'. '</object>');

    by this:
    case 'youtube' : return ('<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/'.$ID.'" name="wmode" value="transparent"></param>'. '<embed src="http://www.youtube.com/v/'.$ID.'" type="application/x-shockwave-flash" width="425" height="350" wmode="transparent"></embed>'. '</object>');

    I didn't test for other videos, but I guess if you change this for Google & MySPace, it will work the same. Hope this helps.
  • Hey, how I can allow h1,h2,h3,h4 tags?
    The text inside them simple disappear.
    Thanks!
Sign In or Register to comment.