Jump to content

Pixrael

Members
  • Posts

    384
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Pixrael

  1. @ryan maybe this could help: https://www.phpclasses.org/package/12821-PHP-Detect-and-block-spam-bots-from-accessing-sites.html
  2. https://learn.microsoft.com/en-us/answers/questions/414790/check-if-lat-long-point-is-inside-polygons
  3. What about this? https://htmx.org/docs/#polling + the Processwire pages API to build the response
  4. Check: https://processwire.com/api/ref/wire-input/url/
  5. @ryan did you consider https://imperavi.com/ products?
  6. or.. you can use the Shopify Webhooks subscriptions too. For REST AI check here: https://shopify.dev/api/admin-rest/2022-07/resources/webhook
  7. If you plan to export and import pages at some point, ex. development to production. I recommend that you never use page IDs in selectors, or in other places where they acts as hard data. Because (during the import) the ID value of the source can change depending on the availability of the number in the destination, and that can destroy your code logic.
  8. Also you can check this https://processwire.com/modules/process-wire-bootstrap4/ and look at the _func.php file, this was for BS4 but maybe you can adapt it easily to your BS version
  9. try to use $page->viewable() instead of asking for the user role.. and report back to us Note: if you want the logged user to only be able to check his own profile, you must add this check also, comparing the ID from the urlSegment with the ID of the current user
  10. @ryan a possible solution for future enhancements to MarkupRegions is that only comments starting with <!--# are the ones that will be removed in the process and the original html comments will be kept. @gebeer you can try to make that modification in your copy of the code.
  11. You can also create a new template (ex. api) with just the title field. Create the template file (ex. api.php) and publish a page on your site without access restriction (ex. domain.com/api) and that's it. In your template file (which is your entry point) you can use: $input->post(), $input->get() or urlSegments to get the request data, and then you can include files, or execute functions or whatever you want. Finally you print everything in JSON format, or in html format if you want to use htmx. Piece a cake! ?
  12. I did something similar in a project, using this library: https://github.com/Rct567/DomQuery to manipulate the content of the SVG file (it's basically XML), using file_get_contents (from file), and then modifying texts, assigning/removing css classes, hiding/removing elements, etc. In this particular case, I ended rendering the modified SVG to PNG using Imagick for the final output (delivered by AJAX). The SVG document must be prepared in advance for that. Using the proper IDs and classes. Visual styles were applied by CSS classes and not directly on elements, in order to manipulate them. Modifications were not interactive, they were captured with a form.
  13. I think in pages that need this paragraph changes you can use different fields for each region, and render the field according to the current region. Ex. body_america, body_europe, etc. You can create a function that determines to which region it belongs according to the country. If you have a license for ProFields you can use Textareas field type to handle that more easily. Pseudo code: $http = new WireHttp(); $country = $http->getJson("http://ip-api.com/json/{$session->getIP()}?fields=countryCode"); $region = getRegion($country); echo $page->body_$region; function getRegion($country) { // Set a default $output (europe) // Using an in_array, switch, etc. find the current related region to override it (america, asia, africa, etc.) return $output; }
  14. hum.. looks like the second call uses POST too: secondAJAXXHR.open('POST', '', true); do you fill the $action variable in the "some logic" code? // some logic $response['action'] = $action; if not, will be empty for a GET request
  15. class Test extends \Wireframe\Controller { public $var; ...... etc } maybe?
  16. Not really, but what I wanted is to help you to have material, to review, because it's difficult to have an idea of future needs ahead of time. You could discard the ones that don't make sense of course
  17. @bernhard check this custom filters for PW, maybe you wan to add this to your module: https://github.com/rolandtoth/TemplateLatteReplace/wiki/Additional-filters
  18. That template engine is great, in my beginnings with Processwire I was testing with this excellent module developed by @tpr it's very complete, with many additions and filters to extend it. But I finally ended up using Markup Regions when it came out around the same time. I wasn't that ready yet for that "advanced" PHP. I'll keep an eye on your module, maybe I'll try again with Latte ?
  19. @wbmnfktr That would be fine, but sometimes we can change the name of the page (ex. by SEO criteria) or change the location of the page, however if a universal identification of that page is maintained, there will be no problems with the maintenance or updating of the project. and furthermore, it would not be necessary to reproduce the design of the site's navigation structure in a folder tree.
  20. Problem: As the page ID is currently used for the creation of the page folder, does not allow the pages to be imported correctly when they are Exported/Imported in the admin. Example: Having a website in production generating new content constantly, and in my development copy I add some categories, pages and other content that includes images, logos, etc. When I upload the local folders to the server, and export/import that pages, the relationship between them is lost, because the exported IDs are already used in production on other pages and PW generates new IDs. Another consequence is that the contents of the local folders are mixed in the folders of the online pages that share that ID. Solution: Would be to add a new internal parameter to each page based on some kind of uuid, which serves as a unalterable reference for naming and accessing the folder related to that page.
  21. @virtualgadjo check this, it may also be useful in your project: https://processwire.com/modules/connect-page-fields/
  22. I know your feelings now, I've been there. In my experience PW is great for creation, but very bad for maintenance. The fact that the entire site configuration is dynamic based on the database tables is a big deal. One piece of advice, if you are going to use the Export/Import pages option, never think of using the ID of the pages in functions and logic in general.
  23. Could this be a solution? https://mediamanager.kongondo.com/
×
×
  • Create New...