Jump to content

horst

PW-Moderators
  • Posts

    4,088
  • Joined

  • Last visited

  • Days Won

    88

Everything posted by horst

  1. Haha, funny sentence, >> "it should be easy" << But seriously, how have you setup this? Are both programms running on the same server and within the same domain? Or are they separated by subdomains? But regardless, I would create a script within the WordPr*ss site / directory, according to the guidance you have linked too, but would create and output JSON data. The URL of that script, I would read in from PW and create the posts. $url = "http://wrdprss.domain.tld/path/to/jsonexport.php"; $opts = array( 'http' => array( 'method' => "GET", 'header' => "Accept: application/json\r\n" ) ); $context = stream_context_create($opts); $jsondata = file_get_contents($url, false, $context); if (preg_match("#HTTP/[0-9\.]+\s+([0-9]+)#", $http_response_header[0], $matches) && 200 == intval($matches[1])) { // now parse the data and build the html ... }
  2. If you have set the sort order to manually in the childrens parent site, you can use "sort=sort" or "sort=-sort" in the selector. (Hope this is what you are asking for??)
  3. Do you use A) different values for $config->userAuthSalt in site/config.php B) different PHP versions with the environments ?
  4. Maybe that can work, but haven't tested: you can create another parent template, (as a copy from your current), but only the template in PW backend, not with a template file!! than you assign your current templatefile to the new template under Template Edit _> Files -> "Alternate Template File", as children, you only assign that date template, with setting the auto name format I think you have to experiment with it, so highly recommend to do this in a playground install, not in your current projects install !!
  5. I can confirm a behave like @NoremPload describes, but not like @tsdtsdtsd said. This must be different things. I have noticed this two times by myself: 1) on a PW 2.3.5 site, a year ago or so. Here it has gone away without any interaction. (??) weird! 2) on a local installation of a friend, where it occured from time to time. But couldn't detect any reason why it behaves that way. All images were stored in the assets files subfolder and all admin thumbnail variations were successfully created. After a page reload, with or without using the save button, some images were gone from the images field. (not written into DB) And without allowing to overwriting existing images on upload in the field edit page, you are not able to upload them again! (Error about image files are already exists, but may belong to another field of that page!) Only thought is, that it (must) have to do with the MySQL DB and the lot of concurrent save requests for the pages image field! But I'm not very familiar with DB stuff. So, as it is also a bit weird that an optional wanted sort order gets distorted by a multiple asynchronus upload I always use zip upload nowadays. You can enable zip upload to image fields. This way only one file gets uploaded, and than one by one image gets extracted, registered and variation created. No concurrent tasks anymore. Also an optional wanted alphabetical sortorder is kept. As this only is a workaround, the asynchronous concurrent images upload should work too. And it does work for maybe 99,9995 percent. But if you run into that 0,0005 percent, it is weird. If you like, you can open an issue on github. If not, I will do so later. Am on the go now. BTW: @NoremPload, your avatar reminds me of an old friend of mine.
  6. I have answered to it on Github: https://github.com/ryancramerdesign/ProcessWire/issues/1236#issuecomment-151254248 would this be a solution?
  7. Does you have any page or module created / named "language" ?? (NOt one from the LanguageSupport)
  8. Hi Marty, I'm not sure, but shouldn't it be with a comma, before your image field? $matches = $pages->find("template=portfolio, title|first_name|last_name|body%=$q|portfolio_images.tags*=$q, limit=150"); $matches = $pages->find("template=portfolio, title|first_name|last_name|body%=$q,portfolio_images.tags*=$q, limit=150"); > ! < (Not tested)
  9. very nice site!
  10. There are always executed checks like isViewable, isEditable, isWhatEverNeeded in the context of the current $user. So, everything is fine, if a Superuser is able to access those pages.
  11. Have a look into Functions.php line 805, function wireMail(): $mail = null; $modules = wire('modules'); // attempt to locate an installed module that overrides WireMail foreach($modules as $module) { $parents = class_parents("$module"); if(in_array('WireMail', $parents) && $modules->isInstalled("$module")) { $mail = wire('modules')->get("$module"); break; } } // if no module found, default to WireMail if(is_null($mail)) $mail = new WireMail();
  12. Great! Please, can you add it to the modules directory too? It's done in less then 2 minutes, as you have it in a github repo.
  13. Hey, you are all right. We have had another issue with authentication and the test, where the original SMTP-class also allowed the missing of authentication. In this regard, the user could successfully pass the test (connecting to the server, IP + Port) without providing authentication credentials. Therefore I have hacked the original class with this code you have posted above. (assuming there will be no open relay servers out there in 2015) But yep, now you comes along here. I will have a closer look to it and provide a better fix. (apropriate for both situations). In the meantime you can A) comment the part in the code, or B) don't use the test anymore on tis server. Thanks for your help.
  14. Hi thomas, I'm not sure if my thougths are helpful and also if I got it right what you need to achieve. You have a js app that "talks" to the server, (through ajax or alike?) when it has to read or save data through PW? Why would you trigger poll requests if you don't have anything to do for the app or server? I mean, you can check on top of each regular request that needs to interact with PW as logged in user if he still is logged in, and if not, redirect to the login screen. (maybe?) Or maybe you can set a special session variable (timestamp) for logged in users that gets updated only on regular requests, not on poll requests. This session var needs to be used / bind for the logout timeout then. (but also don't know which hook would be needed for that) When reading my answer now, it doesn't look very helpful at all. (but I have tried it!)
  15. What system you are using? Win > 7 ? And what server setup you are using? (Mamp, Wamp XAMP, etc)
  16. Hehe, this is the time zone advantage! +02:00
  17. Hi @ukyo, maybe there are optimization possibilities in your workflow. If you don't mind, I write down some thoughts ? 1) if you don't want send your original (master) image through the browser, (what I highly recommend), upload it with the max quality setting you can. (Speaking on JPEG only here in this regard). 2) try to reduce the image processing steps to a minimum. In your example you first call size with original width. This triggers a complete image manipulation including creation of a diskfile with the exact dimensions of the original image. But with a lower quality (depending of your default settings, maybe: 90). This lesser quality version is then loaded into pim2 and gets watermarked, and again saved with default value for quality. This is repeated once again for the $sSizeImage. Better would be to A) use quality 100 for all intermediate steps and only save the last one with your desired endquality. I would create one fullsize variation with the watermark logo. // creates a copy of the original, but with watermark and suffix "wmi" $wmiImage = $image->pim2Load('wmi')->watermarkLogo($wmPath, 'c', '2')->setQuality(100)->setSharpening('none')->pimSave(); Now use this wmi image (variation) for your resized versions: // create an image 1130x500 $sSizeImage1 = $wmiImage->size(1130, 500); // create an image max width 300 $sSizeImage2 = $wmiImage->width(300); // and so on, ... This way you have the original image plus one fullsize with watermark and one variation for every output image.
  18. choosing a cms your organization will love, read here, (and also see the first posted comment)
  19. There were other voices here in that thread If you like, I can do, but I'm not sure that it is really helpful.
  20. Hi jlahijani, the only thing what should have influence on that is defaultGamma. Have you tried 2.2 ? Also the master images should be max possible quality (Photoshop quality 12) The output colorspace must be sRGB, regardless if with or without embedded icc profile. Can you tell the GD lib version and the used PHP version?
  21. Really? I thought we don't put alpha state modules into the directory? Wouldn't it be better to put the URL from the forum thread and GitHub repo into the modules description, if it isn't already there? The module is only half way ready, but most of the part what needs to be finished cannot be done by me. So, when it is in the directory, it gets more attention and, I believe, more requests for to make it fit into the UI, and let it also have all the fine new stuff that the core image field has, etc, etc. All what I can't do.
  22. Tremendous Url Field ?
  23. I think this must work: $pa = new PageArray(); // use a PageArray to collect all subject pages foreach($pages->find("template=subject") as $subject) { // iterate over all subject pages $subject->set('myCount', $pages->find("template=artworks, subjects=$subject")->count); // add a temporary property to it that holds the total number of linked items $pa->add($subject); // add it to the PageArray } foreach($pa->sort("-myCount") as $item) { // sort the PageArray descending by total number and echo the title and count echo "<li>{$item->title} ({$item->myCount})</li>"; }
  24. @renobird: ah, now I see what was the real problem. Haven't realized it before.
  25. You cannot (simply) save within the hook that is called after save. You need to avoid endless loop. Add a temporary property to the page object you have altered and check for this in the beginning of the hook method: if (page->imAlreadyDone) return; // is already altered if ($page->template != "nepremicnine-vnos") return; // is the wrong page type $page->cenaStara = $page->cena; // alter data $page->imAlreadyDone = true; // flag page as altered $page->save("cenaStara"); // save
×
×
  • Create New...