Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/26/2018 in all areas

  1. I have a similar setup where around 100k pages per months are created. Even if your setup if more complex due to a lot of door, etc, I hope you will get the idea. You could structure your tree like the following setup : + Root |- - Building (building template) |- - - - 2018 (year template) |- - - - - - April (month template) |- - - - - - - - opened_door_entry (door template) |- - - - - - - - opened_door_entry (door template) |- - - - - - - - [...] |- - - - - - - - Reports |- - - - - - - - - - day_1_report (report template) |- - - - - - - - - - day_2_report (report template) |- - - - - - - - - - day_3_report (report template) |- - [...] another building/year/month/data tree The "door template" will contain the information about an unique entry (user id, dongle id, door id, access time etc). Each night, you generate a report for the current day update the monthly report And to access the data, you will have three options : access a global report for a given date or door_id, user_id... (speed: 1-2seconds) access a report for a given day and/or door_id, user_id... (speed: 1-2seconds) build a custom report from the entries (speed: fast with custom query, see below) With theses options, you can do some COUNT(), SUM(), etc on the fetched pages fields if required. For the option #3, you must go with custom SQL queries. A module is born recently (thanks @bernhard) which will help you to query your data, take a look at this thread: Or you can begin and modify this module for your needs : https://modules.processwire.com/modules/pages-sum/ Do not hesitate to ask precisions or discuss about your interesting project ✌️ Hope it help!
    5 points
  2. Page Query Boss Build complex nested queries containing multiple fields and pages and return an array or JSON. This is useful to fetch data for SPA and PWA. You can use the Module to transform a ProcessWire Page or PageArray – even RepeaterMatrixPageArrays – into an array or JSON. Queries can be nested and contain closures as callback functions. Some field-types are transformed automatically, like Pageimages or MapMarker. Installation Via ProcessWire Backend It is recommended to install the Module via the ProcessWire admin "Modules" > "Site" > "Add New" > "Add Module from Directory" using the PageQueryBoss class name. Manually Download the files from Github or the ProcessWire repository: https://modules.processwire.com/modules/page-query-builder/ Copy all of the files for this module into /site/modules/PageQueryBoss/ Go to “Modules > Refresh” in your admin, and then click “install” for the this module. Module Methods There are two main methods: Return query as JSON $page->pageQueryJson($query); Return query as Array $page->pageQueryArray($query); Building the query The query can contain key and value pairs, or only keys. It can be nested and contain closures for dynamic values. To illustrate a short example: // simple query: $query = [ 'height', 'floors', ]; $pages->find('template=skyscraper')->pageQueryJson($query); Queries can be nested, contain page names, template names or contain functions and ProcessWire selectors: // simple query: $query = [ 'height', 'floors', 'images', // < some fileds contain default sub-queries to return data 'files' => [ // but you can also overrdide these defaults: 'filename' 'ext', 'url', ], // Assuming there are child pages with the architec template, or a // field name with a page relation to architects 'architect' => [ // sub-query 'name', 'email' ], // queries can contain closure functions that return dynamic content 'querytime' => function($parent){ return "Query for $parent->title was built ".time(); } ]; $pages->find('template=skyscraper')->pageQueryJson($query); Keys: A single fieldname; height or floors or architects The Module can handle the following fields: Strings, Dates, Integer… any default one-dimensional value Page references Pageimages Pagefiles PageArray MapMarker FieldtypeFunctional A template name; skyscraper or city Name of a child page (page.child.name=pagename); my-page-name A ProcessWire selector; template=building, floors>=25 A new name for the returned index passed by a # delimiter: // the field skyscraper will be renamed to "building": $query = ["skyscraper`#building`"] Key value pars: Any of the keys above (1-5) with an new nested sub-query array: $query = [ 'skyscraper' => [ 'height', 'floors' ], 'architect' => [ 'title', 'email' ], ] A named key and a closure function to process and return a query. The closure gets the parent object as argument: $query = [ 'architecs' => function($parent) { $architects = $parent->find('template=architect'); return $architects->arrayQuery(['name', 'email']); // or return $architects->explode('name, email'); } ] Real life example: $query = [ 'title', 'subtitle', // naming the key invitation 'template=Invitation, limit=1#invitation' => [ 'title', 'subtitle', 'body', ], // returns global speakers and local ones... 'speakers' => function($page){ $speakers = $page->speaker_relation; $speakers = $speakers->prepend(wire('pages')->find('template=Speaker, global=1, sort=-id')); // build a query of the speakers with return $speakers->arrayQuery([ 'title#name', // rename title field to name 'subtitle#ministry', // rename subtitle field to ministry 'links' => [ 'linklabel#label', // rename linklabel field to minlabelistry 'link' ], ]); }, 'Program' => [ // Child Pages with template=Program 'title', 'summary', 'start' => function($parent){ // calculate the startdate from timetables return $parent->children->first->date; }, 'end' => function($parent){ // calculate the endate from timetables return $parent->children->last->date; }, 'Timetable' => [ 'date', // date 'timetable#entry'=> [ 'time#start', // time 'time_until#end', // time 'subtitle#description', // entry title ], ], ], // ProcessWire selector, selecting children > name result "location" 'template=Location, limit=1#location' => [ 'title#city', // summary title field to city 'body', 'country', 'venue', 'summary#address', // rename summary field to address 'link#tickets', // rename ticket link 'map', // Mapmarker field, automatically transformed 'images', 'infos#categories' => [ // repeater matrix! > rename to categories 'title#name', // rename title field to name 'entries' => [ // nested repeater matrix! 'title', 'body' ] ], ], ]; if ($input->urlSegment1 === 'json') { header('Content-type: application/json'); echo $page->pageQueryJson($query); exit(); } Module default settings The modules settings are public. They can be directly modified, for example: $modules->get('PageQueryBoss')->debug = true; $modules->get('PageQueryBoss')->defaults = []; // reset all defaults Default queries for fields: Some field-types or templates come with default selectors, like Pageimages etc. These are the default queries: // Access and modify default queries: $modules->get('PageQueryBoss')->defaults['queries'] … public $defaults = [ 'queries' => [ 'Pageimages' => [ 'basename', 'url', 'httpUrl', 'description', 'ext', 'focus', ], 'Pagefiles' => [ 'basename', 'url', 'httpUrl', 'description', 'ext', 'filesize', 'filesizeStr', 'hash', ], 'MapMarker' => [ 'lat', 'lng', 'zoom', 'address', ], 'User' => [ 'name', 'email', ], ], ]; These defaults will only be used if there is no nested sub-query for the respective type. If you query a field with complex data and do not provide a sub-query, it will be transformed accordingly: $page->pageQueryArry(['images']); // returns something like this 'images' => [ 'basename', 'url', 'httpUrl', 'description', 'ext', 'focus'=> [ 'top', 'left', 'zoom', 'default', 'str', ] ]; You can always provide your own sub-query, so the defaults will not be used: $page->pageQueryArry([ 'images' => [ 'filename', 'description' ], ]); Overriding default queries: You can also override the defaults, for example $modules->get('PageQueryBoss')->defaults['queries']['Pageimages'] = [ 'basename', 'url', 'description', ]; Index of nested elements The index for nested elements can be adjusted. This is also done with defaults. There are 3 possibilities: Nested by name (default) Nested by ID Nested by numerical index Named index (default): This is the default setting. If you have a field that contains sub-items, the name will be the key in the results: // example $pagesByName = [ 'page-1-name' => [ 'title' => "Page one title", 'name' => 'page-1-name', ], 'page-2-name' => [ 'title' => "Page two title", 'name' => 'page-2-name', ] ] ID based index: If an object is listed in $defaults['index-id'] the id will be the key in the results. Currently, no items are listed as defaults for id-based index: // Set pages to get ID based index: $modules->get('PageQueryBoss')->defaults['index-id']['Page']; // Example return array: $pagesById = [ 123 => [ 'title' => "Page one title", 'name' => 123, ], 124 => [ 'title' => "Page two title", 'name' => 124, ] ] Number based index By default, a couple of fields are transformed automatically to contain numbered indexes: // objects or template names that should use numerical indexes for children instead of names $defaults['index-n'] => [ 'Pageimage', 'Pagefile', 'RepeaterMatrixPage', ]; // example $images = [ 0 => [ 'filename' => "image1.jpg", ], 1 => [ 'filename' => "image2.jpg", ] ] Tipp: When you remove the key 'Pageimage' from $defaults['index-n'], the index will again be name-based. Help-fill closures & tipps: These are few helpfill closure functions you might want to use or could help as a starting point for your own (let me know if you have your own): Get an overview of languages: $query = ['languages' => function($page){ $ar = []; $l=0; foreach (wire('languages') as $language) { // build the json url with segment 1 $ar[$l]['url']= $page->localHttpUrl($language).wire('input')->urlSegment1; $ar[$l]['name'] = $language->name == 'default' ? 'en' : $language->name; $ar[$l]['title'] = $language->getLanguageValue($language, 'title'); $ar[$l]['active'] = $language->id == wire('user')->language->id; $l++; } return $ar; }]; Get county info from ContinentsAndCountries Module Using the [ContinentsAndCountries Module](https://modules.processwire.com/modules/continents-and-countries/) you can extract iso code and names for countries: $query = ['country' => function($page){ $c = wire('modules')->get('ContinentsAndCountries')->findBy('countries', array('name', 'iso', 'code'),['code' =>$page->country]); return count($c) ? (array) $c[count($c)-1] : null; }]; Custom strings from a RepeaterTable for interface Using a RepeaterMatrix you can create template string for your frontend. This is usefull for buttons, labels etc. The following code uses a repeater with the name `strings` has a `key` and a `body` field, the returned array contains the `key` field as, you guess, keys and the `body` field as values: // build custom translations $query = ['strings' => function($page){ return array_column($page->get('strings')->each(['key', 'body']), 'body', 'key'); }]; Multilanguage with default language fallback Using the following setup you can handle multilanguage and return your default language if the requested language does not exist. The url is composed like so: `page/path/{language}/{content-type}` for example: `api/icf/zurich/conference/2019/de/json` // get contenttype and language (or default language if not exists) $lang = wire('languages')->get($input->urlSegment1); if(!$lang instanceof Nullpage){ $user->language = $lang; } else { $lang = $user->language; } // contenttype segment 2 or 1 if language not present $contenttype = $input->urlSegment2 ? $input->urlSegment2 : $input->urlSegment1; if ($contenttype === 'json') { header('Content-type: application/json'); echo $page->pageQueryJson($query); exit(); } Debug The module respects wire('config')->debug. It integrates with TracyDebug. You can override it like so: // turns on debug output no mather what: $modules->get('PageQueryBoss')->debug = true; Todos Make defaults configurable via Backend. How could that be done in style with the default queries? Module in alpha Stage: Subject to change This module is in alpha stage … Query behaviour (especially selecting child-templates, renaming, naming etc) could change
    4 points
  3. This was an interesting read. http://blog.mauriziobonani.com/processwire-building-a-basic-reserved-area/
    4 points
  4. hi @hberg539, welcome to the forum and to the world of ProcessWire very interesting project, indeed! ProcessWire is awesome for making interfaces for managing your database in an easy, and (by everybody) understandable way (gui). The problem that comes with all the flexibility is that regular SQL queries are WAY harder to do (just take a look at the database. Every field is a single table, so you need to join all tables before you can actually use them for a useful query). So if you are used to having your database tables and doing some SELECT this FROM that... then you'll have a much harder time. That's why I built the linked RockFinder (that is still alpha, so be careful - there might be some breaking changes in the sooner future). Using RockFinder it will be very easy to use the PW API (which is great, of course), plus - and that's the awesome part - do everything you want via SQL. See this post how you can easily combine both worlds. Basically you just let RockFinder create the complex SQL query for you and then you build another SQL select around it: $finder = new RockFinder("template=dooraction", [...fields...]); $sql = $finder->getSQL(); $database->query("SELECT foo, sum(bar) FROM ($sql) as mytable WHERE DATE_FORMAT(...)"); There are also some performance tests in the linked topic. Hope you share a great showcase with us once you are done Good luck and lots of fun!
    3 points
  5. Totally useful ? Thanks you !
    3 points
  6. @Autofahrn, have you tried out one of the WireMail-ThirdPartyModules?
    2 points
  7. Check these threads with same warning msg: https://github.com/processwire/processwire-issues/issues/184
    2 points
  8. The idea of PageTableExtented is brilliant itself. But your work takes a step further and makes Processwire even more attractive to non developers i.e. editors. In my humble opinion this function surely will take Processwire to the next level. Keep up the good work. I am eager to see how this concept inspires other awesome developers here we have In this wonderful community. Gideon
    2 points
  9. The actual size of the database doesn't matter that much, but the speed in how the data can be accessed matters. Zeka, is there any difference in speed with option 1. and 2.? wbmnfktr, i try to answer some of the questions you mentioned: The data is for history reasons (who opened the door where and at what time) and the data should be stored at least half a year. After that, the data can be truncated or be archived to an csv file. I project around 120.000 logging entries per month. Charts should be created (e.g. door access activitiy in the last 30 minutes). Processwire will provide an API to the door access system, so each door access request will be controlled by processwire. I'm currently a beginner in processwire (but really do like it), so a simple solution which doesn't result in a bad bottleneck one or two months later would be great. Thank you for your help.
    2 points
  10. I discovered the empty $input dump as soon as __debugInfo() was made the default dump in Tracy. Sorry, I should have raised it at the time but was in the middle of something so just changed back to the full dump setting and then forgot about it. Maybe it's just because I'm more used the full dump, but I still prefer that option. I like having more info in the dump rather than less and don't mind wading through it to find what I'm looking for.
    2 points
  11. @noelboss, this is BEAUTIFUL!! Very easy to understand. I'm eager to play with it and create a front-end using Vuejs and another with Gatsbyjs. Many thanks for this module!!
    2 points
  12. Non-exhaustive list of css ressources that we may need for some projects (if not mistaken, I haven't used any of them for the moment, except the Mozilla one): https://jonathantneal.github.io/sanitize.css/ https://github.com/jonathantneal/postcss-normalize http://browserl.ist/ https://github.com/browserslist/browserslist https://css-tricks.com/browserlist-good-idea/ https://evilmartians.com/chronicles/autoprefixer-7-browserslist-2-released https://leaverou.github.io/prefixfree/ https://github.com/ismay/stylelint-no-unsupported-browser-features https://github.com/anandthakker/doiuse https://stylelint.io/ https://github.com/ntwb/awesome-stylelint http://cssnano.co/ https://www.10bestdesign.com/dirtymarkup/ https://www.styled-components.com/ ( https://marksheet.io/ ) [ https://developer.mozilla.org/en-US/ ]
    1 point
  13. ProcessSlider Module (alpha version) Repository https://github.com/mauricius/ProcessSlider Introduction Like many of you, I came to ProcessWire from Wordpress and immediately I fell in love with its power and its clean syntax. I have to say that PW has become my default choice for building websites. However there is only one thing that me and my clients miss from WordPress and is the ability to visually build image sliders through plugins (Nivo, Revolution Slider, LayerSlider, just to name a few). So I decided to create a module for this purpose. ProcessSlider essentialy is an editor for the wonderful Jssor plugin (http://www.jssor.com/) which is absolutely free. The module creates a new page under the Setup menu which allows users to easily add image sliders on the site using an intuitive visual editor. To each slider you can easily add images and other custom and animate them using the transition effects provided by the Jssor slider. The ProcessSlider module in reality is composed by three different modules: ProcessSlider: the main module InputfieldSlider/FieldtypeSlide: allows the user to use an existing slider inside a page MarkupSlider: converts the slider into Jssor compatible markup and optionally provides the necessary initialization script Features Custom slider size Drag and Drop interface Move and resize elements Slides background with images from existing PW pages Slider Preview (with the provided MarkupSlider module) Predefined style classes for Elements Add or remove Slides Add or remove elements Change slide order visually Jssor skins and bullets support Visual Timeline Optional responsive/fullwidth slider Predefined elements: Images, Text, Links, Image as link, Div blocks, Youtube Videos Animation Options (In and Out): Animation type, Delay, Duration The editor is built with Vue.js+Webpack and uses jQuery for D&D and resize functionalities. Release I'm going to release the module in a couple of weeks, there are still some minor tweaks and improvements that I would like to add. Demo Screencast (be sure to watch it at least at 720p) I hope it will be helpful to the community and I would be glad to get feedback or suggestions for improvement! Please also consider that it is my first PW module, so probably I'm missing some best practices, hopefully the most experienced developers can throw me some hints
    1 point
  14. Hi @Lemoratoire, welcome to the forums. You need to change the field settings. So, go to /setup/field/ find the Body field and on the Input tab change you can add some tags to the "Extra allowed content'" field or, for a full control of what HTML tags you can use, you'll need to disable the "ACF" and the "Use HTML Purifier" options. But beware that this opens a security risk if someone else is entering code beside yourself.
    1 point
  15. If you want syntax highlighting, you could maybe use this: https://modules.processwire.com/modules/inputfield-ace-extended/
    1 point
  16. No idea. But you should check your browser JS console if you find any hints there. Also install Tracy Debugger and see if any errors or warnings appear. If it's a public site, you could also give us the URL.
    1 point
  17. Hey Bernhard - not sure on this yet - I think for the average new Tracy user using __debugInfo() is a more useful experience - a full PW object can be quite overwhelming for the uninitiated. Of course once you're comfortable with them they're fine, but they also often require the use of bdb() or bd($page, [8]) type calls to get to all the info you need and a new user may not know about those options yet and just think that those [...] mean that the info isn't available. For those reasons I am tempted to leave as is for the moment. Note that Ryan just implemented __debugInfo() for WireInput: https://github.com/processwire/processwire/commit/105ba2b8ebbdf4e65f2300bf79b233850107c4d6 so that issue is solved at least.
    1 point
  18. Hey, @Shailaja! Welcome here! Glad you are here with us! But... I do not see any question in you post)))) I guess you do not want to see anything when you reach your subdomain. It might be only possible if you edit your domain zone so the subdomain will not point to your hosting provider at all. Anyway, Hostgator's support would help you much quicker))
    1 point
  19. Hi @theo, This is really impressive. Any update on this project??? Gideon
    1 point
  20. Did this now, code could most likely be improved, but it works: if ($movies) { // Movies with release date function hasReleaseDate($movies) { return (array_key_exists('release_date', $movies)) ? true : false; } // Movies without release date function noReleaseDate($movies) { return (!array_key_exists('release_date', $movies)) ? true : false; } // Generate arrays of movies with/without release date $movies_with_release_date = array_filter($movies, 'App\Controllers\hasReleaseDate'); $movies_without_release_date = array_filter($movies, 'App\Controllers\noReleaseDate'); // Sort by date - newest first function sortNewestFirst( $a, $b ) { return strtotime($b["release_date"]) - strtotime($a["release_date"]); } usort($movies_with_release_date, "App\Controllers\sortNewestFirst"); // Append movies without release date $movies = array_merge($movies_with_release_date, $movies_without_release_date); View::renderTemplate('Actor/list-all.html', [ 'name' => $this->getFormattedName($name), 'movies' => $movies ] ); } else { View::renderTemplate('Actor/no-results.html'); } The more I move on with this, the more I see the importance of finding some kind of structure. It's starting to confuse myself with where to put code, whether it goes in a model, a controller etc. Def need to work on this. However, all good for now thanks @arjen
    1 point
  21. A hard reset and a reboot fixed the problem Thank you all for trying to help.
    1 point
  22. Welcome to the club, Adrian ? +1 for making the large dump default. I also think it's better to turn it off if you need but see everything by default so that misleading situations like yours and mine some days ago are less likely to happen
    1 point
  23. @Robin S - I'll have to get back to you on that when I get a minute to look into it. Totally OT, I just wanted to mention this issue to you guys because it cost me some time today. Now that Tracy by default uses __debugInfo() for d() an bd() calls, I was getting empty responses for d($input->get), post, cookies etc. I have posted an issue for Ryan: https://github.com/processwire/processwire-issues/issues/575 - please feel free to +1 it! but in the meantime, you will need to set debugInfo to false or turn of __debugInfo() completely in the config settings.
    1 point
  24. If you have not googled "404 only home page working processwire" there are many threads discussing various issues, most involve .htaccess not working and sites in subdirectories.
    1 point
  25. Thanks for the remainder @Robin S. I've replaced the character icon with an SVG. I've committed the changes, no version bump. Perhaps I would have used FontAwesome if it would have been possible to set it as a background-image but that's not the case. I've tried adding the SVG variant of the FA search icon but then searched for a slimmer one. There are only a few icons in AOS and I wouldn't like to increase the overall module size.
    1 point
  26. I've added the new sticky pagelist action, @theo's langswitcher fix, Tracy panel z-index fix (hopefully) and other minor fixes in v1.9.1. I noticed that I was using one SCSS mixin too many times (for icon-only pagelist actions) and it contained rules that I could apply to items outside the mixin. After cleaning this up the final CSS shrinked from 127 to 93 Kb so it was worth the trouble. I removed the js lib "perfect scrollbar" that was used to replace the browser scrollbar with a mini one (RenoTweaks). From now on AOS uses CSS to achieve the same thing, and is available in Chrome only (you can find it under Misc). It's a sacrifice but results in much leaner code, is controlled by the browser so it's unlikely to break, and modifies every scrollbar in the admin. For example they are available in Tracy panels too and also in CKEditors (the latter required additional efforts though): Documentation is in progress, as usual
    1 point
  27. Wow, da hätt glaubs öpper gschaffed... trotz de Früehligs-Polle From just a very quick first glance, this looks really nice. I'm sure I'll install this when I have some spare time and play around with it. I don't actually have a real use-case myself atm, but since we're experimenting with conversational interface stuff lately (chatbots etc.), Dialogflow Webhooks etc., this could come in very handy for REST/API-like scenarios.
    1 point
  28. Thats what I built it for
    1 point
  29. Thanks for the thread @Soma. One of the most important and cited ones in the whole forum history! In the original post there are a few points that seem to be not discussed later in the thread, but which are extremely interesting to me. 1. Are there any good examples of those to dig into? Gists maybe? 2. Looking here it seems arrays are not allowed. I might be not understanding it right or things might change since when it was written. Is there actually a way to process input from a page or an array? 3. There was already a question about what kind of validation processInput does and @adrian's answer too. I read the code a few times but still not sure should I sanitize values after processInput before saving to page fields or not. Is it necessary? Thanks again! Learning ProcessWire is still fun (or am I doing it too slow?!)
    1 point
  30. @bernhard just liked the original post after a few days passed, and I got notified. So decided to put a little update here. There are actually some web-design related thing I learned from this situation: Do not rely on cdn's for jquery, fonts and stuff. Opera actually is not that useless browser, as it has Turbo Mode. Thanks for support!
    1 point
  31. All of a sudden, with nothing changed on the database or server, a website was getting error when doing a search: Error: Exception: SQLSTATE[HY000]: General error: 23 Out of resources when opening file './your-database-name/pages_parents.MYD' (Errcode: 24 - Too many open files) (in /home/forge/example.com/public/wire/core/PageFinder.php line 413) #0 /home/forge/example.com/public/wire/core/Wire.php(386): ProcessWire\PageFinder->___find(Object(ProcessWire\Selectors), Array) #1 /home/forge/example.com/public/wire/core/WireHooks.php(723): ProcessWire\Wire->_callMethod('___find', Array) #2 /home/forge/example.com/public/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\PageFinder), 'find', Array) #3 /home/forge/example.com/public/wire/core/PagesLoader.php(248): ProcessWire\Wire->__call('find', Array) #4 /home/forge/example.com/public/wire/core/Pages.php(232): ProcessWire\PagesLoader->find('title~=EAP, lim...', Array) #5 /home/forge/example.com/public/wire/core/Wire.php(383): ProcessWire\Pages->___find('title~=EAP, lim...') #6 /home/forge/example.com/public/wire This error message was shown because: you are logged in as a Superuser. Error has been logged. I tried several things, listed in this thread: https://serverfault.com/questions/791729/ubuntu-16-04-server-mysql-open-file-limit-wont-go-higher-than-65536 But for some reason, MySQL was not getting its limit increased, but in the end, the one that did the trick was this: This worked for me on Ubuntu Xenial 16.04: Create the dir /etc/systemd/system/mysql.service.d Put in /etc/systemd/system/mysql.service.d/override.conf: [Service] LimitNOFILE=1024000 Now execute systemctl daemon-reload systemctl restart mysql.service Yes indeed, LimitNOFILE=infinity actually seems to set it to 65536. You can validate the above after starting MySQL by doing: cat /proc/$(pgrep mysql)/limits | grep files
    1 point
  32. Who will use these data entries? What will happen with all these data entries? How many data entries will there be each minute/hour/day/week? How long will they be stored? Will they be archived/deleted? Will someone create charts from it? Will they be exported to another programm/system? Will there be JSON/XML/RSS exports/strems/feeds or even an API? Will ProcessWire provide those access details for each dongle/user/door? There are so many best ways to go depending these paramters and variables.
    1 point
  33. There are several possible ways. 1. Create template as you have proposed. 2. Create custom field type with custom DB table schema. 3. Use Table field from Profields. 4. Use wire $log (actually, don't think that it's an option here) Options 2 and 3 are more efficient from how they store data in DB.
    1 point
  34. This one also is very cool: https://codyhouse.co/
    1 point
  35. Hi all - I have started a new 3.0 branch which has some more breaking changes. This new version moves the country code into it's own "data_country" database field and stores a raw version of the number in the default "data" field. The reason for this is to make it possible to do a: $pages->find("phone=13727654876") Before you could only find by component parts, like: $pages->find("phone.country=1, phone.are_code=372, phone.number=7654876") My need for this was to find a user by their full raw/unformatted phone number as returned by the Twilio sms service's POST response. I'll keep the changes in this branch for a while, but I would encourage new installs to try this version. Let me know how it goes.
    1 point
  36. Try: $datetofind=strtotime($date); foreach($page->special_days->find("date_value={$datetofind}, time_from!='', time_to!=''") as $special_day) { $slot_txt.=$special_day->time_from." to ".$special_day->time_to."<br/>"; }
    1 point
  37. I'm surprised this hasn't come up yet: https://tympanus.net/codrops/
    1 point
  38. It's a little more complicated than that - need to make sure that $processedPages is defined outside the method so it' not reset on each recursive call. I know Ryan will have his approach to this so I'm not going to bother refining right now, but if anyone is interested, here is the new issue: https://github.com/processwire/processwire-issues/issues/572
    1 point
  39. You might find out more if you print out the names ($key) of all properties of type page and their value's (page) ids. There should be some kind of repeating pattern then that leads from subscriber to tester back to subscriber, but their might be (quite) some hops in between.
    1 point
  40. Hey, thanks for the feedback @giannisok and for the solution @wbmnfktr. I have just updated to version 0.0.2 with the ability to unsubscribe and delete users. I also removed the 'string' type declarations, hope it works now with your PHP version @giannisok . When I have the time I'll change my dev machine setup, so I can test with different PHP versions. But since I use Valet, I think I can only downgrade to php5.6 anyway.
    1 point
  41. I also did some research the last days about GDPR and want to share some notes on that. Most of the information is taken off official sources, but is without engagement. To add one thing to @szabesz note: Beginning with GDPR in May 18 the state will be that you are allowed to set cookies without any further approval from the user, if they (the cookies) are necessary so that you site or service works. Usually that are session cookies, or cookies that store the user's language. Every other cookie (to track or analyse user data) needs permission to be set (the so called "opt-in"). In this case you are not allowed to set the cookie without user permission. In general (and in most situations enough) you need some things in order to be compliant with GDPR: a up-to-date data protection policy on the website frontend a GDPR compliant data processing contract with all companies that handle personal user data according to your order (like the hosting provider, or e.g. Google Analytics, or whatever..) a documentation of technical and organisational measures a list of all data processing activities That does not take into account if you handle very sensitive personal data (e.g. race or relegion). So of course, not all is related to ProcessWire, but only implementing technical measures is not enough to get compliant. At the end the note, that a very important part is also to document all things related to data privacy (regulations). We - as the data processors - have to burden of proof.
    1 point
  42. Thanks @adrian, and in AOS there's also a "Add Trash action also for non-SuperUsers" feature that might come handy.
    1 point
  43. Of course the core now has the "trash" page list action, but AOS also has a great "delete" action implementation with an inline confirmation step.
    1 point
  44. There's a little gotcha related to this module: if you have it enabled on a late version of ProcessWire, it could break the language translation UI if one or more of your translation strings include the phrase "</head>". ProcessPageDelete inserts a script block in front of all of those, which breaks the scripts on the page. None of such phrases in the core (by default) as far as I can tell, but it is found from some rather popular modules (Minify, FormBuilder). Not sure if this module is even needed on newer installations – just happened to have it installed on a site I'm currently updating from 2.x to 3.x, ran into this issue, and thought I'd mention it in case it will save someone else a bit of debugging time
    1 point
  45. I think you need quotes to get accurate results. How about this one: https://nerdydata.com/search?query="%2Fsite%2Fassets%2Ffiles%2F" Although I don't think the total count is relevant, but definitely show some sites I haven't seen, especially of interest is: https://www.payrexx.com/
    1 point
×
×
  • Create New...