Leaderboard
Popular Content
Showing content with the highest reputation on 02/03/2018 in all areas
-
ProcessWire 3.0.90 This week updates focused mostly on GitHub issue reports, emphasizing a few that I'd put off for a little while because they would take more time than usual to resolve, and didn't affect many people. But they are nevertheless important, especially nearing the next master version. We also have a new addition in 3.0.90 thanks to @horst. This version adds the latest iteration of his ImageSizerEngineAnimatedGif module to the core. This means that PW can now generate variations (alternate sizes/crops) of animated GIFs. Previously any variations of an animated GIF just ended up being one frame of it. Now all the frames are retained. To enable this, go to Modules > Core > Image > Animated GIF Image Sizer, and click Install. Though we'll probably set this one to install automatically in one of the next versions. But once installed, upload an animated GIF, and ProcessWire takes care of the rest. No longer blog post this week because the above is all I have to report and it doesn't seem long enough for a blog post. I hope that everyone has a great weekend!8 points
-
As additional information for those who uses my third party module "Image Animated GIF":5 points
-
I have to agree: this is a good discussion, but doesn't belong to module support thread. Any mods up to that? I hope I'm not causing any unnecessary confusion – and I may not see the full picture yet, so perhaps I'm missing the point entirely – but when it comes to snippets, there's already https://processwire-recipes.com/. If you have useful snippets for common tasks etc. I'd suggest submitting them there. Similarly I'm leaning towards collecting ideas for improving the existing modules directory rather than creating a competing platform. In the 2018 roadmap post Ryan listed modules directory as one focus point for this year, and I'm sure he'd be happy to get some feedback on exactly how it could be improved.4 points
-
@SamC Slightly off topic, but here's a good one for JS. http://www.leerichardson.com/2015/02/an-illustrated- gude-to-parameter.html P/S : the spelling mistake in the URL is as is. As you learn other languages, this is another area where there might be subtle differences between languages that could come back and bite you. (e.g. Java only does pass by value)4 points
-
nothing fancy i just drop the extrem use of shadows and converted colors....so it fits a little bit normal in the PW: calendar.css custom_1.css but notice it is just a proof of concept - not browsertested - just some fast playing. Best regard mr-fan3 points
-
2 points
-
Thanks @Juergen - sorry about the description/notes issue - it's fixed in the latest version.2 points
-
Hello Adrian, thanks for the great update! In my case it seems that the field description and notes will not be outputted in the backend. Can someone confirm this behavior? Best regards2 points
-
2 points
-
Hey guys, I found something incredible. Look at this new fieldtype from the CMS Statamic: https://statamic.com/blog/statamic-2.8 It is called Bard and combines the Repeater Matrix with an normal textfield. I think this is a really good way to edit long text. It would be awesome if Processwire could get an similar fieldtype. What do you think? Jannis1 point
-
Presentation Originaly developped by Jeff Starr, Blackhole is a security plugin which trap bad bots, crawlers and spiders in a virtual black hole. Once the bots (or any virtual user!) visit the black hole page, they are blocked and denied access for your entire site. This helps to keep nonsense spammers, scrapers, scanners, and other malicious hacking tools away from your site, so you can save precious server resources and bandwith for your good visitors. How It Works You add a rule to your robots.txt that instructs bots to stay away. Good bots will obey the rule, but bad bots will ignore it and follow the link... right into the black hole trap. Once trapped, bad bots are blocked and denied access to your entire site. The main benefits of Blackhole include: Bots have one chance to obey your site’s robots.txt rules. Failure to comply results in immediate banishment. Features Disable Blackhole for logged in users Optionally redirect all logged-in users Send alert email message Customize email message Choose a custom warning message for bad bots Show a WHOIS Lookup informations Choose a custom blocked message for bad bots Choose a custom HTTP Status Code for blocked bots Choose which bots are whitelisted or not Instructions Install the module Create a new page and assign to this page the template "blackhole" Create a new template file "blackhole.php" and call the module $modules->get('Blackhole')->blackhole(); Add the rule to your robot.txt Call the module from your home.php template $modules->get('Blackhole')->blackhole(); Bye bye bad bots! Downloads https://github.com/flydev-fr/Blackhole http://modules.processwire.com/modules/blackhole/ Screen Enjoy1 point
-
Inspired by the "max megapixels" option for the client-side image resizer, I made a simple module that adds target megapixel resizing for Pageimages. Image Megapixels A module for ProcessWire CMS/CMF. Adds methods to Pageimage objects useful for resizing to a target megapixel value. Example use You are creating a lightbox gallery of images with different aspect ratios. For the enlargements, rather than setting a fixed maximum width or height you want all the enlargements have the same size in terms of area, allowing a panoramic image to be wider than a square image, for instance. Another use case is sizing a gallery of sponsor logos. The supplied logos are different aspect ratios but you need to ensure the logos are sized so each has equal prominence on the page. The effect of resizing three different aspect ratios by the same megapixel target value can be seen in the screenshot below: Installation Install the Image Megapixels module. API // basic usage $pageimage = $pageimage->megapixels(float $megapixels); // usage with all arguments $pageimage = $pageimage->megapixels(float $megapixels, array $options = []); Example: foreach($page->images as $image) { echo "<img src='$image->megapixels(0.8)->url' alt='$image->description'>" } If needed you can supply an array of options for Pageimage::size() as a second argument. Getting dimensions If you just want to get the height and width dimensions needed to size an image to the given number of megapixels you can use the Pageimage::megapixelsDimensions() method that this module also adds. It returns an array with width and height as keys. Example of how this could be used to output a gallery of logos: foreach($page->logos as $logo) { $dimensions = $logo->megapixelsDimensions(0.01); $width = $dimensions['width']; $height = $dimensions['height']; $width2x = $width * 2; $height2x = $height * 2; echo "<img src='{$logo->size($width, $height)->url}' srcset='{$logo->size($width, $height)->url} 1x, {$logo->size($width2x, $height2x)->url} 2x' alt='Logo' width='$width' height='$height'>"; } https://github.com/Toutouwai/ImageMegapixels https://processwire.com/modules/image-megapixels/1 point
-
Hi, me again - queen of the ProcessWire API Wrapper. Why re-invent the wheel when there are so many great, well-supported apps out there that don't impact on the core of PW? Almost see PW as a portal. Latest endeavour is a PW module for Eventbrite v3 API https://www.eventbrite.com/developer/v3/ The EB webhooks are a easy-peasy-lemon-squeezy. Love it! Can do any of the API GET calls providing they don't include any parameters, eg: $eb = $modules('EventbriteAPI')->login(); $ebUser = $eb->client->get('/users/me/'); $ebUserId = $ebUser['id']; // /users/:id/owned_events/ $result = $eb->get("/users/$ebUserId/owned_events"); Problem I'm having is with using parameters in the actual API, eg: $eb = $modules('EventbriteAPI')->login(); $ebUser = $eb->client->get('/users/me/'); $ebUserId = $ebUser['id']; $ebPath = "/users/$ebUserId"; $token = $sanitizer->text($eb->access_code); $pageSize = $sanitizer->int(5); $expand = array(); $result = $eb->client->get( $ebPath . "/events?&token=" . $eb->access_code . "&page_size=" . $pageSize ); Every time I use a parameter, I get the EB error message for the last one, in the example below, the paging limit: "There are errors with your arguments: page_size - Enter a whole number." Even stranger is if I manually create the URL, eg https://www.eventbriteapi.com/v3/users/2425020999999/events?&token=WNU7SPIEUUUIXXXXXX&page_size=5 in the EB API test environment, I get the correct result. Fairly certain it's an EB issue but wanting to double check I've got everything right and the PW API isn't doing anything too clever with the $_GET vars. Any help/suggestions most welcome. Thanks psy1 point
-
Hello Adrian, could you please check the following: After updating the module all my labels of the different input fields (area code and so on) with the translations are gone. I had to enter it once more. It seems that updating the module deletes all entered label values. Thanks PS: The only message I got from Tracy was the following: PHP Notice: Undefined offset: 3 in .../site/modules/FieldtypePhone/FieldtypePhone.module:3221 point
-
1 point
-
1 point
-
@theo: Thank you for the feedback, and I'm glad you like my module I'm going to look into that behavior as soon as I have a little time on my hands.1 point
-
you can put a function somewhere in your code (eg _functions.php): function translate($string) { if($config->lang == 'en') { $translations = [ 'hallo welt' => 'hello world', ... ]; return $translations[$string]; } return $string; } echo translate('hallo welt'); // hallo welt $config->lang = 'en'; echo translate('hallo welt'); // hello world1 point
-
Developing this module has definitely been a trial by fire. Getting there though and for sure, reading the PW API docs helped and not just what I thought I needed to know but other stuff as well. Was so focussed on: $eb = $modules->get('EventbriteAPIv3')->login(); in my webhook template which failed every time, I completely overlooked: $eb = wire('modules')->getModule('EventbriteAPIv3', array('noPermissionCheck' => true))->login(); Of course the webhook template/response is not a logged-in admin with permission to change stuff... Doh!1 point
-
thanks theo, looks great already and please share your work - maybe someone wants to take it further maybe you want to take a look at http://rvera.github.io/image-picker/ - you could use a regular select field, modify the options via hook and then let the jquery plugin do the presentation of the images.1 point
-
Just wanted to share a blogpost by myself about my master thesis that I'm writing at a great little company based in vienna and specialised in earth observation related things and geoinformatics called EOX: https://eox.at/2018/01/visualizing-geotiff-tiles-with-openlayers/ In (very) short, this is how WMTS works now: this is what we do: and this is what we analyze (finding the "break-even" when it starts to make sense using this approach): Maybe this might especially be interesting for you, @Mats ?1 point
-
Ah, I should have known there would be something in PIA for this - it's the real Swiss Army Knife for images. I really need to have a proper explore of that module. (I think it's the state of the docs that has been putting me off - maybe you could consolidate/tidy everything into the GitHub readme?) I have a very primitive system. For modules I'm interested in I have a spreadsheet with name, category, link, brief description of what it does (in my own words). But I often forget to update it with new modules and just try to rely on memory. For forum snippets (and links to the original post) I just have a folder with a bunch of text files in it. The text files are named according to what the snippet is about. Then when I'm looking for something I use the quick filter feature in my file manager (XYplorer).1 point
-
This is a good thing. I'd suggest that you first get a thorough grounding of the basics before plunging into creating anything. The resources suggested in the previous posts are all good. However, without a basic understanding of ProcessWire, they will not make much sense to you. People learn differently. Some people like to dive in and pick up the basics as they go along. Others (me included ) prefer to get the basics first before diving in. So, if you can go through these first, you'd be the better for it in the long run. Selectors PHP foreach loop (in case loops are newish to you) $page $pages Yes, what you asked is doable. But you will need to get those hands dirty with some custom code. It'll be fun though. Welcome to the forums .1 point
-
Hi @Robin S, congrats to one more nice module! And I totally understand why you created it. I also (wanted to) use such a feature in different scenarios. Therefor once I added the "weighten" option to the PIA module. Hopefully you don't mind my following propagation of an alternative way to apply such a functionality. Maybe it is usefull for some people to have a different way to define / calculate / imagine the resulting images. You call it Megapixels, Pia uses image pixel dimensions for width & height or a single dimension for squares, defining a bounding box and get the images contained & weightened into that box. Additonally Pia handles one out of four values to the weighten-option to prioritize the landscape or portrait images in two ways: So, what you wanted was allready available in the modules directory for about three years. But I believe, when seeing all your modules, you have had fun building and sharing it. OT: For me, the last two years it is not possible to keep track of all the good new stuff coming into the core and from community members (like you). Some years ago, it felt doable for me. Lately I also found "a new possibility" to do things that was allready three years available. Even I had read it in the past and bookmarked it under my other several hundred PW links, it got out of focus. If somebody know a good way to keep track and or archive all the good stuff from here, (besides the few things that get mentions in the weekly news & blog posts), please share.1 point
-
@Monty this might help: https://www.pwtuts.com/processwire-tutorials/creating-a-main-menu-and-sub-menu-for-your-website/1 point
-
Channelling Thomas Edison again. Problem I've having now is not Eventbrite but PW. The module is configured to not autoload although I've tried that too. I have 2 page templates: 1. Calls my EventbriteAPIv3 module that returns data to a 'normal', viewable page template. All good there 2. Calls my EventbriteAPIv3 in the EB web hook endpoint page template. Not matter how I try to configure it, the module is never loaded. Instead I get any number of PW error messages, eg: When I use $eb = $modules->get(EventbriteAPIv3)->login() or $eb = wire('modules')->get('EventbriteAPIv3')->login() in the page template: Error: Exception: Unknown Selector operator: '' -- was your selector value properly escaped? (in /home/xxxx/xxxx.com/wire/core/Selectors.php line 378) Other error message include, depending on the method I chose to load it: Error: Uncaught Error: Call to a member function getAccessCode() on null in /home/xxxxxx/xxxxxx.com/site/templates/eventbrite-webhook.php:21 Have even tried putting the $modules->get call it in _init.php without success. Reading the PW doco, google searching and running out of ways to vary the call yielded nothing. All suggestions, help & guidance most welcome.1 point
-
If you want a navigation different from the page tree you can write it also in HTML and add it to the template. Theres no need to use a function to create it. You can get the URL for a page in this way: $url = $pages->get(Id of the page)->url; fe. if the page has the id 45 you get the url like this: $url = $pages->get(45)->url; You can use it to write the menu in HTML and add the URLs with PHP like this <a href="<?php $pages->get(45)->url;?>"><?php $pages->get(45)->title;?></a> This outputs the link and as linktext the title of the page. There are many ways to create a navigation. I recommend you to take a look at the cheatsheet.1 point
-
Hi @Monty, and welcome to the forum! With the blank profile, you are left to build everything you may need for your site. However, you can use the code from other profiles, such as from the site-default/templates/_main.php file to generate your menu navigation, like so: //place this code in your template where you want the menu displayed. <ul class='topnav' role='navigation'><?php // top navigation consists of homepage and its visible children foreach($homepage->and($homepage->children) as $item) { if($item->id == $page->rootParent->id) { echo "<li class='current' aria-current='true'><span class='visually-hidden'>Current page: </span>"; } else { echo "<li>"; } echo "<a href='$item->url'>$item->title</a></li>"; } ?></ul> Another option could be to use the _func.php file located in the site-default/templates folder of the processwire zip file you downloaded. This file contains a similar function to generate a navigation menu which you can call from a template. It all depends on which method (eg, Delayed Output) you are using to create your site and the structure of your pages, so this is only a general information. Is this the planets tutorial? Feel free to post your structure and someone will be able to give you more specific suggestions.1 point
-
Getting closer to an initial release. Def been a learning experience using EB's self-proclaimed "easy API". Tip for other devs when implementing other vendors' API's - check the github pull requests before committing hari-kari. In my case https://github.com/eventbrite/eventbrite-sdk-php/issues/7 - wasn't me after all, just a MAJOR bug in the API. My alpha version has the suggested solution implemented and all good so far What I can say is that if you only want to pull info from your own EB stuff into PW, you won't need my module. Simply set up the necessary in EB and create a PW page/template to handle the web hooks, eg when an event is created in Eventbrite, you can pull that info into PW with: // Retrieve the request's body and parse it as JSON $eventbrite_json = @file_get_contents("php://input"); $eventbrite_obj = json_decode($eventbrite_json); /** * Eventbrite webhooks * attendee.checked_in - Triggered when an attendee’s barcode is scanned in. * attendee.checked_out - Triggered when an attendee’s barcode is scanned out. * attendee.updated - Triggered when attendee data is updated. * event.created - Triggered when an event is initially created. * event.published - Triggered when an event is published and made live. * event.updated - Triggered when event data is updated. * event.unpublished - Triggered when an event is unpublished. * order.placed - Triggers when an order is placed for an event. Generated Webhook’s API endpoint is to the Order endpoint. * order.refunded - Triggers when an order is refunded for an event. * order.updated - Triggers when order data is updated for an event. * organizer.updated - Triggers when organizer data is updated. * ticket_class.created - Triggers when a ticket class is created. * ticket_class.deleted - Triggers when a ticket class is deleted. * ticket_class.updated - Triggers when a ticket class is updated. * venue.updated - Triggers when venue data is updated. */ switch ($eventbrite_obj->config->action) { case 'event.created': $apiUrl = $eventbrite_obj->api_url; $apiUrlArr = explode('/events/', $apiUrl); $eventId = str_ireplace('/', '', $apiUrlArr[1]); $template = wire('templates')->get('name=test-eventbrite-webhook'); $p = new Page(); $p->template = $template; $p->title = $sanitizer->text($eventId); $p->name = $sanitizer->pageName($eventId); $p->parent = pages(1); $p->save(); break; default: break; } // tell eventbrite the webhook was received. http_response_code(200); // PHP 5.4 or greater1 point
-
1 point
-
@adrianromega, did you see the "Example use" section above? To expand on this... it's useful in any situation where you want to be fair to a group of images with different aspect ratios. Take the three images shown in the screenshot above. If these images had been resized using maxSize(800,800) for instance, photo 2 (the square image) would be larger than the others in total area - it would contain the most image data. Now suppose you're running a competition on your website where visitors can vote for the best photo. The three images above have been submitted by three different photographers. If you are resizing by maxSize() rather than megapixels then it's not fair on photographers 1 and 3 that their images are shown smaller than the image from photographer 2.1 point
-
@rick overcame that hurdle, now onto next one. Eventbrite is a great app but unfortunately : their v3 API doco is at best minimal and often misleading/confusing, the errors it reports are correct but don't accurately describe the exact problem, and what works on their browser based debug page doesn't always translate to the actual PHP API. In the above case, the order of the $_GET vars is important and when using one $param, the doco doesn't mention you also require another. In my case above, I needed both page_size and page (page_number). All good now. Still working on getting it all into a functioning PW module.1 point