Hi Kyle,

I've hacked together a helper based on the TextHelper methods that
should do what you're looking for...

http://bin.cakephp.org/view/1261676226

Save it to app/views/helpers/autolink.php and include it in your
helpers array:

var $helpers = array('Html', 'Form', 'Autolink');

And in your view:

<?php echo $autolink->images($post['Post']['content']); ?>

Not very well tested I'm afraid but it should give you some ideas...


On 21 May, 02:00, Kyle Decot <kdec...@gmail.com> wrote:
> I would prefer not allowing the users to use a WYSIWYG editor. I would
> rather they use a simple textarea, and if they happen to include a URL
> in their post, then change that into a link, somewhat like $text-
>
> >autoLink() but instead of creating links, create <img />'s
>
> On May 20, 8:46 pm, JamesF <usaexportexpe...@gmail.com> wrote:
>
> > you might want to check out the jquery fck editor plugin. i use this
> > in conjunction with jquery to turn my text area inputs into a wysiwyg
> > editor and it saves html to the database. (make sure you sanitize
> > first).
>
> > so if you were to go this route you first need to get jquery working
> > in its most basic form on your site, than get the fck editor plugin
> > for jquery, then install fck to your vendors folder.
>
> > explaining in detail would be a bit lengthy but i hope it gives you
> > some ideas.
>
> > On May 20, 3:10 am, Kyle Decot <kdec...@gmail.com> wrote:
>
> > > I am building a forum and I want to make it so that if someone enters
> > > some text w/ a link to an image in it, my script will take out the
> > > link and replace it w/ the image. Anyone know how I would do this? I
> > > would also like to do the same thing w/ youtube and vimeo links in the
> > > future. Thanks for any insight or help you can provide.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to