-
Posts
4,077 -
Joined
-
Last visited
-
Days Won
87
Everything posted by horst
-
This is how I understood @Ivan Gretsky but I may be wrong. Regardless of this, it depends on how many devs work on one site. If I'm the only one, I mostly know what I'm doing. ?
-
What about this: The config setting should not override the fronten selection, but should make the named ones stay visible (unhideable). ? Or is it that what you allready have in mind? Thinking that someone enables per frontend a panel, that is not within the config setting.
-
Additionally to adrians suggestion to use TracyDebugger, there also is a possible solution to programmatically adjust between different installed WireMail extensions. (Initially I understood your question in a wrong context. I thought you would want to use both directly in production mode. But if you want to use one for debug mode and one for production, you may define / setup something in your config.php and ready.php.) I would define an extra var in site/config.php that, set to true, enables the wiremailsmtp (production) mode. If it is set to something other or completly missing, enable the wiremail debug extension. needed code may look like this: // in site/config.php $config->useProductionMailclass = false; // in site/ready.php $wireMailClassProduction = 'WireMailSmtp'; $wireMailClassDebug = 'WireMailTesting'; $neededWireMailClass = true === $config->$config->useProductionMailclass ? $wireMailClassProduction : $wireMailClassDebug; // now read which version currently is set to use if($mail->className != $neededWireMailClass) { // the wrong class is in use, change it: foreach($modules as $module) { $parents = class_parents("$module"); if(in_array('WireMail', $parents) && $modules->isInstalled("$module")) { if($module->className == $neededWireMailClass) { $mail = wire('modules')->get("$module"); break; } } } } // do a final validation and add an error handling for when the desired module isn't loaded at this step! if($mail->className != $neededWireMailClass) { die('Something weird is gooing on here with WireMail-Classes'); }
-
You are talking about the admin site, - or Frontend?
-
That is exactly what cannot override the customers private browser setting for file downloads of type PDF. If you serve a file of type PDF you can tell the browser "your wishes", but every individual browser may have its own preferences that cannot be overridden. I had understand that it should be not downloaded but directly shown as document, what only can be asured if you also provide the app for displaying the doc, as you don't know if a browser has a setting that enables such a behave.
-
AFAIK, this is a browser specific setting, that you hardly can override if you only serve a download link. But if you use a service like g**gle docs, it should work: https://nogajski.de/autosoftproof/ (the last link in the list)
-
Performance Question - Visitor Counter with dates..
horst replied to mr-fan's topic in General Support
+1 for Matomo- 7 replies
-
- performance
- counter
-
(and 1 more)
Tagged with:
-
Hi Ivan, I think you can try to instantiate two parallel vars by calling the extention class names. At least you should give it a quick testing, if that works. I never have done this. $smtp = new WireMailSmtp(); $mgun = new WireMailMailGun(); You need to check if those initiated objects need to be passed any config data to work. EDIT: yep, and leave the predefined instance wire('mail') alone.
-
A bit OT, but worth a read: https://dev.to/effingkay/4-practices-for-better-code-4nf3
-
Hhm, so you will have one or multiple webservers with different states of variations, but only the AWS S3 cloud is always containing everything. What's about your own idea, hooking into $page->save(): check if imagefield(s) exist in that edited page if yes, compare all image and variation timestamps and upload those from within the last x minutes. This way, you are completly free to use what ever image tools you like.
-
What is the primary benefit for hosting images in the S3 cloud? Or the other way round: do you need to save diskspace on your local server?
-
I think you don't need to hook into this module. You need to hook into Pageimage, doing the following: check if the requested variation is available on your AWS S3 remote storage, and if yes, just link to it, and if no, create a new one, upload it and finally link to it. This is independent from the different ImageRenderingEngines and extra modules. EDIT: Have you seen this:
-
I don't understand. Please can you clarify, maybe with a short explanation, what you want to do?
-
Which PW-version are Site A & Site B? I have used fields & templates export & import a lot, but without ex-/importing pages. I don't have had any issues so far with the templates ex-/import feature. Only if there are templates in family-children relation that need both imported together in a new site, it needs multiple import steps, as in the first run, the family settings can not be set because wether parent nor childrens are known in the system.
-
@bernhard only thing what seems not as good with OSM as it is from g**gle, is the routing planner. At least, it wasn't for a long time. (?) My personal workaround for that is to use OSM with a link to g**gles routing planner. ? For example, on https://wein-coop.de/ I use OSM with Leaflet and a link to the Routingplanner ( https://www.google.de/maps/dir/50.7823,6.0759/@50.7823,6.0759,15z ).
-
Thanks for the hint, Bernhard. Until now, I haven't had time to look at it. So, will add it to the list of things to explore / try out. ?
-
Definetly can confirm that with the PageTree and the rare cases where additionally a ListerPro page is needed. ?
-
Maybe this is the better forum for it. Crosslink:
-
Issues Repository: If A Reported Issue Effects You...
horst replied to netcarver's topic in Wishlist & Roadmap
A bit OT, but related to Githubs notifications and issue repos in general. Today I found a nice app, that shows all new GitHub Notifications in a nice way. All previously read comments in a thread are minimized. I found it together with other tools here: https://dev.to/maestromac/tools-i-use-to-stay-on-top-of-githubs-notifications-56mo Screenshot: -
Very nice site and well done write up with good insights! ? Also nice to see, that someone other, besides me, is using Admin Links In Frontend these days. ?
- 4 replies
-
- 1
-
- showcase
- consulting
-
(and 1 more)
Tagged with:
-
https://duckduckgo.com/?q=site%3Aprocesswire.com%2Ftalk+server+locale+is+undefined&t=ffsb&ia=web
- 1 reply
-
- 3
-
Because there are many languages that uses those chars. Means: these are not only "german umlauts", this is used in multiple languages. And those languages all reduce the chars to a single char, (ä -> a, ö -> o, ü -> u). So, the usage in german language, changing it to a char with a trailing e, is in the minority here. ?
-
[solved] which version numbers do you use? integer or string?
horst replied to bernhard's topic in Module/Plugin Development
Why not? Does version_compare() not work for you? Or extracting major and minor parts separately? Or if you only need to have consistency for modules under your control, why not define major/minor versions explicitly? -
Checking page (all fields) against json feed
horst replied to louisstephens's topic in API & Templates
Using the uncache has nothing to do with the function calls. Uncaching is usefull in loops, at least with lots of pages, to free up memory. Every page you create or update or check values of, is loaded into memory and allocate some space. Without actively freeing it, your available RAM gets smaller and smaller with each loop iteration. Therefor it is good practice to release not further needed objects, also with not that large amount of iterations. -
Checking page (all fields) against json feed
horst replied to louisstephens's topic in API & Templates
Two or three things come to my mind directly: If there is no unique ID within the feed, you have to create one from the feed data per item and save it into an uneditable or hidden field of your pages. Additionally, you may concatenate all fieldvalues (strings and numbers) on the fly and generate a crc32 checksum or something that like of it and save this into a hidden field (or at least uneditable) with every new created or updated page. Then, when running a new importing loop, you extract or create the ID and create a crc32 checksum from the feed item on the fly. Query if a page with that feed-ID is allready in the sytem; if not create a new page and move on to the next item; if yes, compare the checksums. If they match, move on t the next item, if not, update the page with the new data. Code example: $http = new WireHttp(); // Get the contents of a URL $response = $http->get("feed_url"); if($response !== false) { $decodedFeed = json_decode($response); foreach($decodedFeed as $feed) { // create or fetch the unique id for the current feed $feedID = $feed->unique_id; // create a checksum $crc32 = crc32($feed->title . $feed->body . $feed->status); $u = $pages->get("template=basic-page, parent=/development/, feed_id={$feedID}"); if(0 == $u->id) { // no page with that id in the system $u = createNewPageFromFeed($feed, $feedID, $crc32); $pages->uncache($u); continue; } // page already exists, compare checksums if($crc32 == $u->crc32) { $pages->uncache($u); continue; // nothing changed } // changed values, we update the page $u = updatePageFromFeed($u, $feed, $crc32); $pages->uncache($u); } } else { echo "HTTP request failed: " . $http->getError(); } function createNewPageFromFeed($feed, $feedID, $crc32) { $u = new Page(); $u->setOutputFormatting(false); $u->template = wire('templates')->get("basic-page"); $u->parent = wire('pages')->get("/development/"); $u->name = $feed->title = $feed->id; $u->title = $feed->title; $u->status = $feed->status $u->body = $feed->title; $u->crc32 = $crc32; $u->feed_id = $feedID; $u->save(); return $u; } function updatePageFromFeed($u, $feed, $crc32) { $u->of(false); $u->title = $feed->title; $u->status = $feed->status $u->body = $feed->title; $u->crc32 = $crc32; $u->save(); return $u; }