-
Posts
4,085 -
Joined
-
Last visited
-
Days Won
87
Everything posted by horst
-
This can be used to avoid sessions on the front end, or on some pages. (And allow them for the admin, where it is needed) You should check this site in regard of its GDPR rules / announcements. (In regard that you not now has enabled sessions where it should not be.) 0400 is better == more secure. If you need to update the site/config.php in the future, you THEN can set it temporary to 0600 for your changes, and directly afterwards back to 0400.
-
Ooh. Than I've thought to complicated. ?
-
I don't (know) ? ??
-
I do such things with a small javascript or AJAX call on doc ready or similar. Or sometimes in the head section of the HTML page, depending what is needed. So you may add a small JS snippet directly after the opening body tag that checks the user preferences and according the result, add or remove a css class from/to body. (?)
-
Ok, I see. Then you should post an issue on github.
-
I cannot find any example with newline character in the docs? Do I oversee something? I thought that escape characters are not supported by the translation. If I'm right, maybe it should be written explicitly in the docs too. I think the right usage is or can be like this: // use %s with sprintf() $out = sprintf(__("It's time for you %sto get to the party."), "\n");
-
Hi, I have following situation with a small local hosting company that do not give access to (common) service panels for domain administration: There are two existing domain names example-a.com and example-b.com. example-b.com is an old site that does not have an own webspace any longer, as its content was years old and unmaintained. The hosting company has mapped both domain names to the same webspaces webroot directory. (at least they told so) We have build a new site under example-a.com and it is hosted correct in the webspace. Now we want to detect all incoming from example-b.com and redirect to URL example-a.com/subpage5/ To achieve this we added the following line into the root .htaccess file: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_HOST} ^example-b\.com [OR] RewriteCond %{HTTP_HOST} ^www\.example-b\.com RewriteRule ^(.*)$ https://www.example-a.com/subpage5/ [L,R=301] ... But unfortunately it only redirects to the webroot (https://www.example-a.com/) and not to the /subpage5/. Does anybody has an idea why this behaves or how I can handle it better?
-
Wouldn't it be better using g**gle search for that? searching forum: site:processwire.com/talk api (https://www.google.com/search?q=site%3Aprocesswire.com%2Ftalk+api) searching whole site: site:processwire.com/ api (https://www.google.com/search?q=site%3Aprocesswire.com%2F+api)
-
FieldTypeImage strange white outline on transparent png's
horst replied to bbeer's topic in General Support
One last try: You may try to (re)save an original image in Photoshop as 24bit PNG with transparency, just to make sure it definetly get handled by the imagick engine. (There is a small chance that, for example, 8bit PMGs with transparency (or different types of transparency) get not handled by imagick, also if you selected it as first engine. PW does an image inspection and if the current prefered engine is marked not to be able to handle that format combination correct, it will be passed to the next engine in the chain. 24bit PNG with transparency definetly will be handled by imagick. (The last one in the chain always is GD, as fallback). -
FieldTypeImage strange white outline on transparent png's
horst replied to bbeer's topic in General Support
Yep. I bet that this are 99.9% transparent pixels from the originals cutout pictures. I mean the originals were photographed on a more or less white background, then it get cropped not by a hard pixel path but by some tool that uses cropping by transparency mask. After that, a shadow drop was added. In the original images the cropped out area is visually not seen, but there are some pixels with a special setting: color white & transparency 100%. It would have been better, if the cutout had be done by hard cropping, 1-2px into the object. If this currently is resized by GD-lib (PWs default or fallback engine), you may try to switch to ImageMagick engine if the server allows this. -
FieldTypeImage strange white outline on transparent png's
horst replied to bbeer's topic in General Support
image example? (original AND issue variation) -
..., yep, ooor, you should not use ../ this in your dest path. ? This is for security reasons. If you give real $dest pathes without up-traversal segments into your createDuplicateImage() function, then you don't need realpath() there. Or you use it one step earlier: public static function createDuplicateImage($src, $dest) { if (file_exists($src) === false) { return false; } // NOTE new line $dest = realpath($dest); // Duplicate the file \ProcessWire\wire('files')->copy($src, $dest); return new \ProcessWire\ImageSizer($dest); } But anyway. I'm glad you figured it out and finally it is working for you! ?
-
This must have to do with the access rights set in your server setup. Normally they get set via wirechmod($filename) automatically. ?
-
You can do with using the imagesizer directly: $is = new ImageSizer("path/to/your/image/filename.jpg", [OPTIONS-ARRAY--OPTIONAL]); // $is->setOptions([OPTIONS-ARRAY--OPTIONAL]); // or set it later here, or ommit setting individual options and use the defaults ! $is->resize($width, $height); // width or height can be 0 ! This resizes and overwrites the image you pass to it. So if you do this with a PW pageimage, you would overwrite the original image if you pass it the originals name!!
-
@ryan Thanks for clarification. I somehow mixed it up with the core page paths module in my mind:
-
Hi @ryan, many thanks for the additions, especially the status one will be used by me! ? I want to ask if the support for matching children paths also works with multi language names, e.g. (/path/to/page/) resolves the same as the de path of the same page (/de/pfad/zur/seite/) ?
-
preservation of GET params during language redirects
horst replied to j-w's topic in Multi-Language Support
On page /en/meineseite/?param=value first save the param into a session var, then do the redirect and in the target page read out the session var $value = $input->get('param'); $value = $sanitizer->text($value); // or any other appropriate sanitizer method for your usecase, and or any other custom validation $session->set('param', "$value"); $session->redirect($YOUR_TARGET_URL); $value = $session->get('param'); -
A short description of what you have done or want to do and what is not functional would be more helpful I believe. Also was there any error given instead of your expected action? I'm on mobile currently and my accu said low memory. So if I'm going offline because of this, I hope someone else can scheme in and help, when we are able to understand your issue. ?
-
@markus_blue_tomato One solution could be to store an extra key containing the last modified timestamp from the image together with the blurhash string, and then every time before output, compare the (current) images last modified timestamp with the stored one. If the stored one is older, regenerate the blurhash string.
- 37 replies
-
- 2
-
-
-
- image
- lazy loading
-
(and 2 more)
Tagged with:
-
If you do not have limitations for outgoing (SMTP) E-Mails per/Day or per/Month and if whether your company nor any other user on the same shared hosting is blacklisted in spam protection services, it should be pretty fine to send them on your own.
-
I posted you a link 2 month ago: I think it can be done with language alternate fields. Have you checked it?
-
To be honest, I don't know if this is a standard processwire file. But with language files one can use it as follows: Instead of adding each string to an own variable, you can add a second parameter to all the language strings you use around in different template files or module files or where ever you need them: __('Text 1', '/path/to/your/_strings.php'); __('Text 2', '/path/to/your/_strings.php'); ... And instead of adding the '/path/to/your/_strings.php' as text all the time, I use a functions call for that. This way you do not have to include the file and can use it everywhere handled through the PW translations system, because you tell it that the current string is the same as a string in the centralized _strings.php In /site/init.php I define this function, that simply returns the path to my centralized translation file: /** * TRANSLATABLE STRINGS * Include translatable strings */ if(!function_exists('ProcessWire\mystrings')) { function mystrings() { return '/site/_strings.php'; // absolute URL or absolute filepath to the central translation file } } My _strings.php would look like this: <?php namespace ProcessWire; /** * TRANSLATABLE STRINGS * Define globally available translatable strings * * USAGE * * __('Lesen Sie mehr ...', mystrings()); * * The function mystrings() returns the textdomain of this file. * **/ ... __('Datenschutzerklärung'); __('Die Maße des Werks sind:'); __('Dieses Bild drucken!'); __('drucken'); ... __('Text 1'); __('Text 2'); ... __('Zurück zur Übersicht'); To sum up, this way I don't need to include a _strings.php and it also works every where.