Show addons for Both Vanilla Versions or filter to Vanilla 1Vanilla 2
Order by RecentPopular

Addons Plugins Html Formatter 2.4

Warning! We have not performed any code-review or testing of this addon. Use it at your own risk.
Author
SubJunk
Version
2.4 
Released
May 2006
Downloads
12798

Download Now

Requirements

Requires
Vanilla 1

Other Requirements (if any):

Comments

  • trying out some html

    get your Vanilla here

    how do I make it so that urls are automatically created as a link?
    e.g. http://www.getvanilla.com <-- not a link, but is there an extension which makes it a link?

  • If u use the "Text" option and then type
    http://www.getvanilla.com <-- is a link

    it would be nice is the HTML option did that as well.

  • is there a way to combine both? so users don't have to keep switching back and forth btwn text or html?

  • oh ok
    can I do that without the extension?

  • there is only way to find out :)

  • well I already tried it and it doesn't work.
    It just seems strange to install the html formatter extension when you don't really need the "html" part of it.
    Furthermore, an average user could get confused thinking that they need to enable the html option to have links in their post.

  • I'm confused, selecting "text" format and typing a link (http://google.com) <-- gives a link!? Hmm..that seems odd. Convenient, I suppose, but odd.

    Presumably, if you select "Html" you know how to create a link using HTML.

  • Convenient indeed.
    But inconvenient from a usability POV, i.e. "text" would imply text only, as is the case for emails.

    Anyhow, the extension is definitely useful in its own right.

  • Guys - that autolinking and the / me function is part of the Extended Text Formatter, not the base text formatter that comes with vanilla. Though this discussion isnt really the place for this discussion.

  • ahh thank you, now that makes sense.

  • Is it just me, or does this double space everything when using paragraph or list tags?

  • Yes it does, that's what AutoP is for.

  • oh, awesome, thanks:)

  • Uploaded version 2.0.3 of Html Formatter.

  • wow cool, I didn't know it did that

  • The new version seems to break the formatting?

    I keep getting these errors?


    Notice: Uninitialized string offset: 0 in /nfsn/content/artmgs/public/forum/extensions/HtmlFormatter/default.php on line 226

    Notice: Uninitialized string offset: 0 in /nfsn/content/artmgs/public/forum/extensions/HtmlFormatter/default.php on line 226

  • I get this error as well: http://exhibitq.com/talk/discussion/1/

  • Uploaded version 2.0.4 of Html Formatter.

  • oops, sorry about that. guess that's what I get for not testing it... :-/

    should be fixed now

  • Lovely job thanks SirNot! All clear in my test forum...

  • 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?

  • 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) {<br /><br /> $String = str_replace(array("&quot;","&amp;"),array('"','&'),$String);<br /> $String = preg_replace(<br /> "/<br /> (?<!<a href=\")<br /> (?<!\")(?<!\">)<br /> ((https?|ftp):\/\/)<br /> ([\@a-z0-9\x21\x23-\x27\x2a-\x2e\x3a\x3b\/;\x3f-\x7a\x7e\x3d]+)<br /> /msxi",<br /> "<a href=\"$0\" target=\"_blank\" rel=\"nofollow\">$0</a>",<br /> $String);<br /> return $String;<br />}<br />
    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>'.<br /> '<embed src="http://www.youtube.com/v/'.$ID.'" type="application/x-shockwave-flash" width="425" height="350"></embed>'.<br /> '</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>'.<br /> '<embed src="http://www.youtube.com/v/'.$ID.'" type="application/x-shockwave-flash" width="425" height="350" wmode="transparent"></embed>'.<br /> '</object>');<br />

    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!

  • Test:

    Header 1


    Header 2


    Header 3


    Header 4


    Header 5


    Header 6



    Test:<br /><h1>Header 1</h1><br /><h2>Header 2</h2><br /><h3>Header 3</h3><br /><h4>Header 4</h4><br /><h5>Header 5</h5><br /><h6>Header 6</h6>

  • Interesting... here's the output for my above comment in fx2 win32

    <div class="CommentBody" id="CommentBody_66788">Test:<br /><h >Header 1</h><br /><h >Header 2</h><br /><h >Header 3</h><br /><h >Header 4</h><br /><h >Header 5</h><br /><h >Header 6</h><br /><br />&lt;code >Test:<br />&lt;h1&gt;Header 1&lt;/h1&gt;<br />&lt;h2&gt;Header 2&lt;/h2&gt;<br />&lt;h3&gt;Header 3&lt;/h3&gt;<br />&lt;h4&gt;Header 4&lt;/h4&gt;<br />&lt;h5&gt;Header 5&lt;/h5&gt;<br />&lt;h6&gt;Header 6&lt;/h6&gt;&lt;/code><br /><br /> </div>

    And readable
    <div class="CommentBody" id="CommentBody_66788">Test:<br /><br /><h >Header 1</h><br /><br /><h >Header 2</h><br /><br /><h >Header 3</h><br /><br /><h >Header 4</h><br /><br /><h >Header 5</h><br /><br /><h >Header 6</h><br /><br /><br /><br />&lt;code >Test:<br /><br />&lt;h1&gt;Header 1&lt;/h1&gt;<br /><br />&lt;h2&gt;Header 2&lt;/h2&gt;<br /><br />&lt;h3&gt;Header 3&lt;/h3&gt;<br /><br />&lt;h4&gt;Header 4&lt;/h4&gt;<br /><br />&lt;h5&gt;Header 5&lt;/h5&gt;<br /><br />&lt;h6&gt;Header 6&lt;/h6&gt;&lt;/code><br /></div>

  • Yeah, for me it's very the headers are very important :(
    Any thoughts?

  • What about span?
    <span style='font-size:1.3em;'>What about span?</span>
    Or span with predefined classes?
    <span class='h1'>Or span with predefined classes?</span>

  • Uploaded version 2.0.6 of Html Formatter.

  • oops, I managed to forget to allow digits in the node names. fixed now.

  • heh all fixed. good job :)

  • Good catch cw, nice fix SirNot :)

  • It doesn't work with comments tags like
    <!--more-->
    it displays it as text, rather than hide it from display

    Actually it should do a text replacement convert the more text into an anchor
    So take this /<!--more(.*?)-->/
    and convert it into this<a id="more" name="more"></a>
    also support for will be nice. it should generate links like &Page=2

  • Yes, it is working now! Thanks a lot!

Want to take part in this discussion? Click one of these: Sign In Register For Membership

Make Your Own Addons!

What is this stuff?

Addons are custom features that you can add to your Vanilla forum. Addons are created by our community of developers and people like you!

Vanilla Approved?

We review addons to make sure they are safe and don't cause bugs. An addon is considered to be "Vanilla Approved" once our review process is complete.

Don't have Vanilla yet?

Download Vanilla Now