Jump to content

adrian

PW-Moderators
  • Posts

    10,902
  • Joined

  • Last visited

  • Days Won

    349

Everything posted by adrian

  1. Ah ok, that makes sense I presume you have seen this, but just in case: http://modules.processwire.com/modules/process-forgot-password/ Also, worth reading this: http://processwire.com/talk/topic/490-how-to-reset-your-password-how-to-enable-the-forgot-password-function/
  2. Hey Marty, But doesn't that module send a new password - I don't think it can send the user an existing password. Not sure how it would help in your case, but maybe I am missing the point. I am sure what you want to do is quite easy to accomplish, I just think that it might be better to explain to the client why it's not a good idea. Not many sites allow password recovery these days. EDIT: A password reminder might be a reasonable solution though, rather than sending their actual password. That could easily be stored as a custom field in the user template and emailed out on request.
  3. Hey Marty, the password is encrypted, which is why this isn't really possible. I guess you could hook into user save and make a copy of the password in a plain text field that could then be emailed, but I am sure everyone would agree that this is not a good idea
  4. I haven't got many ideas left for you at the moment, but I would try generating your feed using the vanilla example that Ryan's mentions on the module page: http://modules.processwire.com/modules/markup-rss/ Take the code out of your function and see if that generates the feed xml properly. Also make sure there is nothing else in that rss.php template - no main or head/foot inc files etc. If that works, then you can try adding it back into your function if need be.
  5. http://processwire.com/talk/topic/3775-formbuilder-export-to-csv-or-excel/
  6. Hi lowlines and welcome to PW. Not sure if you have seen this module or not: http://modules.processwire.com/modules/after-save-actions/ but it allows you to control what happens after a page is saved. Not sure exactly what would be your best option, but you should be able to hook into before save, eg: $this->pages->addHookBefore('save', $this, 'setPublished'); The setPublished function would then remove the unpublished status for the page. Does that help at all? Also, have you seen: http://processwire.com/api/hooks/ http://processwire.com/api/hooks/captain-hook/ EDIT: Have a read of this: http://processwire.com/talk/topic/2331-doing-additional-logic-after-saving-a-new-page/?p=21881 Talks about doing additional logic after saving a new page and so I think might suit your needs. Might be the addHookAfter('added' that you are looking for, although do you really want to publish a page that has just been created and still only has a title and name field assigned?
  7. Here is a revised version of the module. It accepts all Page::status options, eg. $form->pagestatus = Page::statusUnpublished; $form->pagestatus = Page::statusHidden; If left blank, then the page will be published. Not sure if this is really an ideal default. Maybe it would be good to get some input from others on this. FormTemplateProcessor.module
  8. Nice - the only thing I was thinking by the approach I suggested is that it would allow you to also set the status to hidden, or any other option you wanted.
  9. It might be best to go with something like: $form->pagestatus = 'unpublished'; That way the module could simply grab "pagestatus" and add it to the page using addstatus before saving. I'll see if I can find a few minutes to modify the module to handle this.
  10. I don't think Ryan has that option in the module. The module code could be enhanced to handle that, or you could do something like this after rendering your form. $newpage = $page->children->last(); $newpage->removeStatus(Page::statusUnpublished); $newpage->save(); I think this should work. EDIT: added the necessary save line at the end. EDIT #2: Actually not sure if this will work at all - this could get messy if the form is rendered and not submitted and if someone else submits while another form is still being filled out. Sorry, might need to rethink this and go with editing the module code properly. Ignore all the above and see http://processwire.com/talk/topic/59-module-want-form-builder/?p=41431
  11. Oh, I see - you are actually using Ryan's module from the first page of this thread - sorry, my bad! I assumed you were using diogo's code. There is a line in that module: $this->contact->status = Page::statusUnpublished; The easy hackish option would be to remove that line from the module code.
  12. Just before: $mypage->save(); which I mention a couple of posts above, you just need to add: $mypage->removeStatus(Page::statusUnpublished); EDIT: although I thought they were published by default and you actually had to add: $mypage->addStatus(Page::statusUnpublished); to set them to be unpublished.
  13. But if they are showing up on your reader page where you are using: echo $rss->render("http://undpw.local:8888/rss-vacancies"); I don't really understand, because they were not included in the XML output when viewing that page (http://undpw.local:8888/rss-vacancies) directly in the browser. Is that correct?
  14. Ok, sorry, I thought you were using the feed generator module on the reader side for some reason. My mistake! It is all starting to make more sense now. Your code for MarkupLoadRSS (RSS Feed Loader) looks correct - sorry for the confusion there. So I guess the issue is still the generation of the feed at that url on the other site. I am at a loss for why it is showing selector-test (which it shouldn't) and nothing else. Strangely, when looking at the output for your reader page, it seems like it is actually showing results of pages from the PW default profile (eg: Child page example 1).
  15. I know you are doing some unusual things with the include, but you still can't (unless there is something I am missing about the module), do: echo $rss->render("http://undpw.local:8888/rss-vacancies"); Try this instead: $rss->render($items); You shouldn't need to be echo'ing it either. At least try this standard approach first so you know the module is working as expected for you. Then perhaps you can figure out and better explain your other needs regarding the two site approach to all this.
  16. I just re-read this bit: I think I get what you are trying to do, but I don't think this can be done with an include. You certainly can't call $rss->render on a url like that. It needs to be on a page array. I think you might be able to make it work with a screenscrape approach. There might be better ways, but I still don't understand the connection between the feeder and reader sites. Are these separate domains? Again I am not really sure what you are after, but simplepie (http://simplepie.org/) might be useful if you are trying to parse an RSS feed from one site and display the results on another. I think we still need more details to help you to figure out what you are trying to do.
  17. The code to render the rss feed should be placed in a template/page called "rss" or similar, not in the template for a "normal" page that includes content that you want in the feed. Try that and let us know how you go.
  18. Thanks Willy, I guess I am suggesting that Ryan remove the 255 limit since this is the default for the built in title field. Admittedly long titles like these are somewhat of an unusual case, but I have a few sites where the client is entering newspaper articles and scientific journal articles and the titles of these can be very long and I don't want them truncated. Ryan mentioned that the title should never be truncated, so just trying to ensure that this actually is the case by default.
  19. Hey Ryan, Little bit of confusion on my part - I was using an older version of PW to test these changes. Now testing on dev, so this should all work fine. Regarding the title field - it is being truncated by the input field: <input id="Inputfield_title" class="required InputfieldMaxWidth" name="title" type="text" maxlength="255" /> Of course the DB field "data" is a full text, so it is not being truncated there, so firstly, can we remove the maxlength from the input field for the title? Also, there is a line in InputfieldPageTitle.js which is designed to truncate "var" to 128 characters. So, what I have done in InputfieldPageTitle.js is: //var val = $(this).val().substring(0, 128); var val = $(this).val(); Then in InputfieldPageName.js: //if(name.length > 128) name = name.substring(0, 128); if(name.length > 128) name = $.trim(name).substring(0, 128).split("-").slice(0, -1).join(" "); Does that all makes sense? Would you rather I submitted this as a pull request?
  20. I can't say I understand why you are getting just those page being detected, especially the selector-test page. It also shouldn't be finding your /rss/ page in the pages list. Can you please show us exactly the selector you are using, along with a list of the pages that are returned with the selector test tool, or with the following, where {selector} is the selector code you are using: foreach(wire('pages')->find( {selector} ) as $page){ echo $page->title . '<br />'; } Maybe also post the complete code that you have in your function. Also, just for the fun of it, can you see what happens when you don't put the rss render code in a function. Maybe also write out the page tree for your vacancies pages, including the templates for the parent and child pages. I am sure we can figure it out.
  21. If this is in a function like your previous post suggests, then you need to do: $items = wire('pages')->find ... If that is not the problem, what happens if you go back to back to the standard: $items = $pages->find("limit=10, sort=-modified"); Does it work like that? I am also wondering about "include=all". Do you really want items that have been added to the trash to show up in your feed? Do you have debug on? Any php errors?
  22. Inside functions you need to use: wire('modules')-> Same goes for wire('pages') etc. This is due to variable scope issues: http://php.net/manual/en/language.variables.scope.php If you are ever writing a long function where one of the PW variables is used many times, you can always define it at the top of the function: eg: $modules = wire('modules');
  23. Hi and welcome to PW. I haven't used vagrant, so I am not sure why there would be an issue with the PHP session path, but have you checked that PHP can write to: /vagrant/rhythm-site/site/assets/sessions
  24. It looks like he has taken care of the image stretching too much on the last line (or if there is only one image): https://github.com/ed-lea/jquery-collagePlus/commit/a31bd4e661f22eda169266e4b70c0212bae62211 Regarding the issue of waiting for all images to load before displaying anything can be taken care of by simply removing the: $(window).load(function () { in your plugin. Since all the images you are sending to it have width and height attributes, it doesn't need to actually load them all before starting to display them.
  25. Hey Ryan, Using the following in InputfieldPageName.js seems to do the trick. if(name.length > 128) name = $.trim(title).substring(0, 128).trim(this); I was looking at InputfieldPageTitle.js and noticed that it doesn't actually do the truncate to 128. The browser is truncating to 255, but I think it is missing something like: $titleField.val(val).trigger('blur'); Also, I am not sure why, but the approach in the first code block above doesn't work for the title. Instead, I had to use: if($titleField.val().length > 128) val = $.trim($titleField.val()).substring(0, 128).split(" ").slice(0, -1).join(" "); But, I guess I am not sure what you actually want to do with the title field. Do you want it truncated to 255, or 128 to match the length of the name field? Some potentially more robust ways of doing this: https://github.com/micjamking/succinct/blob/master/jQuery.succinct.js https://gist.github.com/ChrisCinelli/5688048 Neither tested so far, as I don't think we need them. In particular, the succinct plugin was designed to deal with a couple of edge cases that I don't think should affect us: http://stackoverflow.com/questions/4637942/how-can-i-truncate-a-string-in-jquery
×
×
  • Create New...