Jump to content

horst

PW-Moderators
  • Posts

    4,088
  • Joined

  • Last visited

  • Days Won

    88

Everything posted by horst

  1. ImageSizerEngine NETPBM CLI Version 0.1.0 beta (requires PW 3.0.10+) Get it from the modules directory or from github. https://github.com/horst-n/ImageSizerEngineNetpbmCLI For information what it is and how to use and install, please read this Blogpost. Currently supported by Version 0.1.0: only JPEG, - no PNG, - no GIF GIF and PNG will fallback and handled by GD currently. This will be changed when I have a bit more time.
  2. ImageSizerEngine ImageMagick CLI Version 0.1.1 beta (requires PW 3.0.10+) Get it from the modules directory or from github. For information what it is and how to use and install, please read this Blogpost.
  3. // maybe ? $projects = $pages->get("/projecten/")->children("sort=sort"); $prev2 = 0 < $page->prev($projects)->prev()->id ? $page->prev($projects)->prev() : $page->first($projects); $prev1 = 0 < $page->prev($projects)->id ? $page->prev($projects) : $page->first($projects); $next1 = 0 < $page->next($projects)->id ? $page->next($projects) : $page->last($projects); $next2 = 0 < $page->next($projects)->next()->id ? $page->next($projects)->next() : $page->last($projects); // or, if the above do not work as expected, maybe: $prev2 = 0 < $page->prev($projects)->prev($projects)->id ? $page->prev($projects)->prev($projects) : $page->first($projects); $prev1 = 0 < $page->prev($projects)->id ? $page->prev($projects) : $page->first($projects); $next1 = 0 < $page->next($projects)->id ? $page->next($projects) : $page->last($projects); $next2 = 0 < $page->next($projects)->next($projects)->id ? $page->next($projects)->next($projects) : $page->last($projects); But what do you want to show for prev2 and prev1, if the current page is the first? // simply use ? $selector = "limit=2"; $prevAll = $page->prevAll($selector); $nextAll = $page->nextAll($selector); // and then foreach($prevAll as $prev) { ... } foreach($nextAll as $next) { ... } This only will render items if there are any. Means, if the current page is the first one, you will not get previous-links. (what makes sense, as there are no ones).
  4. @Jugibur: that's all right what you are saying. - But, ... the -strip param is only available in the CLI version of ImageMagick, not with the PHP extension. But the PHP extension can handle embedded image markers as well, if, and only if: needed dependencies are compiled in. For ICC conversion, the lcms lib needs to be compiled in, what seems not by default or not with all extensions. Other cons are: with the PHP extension of Imagick, you cannot determine if it is supported / compiled in or not! And if it is supported, it will expand the processing time up to 3-4 times, compared to the processing time without ICC conversion. Therefore, and to have a homogenuous behave across all engines, we strip all image markers by default, but excluding IPTC. (stripped ones are: ICC, EXIF, XMP, JPEG-Comments, and others) Here are two more modules for the new ImageSizerEngine System: ImageMagick CLI Netpbm CLI
  5. The famous jquery DataTables have a Dynamic search / filter inputfield embedded what do a great job. Not exactly what you are looking for, but maybe worth a look into the code. Maybe they use an embedded sub library for that?
  6. OMG. How many users will upload images to this site? Multiple / different users, or only you? I personally use max size = 2500px for the largest dimension of an (original) image. I create those with Photoshop in max quality before uploading.
  7. I suggest to read https://www.littlebizzy.com/blog/ttfb-meaningless, and especially look for TTLB (Time To Last Byte). IMO, TTFB is completly meaningless,the only thingthat matters is: how fast can a user read / see the content of a page. And if you read on Wikipedia TTFB_vs_Load_Time or the more in depth article why it is meaningless, you may see that this doesn't matter. One thing, what is described there for example, is, that if you use gzip compression for your html / js / css content, you get a higher TTFB, but the TTLB is 20-30% lower! But besides that, using ProCache is the fastest way to serve your content. It also includes a part that assist you to setup the server for gzip, caching etc, it can collect and minify your JS, CSS, and HTML files, and you completly ommit invoking the PHP engine and connecting to a DB.
  8. (https://en.wikipedia.org/wiki/Time_To_First_Byte) ProCache does serve static HTML files! PS: TTFB is meaningless
  9. Exactly as @Craig said: for example, if you want import two templates that have a parent / children family relation, it cannot be imported in one go, as for both the other referenced family template isn't known in the system. But it works fine, if you first let out the family settings. Click / select YES for "Create this template?" for both templates and commit the form. In the next screen, you simply click on ok and in the next step you paste in the data again and click peview. Now you will see both templates with the opened settings. One shows the new property "parentTemplates" and the other a new property "childTemplates". Lastly click commit changes and you are done.
  10. It is not intended to be set as global / default option sitewide. You definitly need to set it with every request. The default behave is, if you do not explicitly define an outputformat, the outputformat is the same as the inputformat: jpg => jpg jpg => setOutputformat('png') => png So, it is not a bug in the module, but a "bug" in the description here. I will update the description. Thanks for pointing out, @BernhardB.
  11. Just some thoughts: Can you try to renew the Session between deleting and the new creation. (Logout and Login again). What modules are active? Something like page-path-history?
  12. @SteveB: Sorry, I need to update this in the description here. The UI for Imagesizer options is removed now, as it could interfere with the ConfigModule. I think it is better to have only one SettingsPage / UI screen than multiple, what can let to confusion. Pia is meant to assist in Image API handling, and the ConfigModule is meant for UI handling of config options. So, the UI for Image Sizer Options isn't there anymore, for all PW versions, 2.5+ and 3.0+.
  13. @adrian: I have a running PW 3 now, and played a little with Tracy. Really, really useful. Thank's for that, (also to @tpr!) Regarding the configuration and features: Personally, I would like to only have those features visible / enabled, I currently need. phpinfo is definetly not one of them. I think when I use 1000 times the debugger, I would need 2 times the phpinfo. What's about a single and simple ASM in the configscreen, that lets the user enable / disable features? I have done it that way with ALIF, I don't think it is to much confusing or overwhelming. It would need one ASM in the configscreen and one additional line in your render method: https://github.com/horst-n/AdminLinksInFrontend/blob/master/AdminLinksInFrontend.module#L1437 Anyway, with or without configurable features, it's a very useful module, especially for remote debugging (on live servers) !!
  14. It depends on what you want to measure. If you want to start measuring the time when the prepend file is parsed, thats the right solution. If you want measure the time from the beginning of execution, you also can start in the _init.php and end in the _main.php. As I said, it completly depends on what you want do.
  15. @tpr: Yes, you are right, this is already known as possible solution. see: https://processwire.com/talk/topic/12326-redirect-after-login-to-original-page/#entry114235 I think, @adrian is interested in why it is not working with his module, because it should be. ?!
  16. Hah! It's working now with using $include_fuel ? wire('all')->getArray() : array(), Thanks, @Lostkobrakai! You made me happy!
  17. For me, this doesn't change anything. I have added the namespace ProcessWire to all files that belong to Spex and all my template files too. The error persists. Here are the call stack of my debugger. The relevant lines are 11, 10, 9, 8. As you can see, at runtime it is translated / called ProcessWire\ProcessWire->getArray(). Is this right in regard what we should expect here? index.php(62) Exception: Method ProcessWire::getArray does not exist or is not callable in this context (in ...\pw3\wire\core\Wire.php line 347) #0 [internal function]: ProcessWire\Wire->___callUnknown('getArray', Array) #1 ...\pw3\wire\core\Wire.php(303): call_user_func_array(Array, Array) #2 ...\pw3\wire\core\WireHooks.php(555): ProcessWire\Wire->_callMethod('___callUnknown', Array) #3 ...\pw3\wire\core\Wire.php(327): ProcessWire\WireHooks->runHooks(Object(ProcessWire\ProcessWire), 'callUnknown', Array) #4 ...\pw3\wire\core\ProcessWire.php(471): ProcessWire\Wire->__call('callUnknown', Array) #5 ...\pw3\wire\core\Wire.php(328): ProcessWire\ProcessWire->__call('callUnknown', Array) #6 ...\pw3\wire\core\Wire.php(328): ProcessWire\ProcessWire->callUnknown('getArray', Array) #7 ...\pw3\wire\core\ProcessWire.php(474): ProcessWire\Wire->__call('getArray', Array) * #8 ...\pw30\site\modules\Spex\Spex.module(250): ProcessWire\ProcessWire->__call('getArray', Array) * #9 ...\pw30\site\modules\Spex\Spex.module(250): ProcessWire\ProcessWire->getArray() * #10 ...\pw30\site\modules\Spex\Spex.module(155): ProcessWire\Spex->getTemplateVars() * #11 ...\pw3\wire\core\WireHooks.php(626): ProcessWire\Spex->templateFileRenderBefore(Object(ProcessWire\HookEvent)) #12 ...\pw3\wire\core\Wire.php(327): ProcessWire\WireHooks->runHooks(Object(ProcessWire\TemplateFile), 'render', Array) #13 ...\pw3\wire\modules\PageRender.module(500): ProcessWire\Wire->__call('render', Array) #14 ...\pw3\wire\modules\PageRender.module(500): ProcessWire\TemplateFile->render() #15 [internal function]: ProcessWire\PageRender->___renderPage(Object(ProcessWire\HookEvent)) #16 ...\pw3\wire\core\Wire.php(303): call_user_func_array(Array, Array) #17 ...\pw3\wire\core\WireHooks.php(555): ProcessWire\Wire->_callMethod('___renderPage', Array) #18 ...\pw3\wire\core\Wire.php(327): ProcessWire\WireHooks->runHooks(Object(ProcessWire\PageRender), 'renderPage', Array) #19 ...\pw3\wire\core\WireHooks.php(626): ProcessWire\Wire->__call('renderPage', Array) #20 ...\pw3\wire\core\WireHooks.php(626): ProcessWire\PageRender->renderPage(Object(ProcessWire\HookEvent)) #21 ...\pw3\wire\core\Wire.php(327): ProcessWire\WireHooks->runHooks(Object(ProcessWire\Page), 'render', Array) #22 ...\pw3\wire\modules\Process\ProcessPageView.module(205): ProcessWire\Wire->__call('render', Array) #23 ...\pw3\wire\modules\Process\ProcessPageView.module(205): ProcessWire\Page->render() #24 [internal function]: ProcessWire\ProcessPageView->___execute(true) #25 ...\pw3\wire\core\Wire.php(303): call_user_func_array(Array, Array) #26 ...\pw3\wire\core\WireHooks.php(555): ProcessWire\Wire->_callMethod('___execute', Array) #27 ...\pw3\wire\core\Wire.php(327): ProcessWire\WireHooks->runHooks(Object(ProcessWire\ProcessPageView), 'execute', Array) #28 ...\pw3\index.php(53): ProcessWire\Wire->__call('execute', Array) #29 ...\pw3\index.php(53): ProcessWire\ProcessPageView->execute(true) #30 {main} E_USER_ERROR Spex.module has: <?php namespace ProcessWire; public function getTemplateVars($include_fuel=true) { return array_merge( $include_fuel ? wire()->getArray() : array(), // should be: $include_fuel ? wire('all')->getArray() : array(), !! array('spex' => $this), array('slots' => $this->slots), $this->templateVars ); }
  18. For me it is not working too. I have prefixed all files with namespace ProcessWire, but getting the same error: Method ProcessWire::getArray does not exist or is not callable in this context (in .../wire/core/Wire.php line 347)
  19. Don't know if it will change anything, but it can be worth a try: instead of include_once("./init.inc"); you may try to use include_once( dirname(__FILE__) . "/init.inc");
  20. Sorry, I cannot follow. A queue only stores the data you put into it, nothing more. If you need references to whatever, put it into your data. That's the only way to have your needed data together. But this has nothing to do with the queue. Once again, the queue is nothing else than a storage, a DB table, with exactly 1 field for your data. Therefore, (I think you do this already), you have to wrap your data into an array. If you need more data-information as you currently have in it, just put it into the data array too.
  21. @Vayu_Robins: +1 for adrians module. That's the perfect fit for your needs. How could I not think of it? I use it myself on a site.
  22. Oh! Thanks, Charles. I completly missunderstood. Do you know, where I can find infos about what and / or how those credentials need to be?
  23. Hhm, this may be only of less importance, and I hope, someone else will chime in with a good solution. But if not, I use a login and logout feature with the userswitcher of my ALIF module. If you are comfortable with module creation and hooks, you may have a look at it and pick up some code to build a small module. (Or you put a small code piece into the init.php or ready.php)! The hook method: https://github.com/horst-n/AdminLinksInFrontend/blob/master/AdminLinksInFrontend.module#L284 // if it is in a module, it can look like this: public function hookBeforeProcessLogin(HookEvent $event) { // early return, if it is not a link with the GET param id_original if(!$this->input->get('id_original')) return; // get the redirect URL $id = (int)$this->input->get('id_original'); // sanitize via typecasting $p = wire('pages')->get("id=$id"); if(0 == $p->id) return; // it was not an existing / valid pageid // ?? maybe here you have to do additional validation to secure that the returned page is meant to be served // and that it is not one, the user has no access to, ... ?? ... // if it is a valid page, redirect now $this->session->redirect($p->url); } Not tested, written in the browser, no warranty, but hope it helps.
  24. Thanks for pointing to the typos. I corrected it.
×
×
  • Create New...