Jump to content

Ivan Gretsky

Members
  • Posts

    1,533
  • Joined

  • Last visited

  • Days Won

    16

Everything posted by Ivan Gretsky

  1. Just to make sure... How do you check for output? In the frontend or in the admin?
  2. ProcessWire core still uses Magnific Popup, so do I. Made by the same ukrainian/russian programmer as PhotoSwipe, but a bit more oldschool.
  3. Something to do with the sessions? How are they stored?
  4. Good day! I am playing with the new command and finding some inconsistencies: If something went wrong while installing, like wrong db credentials were provided, there is no way to start over again without downloading the whole repo once again. Should there be a --no-download flag or something like that. The best thing is to make it check the db connection before the download process or even make it interactive and allow reenter the db credentials? Even with a db connection error I still get this untruthful message in the end: Congratulations, ProcessWire has been successfully installed. It would be nice if a new db could be attempted to create if there is not one already. I still get an error in the end PHP Fatal error: Class 'WireDatabaseBackup' not found in C:\Users\dxlab1\AppData\Roaming\Composer\vendor\wireshell\wireshell\src\Helpers\Installer.php on line 486
  5. It was already answered earlier here, Mike. Have a look.
  6. @ryan I was pretty sure you don't. For some people making things is much more interesting than having them. So Tesla won't be more fun than what you already doing (unless you're not a mechanic - or electric in this case ). I think words of appreciation won't hurt time to time. This just felt like the right place for a few. Promise not to write this kind of stuff after each and every you blog post))
  7. I know someone has to write this, so let it be me. The first time I realised what I could do with the ProcessWire API it was like an insane mode in mentioned Tesla Model S. But it was just the beginning as PW keeps accelerating me ever since. Of course there are rough edges, but I am sure there are some in Tesla too - you just have to own it a bit longer to discover them . This creation of yours, Ryan, is something that was a mind-changer and a life-changer for so many of us here and more around the globe. And it is not just cheaper and better, it is open source and the best you can get! Tesla team made a great job. So did you - alone. More people everywhere in the world are using PW now than probably ever will be using Tesla cars. So the impact not only on the future, but on the present is quite comparable (Tesla team just has to work harder to not fall behind too far). ProcessWire is equally fine crafted mixture of technology and design, as this electric car... But none of us have to give it back some day soon. But not only the technology is to be mentioned. ProcessWire is a community, open source and global. People from Africa use it alongside people from Europe and Americas. And they (actually we) come together every day to talk to each other about a topic of no envy and hatred, but a common love and perspective. The world seems to be so unstable and fragmented these days. At the place that I live I hear a lot of negative words aimed at US and its policy. Some of it might be true, some of it is an obvious propaganda. But without other channels of information and communication you can easily lose your own point of view. I am sure something similar is happening on the so called "other side". Here in community we overcome that way of thinking. You, Ryan, and the open source ProcessWire thing is doing better job for creating a world as a better place than NSA spying scandals and troops being brought to places abroad for sure. And your avatar is the most friendly face of America to be seen for many. I do not know if making one of the best pieces of software in the world for free and inspiring one of the most friendly and helpful international communities shall ever help you to buy a luxury electric car (I really hope so), but "at least" your children have something to be really proud about.
  8. Yep, ajax did not work out, it is in iframe indeed. So checking for the process is the option to choose. I managed to write a few lines in ready.php to handle the case: if($page->template == "admin") { if($user->hasRole("editor")) { if(!($page->process == "ProcessPageEdit" && $input->get->id == $currentCity->id)) { $session->redirect("/"); } } } This way the admin login page stays accessible for everyone, but almost everything else is not for the user with editor role. The page with the process ProcessPageEdit is accessible as it is needed for frontend editing, but only under certain conditions (actually only one page is editable).
  9. Good day! I want my users to be able to edit content via frontend editing but not to be able to access admin pages. I kind of reached what I wanted by putting this code in the ready.php file: if($this->page->template == "admin") { if($this->user->hasRole("editor")) { $this->session->redirect("/"); } } But I have a couple of fields, that can only be edited in popups. Those popups use admin pages in iframes, so the become broken as the code above works for them too. Could you suggest some kind of workaround for this situation? P.S. This topic is heavily inspired by this one.
  10. Can you share it?
  11. Ok, so I just install pim1 and write pim2Load().
  12. Good day! Is it somehow possible to test sending emails with WireMailSMTP without them actually being send? Something like you can do with regular php mail function in xampp where all the mail is put into a folder.
  13. Hello! How is going? I am confused how to update pim2 from PW (or really anywhere). Currently I got both pim1 and pim2 installed, but only pim1 is shown in ProcessWireUpgrade with the version 2.1 while pim2 is 2.7. Is there a proper way to handle this?
  14. Yep, already there thanks.
  15. Unix timestamp should be the same on any server, shouldn't it be ? Anyways, what should I check to make php and mysql consistent?
  16. I am really confused here. Please be so kind to explain. When I get $page->created as a timestamp, should not it be the same as 11 digits not depending on any timezone? But when I create a new page and straight after that do something like this: echo time(); echo $pages->get(1053)->created; The first number is less than the second in an amount of seconds equal to an hour. I assume both of these numbers are UNIX timestamps and should be about the same, but they differ in an hour.
  17. Good day! I need to have $page->created as a UNIX timestamp (UTC) to compare it to time(). But I can't figure it out how to do it. I get the $page->created time in the future, later than time(). Please help!
  18. There is no need for processwire:symlink task. Just use the built in deploy:shared task instead: <?php /** * Deployer ProcessWire Recipe * Version 0.0.1 */ require_once __DIR__ . '/common.php'; // ProcessWire shared dirs set('shared_dirs', ['site/assets']); // ProcessWire shared files set('shared_files', ['site/config.php']); /** * Main task */ task('deploy', [ 'deploy:prepare', 'deploy:release', 'deploy:update_code', 'deploy:shared', 'deploy:symlink', 'cleanup' ])->desc('Deploy your project'); after('deploy', 'success'); And not sure config file has to be shared. Of course it is bad practice to store you db credentials in the VCS, but this file is quite essential for the PW site.
  19. Hey, pleini! This is not about extending a class, but maybe an easier way to do what you need. If you got a reasonable need to have some method hookable and a module is maintained, you can ask the author to make it hookable. All module writers I have talked to tried to help me when I asked and almost all of them were friendly doing that)
  20. Here in Russia we use Yandex Maps API, which is quite similar to Google's. I do not know how good is the coverage for all over the world (must be ok for some cases), but you can check it out. It is free (at least for now).
  21. I think that you are right and there is no other way (at least that I know of). Some changes to working translations were introduced recently, so you have the option to only upload one csv file instead of many jsons. But I do not know of a language pack having such a csv yet .
  22. I do not see a need for function here at all <?php // LIST PARTICIPANTS CHILDREN OF THIS PAGE $overviewchildren = ''; foreach($page->children as $participant){ $partnerID = $participant->partnerID; $overviewchildren .= '<div class="row">' . '<div class="col-sm-2">' . '</div>' . '<div class="col-sm-10">' . '<strong><a href="' . $participant->url . '">' . $participant->p_first_name . ' '; if($participant->p_middle_name) { $overviewchildren .= $participant->p_middle_name . ' '; } $overviewchildren .= $participant->p_last_name . '</a></strong><br />' . $participant->p_job_title . '<br />' . $participant->p_department . '<br />' . $pages->get("parent=1004, partnerID=$partnerID")->title . '<br />' '</div>' . '</div>'; } ?> But actually $participant->partnerID should be a Page Field so you can just write $participant->partnerID->title P.S. Note the use of get instead of find.
  23. This can be done with a redirect from child template. The redirect should also pass a parameter with child page id that should be caught in parent template and shared with js with something like this <php echo "<script>var modalPageId=" . $input->get->childPageId . "</script>"; Then you should check this variable in your javascript and fire a popup if it is populated. BUT! Do not do none of this cus it is bad for everything: SEO, usability, you name it. Just through a 404 on child pages. If you need direct link just include a get parameter.
  24. This is because of a variable scope. Use wire('pages')->find(...)... instead. See Ryan's explanation here.
  25. Yes, that is the route I will probably take. I think about storing the token in the user template and use it only in pair with login. I am planning to use forceLogin to authenticate without password on condition if the token in the url matches the token stored in the user template.
×
×
  • Create New...