Extends the default text formatter to autolink urls and auto insert images and videos. *REQUIRES PHP 5!*
To insert an image simply enter the url to an image in your comment. For example:http://www.example.com/image.jpg
The image will be then displayed in your comment.
The same with video. Enter a link to a youtube page like:http://www.youtube.com/watch?v=FA621_F3bKw
And the video will be automatically embedded in your comment.
I wrote this because I wanted a simple solution for my forum for non tech savvy people. I'm not a web coder, so the code is most likely awful.
Supports:
Images
- jpg
- gif
- png
Videos
- YouTube
- Dailymotion
- Google Video
- MySpace
- Spike
- RedLasso
- Vimeo
- OnSMASH
- Ceknito.sk
- Vii.sk
Other Requirements (if any):
Parse error: syntax error, unexpected '&', expecting T_VARIABLE or '$' in /home/user/public_html/messageboard/extensions/MakeItSimpleTextFormatter/default.php on line 35
circuit: Hmm, I forgot that using references in the foreach loop is only supported in PHP 5. I'll see what I can do about that, though it will clunker up the code, so I'm not sure I want to do that.
that's OK, it's not urgent (it is a very good idea, though :) )
Uploaded version 1.10 of Make It Simple Text Formatter.
Uploaded version 1.10 - added support for more video sites.
awesome! Yeah bbcode is hard for some people :P Vimeo support and .mp3 support would rock too!
getting this error when trying to type in a link
Fatal error: Call to undefined function: stripos() in /home/content/h/h/g/hhgunrange/html/Forum/extensions/MakeItSimpleTextFormatter/default.php on line 25
dionhall85: You need PHP 5 for this extension to work.
Oh, Thanks!
I have updated my site to php 5, however when i try to type a link it does not automatically change? How can i fix this?
Do you have the extension enabled? Do you use the text formatter? Link to your site?
I think it would be better if normal links are not displayed link this ->link<- but like normal but just klickable. So you know where the links points and you don't have to look in the statusbar or somewhere. And is it possible that it works also with the BlogThis extension? That would rock.
@elm: Yeah, I wanted the same functionality. You can tweak one line of default.php (in the extension's folder) to make it work.
Change:$Word = '<a href="'.$Word.'" target="_blank" rel="nofollow">->link<-</a>';
to:$Word = '<a href="'.$Word.'" target="_blank" rel="nofollow">'.$Word.'</a>';
I use "->link<-" because long links break my theme. But as juicysauce said, you can easily change that.
Thanks. But the problem is the update. Everytime a new version is released, i have to change some code in nearly every extension I use so I try to make you to do the changes ;). But I see it is not possible to fulfill everyones wishes. Maybe it is possible to format the links like this:
http://www.google.de/sear...lient=firefox-a
so it would not break you theme :) I think this is a good compromise.
I'll second the request for Vimeo and mp3 support. That would serious kick ass.
Vimeo is a bit tricky as they have different video sizes. MP3 support is also tricky, as it requires a player. But I'll try to figure something out.
miquel does it support auto-embedding flickr pics?
It would be awesome if this would support bold italics
EX:
*bold* = bold
_italic_ = italic
miquel: I don't use flickr, gimme an example.
silver-dragon: Everything is possible. ;)

This is how they have formating set up a writeboard.com it's really intuitive and easy to use.
Sounds like you just want Markdown.
Hi there. Good addon. :) However I'm getting this error popup when I try to enable this addon. The server has php5 enabled.
mmm new peoblem occured. Php5 is enabled and i got this error.
Fatal error: Cannot redeclare class ExtendedTextFormatter in /home/35738/public_html/extensions/MakeItSimpleTextFormatter/default.php on line 20
Hello,
This is just what I wanted and it works fine - almost. There's an issue with video links in that when I tried it with this youtube video http://www.youtube.com/v/htt5IjMhysM&rel=0&color1=0xe1600f&color2=0xfebd01&border=0
it lauched it in a new window instead of embedding it.
On the other hand I found an existing post from someone else in my forum where a video link they'd included before I used your add-on now showed as embedded. So it does work sometimes.
What I want to understand is what causes the different behaviour. Any ideas please ?
Could you make a Make It Simple Text Formatter for php version 4.4.5 or lower? My web host doesn't support php5 yet. Thanks!
Uploaded version 1.12 of Make It Simple Text Formatter.
Added support for Vimeo and OnSMASH.
i need MEGAVIDEO Support
Is there any way to make this extension roles based?
I run a forum that was recently attacked by spammers in a big way. I was thinking if I could have new applicants post only text, text links, etc. and then after say 150 or 200 posts get the rights to post photos and then after say 300 or 350 embed videos... that would help me weed out spammers better than just waiting for them to post crap and over run a forum. Thoughts? Maybe another extension would be better?
Hi MrBurrrns,
I rewrote your default.php a bit. I added two config settings for MAX_LINK_CHARACTER_LENGTH, MAX_LINK_CHARACTER_TEXT that allow you to put in an optional link text if the characters in the url exceed a certain limit. This is to solve the layout issue breaking that you brought up and the user request of using the actual URL in the link inner html.
Also I added support for the following protocols:
'http', 'https', 'ftp', 'news', 'nntp', 'feed', 'gopher', 'mailto'
Have a look let me know what you think.
joelpittet.com/vanilla/make-it-simple-text-formatter/default.zip
You can email me with any questions, joel@pittet.ca
So i thought my website supported php5 (I have it hosted on Godaddy, and was a little confused @ php compatibility) so I installed the addon. It proceeded to brick my website, so I deleted the folder (since I could not view any part or change any settings via any web interface) and now I have an ugly bar at the top that says yada yada can not open input stream
"Warning: main(/home/content/account/vanilla/extensions/Make It Simple Text Formatter/default.php): failed to open stream: No such file or directory in /home/content/account/vanilla/conf/extensions.php on line 27
Warning: main(): Failed opening '/home/content/account/vanilla/extensions/Make It Simple Text Formatter/default.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/content/account/vanilla/conf/extensions.php on line 27"
The only way I could get rid of htis was by placing an empty php file into the folder. I went to the settings panel and disabled the addon, but removing the folder will still produce that ugly bar at the top with the file not found error. Does anyone know how to fix this? :/
error when viewing discussion page using PHP 5.2.6
Fatal error: Cannot redeclare class ExtendedTextFormatter in /home/xx/public_html/messageboard/extensions/MakeItSimple/default.php on line 20
Works great for me,
Can you tell me the shortcuts please.
bochenn A service for MP3 that will be cool could be http://www.goear.com/ or even podcasts services.
I think you could implement something like this one, wich is free storage for MP3 files.
Here an example: http://www.archive.org/details/DiputadaGriseldaBaldataEnElProgramaAmaneceEnDelPlataConGustavo
Thanks
You cant just enter embedd code and have it work can you ?
So I don't really get why this doesn't work with HTML format and only the default text format?
Also, totally agree:
It would be awesome to allow just or code and post the flash as is. It would also allow for MP3 and movie play back if it uses the format...
I know there are security issues, but I really want to be able to add EMBED code? is there a way i can adjust the default.php to allow this ?
For anyone interested in displaying the actual URL (but avoid breaking your layout)
Open /extensions/MakeItSimpleFormatter/default.php
Look for (line 66?)$Word = '<a href="'.$Word.'" target="_blank" rel="nofollow">->link<-</a>';
REPLACE this line with<br />if( strlen($Word) > 66 ) {<br />$Word = '<a href="'.$Word.'" title="'.$Word.'" target="_blank" rel="nofollow">'.substr($Word,0,63).'...</a>';<br />} else {<br />$Word = '<a href="'.$Word.'" title="'.$Word.'" target="_blank" rel="nofollow">'.$Word.'</a>';<br />} <br />
I've hard-coded the max length (I'm lazy that way) to 66 chars, and due to the addition of "..." to the end, I display only 63 of them (this explains the numbers).
The code snippet also adds a 'title' attribute to the tag so you can see the full URL by hovering over the link.
OK, and for that person looking to auto-link MP3s:
Open /extensions/MakeItSimpleFormatter/default.php
Look for (line 41?)$Word = '<img src="'.$Word.'" class="discImg" />';<br /> } else if (stripos($Word, 'youtube.com/watch?v=')) {
BETWEEN these two lines you ADD:} else if (strcasecmp(substr($Word, strlen($Word) - 4), '.mp3') == 0) {<br /> $Word = '<br /><embed class="SkreemRPlayer" wmode="transparent" <br /> style="height:24px;width:240px;" src="http://skreemr.com/audio/player.swf" <br /> quality="high" bgcolor="#ffffff" width="240" height="24" align="middle" <br /> allowScriptAccess="sameDomain" type="application/x-shockwave-flash" <br /> flashvars="playerID=1&soundFile='.$Word.'"></embed><br /><br /> (<a href="'.$Word.'" title="'.$Word.'" target="_blank" rel="nofollow">download MP3</a>)';
This will insert a little audio flash player whenever you enter a link that ends in .mp3 (courtesy of SkreemR.com, thank you!)
To be absolutely clear, the code should look like this after inserting the above:$Word = '<img src="'.$Word.'" class="discImg" />';<br /><br />} else if (strcasecmp(substr($Word, strlen($Word) - 4), '.mp3') == 0) {<br /> $Word = '<br /><embed class="SkreemRPlayer" wmode="transparent" <br /> style="height:24px;width:240px;" src="http://skreemr.com/audio/player.swf" <br /> quality="high" bgcolor="#ffffff" width="240" height="24" align="middle" <br /> allowScriptAccess="sameDomain" type="application/x-shockwave-flash" <br /> flashvars="playerID=1&soundFile='.$Word.'"></embed><br /><br /> (<a href="'.$Word.'" title="'.$Word.'" target="_blank" rel="nofollow">download MP3</a>)';<br /><br />} else if (stripos($Word, 'youtube.com/watch?v=')) {
If you look closely you'll see I force-insert a line break before the embed and a download link after it (<a href="'.$Word.'" title="'.$Word.'" target="_blank" rel="nofollow">download MP3</a>)'; Remove if not required.
Tested to work on IE, FF, Opera & Chrome (latest versions on Jan 31, 2009, all windows)
this is conflicting with preview post
if you add anything that should be parsed with additional text before or after it will lump everything together when previewed.
I cant seem to get this one to work at all. Might be an extension conflict, I guess. My load settings currently look like this:
include($Configuration['EXTENSIONS_PATH']."Acronyms/default.php");
include($Configuration['EXTENSIONS_PATH']."Poll/default.php");
include($Configuration['EXTENSIONS_PATH']."ReportPost/default.php");
include($Configuration['EXTENSIONS_PATH']."STOPCAPSABUSE/default.php");
include($Configuration['EXTENSIONS_PATH']."TagThis/default.php");
include($Configuration['EXTENSIONS_PATH']."Transmogrifier/default.php");
include($Configuration['EXTENSIONS_PATH']."MembersList/default.php");
include($Configuration['EXTENSIONS_PATH']."AddMember/default.php");
include($Configuration['EXTENSIONS_PATH']."DiscussionOverview/default.php");
include($Configuration['EXTENSIONS_PATH']."Notifi/default.php");
include($Configuration['EXTENSIONS_PATH']."RelNoFollow/default.php");
include($Configuration['EXTENSIONS_PATH']."Socialimpact/default.php");
include($Configuration['EXTENSIONS_PATH']."ThankfulPeople/default.php");
include($Configuration['EXTENSIONS_PATH']."UserAward/default.php");
include($Configuration['EXTENSIONS_PATH']."WhosOnline/default.php");
include($Configuration['EXTENSIONS_PATH']."Nugget/default.php");
include($Configuration['EXTENSIONS_PATH']."AjaxQuote/default.php");
include($Configuration['EXTENSIONS_PATH']."ForcedBBCode/default.php");
include($Configuration['EXTENSIONS_PATH']."WindowLinks/default.php");
include($Configuration['EXTENSIONS_PATH']."comments_permalinks/default.php");
include($Configuration['EXTENSIONS_PATH']."MakeItSimpleTextFormatter-2008-10-11/default.php");
bochenn excellent TomTester! thanks for both adds!
@bochenn: thanks. I plan to post two more in the next week: auto-link google maps (go from link to embed) and auto-link flickr set links (auto-insert little slideshow)
bochenn Hey broddy, those 2 sounds very interesting. i would like to see auto-link when a user post without the protocol http://, just google.com or www.google.com. I'm waiting for your adds! Thanks
bochenn @TomTester hope this could help you http://flickrslidr.com/index.php
@bochenn, thanks, I'll check it out.
My basic problem with Flickr is that I can easily include a slideshow once I have the UserID or based on a tag search (e.g. http://www.flickr.com/photos/tags/blackwhite ) but cannot if I have only a username. Extending the add-on to include calls to the flickr API (see http://www.flickr.com/services/api/flickr.people.findByUsername.html and ) seems beyond the scope of what's simple and easy... (perhaps it should be a separate add-on)
bochenn Does anyone knows if there is a chance to hace a workaround to embed a Grooveshark element?
Example: http://listen.grooveshark.com/#/song/Useless_Kruder_and_Dorfmeister_Remix_/3102634
Also, hey TomTester, could you make more embeds? Thanks
Bochenn
Addons are custom features that you can add to your Vanilla forum. Addons are created by our community of developers and people like you!
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.