before you save the data you could run a regex replace function on $this->data['Data']['texarea'] to search for urls and add the html tags around it.
On May 21, 12:01 am, Kyle Decot <[email protected]> wrote: > I might look into those. I quickly ran into a problem because I tried > to do $text->autoLink($autolink->images($text)); and the autoLink does > not have a considerHtml option. Any ideas? > > On May 20, 11:53 pm, Andrew McCafferty <[email protected]> > wrote: > > > Glad it works... > > > You might be better trying out the Textile or BBCode helpers though if > > you need more flexibility: > > >http://cakeforge.org/projects/textilehelper/http://bakery.cakephp.org... > > > On 21 May, 04:15, Kyle Decot <[email protected]> wrote: > > > > Awesome! It's definetly a step in the right direction. I've already > > > added it here: > > > >http://www.theskateparkdirectory.com/forums/industry-news/clear-odyss... > > > > I'll probably end up modifying it as there are some other things I > > > would like it to do. Perhaps when it's done, We can post it on the > > > bakery! Thanks! > > > > On May 20, 11:03 pm, Andrew McCafferty <[email protected]> > > > wrote: > > > > > 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 <[email protected]> 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 <[email protected]> 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 <[email protected]> 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
