Jump to content

tires

Members
  • Posts

    247
  • Joined

  • Last visited

Everything posted by tires

  1. Thank you!!! So you just have to put the code at the end of the htaccess file? Is that the only trick?
  2. tires

    SeoMaestro

    In my backend the following error is displayed: Error upgrading module (SeoMaestro): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db123456_1.field_SEO' doesn't exist Is this a known issue or is there a problem in my templates or fields?
  3. Thank you for your answer. I had already seen the module. Nevertheless, I would prefer a simple solution directly via the htaccess file. If there is a solution?
  4. I need a very simple htpasswd protection for my staging installation. So I inserted these lines into the processwire .htaccess at the very beginning: AuthType Basic AuthName "protected" AuthUserFile /usr/home/dev/.htpasswd Require valid-user The file .htpasswd contains the following code (i.e. admin / admin): admin:$2y$10$yuBaR6xKApq7F1BmOXyzbeEz3kQBpuI5p4TJCvRD4VXP2MRmIoBFy For some reason i get a 404 after login.
  5. Ok, I have now found out that you can create a Consent banner with button, with the attributes: class="require-consent" data-src="https://www.youtube-nocookie.com/embed/abcd" data-category="external_media" data-ask-consent="1". This also works wonderfully, BUT only for 1 element. I have a YouTube video (iframe) and a google map (div) on my website. Unfortunately, a banner with a consent button is only displayed for the first element. Only when I comment out the iframe, the banner for the div #standortmap is displayed. echo '<iframe class="require-consent" data-src="https://www.youtube-nocookie.com/embed/123" data-category="external_media" data-ask-consent="1" data-ask-consent-message="Externere Inhalte von google.com und youtube.com werden aus Datenschutz&shy;gründen erst nach expliziter Zustimmung geladen." data-ask-consent-button-label="Video laden" id="youtube-video" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen width="100%" height="100%" ></iframe> <br><br>'; echo '<div id="standortmap" data-lat="11.123" data-lng="1.123" data-zoom="12" data-category="external_media" data-ask-consent="1" data-ask-consent-message="Externere Inhalte von google.com und youtube.com werden aus Datenschutz&shy;gründen erst nach expliziter Zustimmung geladen." data-ask-consent-button-label="Karte laden" style="height: 300px;"></div>'; Is this an error? Or can the module only display one banner at a time?
  6. I embed youtube videos and google maps into my site in various ways. To make the site privacy compliant, I would like to display an overlay above each video and map with a button “Load content” (loads the content once) and “Always load content” (sets the corresponding privacy wire cookie an loads the contents always). Is there already a solution for this? What is the best way to do this?
  7. How can I make the trash in page tree visible for certain user roles and give them the option to restore pages from the trash?
  8. Thank you for your answer. I'll give it a try then.
  9. Are there any disadvantages or would you advise against duplicating pages that contain matrix repeater content? Can this cause problems or is it safe to do so?
  10. Is there a way to automatically create the title and the name of a page from the content of two fields? I have the problem that the editor usually has to enter the same thing in the title field as in these two fields. What is the easiest way? Or is there perhaps a module?
  11. It seems to continue there! Great!!!
  12. I have just realized that the module is still running with my new mailboxes. The problem was that I have several mailboxes that I retrieve. And since there is only one field for the password, this must be the same for all mailboxes ...
  13. With my new mail server, this module no longer works for me either. That's a real shame, because it's a great and helpful module. I assume that you only have to replace the flourish components with the imap_open function. Most of the code should remain untouched. I also lack the technical expertise. The AI suggests the following code: <?php /** * ProcessEmailToPage.module * Module to fetch emails from a mailbox and convert them into ProcessWire pages */ class ProcessEmailToPage extends WireData implements Module { public $moduleHash; public $emailHost; public $emailPort; public $emailPassword; public $emailType; public $forceSecure = false; public $categoryData; // Module info public static function getModuleInfo() { return array( 'title' => 'Process Email to Page', 'version' => 1, 'summary' => 'Fetches emails from a mailbox and creates pages from the messages.', 'author' => 'Your Name', 'requires' => 'ProcessWire 3.x' ); } public function init() { // Set the hash for security to ensure only authorized requests are processed $this->moduleHash = wire('config')->hash; // Example category data (JSON) $this->categoryData = '{"categories": [{"emailAddress": "your-email@example.com"}]}'; // Set connection parameters $this->emailHost = 'imap.example.com'; // Example IMAP server $this->emailPort = 993; // SSL port $this->emailPassword = 'your-password'; // Your email password $this->emailType = 'imap'; // Protocol type (imap/pop3) } public function execute() { // Process emails if the correct hash is provided if(wire('input')->get('hash') && wire('input')->get('hash') == $this->moduleHash) { // Decode category data from JSON into an object $categories = json_decode($this->categoryData); // Iterate through each email category foreach($categories as $category) { // Set up email connection $this->emailType = empty($this->emailType) ? 'imap' : strtolower($this->emailType); // Default to 'imap' $server = '{' . $this->emailHost . ':' . ($this->emailPort ? $this->emailPort : 993) . '/imap/ssl}INBOX'; // IMAP server with SSL $username = $category->emailAddress; $password = $this->emailPassword; // Connect to the mail server using imap_open $mailbox = imap_open($server, $username, $password); if (!$mailbox) { echo "Error connecting to the mail server: " . imap_last_error(); continue; } // Search for all emails (can be adjusted to 'UNSEEN' for unread emails) $emails = imap_search($mailbox, 'ALL'); if ($emails) { rsort($emails); // Sort emails with the newest first $messages = []; // Iterate through each email ID foreach($emails as $email_id) { // Fetch the email header information $overview = imap_fetch_overview($mailbox, $email_id, 0); $messages[] = $overview[0]; // Store header information // Optional: Output more header fields such as "From", "Subject", "Date" // echo "Subject: " . $overview[0]->subject . "\n"; // echo "From: " . $overview[0]->from . "\n"; // echo "Date: " . $overview[0]->date . "\n"; } // Now process the emails, for example, create a page for each email foreach ($messages as $message) { $page = $pages->add('email'); $page->title = $message->subject; $page->body = "Email from: " . $message->from . " on " . $message->date; $page->save(); } // Delete processed emails from the server foreach ($emails as $email_id) { imap_delete($mailbox, $email_id); } // Expunge to permanently remove the deleted emails imap_expunge($mailbox); } // Close the connection to the mail server after processing imap_close($mailbox); } } } }
  14. Thank you very much. I have now simply removed this hook.
  15. Please, come on! 😆 Really, i don't understand what you mean right now.
  16. Which mistake do you mean? 🤓 By the way, do I need this hook at all or does the module automatically index the edited page when it is saved?
  17. having had a lot of frustration during the year creating two shops with shopware 6, i wonder if there is an open source shop system that is as nice and simple as processwire? Do you have any experience with a system with a wide range of functions that is easy to set up and use (apart from padloper and RockCommerce)?
  18. I can't really remember why I used this module (it's been a few years). Do I really need it to find the content of the pages? You mean I should simply adapt the ready.php to, right? $wire->addHookAfter('Pages::saveReady', function($event) { $event->modules->get('SearchEngine')->indexPages($page); $page = $event->arguments(0); $event->wire('log')->save('Page saved', "Page ID: $page->id / Page Name: $page->name / Page Parents: $page->parents"); }); Thank a lot!
  19. Thank you very much for your advice! I have indeed found a hook that was apparently to blame. I can't remember exactly why I added it and what it does ... $wire->addHookAfter('Pages::saveReady', function($event) { $event->modules->get('SearchEngine')->indexPages(); $page = $event->arguments(0); $event->wire('log')->save('Page saved', "Page ID: $page->id / Page Name: $page->name / Page Parents: $page->parents"); });
  20. I have a site with about 5000 subpages and have noticed that it now takes about 10 seconds to save a page. What could be the reason for this and how can I speed up the site?
  21. Ah ok! Thank you! It was sort not move!
  22. Thank you for your reply. It works for me as a superuser. But the editor gets a warning message that he does not have the right to move pages (below this particular parent page). What rights do I need to give him to make this work? I have already spent half an hour unsuccessfully clicking through all the templates and role settings ...
  23. I am a little confused. As far as I remember, on my older Processwire pages, I can only move pages within the parent page (i.e. change the positions of the siblings). Now I've noticed that I can (recently?) move them across the entire page tree. How can I limit the moving of pages? I didn't get any further by setting the user rights.
  24. Thank you! Is this an official solution or some kind of hack? I can't find an info in the documentation.
×
×
  • Create New...