Jump to content

renobird

PW-Moderators
  • Posts

    1,699
  • Joined

  • Last visited

  • Days Won

    14

Everything posted by renobird

  1. Thanks Wanze, I can't upgrade just yet, but I will soon. Thanks for the workaround.
  2. Hi Wanze, Didn't think to check JS errors. There is indeed an error. TypeError: 'undefined' is not a function (evaluating '$(document).on') ProcessBatcher.js: 97 Maybe a conflict with another module's JS?
  3. Hi Wanze, I've installed the module, and am logged in as Superuser. However, I don't see the edit or create links. The html is there when I inspect, but it's set to hidden somehow. Thoughts?
  4. OK, it's been a while since I looked at this, and much of it was inspired or guided by Ryan. I had to boil it down a little to make it generic enough to make sense, so this exact code hasn't been tested, but it should get you started. Here's a proof of concept that works. Template for your calendar page <?php function pagesToJSON(PageArray $events) { $json = array(); foreach($events as $event) { $json[] = pageToArray($event); } return json_encode($json); } function pageToArray(Page $event) { $data = array( 'id' => $event->id, 'title' => $event->title, 'start' => date("Y-m-d H:i:s",$event->start_date), 'end' => date("Y-m-d H:i:s",$event->end_date), 'url' => "./$event->id", // event ID is the url segment ); return $data; } if($input->urlSegment1) { // event ID provided as a URL segment to this page $event = $pages->get("id=$input->urlSegment1"); include("./includes/head.inc"); echo $event->title; echo $event->body; include("./includes/footer.inc"); } else if($config->ajax && $input->get->start && $input->get->end) { // fullCalendar making an ajax request of events $start = (int) $input->get->start; $end = (int) $input->get->end; $events = $pages->get("/calendar/")->children("sort=start_date"); $events = pagesToJSON($events); echo $events; } else { //display the calendar $config->scripts->add('/site/templates/assets/js/fullcalendar.min.js'); $config->styles->add('/site/templates/assets/css/fullcalendar.css'); $config->styles->add('/site/templates/assets/css/calendar.css'); $config->scripts->add('/site/templates/assets/js/cal.js'); include("./includes/head.inc");?> <div id="calendar"></div> <? include("./includes/footer.inc"); } // end else ?> head.inc <!DOCTYPE HTML> <html> <head> <title><?=$page->title?></title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- CSS includes defined via $config->styles->add --> <?php foreach($config->styles as $url) echo "<link rel='stylesheet' type='text/css' href='$url' />";?> <!-- include jQuery --> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js" type="text/javascript"></script> <script>!window.jQuery && document.write(unescape('%3Cscript src="/site/templates/assets/js/jquery-1.6.3.min.js"%3E%3C/script%3E'))</script> <!--js includes defined via $config->scripts->add --> <?php foreach($config->scripts as $url) echo "<script type='text/javascript' src='$url'></script>";?> </head> <body> footer.inc </body> </html>
  5. Thanks guys, you are too kind. That calendar was done with Textpattern, but I built a proof-of-concept of essentially the same thing using Processwire. Ryan gave me some huge clues on using JSON. I'll post it when I'm back at the office next week.
  6. Apeisa, Nice call. I do see a need to figure out custom sorting eventually (Soma gave me some pointers today on IRC) but in this case your solution is a lot easier.
  7. Hadn't thought about it that way. So I would have a profile_image field and a user_images field, and move images between the 2? Actually, I would just be assigning an image from user_images to profile_image, no need to remove it from user_images. That might be the way to go.
  8. Hello all, I'm trying to get my head around sorting user images as well. Although, I don't really need to sort them as much as allow the user to choose which image is first. The scenario would be something like: 1. Present user with a grid of thumbnails showing their existing images. (got this part). 2. User selects an image to "use as profile image". 3. Selected image is now set to first in the images array 4. $user->save; Everything I think of seems far too complicated, I'm hoping there is a fairly straightforward way to do this via the API. A nudge in the right direction would be much appreciated.
  9. Glad you got it sorted out. Good luck with the rest of your project.
  10. Seems like there should be a fix. If access is defined via home_old, and home_old has: Do you want to manage view and edit access for pages that use this template? "yes" Would seem to me that it should work. ?
  11. Hmm, just looked at one of my installs and it only shows guest — which is checked. Seems to work correctly. You are still getting? Can't save page 1: /: Selected homepage template cannot be used because it does not define access. Are you sure you are editing the template that your "Home" page is currently using? I'm only asking, because I've done that one myself.
  12. Hi Wishbone, In your new homepage template, look under "Access" Do you want to manage view and edit access for pages that use this template? Check "yes". I think that should solve your issue.
  13. Jenn, Wow! Excellent work. The site looks and works great! One quick thing: The "Parent Orientation" quicklink on this page results in a 404. http://fyp.washington.edu/getting-started-at-the-university-of-washington/ I work at a University as well. Most of campus uses WP or Drupal, so I feel a bit like a lone wolf using ProcessWire (sounds cooler than black sheep). I think that's starting to change though—ProcessWire powered sites are starting to spring up around campus. Anyhow, great site—thanks for sharing.
  14. Soma, You are removing all my excuses for not learning how to code modules. Dangit.
  15. Wanze, I'm hoping to give it a thorough test run early next week. Thanks Wanze!
  16. Hi Ryan, that's great. I'll test it out later today.
  17. This is brilliant! Is there any way to make it only process emails that come from a particular account, or a whitelist of accounts? I have some potential uses here, but security is a huge issue—just having the address be obscure may not pass the litmus test of my scrutinizers. Well done all. This is very cool.
  18. Y'all are crazy.
  19. This is awesome! Those numbers are quite impressive. I'll be grabbing a license soon.
  20. I've never been to Europe. Can I bring the family and crash with you guys? We'll make the "meat up" part of a larger vacation.
  21. *slaps forehead* Sorry Ryan — works fine. I was testing with user info, and added the field to a custom user template I was testing instead of the system user template. False alarm. Thanks again for this, super useful.
  22. Hi Ryan, This is great! It seems to be working correctly for me if I use it to create a new field and use it in a template. However, if I use it to set a new "label field" for a select — I'm still getting the default (title). Install is running 2.2.9.
  23. Hi vanni, Welcome to the PW forum. I hope you've had a chance to give ProcessWire a test drive. I think you'll find it a more than suitable replacement/upgrade. You can achieve what you are after with TXP by using a plugin called cnk_versioning. The name is a bit of a misnoer, as it doesn't have anything to do with version control, but rather moves your pages,forms,css into the filesystem. That said, I sure hope you stick around and give PW a shot.
  24. I think Soma lives several minutes in the future from all of us. I would say the same for Ryan, but I suspect there are just more than one of him.
×
×
  • Create New...