-
Posts
1,360 -
Joined
-
Last visited
-
Days Won
49
Everything posted by flydev
-
@rareyush I fixed the module, let me know if it works ✌️
-
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 ?
-
@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); } } }); ?
-
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);
-
Giving privileges to edit only the content - After login
flydev replied to SIERRA's topic in General Support
@SIERRA You could try this this module made by @adrian before going further : https://gist.github.com/adrianbj/e391e2e343c5620d0720 -
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 ?
-
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:
-
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.
-
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 ?
-
Giving privileges to edit only the content - After login
flydev replied to SIERRA's topic in General Support
For this job you have this module available : -
@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.
-
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 ?
-
What's on your checklist for the end of a Web design project?
flydev replied to johnstephens's topic in Dev Talk
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. -
@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 ? ?
-
hey @Macrura could you send me your PR about this module ?
-
Assuming your comments field is called comments then you get the count like that : $count = count($page->comments); or $count = $page->comments->count();
-
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!
-
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.
-
Hi @Wanze I don't know if it's possible in the current state of the module to disable "Global File Template" for a given template file. I needed this feature in order to work with a REST API endpoint. The problem is when I try to get JSON data from http://my.sites.sek/api, the markup of the global template file is sent. I forked your module and added an option to ignore the global template file on given template. If it make sense, I can send a pull request.
-
Using the module from the dev2 branch, I made a test based on your example but on my side it return an error. $selector = "template=transactions,date>=1522620000,date<=1523051999"; $finder = new RockFinder($selector, ['montant_especes', 'date']); $finder->sort = false; $sql = $finder->getSQL(); $results = $this->database->query("SELECT sum(montant_especes) as especes FROM ($sql) AS rockfinder"); The field exist in the database : PS: copy/pasting the query returned by Finder in PHPMyAdmin throw the same error. Also, the query returned look weird, check the where clause : SELECT `field_montant_especes`.`data`, `field_date`.`data` FROM ( SELECT `field_montant_especes`.`data` AS `montant_especes`, `field_date`.`data` AS `date` FROM `pages` LEFT JOIN `field_montant_especes` as `field_montant_especes` on `field_montant_especes`.`pages_id` = `pages`.`id` LEFT JOIN `field_date` as `field_date` on `field_date`.`pages_id` = `pages`.`id` ) AS `` WHERE ``.`id` IN (...)
-
I just took a look at the number of pages I got into the system, there is 407446 pages found, expecting around 1.2M pages at the end of the year. I didn't got the time to test your module again deeper but it look promising. The only thing I am scratching my head in, its the calculation of multiple fields on 100K+ pages at one time... Did you tried something already ? Actually, doing some calculation on 119k pages on one go take about 19seconds and rendering a chart from this number of pages take about two or three minutes! ?
-
Hi @Karl_T sorry for that and thanks for reporting this issue, I think I have an idea why is happening - checking this afternoon.
-
Hi, Double check that you are not sending the email to a domain out of your control. Double check your SPAM folder If you use a Google account, you have to disable a security option on your account Read this thread and get back to us