I'm making an image sitemap for my site I'm trying to extract the image link from the post and I'm using the TinyMCE text editor Need Help pls.
I use this code but the problem is I do this in the controller and I can't do it in the view This code being in the Controller leads to two problems, first, that I will not be able to all the images for one post, but I have to fetch the images of all posts together at once. The second thing or the second problem is that this code extracts the images twice: the link I want and the link inside So I want a solution so that I can extract images for one post
Below is a picture of the code in the controller
I developed a plugin that make a html list dinamycally, based on javascript change events of a select element. I need to save that post with this new list items. I think that´s necessary send this list items via ajax maybe with (wp_localize_script). How to do this?
I think you can create hidden input tag in dynamically using javascript and pass this hidden element to using post method using ajax to use in php post saving.
i check in the doc and everywhere i could but i didn't find any solution.
So i have a form and i upload an image in this form. I would like an error message if user is submiting a too large image or a too tall one. I need to do this for a proper display for my image.
I would like if possible do this with #assert but i dont think it's possible so i can add a validation.yml file if it's needed but it has to be check on the client-side
Thx if you have any clue to do this !
I have been trying to set up the tutorial, https://github.com/blueimp/jQuery-File-Upload/wiki/How-to-submit-additional-Form-Data with rails 3. However I am slightly confused about how Form Data works with Rails Object. From my research it seems that Form Data with serializeData returns an array. However, I am totally lost about what to do after that.
I am wondering how do I use data.FormData and put it in my rails object. For example I have an art model in Rails that file upload will upload a picture to. What can i put in my controller under create so that the title of the art object correspond to the title under the label in td class="title" Title: input name="title[]" required /label /td "Thanks.
Regards,
Kane
I have a text area in which I am trying to add youtube embed code and other HTML tags. $this->input->post is converting the <iframe> tags to < and > respectively but not the <h1> and <h2> tags.
Any idea how I can store these values?
If you only have a small number of forms that you need to allow iframes in, I would just write a function to restore the iframe (while validating that it's a valid YouTube embed code).
You can also turn off global_xss_filtering in your config (or not implement it if you're using it), but that's not the ideal solution (turning off all of your security to get one thing to work is generally a horrible idea).
$config['global_xss_filtering'] = FALSE;
To see all of the tags that get filtered out, look in the CI_Input class and search for the '$naughty' variable. You'll see a pipe-delimited list (don't change anything in this class).
Why don't you avoid CIs auto sanitizing and use something like htmlspecialchars($_POST['var']); ? Or make a helper function for sanitizing youtube urls...
Or you could either just ask for the video ID code or parse the code from what you are getting.
This would let you use both the URL or the embed code.
Also storing just the ID takes less space in you database, and you could write a helper function to output the embed code/url.
In this case, use $_POST instead of $this->input->post to get the original text area value, and then use HTML Purifier to clean the contents without losing the <iframe> tag you want.
You will need to check HTML Purifier documentation for details. Please, check this specific documentation page about "Embedding YouTube Videos".