Jump to content

flydev

Members
  • Posts

    1,366
  • Joined

  • Last visited

  • Days Won

    49

Everything posted by flydev

  1. Its one of the new Facebook security things yes. Please have a read to this article and please don't slap me with a large trout, its a WP oriented blog ! ? https://wp-native-articles.com/blog/news/how-to-fix-facebook-apps-error-cant-load-url-domain-url-isnt-included-apps-domains/
  2. ok this time is good, you need to put your markup after the if condition. <?php //Display current user image $upload_path = $config->paths->assets . "files/avatar_uploads/"; $f = new WireUpload('userimage'); $f->setMaxFiles(1); $f->setMaxFileSize(1*1024*1024); $f->setOverwrite(true); $f->setDestinationPath($upload_path); $f->setValidExtensions(array('jpg', 'jpeg', 'png', 'gif')); if($input->post->form_submit) { if(!is_dir($upload_path)) { if(!wireMkdir($upload_path)) throw new WireException("No upload path!"); } $files = $f->execute(); if ($f->getErrors()) { foreach($files as $filename) @unlink($upload_path . $filename); foreach($f->getErrors() as $e) echo $e; } else { $user->of(false); $user->profile_picture->removeAll(); // wirearray (line added by @horst: explanation is three posts beneath) $user->profile_picture = $upload_path . $files[0]; $user->save(); $user->of(true); @unlink($upload_path . $files[0]); } } // here $userImg = $user->profile_picture->first(); echo '<img src="'.$userImg->url.'">'; ?> <form class="forum-form" accept-charset="utf-8" action="./" method="post" enctype="multipart/form-data" > <input type="file" id="attach" name="userimage" accept="image/jpg,image/jpeg,image/gif,image/png" /> <input type="submit" name="form_submit" value="Submit"/> </form> and if you want to avoid a warning in imageExtra, then you should assign a title to the picture_profile field : [...] $user->profile_picture->title = ''; // or whatever $user->save() [...]
  3. @rareyush sorry, its a custom function, you can copy paste the code in _func.php or where you want : /* * replace the last occurence of $search by $replace in $subject */ function str_lreplace($search, $replace, $subject) { return preg_replace('~(.*)' . preg_quote($search, '~') . '~', '$1' . $replace, $subject, 1); }
  4. Hi @theo is there something in the apache / nginx / php* logs ?
  5. Hello @Sanyaissues , I was not aware of the reCAPTCHA v3 but it will be definitely implemented. I will wait a bit more documentation as I already tried to get it working but without success. Thanks for your interest ?
  6. @rareyush I fixed the module, let me know if it works ✌️
  7. yes sorry, I edited my previous post, please re-copy the code. The error is because I use the keyword $this (as I am writing a module) instead of using wire() in the hook if he is called from the ready.php ?
  8. @MarcoPLY more info about options fieldtype there. There you go ( should support multi-language) : wire()->addHookAfter('LoginRegister::processRegisterForm', function ($event) { $form = $event->arguments[0]; foreach($form->getAll() as $f) { $name = $f->attr('name'); if(strpos($name, 'register_') !== 0) continue; if($name == 'register_subscribe_newsletter' && wire('input')->post->register_subscribe_newsletter == 1) { $options = wire('fieldtypes')->get('FieldtypeOptions')->getOptions(wire('fields')->get('shipping_countrycode')); // get the field foreach ($options as $value) { // loop if(wire('input')->post->register_shipping_countrycode == $value->id) { // check field options id $country_title = $value->title; // assign country option title } } $mc = wire('modules')->get("SubscribeToMailchimp"); $email = wire('input')->post->register_email; $subscriber = [ 'FNAME' => wire('input')->post->register_pad_firstname, 'MMERGE4' => $country_title, ]; $mc->subscribe($email, $subscriber); } } }); ?
  9. It would be easy to give an example using a Page object, but from a module I am curious how to achieve it. Another idea could be creating a page/template with all the fields which will be potentially injected in a form then $test = $fields->get('test_field'); $field = $test->getInputfield($injectPage); // $injectPage is a Page object $form->add($field);
  10. @SIERRA You could try this this module made by @adrian before going further : https://gist.github.com/adrianbj/e391e2e343c5620d0720
  11. Hi @hellboy Did you mean that you get the content of the msg javascript variable in your console or you just don't have any error output ? If yes, what is the content of msg ?
  12. So to get it working, nothing fancy, all easy. In this example, only the email user field is used. Thanks @daniels for this module ? Assuming the checkbox field is called "subscribe_newsletter" and added to the "Registration form fields" in LoginRegister settings, in ready.php : wire()->addHookAfter('LoginRegister::processRegisterForm', function($event) { $form = $event->arguments[0]; foreach($form->getAll() as $f) { $name = $f->attr('name'); if(strpos($name, 'register_') !== 0) continue; if($name == 'register_subscribe_newsletter' && wire('input')->post->register_subscribe_newsletter == 1) { $mc = wire('modules')->get("SubscribeToMailchimp"); $email = wire('input')->post->register_email; // Do not forget to saninitize the email field $mc->subscribe($email); } } }); Result:
  13. Yes, I dont know why I was looking to hooks to insert the checkbox.. Adding it to the fields list will be a lot easier.
  14. I will install the Mailchimp module to see how it work. From what I already see, we could add a checkbox by hooking into LoginRegister::buildRegisterForm and we can do the newsletter registration stuff in LoginRegister::processRegisterForm stay tuned ?
  15. For this job you have this module available :
  16. @MarcoPLY feel free to ask your question in this thread or this , as I am building a companion module for LoginRegister, all feature are welcome.
  17. hey @Wanze I stumbled into an issue after updating the module I ran into some time ago before deploying a site on a Windows 2008 server. The issue is described there And the fix there : Each time I don't remember where the issue come from and I have to google it and re-read my thread. Are willing to accept a PR ?
  18. I am not giving you a checklist but a tool which can be helpful for "managing" the end of your project by writing tasks. Check out https://github.com/deployphp/deployer I personally use it in conjunction with Duplicator - but it can be used in any workflow, like rsync etc... - Once the package is created, you launch your task and the tool configure/deploy everything for you.
  19. @theo The new function is based on the official WireFileTools::zip() function and I didn't saw this check. Nice catch ? It has not do with the issue I remember. I just checked and its a silly mistake I made while updating the module. Thanks again @theo . It will be fixed in Duplicator-1.2.10 I never ran into into this issue but it look like it can happen. I have a site with 600MB stuff and his database size at 1GB+, I have no timeout building the package or downloading issue. To me, it look like a server settings. If you can, please send me the server details so I can try to reproduce it. PS: still didn't found the time to check what is going on GoogleDrive. @szabesz any feedback about Dropbox v2 ? ?
  20. hey @Macrura could you send me your PR about this module ?
  21. Assuming your comments field is called comments then you get the count like that : $count = count($page->comments); or $count = $page->comments->count();
  22. I have a similar setup where around 100k pages per months are created. Even if your setup if more complex due to a lot of door, etc, I hope you will get the idea. You could structure your tree like the following setup : + Root |- - Building (building template) |- - - - 2018 (year template) |- - - - - - April (month template) |- - - - - - - - opened_door_entry (door template) |- - - - - - - - opened_door_entry (door template) |- - - - - - - - [...] |- - - - - - - - Reports |- - - - - - - - - - day_1_report (report template) |- - - - - - - - - - day_2_report (report template) |- - - - - - - - - - day_3_report (report template) |- - [...] another building/year/month/data tree The "door template" will contain the information about an unique entry (user id, dongle id, door id, access time etc). Each night, you generate a report for the current day update the monthly report And to access the data, you will have three options : access a global report for a given date or door_id, user_id... (speed: 1-2seconds) access a report for a given day and/or door_id, user_id... (speed: 1-2seconds) build a custom report from the entries (speed: fast with custom query, see below) With theses options, you can do some COUNT(), SUM(), etc on the fetched pages fields if required. For the option #3, you must go with custom SQL queries. A module is born recently (thanks @bernhard) which will help you to query your data, take a look at this thread: Or you can begin and modify this module for your needs : https://modules.processwire.com/modules/pages-sum/ Do not hesitate to ask precisions or discuss about your interesting project ✌️ Hope it help!
  23. Totally useful ? Thanks you !
  24. In incognito mode, the websites load correctly ? Also you can try to clear the DNS cache, in a terminal type : 1) ipconfig /flushdns 2) ipconfig /registerdns 3) ipconfig /release 4) ipconfig /renew 5) netsh winsock reset If it doesn't work, you should open a ticket on your ISP. PS: I had problem accessing Github and ProcessWire this last 23 April.
×
×
  • Create New...