Michiel Dethmers | 29 Jul 2005 16:51
Picon
Favicon

Re: Re: Added a new import template op


I had to add multipart encoding to the form tag, and you wiped the "content" if it is uploaded from the textarea, but now it's applied and works
there's still an issue though. If you upload a file and check the boxes for validating content, and it returns an error, adn then you save the content from the textarea instead (which has loaded the file) and you go back into editing, it seems there's a duplicate htmlspecialchars somewhere.
I need to check where

Michiel

Fidel Santiago wrote:
OK, at the end I have done the patch for the import template funcion with your comments. I have tested it and it is ok for me. Ciao, Fidel Santiago. On 7/15/05, Fidel Santiago <pperez333 <at> gmail.com> wrote:
Very good idea. What a pity it is not mine. I will work in it. Thanks, Fidel Santiago. On 7/13/05, Michiel Dethmers <michiel <at> tincan.co.uk> wrote:
Ah, hmm, can I make one suggestion? It's a nice idea, and I'd apply the patch, if it wasn't that you've been cutting and pasting a bit too much. Basically what you've done is take my "template.php" file, cut out the <textarea> field, put in a <file> field and change a bit in the upload
code.
It's nice and it, for now, will get it to do what you want it to do, but it's a nightmare for maintenance. If a bug is found in the code that you re-used, it would have to be changed in two places and we would have to remember that. Instead could you do this: edit template.php to have the file upload above the textarea and put
some
text in saying "either upload a file or paste the contents in this box" edit template.php to process the uploaded file as you did, making a
choice
between either or, and possible making one of them have precedence. Thanks Michiel Fidel Santiago wrote: OK, I send the patch and the new file. I do not know how to put it in the patch. I hope it be useful. Fidel Santiago. On 6/28/05, Fidel Santiago <pperez333 <at> gmail.com> wrote: Sorry for my ignorance but I do not know how and where to "upload" the patch. Besides I have added a file and I do not know, not have found, the way for inserting it in the patch. Can anybody help me? Thanks. Fidel Santiago. On 6/21/05, Michiel Dethmers <michiel <at> tincan.co.uk> wrote: If you can send a patch with the current CVS version, it might be quite useful and easy to add. Make sure to use the latest dev version, http://docs.phplist.com/PhplistDevelopment Michiel Fidel Santiago wrote: Hello, I have modified template.php for admiting the importing of files. Do you think is interesting putting it in the CVS? Ciao, Fidel Santiago. --------------------------------------------------------------------- To unsubscribe, e-mail: phplist-developers-unsubscribe <at> tincan.co.uk For additional commands, e-mail: phplist-developers-help <at> tincan.co.uk -- least likely to say "it can't be done" most likely to say "if it's not in mantis, it won't be done" t | i | n | c | a | n || l | t | d Buenos Aires | London | Machynlleth t | i | n | c | a | n || l | t | d --------------------------------------------------------------------- To unsubscribe, e-mail: phplist-developers-unsubscribe <at> tincan.co.uk For additional commands, e-mail: phplist-developers-help <at> tincan.co.uk ________________________________ --------------------------------------------------------------------- To unsubscribe, e-mail: phplist-developers-unsubscribe <at> tincan.co.uk For additional commands, e-mail: phplist-developers-help <at> tincan.co.uk -- least likely to say "it can't be done" most likely to say "if it's not in mantis, it won't be done" t | i | n | c | a | n || l | t | d Buenos Aires | London | Machynlleth t | i | n | c | a | n || l | t | d
Index: admin/template.php =================================================================== RCS file: /cvsroot/phplist/phplist/public_html/lists/admin/template.php,v retrieving revision 1.2.2.8 diff -u -r1.2.2.8 template.php --- admin/template.php 21 Jul 2005 00:26:28 -0000 1.2.2.8 +++ admin/template.php 28 Jul 2005 12:05:05 -0000 <at> <at> -3,6 +3,12 <at> <at> <?php require_once dirname(__FILE__).'/accesscheck.php'; +if (is_uploaded_file($_FILES['file_template']['tmp_name'])) { +$content=file_get_contents($_FILES['file_template']['tmp_name']); +} else { +unset ($content); +} + if (file_exists("./FCKeditor/fckeditor.php") && USEFCK) { include("./FCKeditor/fckeditor.php") ; <at> <at> -171,9 +177,13 <at> <at> <td><input type=text name="title" value="<?php echo stripslashes(htmlspecialchars($data["title"]))?>" size=30></td> </tr> <tr> - <td colspan=2><?php echo $GLOBALS['I18N']->get('Content of the template.')?><br /><? echo $GLOBALS['I18N']->get('The content should at least have <b>[CONTENT]</b> somewhere.')?></td> + <td colspan=2><?php echo $GLOBALS['I18N']->get('Content of the template.')?><br /><? echo $GLOBALS['I18N']->get('The content should at least have <b>[CONTENT]</b> somewhere.')?><br/><? echo $GLOBALS['I18N']->get('You can upload a template file or paste the text in the box below'); ?></td> </tr> <tr> + <td><? echo $GLOBALS['I18N']->get('Template file.')?></td> + <td><input type=file name="file_template"/></td> + </tr> +<tr> <td colspan=2> <?php --------------------------------------------------------------------- To unsubscribe, e-mail: phplist-developers-unsubscribe <at> tincan.co.uk For additional commands, e-mail: phplist-developers-help <at> tincan.co.uk

-- least likely to say "it can't be done" most likely to say "if it's not in mantis, it won't be done" t | i | n | c | a | n || l | t | d Buenos Aires | London | Machynlleth t | i | n | c | a | n || l | t | d

Gmane