Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/13/2023 in all areas

  1. Hey! A client wanted me to update their website to make it show dates in the form "1. - 3. Jän. 2023" instead of "1. Jän. 2023 - 3. Jän. 2023" It's a small change but not so easy to solve, especially if you want to make it locale aware etc... So I've created "HumanDates" library which is not a PW module but a standalone PHP class so that everybody can easily use it even outside of the PW universe: https://github.com/baumrock/HumanDates Usage is simple and the library can be used as a strftime replacement: // manual download require_once "/path/to/HumanDates.php"; // using composer // composer require baumrock/humandates require_once "/path/to/composer/autoload.php"; // create HumanDates instance $dates = new HumanDates(); echo $dates->format("2023-01-01"); // 1. Jan 2023 echo $dates->range("2023-01-01", "2023-01-03"); // 1. - 3. Jan 2023 If it is useful to you please let me know by giving it a star on github ? https://github.com/baumrock/HumanDates/stargazers PS: It will be available in RockFrontend in the next release simply by calling $rockfrontend->humandates() ?
    4 points
  2. Hi @700ml Have you added $config->dbCharset = 'utf8mb4'; to the config.php?? Gideon
    3 points
  3. You can also build the whole application in the admin and have all of ProcessWire´s form validation and possibilities there, like dependend showing and hiding of form fields. I have built several projects for example a job application management system. room management. E-Commerce site with management from order to production inside of the admin. Some of my edit pages even have AJAX calculation fields in them. PDF and chart generation is another thing. I use the edit form of pages to manage different stuff. I also use CustomPageClasses to modify the forms inside of the admin. It depends, if the forms should be customer facing (to the public) or are they just for your client?
    2 points
  4. I've built a commercial module RockForms that can be of huge help here. It uses https://doc.nette.org/en/forms which is the only library on earth that I know where you define all rules from within PHP and get the same exact validation rules also on the client side for live validation. You have tons of options regarding validation and you can even create nested validation rules: https://doc.nette.org/en/forms/validation The drawback of using Nette Forms is that it makes it very hard to customise the created markup of your forms to your needs. That's where RockForms jumps in. Also it integrates everything very well with PW and creates pages from submitted forms, provides hookable methods to do custom stuff at custom events and handles redirects to prevent double form submissions etc.; Basically it handles all the tedious things for you that you'd have to think of upfront or that you have to fix later if you didn't think of them ? A simple form could look like this: // create form with a unique name $form = new RockForm("demo"); // field setup $form ->addText("forename", "Enter your first name") ->setRequired("We need your first name to show it!"); $form ->addText("surname", "Enter your given name"); $form ->addSubmit("submit", "Submit your name"); // render output if ($form->showSuccess($values)) { $name = $values->forename; if($values->surname) $name .= " " . $values->surname; echo "<strong>Thank you for submitting the form, $name!</strong>"; } else { echo $form->render(); } Or for more complex forms you can define everything in OOP style. Extensive docs are in the works and provide live examples that you can play around with: https://www.baumrock.com/modules/rockforms/docs/ Compared to FormBuilder the module does not (yet) have a UI to build forms. That's done in code, but it seems that this is what you want anyhow?! Single Site License will be 49€ - if you are interested write me a PM ?
    2 points
  5. Had same problem recently. P.S. @horst, it is page 17 of WireMailSmtp support thread. Maybe it is time to split it in Module-Specific Support section?
    2 points
  6. @horst - The latest ProcessWire DEV 3.0.220 seams to break the WireMailSmtp module (namespace fatal errors) after a module recompiling. Class "ProcessWire\WireMailSmtp" not found I cannot reach the settings any more and probably it does also not send out mails. Isn't it a good idea to drop compatibility to ancient ProcessWire 2 versions and add the ProcessWire namespace in your code, so it does not compile?
    2 points
  7. Planets are sphere primitives with an image texture applied. The Voyager is a GTLF model from NASA (threejs has importers for that). There's a background that's basically a cube with inward facing images and the Saturn rings is just a plane with a PNG texture. You can also see some specs coming towards the camera that's a particle system. Basically 2000 randomly placed vertices that move and get reset once they're past the camera. It's a ton of fun to work with this stuff.
    2 points
  8. Hey Ryan! This is basically a full-viewport Threejs scene on a fixed element behind the content. Planets have a static position, and the probe just moves along the Z axis with the camera attached to it. As the user scrolls, the scrollTop is translated to a Z position for the probe. I had to add a little compensation for the window size so that the probe's position matches the content the user is seeing as is intended. There's also an intersectionObserver detecting each slide coming into view, and depending on what's visible the camera changes position to look left or right. The flying logos are relatively simple. From PW I just generate a JSON with the list from an images field. The script that generates the scene loops through that array, adds planes and textures for each one. X and Y positions just cycle through an array with presets, and Z is incremented with a set distance between them. Content itself is basic Tailwind stuff. Although I have some custom made scripts handling entrance animations, like the typing effect on the dotted text. The game is the result of a conversation with ChatGTP. I had the basic idea of making the user spin the cursor around a dot, mimicking the probe's orbit around Earth, but took the opportunity to challenge the AI. It actually gave me a pretty decent script right off the bat that served as a proof of concept. Then I discussed how to make it challenging and it gave me a few ideas. I iterated over them, and eventually came to the solution of adding movement speed to a variable multiplied by the number of consecutive unbroken turns. Had to refactor the whole thing to make it work properly, but ChatGTP was pretty darn useful in the process.
    2 points
  9. So I've just updated my personal website after some 7 or 8 years. It's a small one pager, but with some quirks that I hope you'll enjoy. Have a look: https://heldercervantes.com/ First, the approach was to somehow reinterpret my CV into a web experience. My last CV, along with my Supertiny agency's website share this space exploration / alien contact theme, so the idea here was to incorporate a journey through space as the user scrolls through the website. In the end you'll find a mini-game, where you can attempt to reach the far depths of space and discover what's out there. Most content is static, but I'm using PW to manage the logos you'll fly by at some point and the projects, the game's highscores and SEO. I intend to improve it a bit in time. Sound is probably the next thing I'll add, and I have some ideas to make the game more interesting. Fun fact: Setting up PW for this one took about 2h.
    1 point
  10. I've just bumped the dev branch version to 3.0.220. Relative to 3.0.219, this version is largely focused on issue resolutions, and there are 11 of them, among 14 commits. See the dev branch commit log for details. This is just a brief update so I don't have more to add other than that I hope you are having a great week, and have a great weekend!
    1 point
  11. I’ve done several quite complex apps like that. Not quite the same as your requirements, though. Lots of complex calculations and relationships. A clear spec and entity model are absolute musts. But as @dotneticsays If it’s just for the client then the admin is fine. However a key issue is whether there are likely to be concurrent users. If there are only a very small number of users then you can use ProDevTools to handle edit collisions. Otherwise it’s a whole lot more complex and you may be better buying an accounting package.
    1 point
  12. Hi @Inxentas With ProcessWire, you can use whatever you want on the frontend: Vanilla JS, jQuery, Vue. I would recommend that you take a look at htmx, which seems very interesting and should align well with ProcessWire's philosophy. As far as I know, Alpine.js is often used in conjunction with HTMX for frontend scripting. By the way, there are some excellent essays on htmx's website. I highly recommend reading them for everyone involved in web development.
    1 point
  13. I get this error all the time on my development server. 9 out of 10 times I had simply forgotten to change config.php, and my site would try to access the database using my local config! Could it be that you've accidentally overwritten that file with your local version? I ended up implementing a switch in config.php that checks what domain we're on, and sets the config variables according to the current domain. Should it be an upgrade issue, you can get into some trouble when upgrading through the ProcessUpdate module because the JS files for AdminThemeUikit are missing! I had this issue a while back with a bunch of sites that were suddenly running on PHP8 due to a decision of the hosting provider, and some friendly people on this forum helped me update ProcessWire manually to get around this issue. You can find the topic here.
    1 point
  14. It seems like you're looking for a way to create 301 redirects within ProcessWire (PW) using page IDs instead of page paths. While there may not be a specific module that supports this exact requirement, you can achieve the desired functionality by implementing a custom solution within ProcessWire. Here's a general approach you can follow: Create a new field in your Page template to store the destination URL. Let's call this field "Redirect URL" for reference. In the template file for the source page, retrieve the "Redirect URL" field value for that specific page. You can use the $page API variable to access the current page object and retrieve the field value. In the same template file, issue a 301 redirect using the retrieved "Redirect URL" value. You can use the wire()->session->redirect() method to perform the redirect. Here's a sample code snippet to illustrate the process: php Copy code // Retrieve the Redirect URL field value for the current page $redirectURL = $page->redirect_url; // Perform the 301 redirect wire()->session->redirect($redirectURL, 301); Remember to adjust the field name and code to match your actual field name and template structure. By storing the destination URL in a custom field within ProcessWire, you can update it independently of the page path, allowing for flexibility in SEO experiments or changes.
    1 point
  15. @gs-df thank you so much for the recommendation - just plugged it in and it does exactly what I need. @Robin S thank you as well for your work on this module.
    1 point
  16. Join the mission and have your name engraved on NASA’s Europa Clipper spacecraft as it travels 1.8 billion miles to explore Europa, an ocean world that may support life. Sign the message… get on board! https://europa.nasa.gov/message-in-a-bottle/sign-on/
    1 point
  17. (update: sadly not working; see below) Hey! Thank you so much for your reply. The steps you proposed worked, and I was able to login. Huge relief, thank you once again!! ? I have no idea what caused the error all of a sudden. I imagine changing the character encoding of all the utf8_bin fields was one step too far... I've dialed back the changes in PhpMyAdmin to their defaults for all `pages` and related tables, while keeping it at utf8mb4_unicode_ci for the template tables and text-input fields... And for some reason, pasting the password reset code into the homepage template file, under the php opening code, did not work... Thank you once again.
    1 point
  18. $users->get("name=admin")->setAndSave('pass', 'yoursupersecretpassword'); If you put that in ready.php and visit your site once (load any page), then you still can not login? Have you also tried logging in from an incognito window? Maybe some cookies are messing things up?
    1 point
  19. @eelkenet perfect, works great. Thanks a lot!
    1 point
  20. @orchardheightsdental Netcarver is right that you need to get a look at the /site/assets/logs/errors.txt log and see what the last entries are in it. If you don't have SSH access you can also grab it through FTP. My best guess is that your web host upgraded to PHP 8.1 or 8.2 and that you are running a much older version of ProcessWire. PHP 8.1/8.2 upgrades can sometimes break old versions and old sites. I can tell that you are running a pretty old version because it is missing the JS files for AdminThemeUikit, which was added more than 6 years ago. The good news is that the front-end of your site seems to be working. A major PHP upgrade on an old site would be more likely to break both the front and back end. Most likely an upgrade to a more recent PW version (like 3.0.210) would resolve the issue. Though it's also possible that the issue is coming from a 3rd party module that's installed, or something else, and that's what the errors.txt log would tell us.
    1 point
  21. Log in to your server via SSH and navigate to the site/assets/logs/ directory and look at the end of the errors.txt and exceptions.txt files. You should see information there about what could be happening on the server.
    1 point
  22. I am finetuning existing pre-trained models and using langchain toolchain. (About the later, I suggest you to try and keep an eye on a fork of PrivateGPT which is @su77ungr/CASALIOY). I like to be able to run it without the need to plug Internet wire, which is the most important requirement, and I also got really good results with CASALIOY after ingesting a small part of the company's knowledge base. I made some years ago a license plate recognition system deployed on our parks and I am able to ask a basic question in the context of our proprietary softwares and get a response like "Blabla you need to send this MSG_LPR_.. Windows Message with this LParam and WParam, the block will answer you the current amount due by the client in a JSON string stored in WParam... ". It can also explain what a settings do along with real example context, eg., "If the setting `blabla` is set to true, when a car approach, if it's a VIP or is annual fixed bill is paid, the barrier is opened...". It's really astonishing. I am using Vicuna-13b, not GPT, you can find more infos there: lmsys.org Last week I experimented a model called YOLOv7, which is an algorithm for detecting objects in an image. The challenge for us (I got it almost working) is to detect vehicle type in real-time to apply our logic, example, detecting taxis, ambulance, truck and opening the barrier. Look at that : Above, the AI is triggered in real-time on the picture sent by an IP camera already used in our LPR system. You might want to read this paper: https://arxiv.org/pdf/2212.10560.pdf You will find example of how to implement it on Github. After the release of my ongoing project, I had in mind to try to launch a project if Ryan and the mods team consent to, which consist of scrapping the entire forum and build a chat bot, I find it funny to build it, and I would like to see how good will be answer to issues like the ones that recently popped again, yo know, the "the forged session thing", "backend login crash expiration", etc, more than focusing on the core base code of the tool. We might collaborate to learn together ? Just adding that the main issue, is the hardware power...
    1 point
  23. HTMX already sends headers to identify itself with every request it initiates, so you could just put something like this into your config.php: $config->htmx = isset($_SERVER['HTTP_HX-Request']); The other headers seem useful, too: https://htmx.org/docs/#request-headers
    1 point
  24. https://www.mailersend.com/ is also a good option and you can have a look at https://github.com/baumrock/RockMailerSend (no docs at the moment and not officially released yet)
    1 point
  25. Repeaters are output as PageArray (or rather a class that inherits from it, called RepeaterPageArray), so you have all the methods from a WireArray such as: https://processwire.com/api/ref/wire-array/get/ https://processwire.com/api/ref/wire-array/find/ $page->repeater_field->get('FieldA=2')->FieldC
    1 point
  26. Another (rather lo-fi) setup could be: Use dev template files, as alternative templates. For testing out new content, you can leave pages unpublished and still preview them when logged in. If your client (role) has permissions to switch templates with Tracy Debugger, there the template switcher panel you could use. https://processwire.com/blog/posts/introducing-tracy-debugger/#template-path-panel https://processwire-recipes.com/recipes/use-different-sets-of-template-files/
    1 point
  27. Just in case someone stumbles across this in the future - forceLogin() is now available (since 2.6.8): https://processwire.com/blog/posts/processwire-2.6.8-brings-new-version-of-reno-admin-theme-and-more/#new-session-gt-forcelogin-user-method-to-login-user-without-a-password
    1 point
×
×
  • Create New...