Jump to content

flydev

Members
  • Posts

    1,364
  • Joined

  • Last visited

  • Days Won

    49

Everything posted by flydev

  1. I forgot about this thread ? I made some corrections and published it to github, and yes, you can try it. As always, make a DB backup before installing it. See: https://github.com/flydev-fr/UserLikes To install it ?
  2. You can also use the core module `ProcessPagesExportImport` to obtain a JSON config of the export, and then from wordpress, you can just make a script to create the pages you want. A simple google search give `plugins/json-content-importer` as a result, by the title it seem it can do the job by mapping field and value, but in reality, I do not have damn clue.
  3. Another example, clients receipts generated by the terminal are sent on real time to the "receipt app" which can be seen there: https://facture.kingspark.fr/ You can see something more than ~4M pages. This following example, is a dashboard for accouting things, a database of 10gb and more than 11M pages: (traduced by on-browser-google-trad)
  4. This. And you can have a read on a example I posted recently, I will add you two or three more screenshots of the page tree created by our softwares. Edit: Others examples added to the thread, I will make one day a showcase... but you just have to know that no page are created from the admin, but by API calls. The module used is the one linked by @MarkE and made by @Sebi . Anyway, it let you use the workflow you want, I mean freedom. And also, you can note that it scale pretty well (even if my apps are not so quite optimized, just saying).
  5. ? An issue was reported on github about the FTP functionality which was not working on PHP-8.1, which is fixed in the dev branch (Duplicator v1.4.24). As I didn't tested to backup a thing on GoogleDrive and Amazon S3, if you spot other issues, please feel free to report it in this same thread or fill a github issue. It might also be the time to implement something related to GDPR (package encryption) which I think was already discussed somewhere. Thanks you.
  6. It depend on how you configured the field. You can make it work by calling $page->images->first()->url The doc say: For more informations: https://processwire.com/docs/fields/images/
  7. Confirming that your snippet works fine here with LoginRegisterPro. But @Liam88 you have an issue, and if you are trying to debug/navigate to the url given by your $u->id link when there is no urlSegments, then you will end up on wrong user id, and then certainly on a random page ? // no urlSegment1 present // display links for user profiles? foreach($users->get('roles=login-register, sort=name') as $u) { echo "<li><a href='$u->id/'>$u->name</a></li>"; } $users->get() return a Page or null, so you are only getting iteration on the page's properties. You should use $users->find() to get the right $u page and his real id. Try with the correction and report back. And just a note: This method do not exist, it's isLoggedin(), with `Logged` and `in` in lowercase. Just in case to avoid future hassle ?
  8. But role is a thing, and permissions is another and this last is what you are looking for. Look there - https://processwire.com/docs/user-access/permissions/ - and try to play with them, then give a look at those modules : https://processwire.com/modules/admin-restrict-page-tree/ https://processwire.com/modules/custom-admin-menus/ For example, I have a role "accountant" and he do not have access to the page tree or any other features than the "accounting" module.
  9. Hi, you could use PageSum for simplicity. Just install the module and then for example: $selector = "parent=/products/, seller=$item"; // your selector $cnt = $pages->count($selector); // number of pages that match $selector if(!$cnt) echo 'No rated product found'; $sum = $pages->sum($selector, "rating"); // get sum of all matched products from "rating" field with "PageSum" $avg = $sum / $cnt; // math echo "Average rating of {$item->title} product (x$cnt) is ". number_format($avg, 2); // format number as needed
  10. Look at this example. Its made with the old version of RestAPI first made by @thomasaull years ago. To get the context, you can navigate to https://kingspark.fr and https://valideur.mykingspark.fr . I am speaking about a system which give the possibility to some of our client use their mobile or a barcode scanner device to give "free of charge parking" of their customer. Its composed with custom hardware, software and devices or mobile apps (you see it on GooglePlay). Image #1: List of Parkings // Image #2: The custom made SAGAS Terminal // Image 3: A configured User / Device available for registration and use. On the first picture, you can see a list of "Parkings", and some can have the "Valideur" functionality. We can configure attached devices and some users with specific role to get access for registration. And then, imagine the following. A customer land on the parking, grab a ticket and go to their rendezvous At the end, the guy in the office use his "Barcode Scanner" to "validate" the ticket of the customer; This mean that the customer will not pay anything when landing on the terminal to exit the parking, and when he will present the ticket on the barcode-reader installed on the terminal (the "black hole" you can see on the center in the picture), it will be recognized by another software and thought a call on ProcessWire Rest API backend. I made you two screencasts, the first is the software which once installed and registered, get the quota (number of validation available) from the user assigned to the license-code, and the second is my mobile which get notification sent from ProcessWire (by this module) from a monitoring system to get real-time information on registration. If you have any question, do not hesitate. There a more example, but you should get the whole idea ?
  11. What I would do in your scenario is: 1) Catch any \Exception and return a valid JSON with for example: $result = ['success' => false, 'error_msg' => 'Description of the error']; and log the exception original message in your logs 2) To "catch" a notice or warning, do that from a script that analyze a custom Apache ErrorLog and send you a mail on a pattern you would like to receive the mails. Just do not show "errors, mean warning, notice..." but log them into a custom Apache ErrorLog. 3) <- should be the first step, write Test Cases, test your code, and more over, do not upgrade a production code directly, as the most notice and warning you will get once your code is working is from deprecated code (PHP version, ProcessWire, Modules..). And do not forget that you can handle many scenario, eg., you can catch WireException, CustomException, \Exception. You could read some Ryan's code by opening files that are in the wire\core folder to get some example.
  12. I will take the time to answer your question a bit later @bernhard with some real example I use at work. But to get a general idea, when you go on the AppStore or GoolePlay, every app you see need to "discuss" with an (generally "Rest") API. Obviously there are many constraints to take into account when choosing the backend that will provide the API. For example, at work, I have servers that have to support quite heavy loads and that are written in Pascal. You can take a look there: https://synopse.info/files/html/Synopse mORMot Framework SAD 1.18.html#SOURCE (⚠️ it can hurt your head for the day ?) and read the general purpose and concept. I also have three ProcessWire backends (that need to be merged) that serve more user-oriented needs, such as apps delivered to customers or our technical maintenance group.
  13. @Liam88 you might try and ask @ryan if you could achieve it with the Pro Module `Likes`:
  14. Thank you for letting me know that they exist. I'm not even going to test them ? More seriously, the only thing I personnaly "miss" it's an official SomethingBidule_API core module maintained by @ryan . In the meantime, @Sebi is doing a great job, we just need people who want more functionalities, or rather something "more" solid, to do pull-requests.
  15. This IS NOT related directly to ProcessWire code. A critical CVE vulnerability was found in ZLib. Posting here in case some of you manage dedicated servers, and/or for checking if your hosting provider(s) do their job. more information: https://nvd.nist.gov/vuln/detail/CVE-2022-37434
  16. I am on mobile, so short answer. You can define your own error handler with `set_error_handler`. (Do not forget to restore the default handler, check the php doc.) Example: function send_email_on_notice() { … } set_error_handler("send_email_on_notice", E_NOTICE); […] restore_error_handler() Consider testing the behavior of it if you use it on a try/catch block.
  17. Hi, check the following thread, starting at this message (then read the whole thing) : ? And about locking a page before/after with your own logic:
  18. @bernhard sorry, forgot to include the link, edited the post.
  19. @bernhard you might want to take a look at this medium article, section mic/voice and OBS settings (I hope you are already using this one: https://github.com/obsproject/obs-studio/wiki).
  20. I think that some of your questions is just a matter of taste from every dev. Throwing my tastes below. I am personnaly not used to speak english with other people, and that's the most "complicated" thing to me when watching youtube video, anyway your accent is very good - I understand everything ?? It doesn't matter, everything need to be explained and you did very well. Taking time for learning is just required. (watched till the end last saturday with a coffee). Put this on the right-bottom corner, absolutely ! Both, make the video after writing the readme ?. I always end up on the video, after reading a readme, and if the readme only contain the link of the video, I feel very sad. Perhaps the sound of the voice should be a little higher pitched. No music for cencentration ! Or in the intro/Outro only ! ? You can be proud, thanks for it ?? Oh yes !
  21. You must write: `catch(\Exception $e)` as the object must be an instance of the Exception class or of a subclass (see/mean inheritance here) of the Exception class. A must read is this following blog post on Microsoft and then come back with questions if still any ?? https://docs.microsoft.com/en-us/archive/blogs/kcwalina/how-to-design-exception-hierarchies Excerpt from Krzysztof Cwalina (software architect) :
  22. A dumb question, disk or partition full ? You could also look at this answer on dba.stackexchange for identifying the issue: https://dba.stackexchange.com/a/48897/170766
  23. Just a thought before we go further. When is the 404 page displayed? On the index page (frontend) or only the admin page? If it's the second case, the .htaccess file is probably missing or the admin page entered may not be the right one (this can be checked in the database, table pages, id 2, column name) Otherwise, in the first case, check that you uploaded all the required processwire files (at least the index.php which will throw an error if the setup is ok, or as @DV-JF double or triple check your apache configuration on xampp.
  24. Ok, then to fix the error, in `ProcessLoginHistory` date format setting, put : Y-m-d H:i:s Then ping @teppo ?
  25. Ok then, first make a backup of the database, just in case, and please show us the full `call trace` logs shown on the tracy error (below the first error screen panel), along the ProcessWire version and MySQL version. You can also try to click on `Module Refresh` to see what happen. --- I didn't saw in first instance that the error was from the module `ProcessLoginHistory`, there must be a heck between the two modules. Will check. @Roych can you share the settings of `ProcessLoginHistory` and `ProcessLoginHistoryHooks` please ?
×
×
  • Create New...