Jump to content

szabesz

Members
  • Posts

    2,920
  • Joined

  • Last visited

  • Days Won

    17

Everything posted by szabesz

  1. ProcessWire's Page constructor: https://github.com/processwire/processwire/blob/3cc76cc886a49313b4bfb9a1a904bd88d11b7cb7/wire/core/Page.php#L594 public function __construct(Template $tpl = null) { parent::__construct(); if($tpl !== null) { $tpl->wire($this); $this->template = $tpl; } $this->useFuel(false); // prevent fuel from being in local scope $this->parentPrevious = null; $this->templatePrevious = null; $this->statusPrevious = null; } So in extending custom page calsses I do this: function __construct(Template $tpl = null) { parent::__construct($tpl); // my initializations go here... } I had no issues with it so far.
  2. 2D or 3D in PHP? PHP-GLFW (https://phpgl.net/) GameDev and Real-Time Applications in PHP 3D example: https://phpgl.net/examples/opengl/10-sponza.html Cross-Platform PHP-GFLW works on Window, MacOS and Linux. We also support standalone & portable binaries for MacOS and Windows.
  3. https://www.oreilly.com/library/view/php-8-objects/9781484267912/ https://www.oreilly.com/library/view/php-8-solutions/9781484271414/
  4. Yeah, that would be nice to have for sure. Since all M4 Mac Minis come with 16-core Neural Engine cores, I guess* they will be equal in this regard. Checking out M3 Mac reviews available out there might help you determine which M4 chip variant can be good enough for running local LLMs. *Edit: I could be mistaken, and other cores are also important to have. Having an Intel CPU based Mac, I have not yet dived into this topic just yet.
  5. Good question. Actually, yesterday I started to consider getting the 20-core GPU version (the most expensive one), but only if I decide to get into 3D seriously once and for all. I'm giving myself some time to think about that, as it would mean a lot less web development work, which I love with ProcessWire. As long as Ryan is around, I don’t think I will ever leave PW, but if I switch my main focus, then obviously I won't have as much time to work on ProcessWire-based projects. As for web development, I am pretty sure that even the cheapest M4 Mac mini would be just fine. My daughter's original base model M1 MacBook Air is at least twice as performant as my current 2019 Intel MacBook Pro in almost all respects, and the latter is still perfectly fine for DTP and web development. So why spend the extra money on features I do not use? However, I still want to replace my current Intel Mac, as I would like to make more homemade videos from our family footage recorded over the years, and any M series Mac is a lot better for that than my aging Intel CPU based laptop.
  6. That was my thought too. Since the machine fits in a pocket (well, you need a large coat for that, but there are such pockets...) if I buy a small keyboard and a small screen, I can easily temporarily relocate my office when I need to. I have no idea which keyboard and small monitor to buy just yet, but I will definitely purchase them in the end. BTW, here is a quick review for those interested: https://www.youtube.com/watch?v=KxgnSiK5qBA
  7. There you go, the M4 Mac mini: https://www.apple.com/mac-mini/ Mine will be configured as: Apple M4 chip with 10-core CPU, 10-core GPU, 16-core Neural Engine 16GB unified memory 512GB SSD storage 10 Gigabit Ethernet Three Thunderbolt 4 ports, HDMI port, two USB‑C ports, headphone jack Should you want to install Linux on it: https://asahilinux.org/2024/10/aaa-gaming-on-asahi-linux/ But probably a better option: https://eclecticlight.co/2024/01/01/virtualise-linux-on-apple-silicon-with-liviable-beta-4/
  8. A combustion engine does not need to be overly complicated either. It is not a ProcessWire, but it used to do its job as well (and if needed, my father could fix it on his own while on the road). https://www.trabant-szene-fuerth.de/Fahrzeuge/Trabant/trabantmotor.htm https://www.bhlingual.com/east-germanys-trabant-peoples-car-a-reprieve-blog
  9. I'm pretty sure Ryan could arrange a trip around Europe without paying a cent for accommodation. Here are some photos of our little town: https://kepguru.hu/hatterkepek/cimke/tata just in case they start to think about such a trip :P
  10. Happy birthday! Now that you remind me, next week I will also turn one year older, (ugh) :P
  11. @kongondo I recently bought my son a used M2 Air, which was not too expensive and is in pretty good condition and a lot faster than my getting-old 2019 Intel MacBook Pro. Have you ever considered the UNIX experience without all the hassle? Just my two pence... Personally, I am waiting for the M4 Mac mini: https://buyersguide.macrumors.com/#Mac_Mini And sorry for being somewhat off-topic, macOS is not Linux, but it feels similar in many ways and is a lot easier to tame.
  12. @Robin S I am sorry for the confusion, the issue is related to the Custom Logs module for sure. I mixed up the modules because both support threads were open in my browser, and I picked the wrong one. I use the modules in tandem, as that is the most obvious way to have the best log viewing experience. As for the issue: "Do you have a custom log named 'my-log' defined in the module config?" Yes, I did set the file's name (without the extension) in the module config. The good news is that it has now "started to work". I'm not sure what I did right this time, but renaming it in the config and in my code fixed the issue. Maybe some invisible character was involved, I don't know (that's just my best guess), as I had definitely tried to make it work before I reported my issue. Thanks for both modules and your support as well!
  13. @Robin S Hello, Thanks for sharing the module! This is the first time I am using it, and I find that contrary to this, quote: "$cl->save('my-log', $my_data);" If I use hyphen in the specified filename then this kicks in: // Return early if this log is not configured as a custom log As soon as I use underscores instead, all is good.
  14. Hello, I'm glad you find the issue. Instead of echoing long strings, why don't you simply mix HTML and PHP this way (written in the browser, so it might contain typos): <?php namespace ProcessWire; $blogger = $pages->find("template=blog_entry,featured_post=1"); // my template ?> <?php if (wireCount($blogger)) : // Check if there are any bloggers ?> <?php foreach ($blogger as $bloggers) : ?> <?php if (wireCount($bloggers->blog_entries)) : // Check if there are any blog entries ?> <?php foreach ($bloggers->blog_entries as $blog_entry) : // my repeater field ?> <div> <a href="<?= $blog_entry->url ?>"> <h1 class="text-xl"><?= htmlspecialchars($blog_entry->title) ?></h1> </a> <a href="<?= $blog_entry->url ?>"> <img src="<?= $blog_entry->blog_main_image->getCrop('blogsmall')->url ?>" alt="<?= $blog_entry->blog_main_image->description ?>"> </a> <?= $sanitizer->truncate($blog_entry->blog_text, 100, ['type' => 'sentence', 'keepFormatTags' => false]) ?> <p class="test_to_show_value_of_featured_filed"><?= $blog_entry->featured_post ?></p> </div> <?php endforeach; // End of blog_entries loop ?> <?php endif; // End of blog_entries check ?> <?php endforeach; // End of bloggers loop ?> <?php endif; // End of bloggers check ?> Which is much more readable, I think. You can even add else blocks to display something when nothing is found. And don't forget <?php namespace ProcessWire;. While ProcessWire has a built-in compiler that adds the namespace for you, there may come a day when that compiler is removed from ProcessWire. Additionally, specifying the namespace helps IDEs understand the context of the code.
  15. Hi, Same topic at PW's GitHub issues: https://github.com/processwire/processwire-issues/issues/1588
  16. If you need to do it even earlier than using init.php: https://processwire.com/talk/topic/26875-page-classes-with-traits/?do=findComment&comment=222333 also see: https://github.com/processwire/processwire/blob/3cc76cc886a49313b4bfb9a1a904bd88d11b7cb7/wire/config.php#L1756
  17. Hello, Just a few hints, as I do not have more time right now, but I hope this helps: Use URL hooks: https://processwire.com/blog/posts/pw-3.0.173/ an to generate unique URLs, you can get inspiration from this helper method I use, for example: public static function getNewRandomUID(): string { $token = new Password(); $hash = $token->randomPass(["minLength" => 20, "maxLength" => 20, "maxSymbols" => -1]); return self::PREFIX_STRING . $hash . Tools::timestamp(); } Such a function can be enhanced by using uniqueNumber() from WireNumberTools: https://processwire.com/blog/posts/pw-3.0.213/ . I would save them in a database table row as text beforehand, so that they can be looked up when a visitor hits a given URL.
  18. @bernhard Just a small note regarding the label "On months". It would be grammatically correct to use "In months," in my opinion. https://langeek.co/en/grammar/course/567/on-in-month It is because "on" would be correct only if the word "month" were used with a specific day, as the linked article explains. Since the months stand alone in this case, "In months" seems to be the correct choice.
  19. FYI: A catalog of hypermedia-driven websites built with HTMX, Unpoly, Turbo or Twinspark: https://hypermedia.gallery/ Aside from the JS tech behind these sites, eTransfer seems worth trying.
  20. To be honest, I am just loosely following the conversation, but it might be worth taking a look at BusyCal's GUI (busymac.com). I know that the interface in a browser and in a desktop app are two different beasts, but BusyCal might inspire Bernhard, if it hasn't already. Anyway, I am a happy user of BusyCal, and I highly recommend it to any macOS users.
  21. I decided not to use that approach for this issue. It would be quite odd to inform the customer "randomly" with a message like, "Hey, the owner of the store is currently editing your cart!" My client and I believe that customers should not be notified in the same way that other backend users are. Such a level of transparency is not what my client wants. Therefore, I opted for the "simplest" solution: locking the cart. However, even locking the cart is not entirely straightforward. In my code, I address not only quantity and price-related issues but also other validation concerns, like this: When a customer loads the cart on the frontend, the system detects all invalid items (it contains outdated prices or product configurations, for example), logs them, and presents the list to the customer before automatically removing them. Based on this log, the backend administrator will receive a daily digest, while customers can optionally request the system to send the list to their registered email address. When a customer loads a cart that is locked by backend users, they are notified that their cart is temporarily locked by the shop owner. They are also presented with a button to click, which will send an automated request email to customer service. The customer will not have to write anything, as the email will contain all the information needed for customer service to unlock the cart. When a backend user accesses a cart edit page, they are presented with any invalid item errors. In this case, we do not want to automatically remove invalid cart items, as the backend user may be working on them, and we cannot determine their intentions. Because of this, no automatic action can be taken, except for one: the cart will be automatically locked if any invalid items are detected. It is then up to the backend user to resolve all issues to make each order item valid again. The backend user must click the 'Save + Unlock Cart' button to make it available for the client again. For editing the cart when there are initially no invalid items, backend users should start their editing session by using the 'Save + Lock Cart' button before proceeding with their edits. As long as no backend user is editing carts, there should be no instances of the cart being locked. Any unfinished tasks by backend users related to editing items should never occur, but they will probably happen a lot of the time. Backend users will receive red error messages that provide clear explanations about invalid items. As long as they do not unlock the cart, the last red error message instructing them to unlock it will remain visible. However, no one is perfect, so backend users will receive an email digest of any carts that may have been left locked accidentally. Our backend users rarely edit cart items, so I believe this relatively simple solution will suffice.
  22. So far, I've been working on the locked-down part of the site that I am using Unpoly for (so I cannot showcase that), but this will change in the near future. In the meantime, here are some great examples that other developers using Unpoly have started to share with each other: https://github.com/unpoly/unpoly/discussions/666
  23. I hope so! It is always sad to think about those (used to be) active members who no longer visit the forum.
  24. Isn't there one already? ;)
×
×
  • Create New...