Jump to content

flydev

Members
  • Posts

    1,366
  • Joined

  • Last visited

  • Days Won

    49

Everything posted by flydev

  1. On windows I am personally used to install : TortoiseGIT https://tortoisegit.org/ (I recommend you to install it via a setup, not the portable one) During the install it will configure your PATH and stuff. To finish, adjust the path in PHPStorm and voila.
  2. Ok @horst, I will try to have something that works, fast/soon.
  3. Some more precisions : We can be able to code an adapter for Twitter application-only, and this is the list of what we can do with : Pull user timelines; Access friends and followers of any account; Access lists resources; Search in Tweets; Retrieve any user information; So I must assume we can get at least the email and/or the firstname/lastname or a nickname. @horst let me know if you will think to code something about that or I will give a try.
  4. @everyone : More beta-tester needed ! If you have a bit time, a local or staging web server - feel free to test it on a prod server - and you want to try this module, please send me a private message ! This module can't harm your server It can be tested on the following ProcessWire version: 2.7.2 (no Composer here) 2.8.x 3.0.x @Ivan Gretsky wanna test it ?
  5. Hey Horst, I think that in the time the lib was made, Twitter was still using OAuth 1.0A - but looking at their doc (twitter) OAuth2 is now supported (?), their doc also stipulate they still use OAuth 1.0A... https://dev.twitter.com/oauth I will look at more closely.
  6. As I am writing the documentation, if you guys have already some questions before I release the module, I will be happy to hear and include them in the FAQ
  7. Thanks for this moment @dragan
  8. Now, the "package manager"; From this window, you can create or delete a package, and also download a packages from the "server backups folder" to your computer. But the best feature is that you can "sync" packages stored on a third-party provider. This mean that the module will check for existing packages on GoogleDrive, Dropbox or whatever (it depend on how you configured Duplicator) and list them so you can delete or download them to your computer, and deploy your nice website in a minute! In the following example, I have packages on my Local Server, on GoogleDrive and Dropbox :
  9. Today, there is a small a preview of a successful deployment (on localhost) using Duplicator : Create a package in the backend Download the package and the installer Upload it to the new hosting Navigate and run the installer
  10. Hello guys ! The Gitlab server is fixed and running, you can update the module to the latest version. All SDKs can be downloaded separately without using composer, the link of each SDK is provided in the module settings. You must uninstall the previous version before testing it. Thanks!
  11. I am checking for this, and it appear that all the SDKs are compiled despite using /*NoCompile*/ on the require_once. Also I note that this feature was introduced in PW 3.0.43, so I assume the file will be compiled for PW 2.7. Concretely, what is the bad thing about leaving all those SDKs file being "FileCompiled" ? if($this->useFTP) { require_once(__DIR__ . '/Classes/FTPClient.php'); } if($this->useAmazonS3) { require_once (/*NoCompile*/ __DIR__ . '/SDKs/aws/aws-autoloader.php'); require_once(__DIR__ . '/Classes/ClientAmazonS3.php'); } if($this->useDropbox) { require_once (/*NoCompile*/ __DIR__ . '/SDKs/dropbox/autoload.php'); require_once(__DIR__ . '/Classes/ClientDropbox.php'); } if($this->useGoogleDrive) { //require_once __DIR__ . '/SDKs/google/autoload.php'; // oh my.. require_once (/*NoCompile*/ __DIR__ . '/Classes/GoogleAutoload.pain.php'); googleAutoload(); require_once(__DIR__ . '/Classes/ClientGoogleDrive.php'); } Anyway, for the people who have the module in hand, I bumped the module to the version 0.0.36. The Gitlab server is not running up but will give a download link in PM as I would appreciate a test on a Windows machine..
  12. Under Edit field > Input > CKEditor Settings > CKEditor toolbar, you need to add the button: A11ychecker Save, then you should see the new button
  13. Checking expiration_date in the selector should do the trick. $todaysdate = date("F j, Y H:i"); $today = strtotime($todaysdate); $ads = $pages->find("parent.template=client, expiration_date<$today, sort=expiration_date"); echo count($ads);
  14. You are not incrementing $alert_count. It should be : $alert_count += 1; // not =+ 1;
  15. I understand now what you mean by no error. There is one last error, which can be seen if you dump the variable $response. You could see that SendGrid return an error code which can be something like that : statusCode => 401 body => "{"errors":[{"message":"Permission denied, wrong credentials","field":null,"help":null}]}" The reason is that the global $sgAPIKey in the function is not getting the value from the $sgAPIKey defined with the key (from some reason that someone might explain here..) To solve the issue, just set your API key in the function directly. [...] function send_email($from_email, $to_email, $subject, $body) { $sgAPIKey = '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'; // Lucy [...]
  16. And I was sure YOU will ask that ! Sure, I am already trying to get back my Gitlab server. The server was hosted in a VMware guest machine, and when plugged the hdd and put the virtual machine ON, the network simply does not work anymore. Can't ping anything, but I know how to fix it, i am just too lazy those days. Edit: Just to say, I still have the code and used the module in the last days, but it look like its not the Windows compatible version..
  17. Sorry but I do not understand, could you explain a bit more please ? Where do you first defined the send_mail () function ? (its not a ProcessWire or SendGrid function). If I assume you defined the function in, for example, _func.php, its normal you got an error of an undefined function. Just assuming... In your last code snippet, everything look fine (I would have defined the function outside the hook).
  18. @oma Call SendGrid like that : new \SendGrid(); (As Adrian said, its a namespace issue) @teppo I used WireFileTools just for the example, the bénéfit of this class is that it provide the ProcessWire API to the object. Sorry for the short answer, i am on mobile.
  19. Yes you can. $this->addHookAfter('Pages::save', function(HookEvent $event) { $arguments = $event->arguments(); $page = $event->arguments(0); if($page->template == 'user') { // Require relevent libraries $wft = new WireFileTools(); $wft->include('sendgrid-php/sendgrid-php.php'); $from = new \SendGrid\Email("Example User", "test@example.com"); $subject = "Sending with SendGrid is Fun"; $to = new \SendGrid\Email("Example User", "test@example.com"); $content = new \SendGrid\Content("text/plain", "and easy to do anywhere, even with PHP"); $mail = new \SendGrid\Mail($from, $subject, $to, $content); $apiKey = getenv('SENDGRID_API_KEY'); $sg = new \SendGrid($apiKey); $response = $sg->client->mail()->send()->post($mail); // dump SendGrid object with TracyDebugger bd($mail); } });
  20. Look like i am going to love it and its a french who made it! ♥ Will give a try soon, thanks for this post @alan
  21. Hello @Niku, sorry I am not giving you the right answer but.. You could take a look at this module : https://modules.processwire.com/modules/inputfield-select-multiple-transfer/ From the module's description it look like it could save you time
  22. There are some good reads in the forum too :
  23. The module got renamed and updated a bit as its not intended to run only on the backend, but work also on frontend side. - Now, the administrator can choose to activate or not the backend login buttons. - The providers are added "dynamically". You have to simply edit a JSON config file which once saved, will show the required fields in the module settings. For example the following JSON config will only provide Google as login provider : { "providers": { "google": { "className": "Google", "packageName": "league/oauth2-google", "helpUrl": "https://console.developers.google.com/apis/credentials" } } } Small note for pw users : If like me you did not know, there is another module that manages OAuth2 authentication. Feel free to use the one which suit your needs! more info there: @jmartsch you should create a new module thread
  24. With this markup and field options : $markup = array( 'list' => "{out}\n", 'item' => "\n\t<div class='form-group input-group'>\n{out}\n\t</div>", 'item_label' => "{out}", 'item_icon' => "<span><i class='fa fa-fw fa-{name}' aria-hidden='true'></i></span>", 'item_content' => "{out}", 'item_error' => "\n<p class='field--error--message'>{out}</p>", 'item_description' => "\n<p class='field__description'>{out}</p>", 'item_toggle' => '' //.... etc ); // field setup $field->icon = 'envelope'; $field->label = ' '; I get the following result : <div class="form-group input-group"> <span> <i class="fa fa-fw fa-envelope" aria-hidden="true"></i> </span> <input id="name" class="InputfieldMaxWidth" name="name" maxlength="2048" type="text"> </div> Another idea could be to set the markup option of the label to something like {{replaceme}} {out} {{/replaceme}} and change those tags when you render the form with a str_replace or a custom function, you see ?
  25. Edit September 2022 See this thread: --- I would have taken another way. As each photo are Page, he could create a module which work with a custom MySQL table where he update the like of a page with some informations aside, like the userID (the user who like the page), the pageID (the page being liked) , a likeStatus (like or unliked) and a timestamp. I made a small module to show the idea : then in the frontend, you can render a 'like' button on choosen templates, and finaly get the total number of likes of a page and the most liked page, see: <?php namespace ProcessWire; $likesmod = $modules->get('LikeSystem'); // render a 'like' button $content = $likesmod->render(); // total like of the page $content .= "Number of likes for this page: " . $likesmod->getTotal($page->id); // most liked page $limit = 1 $mostliked = $likesmod->getMostLikedPage($limit); $content .= "<br>Most liked page: " . $pages->get($mostliked[0]['pageId'])->title . "(" . $mostliked[0]['pageId'] . ") " . " (N likes: ". $mostliked[0]['likesCount'] . ")";
×
×
  • Create New...