Jump to content

ethanbeyer

Members
  • Posts

    111
  • Joined

  • Last visited

Everything posted by ethanbeyer

  1. Check this out: http://docs.mailpoet.com/article/49-lists-of-hosts-and-their-sending-limits For OVH: Most likely because of bounces, your site is unable to send emails. A couple of things you can do: 1. Contact OVH and ask them to give you some idea of what your email's standing is. 2. Use a service like Sendgrid (sendgrid.com) as an off-site SMTP delivery service. If I remember correctly, Sendgrid is free up to 12,000 emails a day. Hope this helps!
  2. Often times when things like this happen it's because you've gone over your limit for emails to send through a particular SMTP host. Who are you trying to send through?
  3. I know this is a pretty old thread, but every time it comes to creating a Repeater through the API, I get LOST. @thetuningspoon's function illuminates a LOT of what happens behind the scenes when a new Repeater is made through the GUI - but I just keep wishing it was as simple as: $f = new FieldtypeRepeater(); $f->set('name', 'repeaterTest'); $f->add($repeaterField1); $f->add($repeaterField2); $f->save(); Because that isn't technically possible without setting the Fieldgroup or Template that will be used by the Repeater first, right? At the end of the day, I think we should improve the docs for Repeaters (https://processwire.com/api/fieldtypes/repeaters/) to include a section on creating a Repeater from scratch through the API so that this process is more easily understood. I am always referencing several Forum posts and parts of the docs in order to get through the spaghetti - having everything in one place would be great. Otherwise it would be awesome to have some functions as a part of the FieldtypeRepeater Class that cut down on the amount of API calls one needs to make in order to create one of these. Just my 2 cents.
  4. I will happily help you with this - it seems like your modules totally pwn the one I wrote. I'd love to try it out!
  5. God bless you, I was going to write something that did this - you did it better than I would've! Also - will you be adding this to the Module library?
  6. @Alxndre' it definitely can. I can add a get() function that would return the entire output from last.fm into a WireData object, and then people could use that however they please. The render() function is written for me specifically, so it probably makes sense to give it a lot more flexibility than it currently has.
  7. @Robin S thanks for the feedback! I will make that change. @maxf5 I see what you're saying completely - but I am also endeavoring to keep my sites from disintegrating into the norm of wordpress sites - being made up of gazillions of similar, undocumented functions. At least with a module they're easy to find... I also plan to add more functionality to the module in the long run. I like your one-line solution, but as much as anything else, it was an educational experience for me, that's all!
  8. Thank you both, @LostKobrakai and @abdus ! Hugely revealing - and a good refresher on some Magic Methods! <3
  9. I've written a module called HTMLBodyClasses that renders classes for the <body> tag. echo HtmlBodyClasses::renderClasses($page); Outputs: <body class="home template-home page-id-1"> Page name, page template, page's ID. You can get it here: https://github.com/ethanbeyer/HtmlBodyClasses
  10. I've created a module that spits out a simple link to the most recent track a user has scrobbled on Last.fm. It's available here: https://github.com/ethanbeyer/Processwire_LastfmApi
  11. Why don't Processwire Objects have all their properties visible? Here's what I mean. Take this super stripped-down class for example: class MyClass { public $public = 'Public'; protected $protected = 'Protected'; private $private = 'Private'; } $obj = new MyClass(); dump($obj); die; Output: MyClass {#244 ▼ +public: "Public" #protected: "Protected" -private: "Private" } This is straight from PHP's manual on Property Visibility. Now, if I do this with two different Processwire Modules, this is what happens. $soc = new Socicons(); $other = new InputfieldSimpleMDE(); dump($soc, $other); die; Output: Socicons {#248} InputfieldSimpleMDE {#113 ▼ +data: array:20 [▼ "label" => "" "description" => "" "icon" => "" "notes" => "" "head" => "" "required" => 0 "requiredIf" => "" "collapsed" => 0 "showIf" => "" "columnWidth" => "" "skipLabel" => false "wrapClass" => "" "headerClass" => "" "contentClass" => "" "textFormat" => 4 "renderValueFlags" => 0 "requiredAttr" => 0 "initValue" => "" "stripTags" => false "showCount" => 0 ] } Now, Socicons is a module I am currently writing, and it has about a dozen public properties. In the first example, the dump of the $obj class included all of that class' properties - so why don't I see all of the properties encased within Socicons? Secondly, why are all the properties of the InputfieldSimpleMDE within a data array? I'm sure this is part of the way that Processwire is written or configured, but I am often scratching my head over this. So again, I am hoping that someone can answer this for me. Why don't Processwire Objects have all their properties visible? Thank you!
  12. Thank you both! It looks like it was $p->of(false); . I have next to no idea how the Output Formatting works. To the docs!! All my best!!!
  13. I'm kind of at a loss with this: I wrote a function inside one of my modules that saves files to a Page through the API. The Field is a FieldtypeFile. $page = $this->storagePage; $files = $page->pdfStorage_files; $files->add($path); return $page->save($files); I can see that the file has been saved to the Page's directory, and if I dump $page->filesManager->getFiles(); , the file I add is present in the array. But in the field_pdfstorage_files table in the database - no entry. Which also means that the file is not visible as a part of the pdfStorage_files field in the Admin Backend. Is there a way to ensure that adding the file to the field saves it everywhere?
  14. Thanks @LostKobrakai and @adrian. Very helpful!
  15. I've created a Process Module, and its execute() function renders the HTML response to an AJAX request. The AJAX request is being made outside of the admin panel, and in all likelihood will be made by "guest" users. Within my ModuleName.info.json file, I have added these lines: "permission": "generate-thumbnails", "permissions": { "generate-thumbnails": "Generate Thumbnails" }, Then within the Admin panel, I gave guests access to run that module. Unless logged in, the response to the AJAX request is always the login form's HTML, rather than the HTML my execute() function creates. So two questions: Is it possible to give non-logged-in users the ability to run that function via the AJAX request, or Is there a better ProcessWire way to create HTML to use as an AJAX response? Thank you!
  16. @Robin S and @kongondo -- THANK YOU! Both of your posts were super helpful. I guess I missed the part about needing to enable URL Segments on the correct template - so that was one of the issues I was having. Then after reading both of your posts, I think @kongondo's solution was the one I was originally after - but @Robin S' post illuminated a way of handling this problem I hadn't thought of. I will try them both and let you know, but I think that @kongondo's code should be usable right out of the box. POST-TINKERING EDIT: The need for URL Segments and mapping them to a new URL turned out to be the primary needed solution. I tried the Process Module Listing Solution, and while I think there's a lot of promise there, it would take some unnecessary work to create a fake folder for the pages in question. Thanks again!
  17. I did when using this method: Did I need to do so for this? If so...we're not doing it all that differently, as it turns out.
  18. Sure. All of my templates are prepended with _init.php. Within _init.php, I placed the following code: $pages->addHookAfter('Page::path', null, 'hookPagePath'); function hookPagePath(HookEvent $e) { $page = $e->object; if($page->template == 'folder-page') $e->return = "/$page->name/"; } So I had the following page & URL structure: /folder/uno/ /folder/abc/ /folder/three/ uno, abc and three were all of the template folder-page. folder-page.php was, for testing, just set up to display the page title: <?php echo $page->title; Navigating to site.dev/folder/uno or site.dev/folder/abc or site.d/folder/three displays the page's title as I'd expect. But if I try to navigate to site.dev/uno - I am met with a 404. If on site.dev/folder, I list the children with links to them, their URLs (<?php echo $child->url; ?>) are displayed as: uno --> site.dev/uno abc --> site.dev/abc three --> site.dev/three Clicking on any of those links brings up the same 404 page. So if I am indeed configuring this wrong somehow, I'd love the help!
  19. @adrian @kongondo I tried that to no avail! I was excited to use that method, but it resulted in a 404 every time, no matter how I attempted to configure it.
  20. Same boat. I love how straightforward the Processwire Approach makes things, but every once in a while, I am building something where I'd like URLs to be a little more flexible. It's the over-cited example in these forums (I've seen this exact argument bandied out at least 5 times), but if I wanted a link like site.com/link, and there could be as many as 250 of these individual pages, it would be nice to have them enclosed somewhere without having to change the page's URL. The closest I've come to solving this was with the following: I enabled URL Segments on the home template. I created a parent page called "Portals"; its name is "p" (so its URL would be site.com/p) home.php looks like this: <?php $search_page = $input->urlSegment1; $new = $pages->findOne("/p/$search_page"); if($new->id) $session->redirect($new->url, false); ?> <div class="container"> <h1>Home</h1> </div> Navigating to site.com/ethfun, the home template looks to see if URL Segment 1 resolves to one of Portals' children. If it does, it redirects to that page (which changes the URL, I realize - but at least the page is accessible with a shorter URL) portals.php looks like this: <?php $session->redirect($pages->get(1)->url); I didn't want to list the children of "Portals", so instead, if someone navigated to site.com/p, they're just redirected to the home page (which does have content of its own to show ). Let me know if you have questions, or if this is the most stupid thing I could ever hope to do!
  21. Any progress made on this front, @Christoph?
  22. WOW this looks incredible. Installing nowwwwww. Thanks!!
  23. @adrian probably! After I wrote that second message I was like, "waaaait a minute - that doesn't seem right..." Does Tracy show the rendered HTML of the email and all the recipients, etc?
  24. I'm a big dummy. It works if you change `$config->env == "dev"` to `$config->env = "dev"`. I had the wrong operator.
×
×
  • Create New...