Leaderboard
Popular Content
Showing content with the highest reputation on 04/26/2015 in all areas
-
Documention section http://processwire.com/docs/ , of course is a must. But PW on going changes and new features are announced on it's blog section http://processwire.com/blog/ . For example, new module configuration definition are introduced in 2.5.5, which simplify the declaration of module configuration. A new , Options fieldtype are introduced in 2.5.17, which i didn;t know it before. Anyway, the blog section is a valuable documentation too.7 points
-
Hi @fliwatuet, welcome to PW. You can achieve this easy, without the need of buying a ProModule. You can achieve everything without ProModules in PW, but if you once have worked with a ProModule, you never want miss it, You need to build a strategy for your site in regard of how to store / categories the uploaded files. And besides what the others already have pointed out, there is a new possibility with serving the files (if you create pages for each uploaded file): PW 2.5.26 has content type support on templates basis If you start building your strategy, you can ask here for tips.3 points
-
People, this is really awesome! When I started this little project I had a little hope for community contributions a) because of the vibrant PW community and b) the modular architecture of Symfony Console, but I would have never expected this growth within a month. Big thanks to all contributing and fixing commands and ideas! @horst: Bam! Delivered! Cheers! I'll look into it, merge it soon and will establish a proper namespace for the growing number of helper classes. One more thing: I hate to have hobby horse projects without at least a rudimentary logo3 points
-
-------------------------------------------------------------------------------------------------------------------------------- for PW 3.0+ please follow this link! -------------------------------------------------------------------------------------------------------------------------------- Croppable Image Module for PW >= 2.5.11 and PW <= 2.7.3 Version 0.8.3 alpha Hey, today I can announce an early (alpha) release of CroppableImage, what was forked from Anttis Thumbnails module. Until now there was a lot of work done by owzim, Martijn Geerts and me. We have solved the issues regarding the list from here: The modules are bundled together so that you only can and have to use FieldtypeCroppableImage for install, uninstall & configure. It uses new naming scheme that was introduced with PW 2.5.0 that supports suffixes. The complete image rendering is delegated to the core ImageSizer, or to any optional hooked in rendering engine. Template-settings are now fully supported, including removing variations when settings have changed. It fully respects settings for upscaling. If upscaling is set to false, you cannot select rectangles smaller than the crop setting. We implemented these enhancements: The GridView now is very nice and compact, and also benefits from the lately introduced setting for $config->adminThumbOptions. Permanent storage of the crop coordinates, quality and sharpening settings are now implemented native. No need to use PiM for this anymore. The usage/display of the Quality and Sharpening DropDown-Selects can be globally disabled/allowed in the modules Configpage. (additionally to that a setting on a 'per field base' is planned.) And the most wanted feature by the community: It gives back a pageimage and not the URL-string. This way you can use it like this: // get the first image instance of crop setting 'portrait' $image = $page->images->first()->getCrop('portrait'); You can further use every pageimage property like 'url', 'description', 'width' & 'height' with it: // get the first image instance of crop setting 'portrait' $image = $page->images->first()->getCrop('portrait'); echo "<img src='{$image->url}' alt='{$image->description}' />"; And you can proceed further image rendering with it: // get the first image instance of crop setting 'portrait' and proceed a resize with imagesizer $image = $page->images->first()->getCrop('portrait'); $thumb = $image->width(200); // or like this: $thumb = $page->images->first()->getCrop('portrait')->width(200); // and if you have installed Pia, you can use it here too: $thumb = $page->images->first()->getCrop('portrait')->crop("square=120"); The only downside with this is that when you (as the site developer) have enabled the usage of DropDown-Selects in the images editor, you do not know the values the editors have chosen for the images. As a workaround for this you can use the getCrop() method with a second param. This is a PW selector string. It can contain as many of the known pageimage options like 'quality', 'sharpening', 'cropping', etc, as you need, but none of them is required. But required is at least one setting for 'width' or 'height': $image = $page->images->first()->getCrop('portrait', "width=200"); $image = $page->images->first()->getCrop('portrait', "width=200, height=200, quality=80"); $image = $page->images->first()->getCrop('portrait', "height=400, sharpening=medium, quality=75"); . . You can get the module from GitHub: https://github.com/horst-n/CroppableImage (Better Docs are coming soon) Screenshots Related Infos A good setting in site/config.php for the AdminThumbs are: (height=>200 and scale=>0.5 !) $config->adminThumbOptions = array( 'width' => 0, 'height' => 200, 'scale' => 0.5, 'imageSizer' => array( 'upscaling' => false, 'cropping' => true, 'autoRotation' => true, 'sharpening' => 'soft', 'quality' => 90, 'suffix' => array(), ) );2 points
-
Some of us still maintain Wordpress sites, so.... Security Advisory: XSS Vulnerability Affecting Multiple WordPress Plugins https://blog.sucuri.net/2015/04/security-advisory-xss-vulnerability-affecting-multiple-wordpress-plugins.html2 points
-
hi fliwatuet, welcome to the forum! 1) you can get really far with processwire and IF, FOR and ECHO 2) you do not need to know a lot about modules. you can handle almost everything in your template files. that's easier in the beginning, where of course later on modules can have advantages over writing all your logic into your templates. 3) as all the others have already said: you don't need them. but personally i also have never regret buying one! have fun with PW and PHP! if you need help, the community here is really helpful and fast. i'm the 5th reply to your post within a day and it's almost always like this. I'm very happy that gebeer showed me PW one year ago, thank you once again! ps: i would recommend you to start with the hello world planets tutorial (do not only read it. install pw and do it!): https://processwire.com/docs/tutorials/hello-worlds/ or with comments here: https://processwire.com/talk/topic/693-small-project-walkthrough-planets/ on page 4 of the first link you will see how far you can get with ECHO - imagine you also know IF and FOR2 points
-
I definitely would encourage you to give PW a try. Most people who took the initial effort are now very happy PW developers You might want to jump right in and have some good reads. Categorizing content tutorial Example code for creating a form with file upload If creating frontend forms through the API is over your head at the moment, you could always use the very affordable paid extension form builder. Easy to use and a big time saver. Multi language And learning PHP when working with PW can be fun. Don't worry, you fill find tons of helpful posts in the forum and the friendly community will help you get started.2 points
-
2 points
-
Finally I have had time to download it. Its simply fantastic and a lot of fun! Regarding the windows users I share how I have set it up. Its only a bit slightly different than the very good explanation here from @marcus and @Mike_Anthony. I have done installation step 1 and 2, but not step 3. Instead of adding something to my path I simply created a single wireshell.bat file that I put somewhere into my already existing system path. I also have no PHP directory accessible through the system path, because I use minimum 5 different PHP versions (3 for CLI and 2 with the local Apache). If there were one in the system path this can lead to weird behavior of PHP, at least with the old PHP 4 that I need for older CLI tasks. My wireshell.bat looks like @ECHO OFF SET phpexe=C:\bin\php-54\php.exe SET phpparams=-c C:\bin\php-54\wireshell\ SET wireshell=%appdata%\Composer\vendor\wireshell\wireshell\wireshell TITLE WIRESHELL :: %CD% "%phpexe%" %phpparams% "%wireshell%" %* TITLE %CD% With the phpparam -c I have specified a directory where the php interpreter has to pickup its php.ini. I have one setup that is different than I need with other CLI scripts. I also could have linked to the php directory what is running under apache. But unfortunately I switch this between php 5.3.8 and 5.4.x for modules testing currently. (and composer and wireshell needs minimum 5.4.0) That with setting the title in the cli windows is nice if you have running several tasks. When hovering over the stacked icons on the taskbar, you can see which one is in "WIRESHELL mode" and which one is finished.2 points
-
The module is now fully functional again and its version number is set to 2.0.0, because it was a full rewrite. Finally it supports all sorts of crops again: cropExtra what is needed by CroppingTools north - south west | east And by x/y params and centered of course too. I updated the first post here in the thread, where yo can find the links to Github and the modules directory.2 points
-
I've just started a new project and decided to test/use Wireshell. After I had successfully created a new project I missed the opportunity to download modules. You've received a new pull request. Maybe you have some time to test (and hopefully implement) it.2 points
-
There is currently a dev branch available where I started a complete rewrite of the Module. This is needed because the 1.0.0 Version only handles animated GIFs with photos right, but fails with some sort of graphics: After a short and successful research (5 minutes in a support forum thread of László Zsidis GIFdecoder class) I found an enhanced class of GIFdecoder. With it, I was able to position the frames correct, but has many trouble with background colors and transparency (example). More can be read here at Github, where I asked xurei, the author of the GIFDecoder_optimized class for help. And with an upload of the corresponding GIFEncoder_optimized class, I was able to submit the manipulated frames with respect for transparency, what the old encoder couldn't handle. Sometimes you get lucky! So, a big big thanks to xurei from all future PW users that need support for animated GIFs with GD-lib. The results of the current dev branch, version 1.0.2 looks much better now: Only thing currently missing is cropping with tools like Thumbnails etc (cropExtra). This is on the ToDo.2 points
-
Hi all, I have send a PR https://github.com/marcus-herrmann/wireshell/pull/1 . You can all play with the branch if you like. EDIT : With respect to feedback and comments : https://github.com/marcus-herrmann/wireshell/pull/2 .2 points
-
This one is fixed now: The PW $config with recent dev versions now contains or can contain a variable logs: /*** 9. MISC ************************************************************************************/ /** * Additional core logs * * All activities from the API functions corresponding with the given log names will be logged. * Options that can be specified are: pages, fields, templates, modules * * @var array * */ $config->logs = array( 'modules', ); Per default it is set to include "modules". I have changed the croppableimage module to suppress loggin if this is enabled. If you use it with a recent dev version please update: https://github.com/horst-n/CroppableImage And I have tested it with PHP 5.3 and it works, so the requirements are updated too.2 points
-
I have updated the module to Version 0.1.0 beta and it has a new addition to the weighten option that can be used together with contain. The initial code I have taken for weighten calculations is from Martijn. I have changed it to simplify its usage so that you only need to specify a bounding square and have to switch it on, or additionaly prioritize landscape oriented images in two favours: x1, x2 or do the same for portrait oriented images with: y1, y2. (read more in the posts above) But if you (@Martijn ) like to use more different options, like with the original ImageFitBoundaries.module, you can use it by specifying different values for width and height together with the new value "comp##". For ## you set the value for compression like comp20, comp30, comp40 or whatever you like.2 points
-
Is my 100th post I wanted to do something special. I edited a video, hope you like it Just for fun Edited: Now with subtitles1 point
-
I've been working on a module to make it really simple to upgrade ProcessWire from one version to another. Especially as a way to make it easy to upgrade from PW 2.4 to 2.5, or to upgrade from one dev version to another. This tool supports upgrading between any branches of ProcessWire (currently we only have master and dev on GitHub). It will also let you downgrade your ProcessWire version, though no reason to do that. The module keeps up-to-date directly with GitHub, so it works as a long-term tool for every upgrade if you want it to. It works best if your file system is writable. However, if it isn't, the tool can still be used. It will still download the upgrade files to the server and then tell you where to move them. I should also mention that this module is somewhat inspired by a similar module Nico built awhile back called AutoUpgrade. So far I've used this tool to upgrade this site (processwire.com), the skyscrapers site, and the modules site (modules.processwire.com). Before releasing this officially in the modules directory, or suggesting it for production use, I'd like to get some help testing. If anyone has availability to help test this on non-production sites, your help is appreciated. It can be downloaded from GitHub here. As a bonus, it will also be a good opportunity to help test PW 2.5! Thanks in advance. What I'd really like to do as the next step with this is make it support upgrade by FTP. That would provide a nicer and safer solution for those that don't have writable file systems on their servers. This tool should be compatible with ProcessWire versions as far back as 2.3.4. I will also update it to support older versions than that if there's demand for it.1 point
-
wireshell 1.0.0 is out See Bea's post -------- Original post ----------- Now this one could be a rather long post about only an experimental niche tool, but maybe a helpful one for some, so stay with me Intention Do you guys know "Artisan" (Laravel) or "Drush" (Drupal)? If not: These are command line companions for said systems, and very useful for running certain (e.g. maintenance, installation) task quickly - without having to use the Admin Interface, first and foremost when dealing with local ProcessWire installations. And since it has a powerful API and an easy way of being bootstrapped into CLIs like this, I think such a tool has a certain potential in the PW universe. It's totally not the first approach of this kind. But: this one should be easily extendable - and is based on PHP (specifically: the Console component of the Symfony Framework). Every command is tidily wrapped in its own class, dependencies are clearly visible, and so on. ( Here was the outdated documentation. Please visit wireshell.pw for the current one )1 point
-
Dynamic Roles are a powerful access control tool for ProcessWire. They pick up where traditional roles leave off, and allow you to assign permissions at runtime based on any factor present with the user. Once a user receives one or more dynamic roles (at runtime), those dynamic roles then specify what pages the user can view, edit, or add children to. If traditional roles are a sledgehammer, Dynamic Roles are a scalpel, allowing nearly any finely tuned access control scenario. Traditional ProcessWire roles are limited to assignment of view/edit/add access on a per-template basis. Dynamic roles go outside those limitations and enable you to assign that access based on any factors present with a page (i.e. match any field values). Dynamic Roles assign new access, but do not revoke existing access provided by traditional roles. As a result, Dynamic Roles can be used together with traditional roles, and the two work beautifully well together. Though Dynamic Roles can also replace all situations where you would use traditional roles for access control assignments. If using Dynamic Roles to assign page-view access, you would typically want to use traditional roles to revoke view access from at least the "guest" role at the template level. Then use Dynamic Roles to assign view access to those pages in a more granular manner. This module directly affects the results of all page getting/finding operations by applying the access control directly to the database queries before pages are loaded. As a result, it is fast (regardless of scale), pagination friendly, and requires no further intervention by the developer other than configuring the dynamic roles as they see fit. Because it relies upon new features present only in ProcessWire 2.4.6+, it requires the current dev branch. Sponsored by Avoine Concept by Antti Peisa Code by Ryan Cramer PLEASE NOTE: This module is in pre-release state (like the PW dev branch it requires) and is not recommended for production use just yet. Though we do appreciate any testing and/or feedback that you are able to provide. While not required, this module benefits from ProFields Multiplier. If you have ProFields Multiplier installed before installing this module, it will make this module more powerful by making all of your access control selectors have the ability to use OR-group conditions. Depending on your access control needs, this enables you to accomplish more with fewer Dynamic Roles. How to install Make sure you are running ProcessWire 2.4.6 (dev branch) or newer. Download from GitHub (we will add this module to the Modules directory later). Place all files from this module in /site/modules/DynamicRoles/. In your admin, go to Modules > Check for new modules. Click "install" for the Dynamic Roles module (ProcessDynamicRoles). Click to Access > Dynamic Roles for the rest (see example and instructions below). Example and instructions Lets say you ran a Skyscrapers site and wanted a role enabling users with "portmanusa.com" in their email address to have edit access to skyscrapers designed by architect John Portman, with at least 40 floors, and built on-or-after 1970. Yes, this is an incredibly contrived example, but it is an example that also demonstrates the access control potential of this module. 1. In your admin, you would click to Access > Dynamic Roles. 2. Click "Add Dynamic Role". Enter a name for the dynamic role, like: "skyscraper-test-editor" and save. 3. Under "Who is in this dynamic role?" section, click "Add Field" and choose: Email => Contains Text => "portmanusa.com". This will match all users having "portmanusa.com" in their email address. 4. Under "permissions" check the boxes for: page-view and page-edit. 5. For this contrived example, we will assume the user already has view access to all skyscrapers, so we will leave the "What can they view?" section alone. 6. For the "What can they edit?" section: Click "Add Field" and choose: template => Equals => Skyscraper. Click "Add Field" and choose: architect => Equals => John Portman. Click "Add Field" and choose: floors => Greater Than Or Equal => 40. Click "Add Field" and choose: year => Greater Than Or Equal => 1970. 7. Click Save. Now users matching the conditions of your dynamic role will be able to edit the matching pages, but not any others (unless assigned by traditional roles).1 point
-
Thanks, but I prefer to keep the visual language simpler and the reference to PW subtle (its brand colors).1 point
-
Good tip, thanks. Just added the blog RSS to my feedreader. Another source of information is the ProcessWire Weekly news (by teppo), to which you can subscribe and get by email. Lurking around the forums is also beneficial.1 point
-
1 point
-
Hi fliwatuet and welcome to processwire. Many pw users report that working with processwire has a php learning side-effect I can confirm from my own experience with processwire that working with processwire you will learn php along with it. With processwire you don't have to learn first a new cms or need to have a lot of coding experience. Instead you can immediately use all html, css, js and php experience that you already have and start using it with processwire. Processwire comes with multi-language out of the box ! With only a few steps you will have it configured. They all have their place, but when compared, processwire is going to save you a lot of time and headache.1 point
-
1 point
-
Thanks, felix! New on develop branch: $ wireshell status (Replacing ShowAdminUrlCommand, ShowVersionCommand)1 point
-
Added a check to make sure the user downloading a PDF has view permission, thanks again Bernhard for finding/suggesting this! https://github.com/wanze/Pages2Pdf/commit/30810213ae939ccc3fc033765570c91c9be47cdd Cheers1 point
-
How it can look like with the current dev branch version PW 2.5.27: //Find all gyms sorted by location $gyms = $pages->find("parent=/gyms/, sort=location"); //Do another find on gyms to find the top three ratings and echo output directly echo $gyms->find("limit=3, sort=-rating")->each("{title}: {rating} Stars"); // output all $gyms echo $gyms->each("{title} in {location}"); Wow, very clearly laid and less writing.1 point
-
You can actually get away without using foreach now. Have a look at the last updates http://processwire.com/blog/posts/processwire-core-updates-2.5.27/1 point
-
Hi mattcohen, since you specifically asked about “more control over the results other than using foreach”, I’d like to add to the responses above that you can absolutely sort, modify, filter the results you get from find()! What ProcessWire’s $pages->find() gives you is a special kind of array object called PageArray. PageArrays have a number of methods detailed in the ProcessWire Cheatsheet. If you need to sort the gyms from your example by location after finding them, you can do this: $gyms->sort('location'); //Sorts ascending. For descending prepend a "-" like so: sort('-location') This may be useful if, for example, you want to output the same list of gyms twice. Once sorted by rating and once by location, perhaps. You can also use find() on an existing PageArray. Maybe you want to show all gyms, but feature the three top rated ones above. You may do something like this: //Find all gyms sorted by location $gyms = $pages->find("parent=/gyms/, sort=location"); //Copy the 3 with the highest rating into $top_three (another PageArray) //No need to go to the database again, because we have $gyms already $top_three = $gyms->find("limit=3, sort=-rating"); foreach ($top_three as $top) { echo "$top->title: $top->rating Stars"; } foreach ($gyms as $gym) { echo "$gym->title in $gym->location"; }1 point
-
Welcome, mattcohen. Does WP let you sort search results by anything other than date yet? What diogo and LostKobrakai said, but I'll add a little bit. From your question, it looks like you know some php or at least prepared to learn (or you know loads). Take a look at http://processwire.com/api/selectors/. There's a lot to take in, but it will give you an idea of the power of PW selectors (especially http://processwire.com/api/selectors/#examples). We, of course, think/know PW will be a wonderful fit for your expressed needs but that's because we have been here a while. Maybe have a play with the Skyscrapers profile, on which some of those examples are based. The search page there is somewhat more detailed than in the PW install, and gives more of a feel for what you can do.1 point
-
Websites often provide content not only as on list of stuff, but with some sort of category. The most flexible way in ProcessWire to manage such a categorization are with PageFields. Form example with a structure like this. - Magazine (magazine) - Articles - Article 1 (article) - Article 2 - Article 3 - … - Categories - Category 1 (category) - Category 2 - … Templatenames in parentheses Now all articles have a url structure like: "…/magazine/articles/articlename/" The categories are looking like: "…/magazine/categories/categoryname/" But it can be useful to also provide the articles as part of the categories like this: "…/magazine/categories/categoryname/articlename/" Because ProcessWire doesn't provide such functionality by default, we'll use urlSegments. These have to be enabled in the template-settings for the category template. This template therefore fulfills two different jobs. Displaying a list of containing articles, as well as rendering the articles which are linked by the list. A simple example of a existing category.php could be: <?php // category.php $articles = $pages->find("template=article, category=$page"); // This example uses a deligated template approach. // Feel free to use your own way of templating, // but this is also a simple way to explain this. $content = renderArticleList($articles); include("./_main.php"); Now we need to include the logic to seperate the default rendered article-list to the now added rendering of the called article. <?php // category.php // Throw a 404 Error if more than one segment is provided if($input->urlSegment2) throw new Wire404Exception(); if($input->urlSegment1){ // Show the called article // Sanitize the input for pageNames $name = $sanitizer->pageName($input->urlSegment1); // Search for the article with this name $article = $pages->get("template=article, name=$name"); // Throw an 404 error if no article is found if(!$article->id) throw new Wire404Exception(); // Explicitly set the original url of the article for the <link type="canonical" href=""> tag $article->canonical = $article->url; // Render the page, like if it was normally called. // $page->url will not updated to the "categorized" url for the rendering-part // so you need to have that in mind if you provide some sort of breadcrumb echo $article->render(); }else{ // Show the list of articles of the current category $articles = $pages->find("template=article, category=$page"); // The generateCategoryUrls() function is new, because // $page->url would provide the wrong urls. // Details are provided later $content = renderArticleList( generateCategoryUrls($articles, $page) ); include("./_main.php"); } Now if we call this "…/magazine/categories/categoryname/articlename/" we'll get the right article rendered out instead of the article-list. Now we need to talk about the article-list, which would - without changes - still render the "wrong" urls to all those articles. Therefore I added the generateCategoryUrls() function. This function iterates over the pageArray and adds a second url to all those articles. <?php // part of _func.php function generateCategoryUrls($list, $category){ foreach($list as $item){ $item->categoryUrl = $category->url.$item->name."/"; } return $list; } The last thing missing is the actual template which gets rendered by renderArticleList(). This would normally call for $article->url to get the url to the article. We want this to render our second url if we are on a category site. To let the template still be useable by non category sites, we just change the parts, where to url is used form the current $article->url to $article->get("categoryUrl|url"). Only if the additional urls are provided they get rendered or it falls back to the normal urls of the articles. There we go, with such a setup all categorized articles are reachable via both urls. A small addition to explain the $article->canonical I used in the category.php. For SEO it's not good to provide the same content on multiple pages without explicitly declaring which of the duplicated ones should be the original / indexed one. By providing the following link tag we provide this declaration. The extra field I use isn't really necessary, because $page->url still is the standart ProcessWire url of the shown article. But I like this to be visibile in the code, that this is a dublicate. <link rel="canonical" href="<?php echo $page->get("canonical|url") ?>"/> Hope you like the explanation. Feel free to give feedback on this. Based on the example shown in the wiki: http://wiki.processwire.com/index.php/URL_Segments_in_category_tree_example1 point
-
Updated Pia to version 0.3.0 Resolved a naming conflict with Pias crop() method: around PW version 2.5.17 there was a new pageimage::crop method introduced. If you use Pia with a recent PW dev version, please update!1 point
-
A quick test shows it works fine for me with GD if I use 24bit PNG with transparency as overlay. I used this code for the final image: $img->crop("width=300, height=200, quality=100")->pimLoad('graywm')->setQuality(90)->grayscale()->watermarkLogo($wm, 'c', 0)->save()->url original image cropped via pia + = using Pim to grayscale + transparent png overlay with colored area the result looks good to me ---- Going one step further and using a pure grayscale overlay (with gray area, not a blue one) enables to change the color on the fly and produce different outputs: $color1 = array(100, 100, 0); $wmColor1 = $wm->pimLoad('color1')->setQuality(100)->grayscale()->colorize($color1)->save(); $img->crop("width=300, height=200, quality=100")->pimLoad('color1')->setQuality(90)->grayscale()->watermarkLogo($wmColor1, 'c', 0)->save()->url original + grayscaled using Pim + overlay in gray final image with yellow colorized overlay ------- @Pierre-Luc: maybe there are parts I'm not aware of in your case, but GD isn't that bad in many regards. So, it is very bad in regards of transients and smooth transparencies when it comes to dynamically create and overlay parts. EDIT: Ah, sorry, I have not looked / read very thoroughly your post. You want use composites with modes and that isn't handled at all by GD. It is not a simple overlay with transparency.1 point
-
I definitely go with PWs API first. I always follow the strategy that the original uploaded image never gets outputed as is. Therefore I'm able (and it is highly recommended) to upload images with full quality! (Photoshop JPEG: Quality = 12) You need to keep full quality (PW: quality = 100) for every intermediate step. Only with the last step, that produces an image for output, you need to apply a lower quality setting, e.g. 80. Example manipulation with watermarking, (using PW API with PageimageManipulator): // create ImageObject from fullsize WatermarkImage $wmPng = $pages->get('/mytoolspage/')->watermark; // create a fullsize image with watermark and quality 80! (the global $config->imageSizerOptions quality is set to 80, so don't need to set it here again individually) $image->pimLoad('full')->watermarkLogo($wmPng)->pimSave(); // create a medium sized image with watermark and quality 75! $wmPngMedium = $wmPng->width(960, array('quality'=>100)); $image->width(960, array('quality'=>100))->pimLoad('medium')->watermarkLogo($wmPngMedium)->setQuality(75)->pimSave(); // create a small sized image with watermark and quality 68! Now we first apply the (full) watermark and scale down afterwards: $image->pimLoad('small')->watermarkLogo($wmPng)->setQuality(100)->pimSave()->width(480, array('quality'=>68)); . If you want apply those or other manipulations direct on upload, you can go this way: // is called on hook: addHookBefore 'InputfieldFile::fileAdded' public function prepareUploadedImage($event) { $inputfield = $event->object; if ('images' != $inputfield->name) return; // we assume images field !! name of the field is: images !! otherwise change it $p = $inputfield->value['page']; // get the page if ('album' != $p->template) return; // don't do it on other pages than albums $image = $event->argumentsByName("pagefile"); // get the image // do the image manipulations $image->size(900, 600); $image->size(600, 400); $image->size(300, 200); ... } If you want to apply the watermarks on uploading, you have to use the identical API calls in the autoload module than you do in the templates: // is called on hook: addHookBefore 'InputfieldFile::fileAdded' public function prepareUploadedImage($event) { $inputfield = $event->object; if ('images' != $inputfield->name) return; // we assume images field !! name of the field is: images !! otherwise change it $p = $inputfield->value['page']; // get the page if ('album' != $p->template) return; // don't do it on other pages than albums $image = $event->argumentsByName("pagefile"); // get the image // do the image manipulations $image->size(900, 600); $image->size(600, 400); $image->size(300, 200); // create ImageObjects from WatermarkImage $wmPng = wire('pages')->get('/mytoolspage/')->watermark; $wmPngMedium = $wmPng->width(960, array('quality'=>100)); $wmPngSmall = $wmPng->width(480, array('quality'=>100)); // create variations with watermark $image->pimLoad('full')->watermarkLogo($wmPng)->pimSave(); $image->width(960, array('quality'=>100))->pimLoad('medium')->watermarkLogo($wmPngMedium)->pimSave(); $image->width(480, array('quality'=>100))->pimLoad('small')->watermarkLogo($wmPngSmall)->pimSave(); } . You can also use Pia within those chains if you like to use one of her shortcuts: $image->contain("square=1200, quality=100")->pimLoad('max1200')->watermarkLogo($wmPng)->setQuality(75)->pimSave(); . Summary: upload quality = 100% every intermediate quality = 100% final quality = is the only quality lower than 100% This way you produce very fine images, even with GD-lib.1 point
-
Hi Andi, 1) Thanks for the links and for the useful part of the informations. 2) I (personally) allready haveused GraphicsMagick a year ago. In the above post it was said in the past (at least I tried to do so). Besides that: I have used a lot of other image processors in the past 15 years too. But I cannot see any usefullness with installing a software that only integrates image processors. If I want to evaluate the quality of image processors, I use the image processors. 3) GraphicsMagick does a (maybe very) good job, but IMHO it isn't the best tool out there. The best tool in regard of visually quality for photos is NETPBM! - if one know how to use it. 4) And sorry if I have posted in a way that not let you see what I have meant in the first place. What I have tried to do with the imagickresizer, and also have tried to say in the newer posts here, was to bring in a next step of image processing for a wide range of users. It should not only be available for those who are on their own servers. So using apt-get install... isn't an option for all that are not on their own servers. 5) Please do not assume what I have done, nor what I have done not. This is neither purposeful nor pleasing to read. My short and precious free time I like to spend rather different. Maybe with programming something (or doing other) that is useful for PW and a wide range of PW-users. 6) I'm available for paid PW modules development. I allready have built some nice custom ones in regard of image processing. Horst1 point
-
Hey marcus, all, Is there anyone played with the importing / exporting of the fields and templates via json and keeping them on the module. May be we can make that a wireshell command . I was looking at continuous integration of fields and templates.1 point
-
So, when looking to all that pro sites that were published here the last time, I first thought better not to post this site. But second thought was: "Oh what the heck, they can not all be professionals here." So here it is, a small site for a little but very fine Italian Restaurant driven by a nice family. They wanted to have something like a webcard that holds their address, telephone number and opening times plus some impressions. http://bella-italia-aachen.de/ The site is build using pocketgrid css framework, less, flexslider.js, superbgimage.js and these modules: Spex & AIOM and CroppableImage & Pia.1 point
-
Sure I will help with what I can . Thank you.1 point
-
1 point
-
Ah, thanks for the explanation. It is very useful to analyze code or test it against scenarios, also if done staticly. But it also can do a lot of harm or result in the wrong direction. I give you a real live example about static analysis that happens to me right a few days ago: Google analyzes websites due to the user experiences with mobile devices. They have sent me a message with their analyzis result where they say that I have to change some things to full fit their requirements, otherwise they don't list those pages in search results requested from mobiles. One of their usefull tips and requirements is: I should avoid calling a JS-resource in the html head, I should not call external resources above the fold! Otherwise it would be not mobile friendly. (Tada!) But in fact, the resource I call there is a very little JS file that don't use dependencies, it just checks if the site is viewed by a mobile device. And if it detects a mobile device it sets some things to avoid overhead and loading of to many resources etc. (like limiting infinite adding to only 2 items instaed of 16 with a desktop, fetching way smaller images, adds a mobile class to the body tag to derive the correct mobile friendly CSS styles from it, etc.) You also should know that all other resources the page needs are: one google-fonts call, one minified css file, and one minified js file which is called just before the body close tag. Also this site uses ProCache and is responding quick like hell. As I can see, in this case it is pretty stupid and useless to follow some static rules, it results exactly in the opposite direction. (If I would call the mobile checker beneath the fold! it could be that there were already to much items (pre)loaded; that the content needs to be rebuilded, rearranged according to the to late added mobile class to the body tag; the fetched images were to big, etc. etc) In fact, the whole users experiences, including those on tablets and desktops (not only those on mobiles), depends on calling this little JS early! If they simply would have built in some logic, it could be a helpful initiative, but how it is used now it is dumb and ignorant.1 point
-
A bit OT, but if you can plan the languages hirarchy right from the start of a new site, you can do it this way: enable languages support set Title / Label of the default language to your desired none english native language, (e.g. 'Deutsch' (German)) drop in the none english language pack (for admin backend) into the default language, (e.g. german langpack) add a new language to it and drop in a language pack for any none english language or simply don't drop in a language pack to get the english version (but not as the default one!) As a nice sideeffect every new user in your system gets the native language per default without have it to select from the list. So, yes, this is no solution if you once have set it up and need to switch the default language afterwards, but just want to note it.1 point
-
Hi @icreation, thanks for dropping in all relevant things: original image, scaled image variation and issue description. But, however, I have no good message for you. The GD-Image-Library that is shipped with PHP for image handling cannot handle smooth transients from opaque to transparent. Also if the image looks like it would only have hard cuts between full color and full transparent areas, it isn't that way. Have a look to my screenshots to understand what I try to say (as a none native english speaker / writer). Especially look at the red dot from the colorpicker and the values for RGB in the info palette: here it shows the values for blue (46, 172, 250) . here in the transparent area it shows nothing . but here, almost 4-5 pixel away from the color area, it shows the exact RGB values like in the blue area (46, 172, 250). Obviously this area has a transparency from nearly 100%, but only nearly. In fact it has only 98 - 99% transparency what let the GD-Library struggle with it. --- I don't know how comfortable your client are with image manipulation in regard of understanding this. The graphics look professional though. If they could try to cut them without that smooth area maybe it will be better. Or you / they could try to export the graphics to GIF instead of PNG. Additionally to that you can tweak the imageSizerOptions for those images to render with these values: $options = array( 'defaultGamma' = -1, 'sharpening' = 'none' ); $image = $image->size($width, $height, $options); Hope that helps a bit.1 point
-
Have updated Pia to 0.2.2 because she also was affected by the same issue as CroppableImage. Recent PW versions now (can) log modules API actions into logfile modules.txt. This is suppressed now. If you use Pia and a recent PW dev version, please update to 0.2.2. http://modules.processwire.com/modules/pageimage-assistant/1 point
-
@Alfred: Now I can confirm that this is a new behave from PW. With PW 2.5.11 I have not have this messages in modules.txt, but after updating to version 2.5.17 I get this too. You said you run PW 2.5.16, so it is something between 2.5.12 and 2.5.16. I remember that there were many changes with the notifier and log functions in PW, so I will post an issue at Github to tell Ryan about it.1 point
-
main.inc should keep the largest possible code for all your different layouts and include sub-xy.inc files. Lets say for example you have the default layout with $bodycopy and $sidebar and additionally a onecolumn layout without sidebar: You define a new variable e.g. $myLayout: // here is how it would look like in the /site/templates/init.inc <?php $headline = $page->get("headline|title"); $bodycopy = $page->body; $sidebar = $page->sidebar; $myLayout = "default"; // we only write the name without the fileextension, this way we also can set a CSS-class in the body tag! // or you put it into the head of every template file, here: /site/templates/basic-page.php <?php $headline = $page->get("headline|title"); $bodycopy = $page->body . $page->comments->render(); $sidebar = $page->sidebar; $subnav = $page->children; $myLayout = "default"; include("./main.inc"); Now move the smallest possible segment from your main.inc into default.inc and replace it in main.inc with an include("./$myLayout"): /site/templates/main.inc <html> <head> <title><?php echo $headline; ?></title> </head> <body class="<?php echo $myLayout;?>"> <?php include("./{$myLayout}.inc"); ?> </body> </html> /site/templates/default.inc <div id='bodycopy'> <h1><?php echo $headline; ?></h1> <?php echo $bodycopy; ?> </div> <div id='sidebar'> <?php echo $sidebar if(count($subnav)) { echo "<ul class='nav'>"; foreach($subnav as $child) { echo "<li><a href='$child->url'>$child->title</a></li>"; } echo "</ul>"; } ?> </div> Lets say you don't want the sidebar on your homepage, then you define / overwrite in your /site/templates/home.php the $myLayout var with $myLayout = "onecolumn"; // we only write the name without the fileextension, this way we also can set a CSS-class in the body tag! Create a file called "onecolumn.inc" and put in your desired markup, e.g.: /site/templates/onecolumn.inc <div id='bodycopy'> <h1><?php echo $headline; ?></h1> <?php echo $bodycopy; ?> </div> To stile your onecolumn layout with CSS you need to append to your css something like: body.onecolumn div#bodycopy { width: 100%; }1 point
-
This CryptoPHP is really bad stuff. Especially on W*rdpr*ss it installes an additional AdminAccount too. This way the attackers may have server control after the desinfection of the malware code itself. CryptoPHP is PHP-code within a file that should be a PNG-image. There is a python detection script on GitHub available: https://github.com/fox-it/cryptophp/tree/master/scripts1 point
-
You may also need the following at the top of your htaccess file: # Use PHP5.4 as default AddHandler application/x-httpd-php54 .php I had set my site up in a subdirectory for the client to see and it worked fine, but when I moved it to the top level, it threw a 500 server error and the error log showed "unexpected T_PAAMAYIM_NEKUDOTAYIM." So I checked the htaccess file of the WordPress system that I was replacing and there was the magic line that solved the problem. Thank you, jsantari for asking and arjen for your answer.1 point