Jump to content

gunter

Members
  • Posts

    72
  • Joined

  • Last visited

Everything posted by gunter

  1. 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
  2. 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
  3. 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...)
  4. 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
  5. 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...
  6. 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!
  7. 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...
  8. 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...
  9. thank you all, guys! I will try the tracy debugger, adrian! And will think about getting the api explorer!
  10. 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...
  11. 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...
  12. 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)
  13. 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
  14. 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!
  15. hi kongongo, it´s a normal user page... here are the screenshots... I really don´t have a lot of pages...
  16. 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)
  17. 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?
  18. 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!
  19. 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...
  20. I have a image upload problem! The ajax gif is turning and not stopping... The image and the resized image appears in the assets/file/xxx folder... The image-sizer.txt log file says it has resized the image (I switched debug on) the ajax gif is still turning When I click save... the image isn´t added to the page... :-( It´s an fresh pw installation... And I tried it with several wamp servers (easynews, xampp)
  21. Thanks Adrian, I wrote a save() function for my module... public function save() { // get stored data $data = wire('modules')->getModuleConfigData($this); // populate stored data array with the current data foreach($data as $name => $value) $data[$name]=$this->$name; // save config data wire('modules')->saveModuleConfigData($this, $data); return $data; // or return true or whatever you like } so I can use it in my module like this: //as example storing a GET variable $this->id = $this->wire('input')->get('id'); $this->save();
  22. Is it today still necessary to store a module configuration variable like this? <?php $data = array( 'something' => 'Well hello there', 'something_else' => 1234, ); $module = 'ModuleClassName'; // can also be instance of module wire('modules')->saveModuleConfigData($module, $data); //I can store a new value in the config variable, but it´s not stored... $this->set("module_config_variable","new value"))
  23. thanks for trying to help me (I had problems with composer) The solution was to completely reinstall windows.. And now it works... A small question I have... Is this the correct way to use the GoogleAPI module to retrieve the calendar list? (from within a module) $google = $this->wire('modules')->get('GoogleClientAPI'); $service = new \Google_Service_Calendar($google->getClient()); $calendarList = $service->calendarList->listCalendarList(); foreach ($calendarList->getItems() as $calendarListEntry) { $out.= " <p><a href='../'>".$calendarListEntry->getSummary()."</a></p>"; //dummy code ;-) $out.= $calendarListEntry[id]; $calendarTest = $service->calendarList->get($calendarListEntry->getID()); //echo $calendarTest->getSummary(); }
×
×
  • Create New...