Jump to content

adrian

PW-Moderators
  • Posts

    10,902
  • Joined

  • Last visited

  • Days Won

    349

Everything posted by adrian

  1. A couple of PW modules: https://github.com/jdart/FieldTypeRate https://github.com/apeisa/CommentRatings Also some other relevant forum posts: http://processwire.com/talk/topic/2126-rudimentary-5-star-rating-system/ http://processwire.com/talk/topic/3630-need-slight-variation-on-existing-module/ Hope something in those is helpful.
  2. I'm afraid I have to run out in a few minutes so won't be able to help more today, so I am going to have to leave you in someone else's capable hands for now. The key thing though is that 500 error being returned when trying access: http://[website]/contact/contact-form/ I would definitely recommend trying the module's demo files exactly as they were and see if that works so you can figure out a working starting point again and modify to your needs. Hopefully that way you can figure out where you went wrong. Good luck.
  3. Ok, I now understand that you are using: http://modules.processwire.com/modules/form-template-processor-mailer/ and not: http://modules.processwire.com/modules/form-template-processor/ My fault for not noticing "Mailer" in the title of your initial post. Let me get my head around this other module and I'll see what I can figure out.
  4. I still think it would be helpful to see all your code. Does contact/contact-form have a template file available? I noticed this is your first post: D:\WAMP\www\client_emerald\site\templates\_inc\php\contact-form.php Just wondering why the template file is not at the root of the templates folder. I can imagine doing something like that for actual include files that aren't assigned to PW pages, but in this case I think you need this to be linked to contact/contact-form, but again, I am not exactly sure how you have things set up.
  5. Hi, and welcome to PW. Did you have a read of the usage instructions here: http://modules.processwire.com/modules/form-template-processor/ That error message suggests that you haven't set the template for the form. As per the instructions, something like: $form->template = $templates->get('my_contact_form_template'); // required Please try that and see how you go, and also post the code you are using in your template to display the form so we can help figure out where you are going wrong.
  6. Well you could do that by using render in your template: echo $referencedPage->render();
  7. Hey Nico, I installed a local copy of latest dev yesterday without a db password. Are you installing stable or dev?
  8. Hey Ryan, I will update the GitHub repo for sure. I was hoping to improve the hook for uploading via the API first though - I'd really like to delay the rename until after the file has been copied into the assets/xxxx folder so I am not messing with any file manipulation code that a front-end form might use. If it uploads the file to a temp directory and then makes the api call to install the file, eg: $page->images->add("/local_temp_path_to_image/image.jpg"); then the form won't know the new filename and so won't be able to delete the file from the temp location. Also, some of the front-end upload scripts posted to this forum suggest moving the file to the final assets/xxxx folder before using ->add, in which case the Pagefile::install won't even be triggered. I'd also like to be able to support images being added from an external URL. Any thoughts on how best to achieve all these requirements? My post #28 above talks more about the issues with Pagefile::install and the need to run it as a before hook, but the problems that also causes. I am sure I must be missing an obvious option.
  9. I know I am hijacking this, but teppo brought it up first Although, I am not sure that anyone outside Australia got these ads, but they played for a long time when I was growing up! I'd also like to see an option for the color scheme to be chosen during installation!
  10. Actually, on the topic of the default look. I personally quite look the futura color scheme, and I don't mind the warm (your current default), but I wonder if "modern" should be the default since it most closely matches the color scheme of the PW website. So, while the website looks as it does, I think that "modern" would be my vote for default "color set" and for the installation routine. Anyone else have a preference?
  11. Nice work - that's pretty much exactly what I was thinking. I am not sure about setting the flags to system and permanent though as the defaults for a function. I think there should at least be a comment on that line that users should adjust to their needs as I don't think this is a typical use case. Glad to see that code of mine is getting some use - I have to say it was quite an effort to figure out and as you said, very un-PW in its complexity. I would love to hear from Ryan as to whether there is an easier way to achieve this. Also, for the sake of putting all the information about creating and working with repeaters from the API in one thread, I think it is worth mentioning the special getNew() method for creating repeater items. It is used in the Page Tree Migrator module and described in detail on this page: http://processwire.com/api/fieldtypes/repeaters/
  12. Exactly what I was thinking. If you don't get to it, I'll do it when I am back at my computer.
  13. I agree it does seem complicated, but so long as it works for you On mobile at the moment, but I might try to clean up that codea little and comment it better so people know what's going on. Glad it worked for you!
  14. Good find - I had forgotten about that post I just used the code from that other post of mine on a fresh PW install (latest dev, although I think it should work on 2.3 stable as well) and it works perfectly. I know that when I was playing around with writing that code I often messed up the PW database to the point where I was getting errors and found the best way was to do a fresh install again. BUT, I just noticed that you are missing these key lines in your version: $repeater_page = "for-field-{$f->id}"; $f->parent_id = $this->pages->get("name=$repeater_page")->id; $f->template_id = $repeater_template->id; $f->repeaterReadyItems = 3; This is critical to make things work. Let me know how you go.
  15. Ryan - just wondering if you are planning on theme-ing the installation routine to match the new default admin theme before 2.4 is released? I think it's important for maintaining a cohesive look for PW.
  16. It doesn't know"$pages". Is the mail script bootstrapped on PW or are you calling a template page directly from the cron job? You might try using wire('pages'), I am not sure this will work, depending on how that script is set up. I think the most reliable and easiest way would be to use the LazyCron PW module: http://modules.processwire.com/modules/lazy-cron/
  17. Sorry, I don't have much time, and maybe someone else will provide a simpler answer, but I went through the process of figuring this out for a module. It was more complicated because I was creating the repeater fields from JSON, but if you search through this code: https://github.com/adrianbj/ProcessPageTreeMigrator/blob/master/ProcessPageTreeMigrator.module for "repeater" you should find what you need in there. Sorry I can't be of more help right now.
  18. One more tweak this morning. There is now the option to preserve the uploaded filename for certain rules. This will allow you to set a general renaming rule for your entire site, but then add a rule for a specific page/template/field that does not rename the uploaded file. Just simply build the rule, but leave the Filename Format field empty. I am not sure if this is what @peterfoeng was looking for in his post above, but hopefully people will find it useful regardless. For the moment, this new version is only available as the attachment here. CustomUploadNames.zip
  19. I just tested and it seems to work fine at my end too. If you're comfortable in PHPMyAdmin you could delete the entry from the field_geo_address table. It would be great to figure out why it's not working for you. But if you need this quickly, it might be the simplest way for now.
  20. The full path to the image would be: /home/samplers/public_html/dev/test/images/Best MCC Pic-2.jpg When PHP is doing file operations you need to use the path, as opposed to the URL, which would be: http://dev.domain.com/test/images/Best MCC Pic-2.jpg
  21. The top save button has had some issues actually saving any changes in some web browsers on older versions of PW. Everything should be fixed in recent dev versions, but if you don't want to upgrade, try using the save button at the bottom of the page and see if that works.
  22. Hi jacmaes, Yes, I am intending on adding some more options. I will have a need for some of these features myself shortly anyway. I'll see what I can do about getting them added sooner than later and then releasing this officially. Thanks for the nudge
  23. Ok, sorry for the delay on this. I have added the ability to rename files uploaded via the API. It works on my testing using something simple like: $page->images->add("/local_path_to_image/image.jpg"); $page->of(false); $page->save(); I have attached a revised version of the module, rather than pushing to github for the moment. Please let me know if it works ok for you. I am not sure how your upload form is working, but at the moment the module will rename the file in its original uploaded location before copying it to the final ID based folder under /assets/. I am not sure if this will work in all scenarios, but I had to use a "before" hook on "Pagefile::install" so that I could still change the filename using: $event->setArgument(0, $newFilename); Using a before instead of after hook means that I am working with the file in its original location. It also means the module can't handle images from remote servers with full http:// paths. Does anyone have any ideas how I might be able to rename after it has been move to the assets/xxxx/ folder? None of the InputfieldFile hooks get called with API uploads, so they are out. I am thinking maybe I might need Pagefile::setFilename hookable, but I'd love to hear any ideas on how to do this. On an unrelated note, I have also added the ability to drag/drop sort the rules in the module settings, making it easier to change the order as needed, which can be important if you have a lot of very specific rules that need to take precedence over more general ones later in the order. CustomUploadNames.zip
  24. Firstly, try it without the rawurlencode. If it still doesn't work, try using the full path to the image. The "./images" might be correct, but doesn't hurt to try.
  25. Well if neither my module nor Martijn's are working, it makes me wonder what is going on with your server / configuration. There are lots of ways to do this with a regex. Here is an example from teppo: https://github.com/teppokoivula/TextformatterImageWrapper/blob/master/TextformatterImageWrapper.module that should get you going.
×
×
  • Create New...