Jump to content

adrian

PW-Moderators
  • Posts

    11,185
  • Joined

  • Last visited

  • Days Won

    372

Everything posted by adrian

  1. Have you read and followed the instructions in post #8 above? Particularly the bit about "Error 404 file or folder". It sounds like you need to download and install a separate url rewrite module. Hope that helps?
  2. The clue is in the array keys - see how there are lots of the same numbers? Your $days = array(); is inside the $programm loop so it is getting reset each time. Also you are outputting the results inside the $programm loop. Try this. Untested, but I think it should be right. $programm = $pages->find("template=event"); //find all pages with events $days = array(); // array for dates - defined once at the start foreach ($programm as $p) { $events = $p->time_loc; //find the repeater fields foreach ($events as $event) { $days[]= date("l, d. M Y",$event->getUnformatted("date")); //fill the dates array with the dates from the repeater } } //close programm loop $day = array_unique($days); // eliminate duplicate dates asort($day); foreach($day as $key => $d) { echo "<p>$key = $d</p>"; }
  3. $program = $pages->find will return an array of pages so you need to foreach through that as well.
  4. In a bit of a rush, but ->get will only ever return one page. You need ->find if you want to get all pages with parent=/products/ So maybe: $all_pages = $pages->find("parent=/products/"); foreach($all_pages as $p){ $p->of(false); $i=0; foreach($p->prod_image as $image){ //if($i!=0) $p->images->delete($image); if($i!=0){ echo $image . " selected to delete<br />"; } $i++; } } Note - really rushed and untested, but hopefully you get the idea.
  5. What I do is define a role called "deletor" with permissions to view, edit. and delete. Then for the appropriate templates give the deletor role the ability to edit the page. For those templates that should be edit only, only check edit for the editor role, not the deletor role as well. Does that make sense?
  6. adrian

    Graphics Tablets

    My gal's tablet and ergodex custom keyboard for Illustrator and Photoshop tool shortcuts
  7. As Ryan states: "The info field (in the page editor settings tab) is currently specific to server time and not affected by timezone settings." https://processwire.com/talk/topic/2846-timezone/?p=38793
  8. That makes sense - I thought I must have been missing something Yeah, most fields don't have created/modified db fields. Files/Images fields do - if you look at the DB structure they have both created/modified fields, although interestingly those fields don't exist on a new install - they get added the first time the field is used. So yeah, I think the easiest option would be to create another field to store that.
  9. Try this: $p=$pages->get("/mypage/"); $p->of(false); $i=0; foreach($p->images as $image){ if($i!=0) $p->images->delete($image); $i++; } $p->save("images");
  10. Maybe I am not getting your point, but I just tested this: $p=$pages->get("/about/"); $p->headline = "test"; $p->of(false); $p->save("headline"); and the page's modified date gets changed, just like it would if you saved the entire page. Are you getting different results, or am I off base on what you are trying to do?
  11. Try running this from a template file: $u = $users->get('admin'); // or whatever your username is $u->of(false); $u->pass = 'your-new-password'; $u->save(); to reset your password.
  12. It's not fully ready yet, but horst has been working hard on it. He will probably chime in here soon, but you can get a fairly recent version of his work here: https://processwire.com/talk/topic/6096-imagick-resizer-need-tests-for-icc-cms/ Navigate into the site-default/modules folder in the zip and grab the module from there.
  13. Sorry about that. I have a quick fix for you. Replace line#113 with this: $videoID = strpos($matches[2][$key],'#') !== false ? strstr($matches[2][$key], '#', true) : $matches[2][$key]; I need to get a more complete fix though because there are other ways to define the start time, but haven't got time right now as I want to check out all the options for vimeo as well. This should get you going in the meantime though.
  14. I am guessing you have also seen this module then? http://modules.processwire.com/modules/link-shortener/ Of course this requires manual creation of each shortlink, but thought I'd post it here just in case someone else finds it useful.
  15. Hi @Can, Here is another option for automatic shortlinks: http://modules.processwire.com/modules/process-redirect-ids/ It uses the ID of the page, so a link can be as simple as: mysite.com/1034 but as long as the page id is in the url somewhere, it will work, so you can structure the link to be whatever you want really. Not sure if it suits your needs or not, but thought I'd mention it just in case.
  16. Hey Nico, not ideal I know, but maybe this workaround would get you going with FieldtypePage fields as well? https://processwire.com/talk/topic/6187-upload-bug-with-image-field-using-inputfield-dependencies/?p=60588
  17. Hi kongondo, Thanks for testing. I should be able to do something for you along the lines of displaying the page names - I'll take a look. The error you are getting is an intentional protection when using the Create/Overwrite mode. Because this mode deletes all children and recreates them I check to make sure there are no other fields (other than title and name) that have content and also that there are no grandchildren that might be deleted. I guess I could add an additional config setting to allow this check to be turned off. Alternatively, the Edit mode will work fine because it won't affect other fields or grandchildren. I am thinking the config option would probably work well, but I am still worried that if this module is accidentally enabled on a template or page with lots of content fields, it could be very destructive without this check. Maybe it's just a case of the developer needing to be very aware of where they make it available. Do you have any thoughts on the best approach here?
  18. Thanks for the kudos. Hope you enjoy it. I am hoping to get to those improvements that Steve suggested sometime soon, but just completely swamped here at the moment!
  19. Glad to hear it sounds useful - please let me know how it goes for you and if you have any suggestions for improvements. I haven't had much real world feedback yet, so I would appreciate hearing your experience.
  20. Yeah, no need to freak out, the admin.php that got copies across goes into the markup subdir, so it's all good Ideally it should have been installed into your Home as the parent, which would have created "blog" as a child of home. I would definitely suggest trying by moving blog to have home as its parent, deleting articles and then renaming blog to articles. I think this should work just fine. Let us know how you go. I probably need some detailed examples with this module that show just how the structure is copied and installed. That will come (maybe a video even) once I find some time to finalized things. Great to have you testing things though.
  21. No offense taken. I have never been much of a curly brace guy - I was always into single quotes and concatenating. I know this goes against the general consensus of what's easier to read, but for some reason it seems more logical to me. You should also have a read of this post: https://processwire.com/talk/topic/4439-when-do-we-need-curly-brackets/
  22. Or you can do: $carouselMarkup = '<div id="carousel-'.$carouselId.'">'; A period in php is a concatenator, same as + is in javascript. The advantage to this approach is that it lets you apply a function to the variable, like: $carouselMarkup = '<div id="carousel-'.strtolower($carouselId).'">'; And actually you don't even need the curly braces inside double quotes if you are using a simply variable. It's only if you trying to do something like: $page->id that you need the curly braces surrounding everything. So this would work just as well: $carouselMarkup = "<div id='carousel-$carouselId'>"; So, it's good to have all these in your repertoire.
  23. I think probably the most important tip is to use google site search to search the forum, rather than the inbuilt IP.Board search which is often not great at all. site:processwire.com/talk "your search term" Obviously the quotes are always needed, but are a great idea when trying to search for an error message you might be getting.
  24. https://processwire.com/talk/topic/4323-field-dependencies/page-5#entry45033
  25. Firstly, you shouldn't use "$fields" as this is a PW variable (http://processwire.com/api/variables/fields/) Even so, that shouldn't actually stop things working. The error you are getting with that code does point to the issue that Dave mentioned regarding the max files allowed setting for the repeater_image field. If that is set to "1" then you don't need, and can't use first(). Does that fix things?
×
×
  • Create New...