Jump to content

flydev

Members
  • Posts

    1,364
  • Joined

  • Last visited

  • Days Won

    49

Everything posted by flydev

  1. You could use $imageobject->width and $imageobject->height So you will use it like that : $square = $page->original_uploaded_image; echo ($square->width >= $square->height) ? '<img src="' . $square->width(500)->url . '" />'; : '<img src="' . $square->height(500)->url . '" />';
  2. Hi, I have the following error on ProcessWire 3.0.40 / MySQL 5.6.28 / PHP 5.6.25 : And this error on another live site (ProcessWire 3.0.25 / MySQL 5.5.50 / PHP 5.6.24 :
  3. try : $items = $pages->find("template=event")->setTotal(100)->setLimit(10); echo $items->renderPager();
  4. Hitting the "Refresh" button could help here ?
  5. Hi Jee, if empty, the inputfield set himself with the right value on the page save(). Doing something like this should work : // set outputformatting to false $page->of(false); // set the date field to an empty string $page->datenow = ''; // save the page, the date field should be updated $page->save(); // set outputformatting to true $page->of(true);
  6. Another little info : memory_limit must be > post_max_size to prevent poorly written scripts for eating up all available memory. And also the LimitRequestBody Apache's directive allows the user to set a limit on the allowed size of an HTTP request message body (set to 0 (illimited) by default).
  7. On the details tab of the field, look at Inputfield Type option, you should be able to switch between textarea / CKEditor.
  8. woohoo thanks you! how I missed that - its working
  9. I thought that the core function was doing the job : if(!is_array($options['exclude'])) $options['exclude'] = array($options['exclude']); Anyway I tried to assign an array, it does not work. Really it drives me crazy lol
  10. Thanks horst, yes but it wont work. For information the core function add and test the trailing slash : if(count($options['exclude']) && (in_array($name, $options['exclude']) || in_array("$name/", $options['exclude']))) continue; Also I remember a detail, when I developed the profiles for Bootstrap and Foundation, I used ProcessExportProfile to export them, and this module try to exclude itself from the generated profile but it fail. So it look like an issue that is here since PW 2.7. // code from ProcessExportProfile [...] $options = array( 'dir' => $dir, 'exclude' => array("$dir/modules/ProcessExportProfile") ); [...]
  11. I am working on a module and I need to exclude files/folders from a zip file created by wireZipFile() running on PW-3.0.38, without success. In the following test code, for example I want to exclude the folder errors and his child files. It create the zip file but fail to exclude the folder even if $option['exclude'] is filed. <?php namespace ProcessWire; $foldertozip = $config->paths->templates; $zipfile = $config->paths->templates.'test.zip'; $result = wireZipFile($zipfile, $foldertozip, array('exclude' => $config->paths->templates.'errors')); $content = ""; foreach ($result['files'] as $file) { $content .= "Zipped $file<br>"; // the listing show the folder 'errors' and his child files } I also tested to modify the core file WireFileTools.php, function zip(), hardcoding the path to exclude, again without success... already many hours trying to figure what the problem is Any idea guys ? thanks you.
  12. @Marvin Earp , Hi and welcome ! Which version of ProcessWire are you using and what is the admin theme ? You should try the fix of @valan :
  13. Hi Kai, I don't see any requirements here that is not manageable by ProcessWire, the only limit will be knowledge of PHP. 1. You could implement OAuth easily with 3rd party libraries or integrate each provider's API into ProcessWire. 2. You can manage users by using API and/or by playing with roles, permissions into ProcessWire backend. 3. Yes - very easy, for example, you can just use "pages" and page filedtype for relations. 4. Yes - by playing with urlSegments. 5. Yes - you can implement this feature easily + there are one or two modules which might help you to achieve that. 6. Yes - you have to implement it. 7. Yes - by using the API . 1. Yes 2. Yes 1. Yes (hooks come to my mind). 2. No problem at all. 3. From what I've read on the forum, I want to say : superfast. (ProCache)
  14. @modifiedcontent Imagine we have 3 pages : Home, Register, Member Area and 3 templates : home, register, member-area. In the template home, if the user is not logged in, the login form appear on the homepage - there is also a link to our register page, another for the member area page and the logout link. Code of home.php : In the register template, we show the registration form. First step, once the form is filled, a validation email is sent to the user. Then if the user go to his mailbox and click to the validation link, he return to our register page and submit the form with the validation token. If everything went smooth, we use a hook before the form is saved to add a role "member" to the user. Then we use a hook after the form is saved to send a confirmation email with the details (username, email, passowrd, welcome message, etc.). Code of register.php : And then in the member-area template, just show welcome message and a logout link. Nothing special here. Code of member-area.php : To test it, just create and copy paste the code of each template. FAQ: Check the hook in the register.php template above. Check the hook in the register.php template above. Read this post and ask for example/help if needed. You could do something like that : $markup = $fu->render(); $markup = str_replace('<ul', '<div', $markup); $markup = str_replace('<li', '<div', $markup); $markup = str_replace('</li>', '</div>', $markup); $markup = str_replace('</ul>', '</div>', $markup); $out .= $markup; (I am sure there is a better way to do it) You can modify the file emailValidation.php or use your own in /site/modules/FrontendUser/templates. Hope it help
  15. Perfect, it work fine on the three versions. Thanks for the update
  16. I think it was just an observation, no offence there It is good to see you trying again to build something with this piece of software.
  17. Today I managed to get it working for the three version. Tested. In the file FrontendUserRegisterEmailValidation.module line 110 I replaced the following code : // Load the plain / html email templates $emailContentHtml = wire('page')->render(wire('fu')->getFile('validationEmail.php', 'templates'), $vars); by this code : // Load the plain / html email templates $file = wire('fu')->getFile('validationEmail.php', 'templates'); $emailContentHtml = wireRenderFile($file, ['options' => $vars], ['default_path' => '']); As wireRenderFile was introduced in ProcessWire 2.5.2, there is no problem of compatibility. We can now receive email validation on PW 3.x with all information to create new user account
  18. It is simply not compatible with ProcessWire 3.x.
  19. I dont know, let me test on a 2.7 and 2.8, I will give you feedback. edit: installing the two version... edit 2: on 2.7.2, 2.8.33 and 3.x, after installation of the FURegisterEmailValidation, it give this error when accessing the frontend page : Fatal error: Call to a member function attr() on a non-object in [...]\site\modules\FrontendUser\FrontendUser\FrontendUserRegisterEmailValidation.module on line 160 Commenting the line 160, the form is rendered on the frontend page. Email testing - @pwFoo there are the results : on 2.7.2 : After filling the form, the email is sent and it contain all the information. It works. on 2.8.33 : After filling the form, the email is sent and it contain all the information. It works. on 3.0.33 : After filling the form, the email is sent and is empty. It do not works.
  20. If I understand correctly, you want the email activation plugin. In the backend, install the module FrontendUserRegisterEmailValidation then you call the module like that (but read the rest of the post and test it) : $fu = $modules->get('FrontendUser'); // add emailValidation to the form $fu->register(array('username', 'email', 'emailValidation', 'password')); $fu->process($pages->get('/login/')->url); echo $fu->render(); --- @pwFoo I implemented FU on a PW 3.0.33 with the FURegisterEmailValidation module. The email is sent but empty. Using TracyDebugger, I dump $emailContentHtml and $emailContentPlain, they are always empty . // Load the plain / html email templates $emailContentHtml = wire('page')->render(wire('fu')->getFile('validationEmail.php', 'templates'), $vars); bd($emailContentHtml); it return : "" (empty string)
  21. Thanks for sharing. I have one comment. I have a doubt about this variable : $input->post->g-recaptcha-response - it return a PHP notice undefined constant (or I am dumb).
  22. Hi Enrico and welcome to the forum. You will get good answers for sure, meanwhile, you can read this tutorial:
×
×
  • Create New...