Jump to content

adrian

PW-Moderators
  • Posts

    10,902
  • Joined

  • Last visited

  • Days Won

    349

Everything posted by adrian

  1. Hi Richard - this should all be very easy to solve. You say that linking directly to submission.php in the templates folder works - that is weird, because the htaccess rules that come with PW prevent calling php files from the templates folder directly You should get a forbidden error. If you want to call the file directly, you should place it in a folder outside the site folder. This is pretty common practice when processing forms, or calling ajax scripts. You can redirect ($session->redirect) back to a page after the submission, so the user won't even see the .php file in their browser. That said, there should also be no problem processing a form from a page that has the submission.php template if you'd prefer. I think we need to see your code so we can help - should be an easy fix!
  2. What about if you use this link: http://gdata.youtube.com/feeds/api/users/disney/uploads?orderby=updated&v=2&client=ytapi-youtube-rss-redirect&alt=rss That actually contains the thumbnail url. Note the "api", rather than "base"
  3. This should be very easy to add. Sorry I don't have time in the next few days and so it will probably have to wait till the new year, but if you are in a hurry, take a look at: http://flourishlib.com/docs/fMailbox That shows what you need to add: "received" (date) and "from". If you decide to add this support before I get a chance to look into, please send me a PR It seems like going forward, this module needs to be further configurable so you can decide what fields you want stored and which PW fields you want them added to.
  4. I am not really sure on why that would happen - did the import actually work properly after commenting out that check? The fact that $fp is empty at that point in the code suggests that the conversion from the xml into a json file ready for parsing by migrator didn't work. But if it all worked as expected for you, then I'll just add it to my list of things to keep an eye on.
  5. Can you PM me the zip or JSON file you are trying to import so I can take a look?
  6. Hi Charles, I think my fork is well ahead on the attachment functionality. In my limited tests I think it was working in all situations, but I might have missed something - so many different things to consider with different email clients. Anyway, please test my version and let us know how it goes for you.
  7. If I understand correctly, the usual approach is to use a counter inside your foreach. $i=0; foreach($sliderimage as $image){ echo '<img ' . ($i==0 ? 'class="active"' : '') . ' src="{$image->url}" />'; $i++; } Or something along those lines.
  8. Sorry, in a rush, but I think you are correct - I think it's coming from: $_SERVER['HTTP_HOST'] https://github.com/ryancramerdesign/ProcessWire/blob/7b9730d43e6eda8bd27841a4811a1b9737bfe903/index.php#L41 I wonder if Ryan should add a backup check for $_SERVER['SERVER_NAME'] if host return nothing. Can you confirm what $_SERVER['HTTP_HOST'] is actually returning?
  9. This might be easiest using jquery which you can do quite easily from your module also. Looking at your str_replace, I don't really get it. Wouldn't you want: $event->return = str_replace('<div class="container">', '<div class="container" contenteditable='true'>', $event->return); But that said, I think jquery might be easier: $('.container').attr('contenteditable', 'true'); Otherwise, you might want to consider domdocument to modify it in PHP if you need to do it server side - it really depends on whether you can guarantee the exact structure of that container div. Have you tested that the $event->return is actually being implemented in the first place? Have you looked at the: $event->replace = true; option?
  10. Well: $config->urls->root will usually just give you "/" $config->httpHost should give www.example.com How are you defining the url in config.php ? Is this an issue in your local testing environment, or on a live server?
  11. Really lovely looking site Peter - clean and professional, and a great writeup on PW too! Only one quick thing I noticed - the dropdown menus are missing highlighting on subitems - not a big deal I guess, but the root item becomes almost invisible when hovering on the subitems because it goes back to being green text. Love your post above too!
  12. Any chance you are using these inside a function or module? In that case you'd need: wire('config')->urls->root Do you have debug mode turned on? That should let you know that you have an undefined variable: $config
  13. Sorry about that teppo - I knew there was another one, but had forgotten what it was
  14. Looks pretty good to me. A couple of things though: if ($f->type == 'Email') etc should be if ($f->type == 'FieldtypeEmail') - at the moment those won't be triggered at all. I think you should change though is to add "true" as the second argument for the pageName. This might not be necessary depending on the input, but I don't think it hurts. Glad you got it all working in the end!
  15. There are a couple of options: https://processwire.com/talk/topic/5019-template-notes/ https://processwire.com/talk/topic/8392-simple-built-in-docs/ Hope that helps!
  16. Yeah, we have the same thing in Canada, but it doesn't do S*&t!!! I almost think some companies are using it as a free call database to work with
  17. I haven't read through your code yet, but have you seen this module: http://modules.processwire.com/modules/inline-editor/ It is listed as proof of concept, but it might work for you, or help you solve the problems with your code. There is of course also Fredi: http://modules.processwire.com/modules/fredi/ and AdminBar: http://modules.processwire.com/modules/admin-bar/ - even though they are not inline, they do make front-end editing easy.
  18. If I understand correctly, this could be done easily with a page field added to the user template. To access the user template, go to the templates page and click Filter > Show System Templates. The Page field (probably ASM Select) that you add would be linked to all the film pages. So you'd just select the films they are allowed to view. Then in your template files you can check whether the user has the film selected before showing it in the list of films for them to watch. Let me know if anything there doesn't make sense. EDIT: Of course it could also be done from the other direction. The template for the films could have a page field that contains a list of all the users and you could choose which users can view the film. You might want to consider PageAutocomplete as the Inputfield type if you end up with a lot of films / users.
  19. Thanks to Soma: https://processwire.com/talk/topic/3875-module-to-add-userid-to-pages-and-control-edit-permissions/?p=37915 Also check out the revised version a few posts below from pogidude. And also this version from tinacious: https://processwire.com/talk/topic/3271-can-i-limit-page-editing-to-the-user-that-created-that-page/?p=32121
  20. Oh I see - you are using a textareas field - sorry, I read textarea, not the plural. What about: $p->prod_features_multi->prod_rating_operating_voltage->setLanguageValue($en, 'test'); BTW, I am sure it works fine, but why: if((string)$p == "1798"){ and not: if($p->id == 1798){ EDIT: Are you using the new multilanguage version of the textareas fieldtype? Also, maybe this question should be posted in the support thread for Profields - that way it will get Ryan's attention for sure.
  21. I am no multi language expert, but i think you need this: $p->prod_rating_operating_voltage->setLanguageValue($en, 'test');
  22. I am also not sure if using die/exit is the only way, but it is what I used in my Table CSV Export/Import module: https://processwire.com/talk/topic/7905-profields-table-csv-importer-exporter/ - see the "Export as CSV" button at the bottom of the first screenshot. The one thing in that module that you might find useful in this module is the hidden iframe technique I used to make the download work without the need to open an extra page: https://github.com/adrianbj/TableCsvImportExport/blob/master/TableCsvImportExport.module#L191 Take a look at the JS file in that module to see how I am modifying the src of the iframe on the fly when the Export button is clicked: https://github.com/adrianbj/TableCsvImportExport/blob/master/TableCsvImportExport.js#L6 Hopefully you might find something to copy, or maybe someone else will have a better idea!
  23. Hi Tom, I don't fully understand what you have done, but if I was trying to run two sites with one in a subfolder of the other I would also set up a subdomain: theory.example.com and an apache virtual host that points to that subfolder when called via the subdomain. Is there any reason you need the url to be www.example.com/theory rather than theory.example.com? You could do some redirects if needed.
  24. Well I am trying - wish I wasn't failing you though One thing I just noticed is that you can remove all occurrences of $this - with this code in a template, you just need $input->post...... I have no idea why this would make a difference, but have you tried: $np->set($f->name, $input->post->{$f->name}); Both work for me, and the $form way is better, but thought this might help us debug.
  25. Definitely working for me, but it sounds like you problem might be that the template from the page that is being used to create the form doesn't have a title field. Is that right? You need to give a page a title or at least a name - name will be created from the title if it is provided, but the name isn't. How are you planning on setting the name/title for the created pages? Have you tried debugging what part of that line is causing the error? Is it $f->name or $form->get($f->name)->value - try replacing each one with fixed values to see where the problem actually is. Yes you are right - you need to save the page before adding fields to it. Are you making use of the automatic page name option? Is that why it is being given a title of date/time?
×
×
  • Create New...