Jump to content

gunter

Members
  • Content Count

    60
  • Joined

  • Last visited

Community Reputation

6 Neutral

About gunter

  • Rank
    Distinguished Member

Profile Information

  • Gender
    Male
  • Location
    Vienna
  • Interests
    Climbing, Yoga, Martial Arts

Recent Profile Visitors

1,988 profile views
  1. problem solved! I have to set a unique id -> then the code from my last posting works - without setting the id -> just one page (the last one) is getting added to the page array $p->id = rand();
  2. $days = 20; $selector = "template=basic-page"; $resultPageArray = $this->pages->find($selector); for($i=0;$i<=$days;$i++){ $p= new Page(); $p->template = 'basic-page'; // set template $p->title = rand(); $p->name = "virtual-page".rand(); $resultPageArray->add( $p); } d($resultPageArray); the dumping function is very useful! Unfortunately I have a problem, this code should in my opionion add 20 pages to items... but only one page gets added, the rest are under $resultPageArray->itemsAdded
  3. Adrian,please... how did you get that clean pagearray debugging info into the bottom screen?
  4. Aaahhhh!! A name! That's it, I didn'nt gave one! Thanks so much, Adrian!!!
  5. $calendarPageArray = pages->find($selector); $p = new Page(); // create new page object //some page stuff... $calendarPageArray->add($p); I found out that it doesn´t seem to be possible to add an unsaved page to the pagearray... It´s for a worktime scheduling calendar... a have some real pages with the weekdays and their worktime... and I have also pages with special calendar days with special worktime.. I want get the calendar days from the pagetree into a pagearray... and then adding the generic weekdays as somehow virtual unsaved pages into that pagearray...
  6. Looked really nice.. but after clicking submit the page disappeared from the menu structure... In the admin it was still editable - but at the settings of the page at status was written "corrupted" -> I think, the culprit is the image field.. First I thought that a custom fieldtype written by me... or other fields are the problem, so I added them to $ignorefields and tried to add them again field by field... everything went fine!!! then... I tried to upload an image but this error came: Can’t save page 1610: /about/xxx/: Call $page->of(false); then.. I uploaded an image in the admin... in the frontend view I did nothing, except clicking the submit button of the form -> and "page corrupted" appeared in the page status
  7. Are you using normally just strtotime and time for your date/time calculations???? Because pw uses them for the datetime fieldtype? Or addionally the datetime class? * Because I just made a small calendar module, which uses datetime... but now I´m thinking about, if this was a good idea...
  8. thank you! wall time made it more clear for me! This is a nice page about time!
  9. 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... *
  10. 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();
  11. 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();
  12. 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?
  13. 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
  14. 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
×
×
  • Create New...