Jump to content

xavier

Members
  • Posts

    7
  • Joined

  • Last visited

Everything posted by xavier

  1. Hello, I did (or I believe) it correctly but this function is still only visible to superusers. Version 2.7. Do I need to change something else? Thank you very much in advance! !!
  2. Thanks to all of you for warm and clever messages, it is a pleasure. Hello @Robin S I appreciate your suggestions, however my knowledge in programming is not enough to rewrite much code. I must use simple ways (simplified and created by others) to solve my problems although, probably, less efficient. Thank you very much
  3. @mr-fan Thank you for the code. The problem is my low experience and that the template I am using contains Angular. At this moment I can't redo the code Angular->php @kongondoThank you very much for your suggestion. I can assure you that I have been searching a lot within the forum and the modules without success. Obviously, I searched with the wrong key words. I also haven't found this, sorry. However, I have installed that module SchedulePages and seems to work very fine. Thanks a lot, it is what I needed, a simple way to switch on the pages automatically. Thanks again! !! Best wishes
  4. Hello, I wonder if it could be possible to add a new status to the pages. Additionally to hidden, lock and unpublished, it could be helpful for some purpouses add a new option: publication period (i.e. when a page will pass from hidden to visible or when a page will dissappear, become hidden). I hope you fill find this suggestion useful and, of course, easy to perform. Best wishes Xavier
  5. May be both of you are right, this is probably too big for me. Thank you very much for your time.
  6. First of all, thank you four your replies. I do not discharge change the code if necessary. It is a matter of calculate the time necessary to change in one way or in another (I can't). The web works ok, so I think that sentence it is also correct. May be it is not the best, but it works. What it is done in the web? Files are included in the template 'foto' which is child of the template 'fotos'. So files are searched according to the month and year, addtionally the user can navigate up or down, by an order stablished in the field 'ordre'. What it is wrong? I do not know how to add and scope, formula or what else in order to select, permanent and automatically files by date (using a date field or whatelse needed). You are right, it is a search. However I am not sure which code is used in that function. The following code is present in the module hanna-code and in file named pwangular.php: <?php header("Content-type: application/json"); $request = file_get_contents('php://input'); $data = json_decode($request,true); $query = $data["query"]; // $selector = wire("sanitizer")->text($selector); try { $paginas = wire('pages')->find($query)->toJSON(); } catch (Exception $e) { echo ("Check that sent fields and that of the DB are the same kind INT, TEXT, DATE...") ; } echo $paginas; return; In the code of the first message, the word 'busca' means 'search. 'ENCONTRADOS' means 'found'. 'todos' means 'all'. May be this helps. Thank you very much for your attention.
  7. Hello everybody, I consider myself less than a newbie, I have entered in processwire world after a recommendation and instantly I liked it very much specially the way to to add information to the web and get easily pages from a dataset. Before, I had to add every page, every link manually. I do not know almost anything of programming, I took an existing webpage, from an informatics course, and I am adapting it to my interests (you can visit it at http://www.bpod.cat). I know that it has something wrong because it is not as fast as I like but this is not the main problem now. The problem is that I would like to filter the files by date. Every day has a new file and may sometimes we add files previous to the present day. I would like that the system could filter files by date and showed, automatically, only files from present day to the past. The script I use is: <script> app.controller('FotosCtrl',function($scope,$http,pw){ $scope.busca = function(){ pw.busca('template=foto, title|comentari~='+$scope.termino).then(function(data){ console.log("ENCONTRADOS",data); $scope.encontrados=data; $scope.termino=''; }); } $scope.buscaFotos= function(fotos){ pw.busca(fotos).then(function(data){ $scope.encontrados=data; console.log("todos",data) }); } $scope.buscaFotos('template=foto,sort=-any, sort=-mes, limit=1, sort=-ordre, '); $scope.page=<?php echo $page->toJSON() ?>; console.log("PAGINA", $scope.page); }); </script> And then, for instance, to select some files I use this sentence: <a href ng-click="buscaFotos('template=foto,any=2017,mes=01,sort=ordre')">Gener</a> But, I can't filter the files automatically by date (to show only present day and before). I have searched in this forum some questions about date filtering and I do not know how to introduce the changes or have use it wrongly. Addtionally, I have introduced some date fields, one without data (date) (to be always present day) and other with the proper day (datefixa) but I also do not know how to comparare each other to get a valid result. I hope this question it is not out of range and someone could help me. Have a nice day. Xavier
×
×
  • Create New...