Jump to content

da²

Members
  • Posts

    221
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by da²

  1. Be sure that the variable is defined before the loop.
  2. Hello, I would probably use an absolute positioning for the drop-down, so it works fine on all screens. Pushing the content following this box doesn't look like the good choice to me. And on mobile there probably are screen sizes where you won't be able to see photo and description at the same time.
  3. Looks like your foreach is wrong, there's not even a "{" or ":" in the opening and I don't see end of loop. 🤨 Could you use the same syntax as in my message? <?php foreach($countymatch as $match): ?> <?php endforeach; ?>
  4. Yes, and replying to a topic doesn't register you to this topic, you always need to register manually. 🙂
  5. You should show the code that's working with a list.
  6. Hello, If you want a free module for user registration you can use LoginRegister. There's features to validate emails, manage forgotten passwords and more. For the notifications you can add a checkbox on user template "registered to notifications", and check it when user wants notifications, so later you can find them with $users->find('registeredToNotifications=1'). To build forms for free you can use module InputfieldForm, for example for the form to register to notifications. To send mails you can use PHP mail function, if your server is well configured to send mails.
  7. No hook involved (disabled all just in case). You're talking about the page setup/template/edit?id=2 (admin page template)? No I didn't defined a sort field. Field are sorted alphabetically in main menu, but not in fields page. I'm also not using tags, in case they change sort order. I can't even understand what is the sort order, as none of the columns is sorted. 🤔
  8. Hello, I don't know if I changed a parameter somewhere to do that, but fields are never sorted by name. I click "Name" column, but as soon as I change page and come back here it's again sorted in a way I don't understand. Filter options are set to "Show all". How to make this page default sort by name?
  9. Twig also is compiled to PHP, it's PHP code that interprets your method/property calls and fails on some PW properties for an obscure reason. Reading your link, the first talk is about this sh*t Twig interpretation. 😄 So at least this ugly behavior is not part of Latte. 👍 EDIT : Haha, and just now I'm searching something in my IDE and see an old Twig error log, showing how WIIIIIIIDE is this Twig interpretation:
  10. Hello, Maybe I will consider using Latte in the future. I love Twig but I have 2 problems with it: This two issues I'm reporting on this page, the second one is the worse because you can write a working code that will break in the future because a field value has became blank. I could use object.get('prop') everywhere but that's ugly and boring to type. The fact that it tries to interpret your property/method calls (maybe it can be disabled, I never searched), for example if I write object.method() and it's not found, it will also try object.getMethod(), object.method, and so on... So you can let typo in your code without knowing it if Twig found something else. On my custom page classes I can have a property prop (the PW field) AND a method getProp() (my own function that does more than prop) and they are not interchangeable even if they return same type of value. Could you tell me if Latte is doing the same 2 things? In terms of performance I didn't find benchmarks with latest version of both engines but I suppose they are close. I'm not sure yet what I'll use in my next project, I'm also interested exploring my own full-PHP method to get the best performances but that must be a clean solution, easy to read/update/reuse.
  11. Sure, but even taking small blocks to move to classes is not really usable. The box I took as example is just a bit of UIkit configuration in my project, mainly overriding UIkit variables. Depending of CSS framework used it will be different.
  12. On my previous project, a designer created a template on https://www.figma.com/. You can export design to CSS, I add a look at this code and it's a terrible thing. 😅 For example, this simple box... ...generates this mess: /* Frame 232 */ position: absolute; width: 460px; height: 580px; left: 490px; top: 425px; /* Ombre */ box-shadow: 0px 0px 10px 5px rgba(0, 0, 0, 0.5); /* Offre Gratuite */ position: absolute; width: 460px; height: 580px; left: 0px; top: 0px; /* Ombre */ box-shadow: 0px 0px 10px 5px rgba(0, 0, 0, 0.5); /* Rectangle 6 */ position: absolute; left: 0px; right: 0px; top: 0px; bottom: 0px; /* Blanc */ background: #FFFFFF; border-radius: 10px; /* Pour accéder à notre outil, veuillez vous identifier */ position: absolute; height: 171px; left: 108px; right: 108px; top: 86px; /* Desktop - Texte courant */ font-family: 'Roboto'; font-style: normal; font-weight: 400; font-size: 18px; line-height: 21px; display: flex; align-items: center; text-align: center; /* Bleu foncé */ color: #02171C; /* Titre */ position: absolute; height: 86px; left: 0px; right: 0px; top: 0px; /* Rouge */ background: #E74342; border-radius: 10px 10px 0px 0px; /* J’ai déjà un compte */ position: absolute; height: 26px; left: 0px; right: 0px; top: 30px; /* Desktop - Mise en exergue */ font-family: 'Roboto'; font-style: normal; font-weight: 700; font-size: 22px; line-height: 26px; /* identical to box height */ display: flex; align-items: center; text-align: center; /* Blanc */ color: #FFFFFF; /* Bouton */ position: absolute; height: 55px; left: 0px; right: 0px; top: 485px; /* Frame 3 */ /* Auto layout */ display: flex; flex-direction: row; align-items: flex-start; padding: 15px 23px; gap: 10px; position: absolute; left: 23.48%; right: 23.48%; top: 0%; bottom: 0%; /* Rouge */ background: #E74342; border-radius: 30px; /* Se connecter */ width: 198px; height: 25px; font-family: 'Gilroy-Bold'; font-size: 20px; line-height: 23px; display: flex; align-items: center; text-align: center; /* Blanc */ color: #FFFFFF; /* Inside auto layout */ flex: none; order: 0; flex-grow: 0; /* Group 202 */ position: absolute; width: 380px; height: 85px; left: 40px; top: 230px; /* Identifiant * */ position: absolute; width: 380px; height: 30px; left: 40px; top: 230px; /* Desktop - Texte courant bold */ font-family: 'Roboto'; font-style: normal; font-weight: 700; font-size: 18px; line-height: 21px; /* Bleu foncé */ color: #02171C; /* Frame 3 */ box-sizing: border-box; position: absolute; height: 55px; left: 8.7%; right: 8.7%; top: 260px; /* Blanc */ background: #FFFFFF; /* Gris */ border: 1px solid #5E7F8C; border-radius: 30px; /* Votre identifiant */ position: absolute; height: 21px; left: 30px; right: 59px; top: 17px; /* Desktop - Texte courant */ font-family: 'Roboto'; font-style: normal; font-weight: 400; font-size: 18px; line-height: 21px; /* identical to box height */ display: flex; align-items: center; /* Gris */ color: #5E7F8C; /* Group 203 */ position: absolute; width: 380px; height: 85px; left: 40px; top: 335px; /* Mot de passe * */ position: absolute; width: 380px; height: 30px; left: 40px; top: 335px; /* Desktop - Texte courant bold */ font-family: 'Roboto'; font-style: normal; font-weight: 700; font-size: 18px; line-height: 21px; /* Bleu foncé */ color: #02171C; /* Frame 3 */ box-sizing: border-box; position: absolute; height: 55px; left: 8.7%; right: 8.7%; top: 365px; /* Blanc */ background: #FFFFFF; /* Gris */ border: 1px solid #5E7F8C; border-radius: 30px; /* Votre identifiant */ position: absolute; height: 21px; left: 30px; right: 59px; top: 17px; /* Desktop - Texte courant */ font-family: 'Roboto'; font-style: normal; font-weight: 400; font-size: 18px; line-height: 21px; /* identical to box height */ display: flex; align-items: center; /* Gris */ color: #5E7F8C; /* Mot de passe oublié ? */ position: absolute; width: 380px; height: 30px; left: 40px; top: 440px; /* Desktop - Texte courant bold */ font-family: 'Roboto'; font-style: normal; font-weight: 700; font-size: 18px; line-height: 21px; /* Rouge */ color: #E74342; Everything is absolute, font-family and other attributes are duplicated everywhere... There's almost nothing to keep in the final code. I wouldn't trust an AI generated code, and when you need to make changes you first have to learn what the AI created and to adapt to it, not my taste. I prefer to have full control on this and know what I'm doing.
  13. I don't know Swift but I see it's a language to develop Apple applications. At first instance I don't feel this is related with using static method in PHP, as it looks related with Python and multi-threading. 🤔 EDIT: Just in case @donatas, are you using php-fpm? Because PHP error log could be in another location and not in Apache.
  14. There's always an error message recorded somewhere, if not in PW logs it's probably in web server logs. If @donatas is using Xampp on Windows, Apache logs are in xampp/apache/logs/error.log. Trying to understand an error without knowing the message is quite challenging. 😄 EDIT : But he should first look in PW Exception|Error logs.
  15. I use many translate functions in static functions without issue. Looks like a strange issue, maybe a PHP version difference?
  16. Look closely what the loop is creating, something is missing. 😉 <tr> <?php foreach($countymatch as $match): ?> <td></td> </tr> <?php endforeach; ?> You should indent your code to make it more readable and easier to debug. For example this is way easier to understand at first look (I didn't test it): <?php $countymatch = $pages->find("template=county-match-result, year={$page->id}"); ?> <table> <thead> <tr> <th>Opponents</th> <th>Venue</th> <th>Points for</th> <th>Points against</th> <th>Result</th> </tr> </thead> <tbody> <?php foreach($countymatch as $match): ?> <tr> <td><a href="<?= $match->url ?>"><?= $match->title ?></a></td> <td><?php if ($match->home_away->title == 'Home') echo "<a href='{$match->home_match_venue->url}'>{$match->home_match_venue->title}</a>"; else echo $match->away_match_venue; ?></td> <td><?= $match->cheshire_points; ?></td> <td><?= $match->opponent_points; ?></td> <td><?= $match->match_result->title; ?></td> </tr> <?php endforeach; ?> </tbody> </table>
  17. Hello, First you should start from a valid table skeleton: https://developer.mozilla.org/fr/docs/Web/HTML/Element/table Then your loop is not creating rows but columns, <tr> is a row and should have only 5 items in your case, but you're adding in a single row as much <td> as you have matches. Also you need a "==" here: if ($match->home_away->title = 'Home')
  18. It's probably a bad server/PHP configuration, maybe this will help: https://stackoverflow.com/a/36455035 Or ask your provider, I have no idea what they do with PHP. That's why I only own dedicated Debian servers in VPS, it's the same price and you are 100 % free to manage system configuration yourself, without the need of using graphical tools that you don't really know what they do. It requires knowledge in Debian and Linux administration but with Google everything can be learned.
  19. It's up to you, I know PW supports at least up to PHP 8.2. But if you don't use any new PHP feature you can stay with PHP 7.4. You only need to tick the ones linked with your error messages.
  20. I have no idea how they configure PHP, you probably already know this page: https://faq.o2switch.fr/hebergement-mutualise/tutoriels-cpanel/selecteur-version-php You may also try to install missing PHP modules corresponding to your errors (see video). Usually on Debian I only need to add this modules "php-mysql php-gd php-zip php-mbstring" but on another Linux distribution you have more or less to install.
  21. This returns only first level children. If you want grandchildren at any level I think you need to create a recursion function.
×
×
  • Create New...