Jump to content

flydev

Members
  • Posts

    1,328
  • Joined

  • Last visited

  • Days Won

    47

Everything posted by flydev

  1. okay ? PS: to update the modules directory, just re-submit the module and the module will be updated automatically in a second.
  2. Installed a stock ProcessWire 3.0.102 I Downloaded the module RockFinder 1.0.0 I installed RockFinder I installed ProcessRockFinder I clicked Setup > RockFinder tester I have the same warning / error. Just for testing I replaced InputfieldRockGrid on line 50 by InputfieldTextarea, I can access the process module.
  3. ProcessWire 3.0.98 PHP 7.0.10 I just installed the module from your Gitlab repo then I clicked Setup > RockFinder tester and the error happen. I think you can't reproduce this error because you have InputfieldRockGrid (called at line 50 in ProcessRockFinder.module.php) but its not shipped with module. That explain the warning. wow those smileys are big lol
  4. Please submit this gold module to the modules directory so we can update it in one click ? Edit: Just re-installed the module from scratch, I got an error when I try to access the RockFinder tester, see the attached screenshot :
  5. Already glad you switched from WP to PW ???
  6. I think I am missing something, because to achieve what you asked, you have to write : [...] foreach($stories as $story) { if(count($page->imagefieldname)) { // images exist, we show the div echo "<div>...</div>"; } [...] } [...]
  7. I am out of idea right now - I have 15 minutes, if you want I can take a look at your install if you feel confident.. Edit: was a browser cache issue.
  8. Sorry, I don't understand what you mean by 'post archive'. The if condition you write, only work if the imagefieldname field is configured to contain a max of one (1) image. It is the case ?
  9. You might have modified your .htaccess file to work on localhost and a subdirectory. Now, you should double check the .htaccess file, in particular this section : # ----------------------------------------------------------------------------------------------- # 11. OPTIONAL: Set a rewrite base if rewrites aren't working properly on your server. # And if your site directory starts with a "~" you will most likely have to use this. # ----------------------------------------------------------------------------------------------- RewriteBase / # RewriteBase /pw/ # RewriteBase /~user/ How is looking your ?
  10. try updating your config.php with your new site url : $config->httpHosts = array('your.newsite.com');
  11. Hi, more infos: https://processwire.com/api/fieldtypes/images/
  12. 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/
  13. 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() [...]
  14. @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); }
  15. Hi @theo is there something in the apache / nginx / php* logs ?
  16. 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 ?
  17. @rareyush I fixed the module, let me know if it works ✌️
  18. 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 ?
  19. @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); } } }); ?
  20. 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);
  21. @SIERRA You could try this this module made by @adrian before going further : https://gist.github.com/adrianbj/e391e2e343c5620d0720
  22. 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 ?
  23. 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:
×
×
  • Create New...