Jump to content

Juergen

Members
  • Posts

    1,394
  • Joined

  • Last visited

  • Days Won

    17

Everything posted by Juergen

  1. This was not clearly written by me. Sorry! I have used "include=hidden" and the page will be found, but the URL did not point to the parent. Thats the way to go!
  2. Thanks @horst, I have also thought about this to add the values via a page save hook to a field, but I have hoped that there will be a more elegant solution (fe. via a page reference field or something like that). Storing the same data twice is a little bit of overhead.
  3. Hello , I want to know how others deal with site search and hidden child pages. Some of my pages have children which status is set to hidden. The parent page is the main page and the only visible page. The child pages provide some content wich will be displayed on the parent (main) page. fe my main page is a page about privacy policies of several social networks - Privacy policy (main page, visible) -- Privacy policy for Facebook (child page, status hidden) -- Privacy policy for Twitter (child page, status hidden) -- Privacy policy for Linkedin (child page, status hidden) So on my main page all the texts of the child pages will be visible. Problem: If I use my search form on the frontend and search for a word (term) that is included in a hidden child page, it will not be found, but this word (term) is visible on the main page. I want to achive that the word (term) will be found, but the URL should point to the main page (in this case the privacy policy page). I guess that others are struggeling with this problem too. How do you deal with this problem? What would be a good approach? Thanks in advance
  4. I also have a lot of these requests in my 404 logger protocol . I think if there is module that can handle it - use it. Check if the module is installed first. If not output a message that this feature is only available if Jumplinks is installed. I dont have Jumplinks installed and I dont know how well it works, but before starting to code from the beginning I would try to use an existing solution first.
  5. Thanks for the hint @PWaddict, I have updated the code on the first post !
  6. Just a thought: I think it would be nice to store the banned IPs also in a logfile, so you have them in one place with the other protocols. Fe: $log->save('blackhole', 'Banned IP') You can also add fe a checkbox in the module settings to offer enabling and disabling of this feature. What do you think? Might this be useful for others too?
  7. Its a fast and simply way to store sent mails. Its only there for the purpose if someone says he has sent a mail, but the site owner doesnt receive it. The log file will be written after PHP mailers send function was successfully triggered.
  8. Thanks for testing @kongondo, but I have tried this before with no luck. Another opportunity would be to add separate colums (<td>) for each entry, but I also dont know how. Serializing the entries dont work.
  9. Hello @ all, I am logging all submissions via my contact form in the log files with the following line of code: $log->save('contact-form', 'Email: '.$emailvalue.'<br />Betreff: '.$subjectvalue.'<br /> Nachricht: '.$commentsvalue); So the logfile is called "contact-form". Unfortnunately all br-tags will be displayed as letters and not as line-breaks. Maybe someone can give me a hint how to use line-breaks in log files. Thanks
  10. Its not so important, because only bad bots will see it and probably no humans (I hope so). By the way 2 bots from China were caught in the trap - works!!!
  11. Works like a charm now! Would be great if the hard coded url of the "contact the administrator" page could be selected out of PW pages. Thanks for the update!!! Edit: It would be better if you add multilanguage support to the custom message textareas
  12. I have installed it again but now I have only included the module in the blackhole.php (not on the home or other page) only to see if it works. It works now, but the loading time of the page is approx. 21 seconds!!!! I have added a hidden link in my site to the blackhole.php and if I click on it my IP will be stored in the DAT file - works well. In the mail that I got afterwards there was a hint about a Port problem: Whois Lookup: Timed-out connecting to $server (port 43). I am on a shared host so it seems that this port is not free. The strange thing is that I have disabled the Who is Lookup in my settings of the module Best regards Jürgen
  13. Hello @ all, I have no idea, but approval via email does not work in my case. Here are all my get variables that will be submitted by clicking the link in the email: code gKB6jlhWTowUeahUNX6OWWvBYBxYf1D41I5LZb4ws1YsA73jmk7sQeOoU1QAy4L6f1IAnmaSKXRjINOtGFDKO92e10Y5IuTzmuHOwkGI8bWtcXaIGstDB_xzq9hhwvZx comment_success approve field comments page_id 2006 As you can see all parameters are there. As far as I know the file CommentNotifications.php is responsible to save the new status "approved" after clicking the link, but in my case nothing changes and I do not get any message on the frontend. Tracy does not complain about anything so I dont know how to check where the problem is. Is there someone who could give me a hint to check out whats going on after clicking the link to find out the problem. Best regards EDIT: Ok, I see! This doesnt work if the comments were not rendered with the render function. So using your own markup to output comments inside a foreach prevents the status change after clicking the approval link. Solution: Copy the whole Fieldtype comments directory in site/modules and make all the markup changes there. Load comment form and list via the render function and everything is fine.
  14. Strange, after clearing the module cache it works now
  15. I have tried it with several combinations and also with absolute pathes - no difference.
  16. Hello @all I have a problem with integrating external stylesheets into AIOM. I have toggled the checkbox to allow stylesheets from outside the template folder, but I always get the following message: PHP Warning: file_get_contents(): Filename cannot be empty in .../site/modules/AllInOneMinify/AllInOneMinify.module:596 So it doesnt find the external stylesheet wich is located in /node_modules/cookieconsent/build/cookieconsent.min.css. This is how I have tried to integrate it: $stylesheets = [ '/node_modules/cookieconsent/build/cookieconsent.min.css', 'css/main.less' ]; echo '<link rel="stylesheet" href="'.\AIOM::CSS($stylesheets).'">' . "\n"; Independent if I change the path to /node_modules/cookieconsent/build/cookieconsent.min.css or ./node_modules/cookieconsent/build/cookieconsent.min.css or ../node_modules/cookieconsent/build/cookieconsent.min.css there is no difference. Technical data: AIOM 3.2.3 PHP 7 PW latest dev Is there something else I am missing?
  17. Great! I didnt know that this exist
  18. In my case I want to count the children which are under the current page beeing edited. Each child page is a date, so I count of how many dates this page has. But counting the children via siblings could also be an opportunity.
  19. Here is my code for others who also deals with the same issue. This little function prevents the deletion of the last child page if page has a certain template. Code runs inside ready.php. //prevent deletion of last child function wire()->addHookBefore('Pages::trash', null, 'preventdeletionlastevent'); wire()->addHookBefore('Pages::delete', null, 'preventdeletionlastevent'); function preventdeletionlastevent($event) { $page = $event->arguments(0); if(!in_array($page->template->name, ['single-date', 'single-event', 'single-business-vacation', 'single-special-business-hours'])) return; $parent = $page->parent; $childrennumber = count($page->parent->children); if($childrennumber === 1) { $event->replace = true; // now original function won't be called $event->return = wire()->warning(__("Deleting of the last date is not allowed. There must be at least 1 date.")); } else { wire()->message(__("1 date was deleted.")); } }
  20. Aaahh, I see!! This would be a solution Thanks!!!
  21. Thanks @Zeka, but I guess in this case I have to define the functions for each "Class::method" - so I have also 2 functions ("Pages::trash", "Pages::delete") - so I can leave the 2 hooks as they are.
  22. Hello @ all, In my case I have some hooks with the same code which run on page "Pages::trash" and "Pages::delete" inside may ready.php. For the moment I have used separate hooks for each of them. Is there a possibility to combine them so the same code runs only once and includes "trash" and "delete"? Explanation: Instead of $wire->addHookBefore("Pages::trash", function($event) { .... run code }); and $wire->addHookBefore("Pages::delete", function($event) { .... run code }); combine them $wire->addHookBefore("Pages::trash","Pages::delete", function($event) { .... run code }); This would be more efficiently for further changes and reduces the code. Best regards
  23. Hello @kongondo, I have discovered a strange behavior: I use a pagetable field inside a parent page. If click on the link inside the pagetable to open a child page inside a modal, I will be logged out from the system if the child page has a matrix field inside. I have traced down the problem and it has to do with a hook that I run on the pagetable field of the parent page (inside my ready.php): $wire->addHookBefore('InputfieldPageTable::render', function($event) { if($this->process != 'ProcessPageEdit') return; $table = $event->object; $page = $this->process->getPage(); // event table if(in_array($table->name, ['datespagetable', 'specialbusinesshourstable', 'eventspagetable', 'businessvacationpagetable'])) { if(count($page->children) == 0){ $table->notes = ""; $this->buttonHook = $this->addHookAfter("InputfieldButton::render", null, function(HookEvent $event){ $event->return = __("Here all dates will be shown afterwards if some were created."); }); } //this part of the button hook is responsible for loggin me out if I click on the link to the page inside the pagetable else { $this->addHookBefore("InputfieldButton::render", null, function(HookEvent $event){ $button = $event->object; if($button->name == 'button'){ $button->attr('value', __('Add event')); } }); } } }); Inside this hook there is another hook for rendering the "Add new" button. So this "InputfieldButton::render" hook is responsible for loggin me out (if I remove this part everthing is fine). So its not a big problem for me (I have comment it out), but maybe you have an idea, why these lines of code could lead to this behavior in combination with the matrix field. Best regards
  24. Oh, sorry - my fault. I use the 2D repeater matrix from Kongondo.
×
×
  • Create New...