Jump to content

gunter

Members
  • Posts

    76
  • Joined

  • Last visited

Everything posted by gunter

  1. let´s think about an appointment scheduling website... It´s about meeting personally - making an appointment with the hairdresser, massage therapist... is it possible to ignore the timezone? Is it possible to store an appointment (10:00 till 11:00) so it is saved and viewable forever correctly, even if the server time setting is wrong? And just using the timezone to decide when a reminder email has to be sent? Once I was invited by friend from another country who made an facebook event to meet during his travel in my town with some friends... at 6 pm... and then there was nobody there because they real beginning was at 7 pm... because he was in another timezone when he created the event and facebook thought... ah... different timezone... lets subtract an hour to the beginning of the event... *
  2. I have a solution: in the EventArray I wrote this: public function setTrackChange(){ parent::trackChange('value'); } it works now with this modification, I don´t know if there is a better way $page->events->setTrackChange(); $page->save();
  3. A problem occured... this code does not work, the updated event field is not saved (but saving works, the title is saved) and the sleepvalue method isn´t called $page->title = "custom title"; foreach($page->events as $event){ $event->location ="new location"; $event->notes ="new notes"; } echo "now we save..."; $page->save(); but when I add an event to the field array the new event is saved AND the fields are stored - this code works: $event = new Event(); $event->date = "1979-10-12 00:42:00"; $event->location = "Vogsphere"; $event->notes = "The homeworld of the Vogons"; $page->events->add($event); foreach($page->events as $event){ $event->location ="new location"; $event->notes ="new notes"; } echo "now we save..."; $page->save();
  4. importing the wiredata to the new wire array did also not work... so I found out, that the wire data was referenced and not cloned/copied... this works now... $copies = new EventArray(); //new wire array foreach($originals as $key => $original){ $copies[$key] = clone $originals[$key]; //cloning the wiredata does work.. } shall I just put this into a __clone(); method in my wire array?
  5. how can I make a copy of an wire array? clone does not work.. $copies = clone $originals; foreach($originals as $original){ $original->title = "this is the original"; } foreach($copies as $copy){ $copy->title = "this is the copy"; } foreach($originals as $original){ echo "<br>this is the original? ".$original->title; } foreach($copies as $copy){ echo "<br>this is the copy? ".$copy->title; } outputs this this is the original? this is the copy this is the original? this is the copy this is the original? this is the copy this is the copy? this is the copy this is the copy? this is the copy this is the copy? this is the copy
  6. I will use this until I find a better solution $value = $s->first(); while ($value) { if($value->start==50){ //just an example to select an element $s->insertAfter($insert, $value); } echo $value.'<br>'; $value = $s->getNext($value); } [edit] I have now the solution, I rewrote the iterator class for my wire array an now it works
  7. Sorry guys, this is not what I need... inserting the array element should be IN the loop I found some snippets here and will try it in the evening: https://stackoverflow.com/questions/2348077/change-initial-array-inside-the-foreach-loop $array = array('red', 'blue'); foreach($array as $key => &$value) {// <-- here $array[] = 'white'; echo $value . '<br />'; } A while loop would be a better solution. while (list ($key, $value) = each ($array) ) { $array[] = 'white'; echo $value . '<br />'; } (edit: unfortunately this code did not work...)
  8. I have a sorted list of calendar events, stored in a wire array. I want iterate/loop through the wire array and at a specific condition I want split the actual element into two elements... so I use inserAfter() the actual element - this works wonderfull, but with foreach the loop does not know that the array is now an element bigger.... so foreach does not work, insertAfter() does work, but the new element does not show up during the loop // $s is a wire array containing 10 Elements $insert = new Event(5555); foreach($s as $key => $event){ if($key==5){ $s->insertAfter($insert, $event); //insert an new item when $key==5 } echo $event; } this works... the inserted item is shown after inserting it into the array $insert = new Event(5555); $count=count($s); $counter = 0; while($counter <$count) { if($counter==5){ $s->insertAfter($insert, $s[$counter]); $count++; } echo "<br>".$s[$counter]->start; $counter++; } but I want a shorter/ more elegant solution
  9. How is it possible choose time with the datetime picker? It is possible to select the date, but not the time.... I´ve looked and tried a few things... but nothing did work...
  10. How can I load a file and use it like page template, populate variables and render it? There is such a functionality, I searched 15 minutes, but I cannot find it!
  11. Hi Ridgedale, I didn´t know that it´s possible to approach the $page-title also via page()->title... and so I thought that´s why the "call to undefined function page()"- error came from...
  12. Do you mean... you want handle the request/url in your template (controller) and take the url segment (method) and map it to a corresponding method in a class of your template? ...like Codeigniter Framework has it? url/xxx/yyy/zzz calls method yyy in controller xxx with zzz as argument? Or do you just don´t know how to use url segments? here this guy uses this kind of url segments...
  13. thank you all, guys! I will try the tracy debugger, adrian! And will think about getting the api explorer!
  14. What is the best and easiest way to get the documentation to my computer? I had problems with the connection to the internet provider and processwire without documentation is sometimes difficult for me...
  15. Interesting solution! ;-) A possible way then would be to see this xy array as image and use pixel manipulation functions bool imagesetpixel ( resource $image , int $x , int $y , int $color ) But I´m not sure if this ist the best solution... to use different "time systems" because, I have my google calendar events, that block my availibility. I have already booked events, that block my availibilitiy, too... Then I can offer the visitors timeslots that they can book...
  16. I want program an appointment system... I am thinking about how I can do this. At first, how would be the most elegant way to store the data from the picture? these are 15 minutes slots for the general working hours for each day (of the week and for special days)
  17. I don´t know why but the problems are gone... I had this problems when I developed with Windows 8.1 and Processwire... and then deleted a language... I installed everything new at my remote linux webspace.. now everything is ok
  18. Which wamp/mamp/lamp system are you using? I wanted build my site local at my windows 8 computer and export that to my webspace provider... But I had so much errors and problems at my local computer, it looked like if processwire is enourmous buggy... I went almost crazy... Then I decided to build everything at the production server... and everything is fine now!
  19. hi kongongo, it´s a normal user page... here are the screenshots... I really don´t have a lot of pages...
  20. I have this error in the error log each time I call my main page what can I do? PagePathHistory::getPage() - SQLSTATE[42S22]: Column not found: 1054 Unknown column 'language_id' in 'field list' In URL stands /en/http404/ but I didn´t call that page, everything looks okay in both languages (de and en)
  21. I have noticed that 381 children pages appeared at a page, the have the name like for-page-20044 and there´s no delete field... The page is using 6 repeater fields... I see a children page with the same name like the page with 6 grand children pages, storing the content of the repeater fields.... But I have 374 other zombie pages... Why did this happen and what can I do?
  22. I solved my problem, too!!! I am now build up my site at the remote host at the hosting company.... And not at my localhost (Windows 8.1..) I had such a lot of bugs! Not just with the upload problems, but also missing table id´s after deleting the finnish language.... and a lot of others problems, too!!! And everything seems to work smooth now!
  23. Sorry for my long silence... I have the upload problem since weeks... It made me almost crazy... For all who did not read my posting: Upload don´t work because the ajax icon is turning and don´t stops. Either this is happening, or it´s not possible do drop the image, neither choose the image by hand in the file browser... I tried all wamp server (EasyPHP, UWAmp, Xampp) I tried all internet explorer, firefox, google chrome... I made "refreshed" my windows 8.1 Then... the problem was gone!!!! It worked... Then some days later... the problem was again appeared... I installed Virtual PC with used a virtual PC with a working Windows 8.1 Image from Microsoft... - > Same problem... I refreshed my windows again... it worked, problem was gone... Then... since the last days I installed 10 windows updates.... then made a system restore point... tried if the upload still works.. and then installing 10 more updates more... It still worked... But today it didn´t work.. I went to the last system restore point... and it worked again... funny story, eh? I´am curious why I don´t read that other people have the same problem.... Now I will install again slowly the software that I have installed since the last system restore point...
×
×
  • Create New...