Jump to content

horst

PW-Moderators
  • Posts

    4,085
  • Joined

  • Last visited

  • Days Won

    87

Everything posted by horst

  1. @SteveB: you may compare how it is built / used with WireMailSwiftMailer or WireMailSmtp. Both are modules that set on top of the base class and just working fine. So, without knowing how you have coded it, I cannot tell you more than to compare yours to those and refer to their examples. -------- It also is possible to check for the right module like so (logging isn't necessary): $mail = wireMail(); if($mail->className != 'WireMailSendgrid') { // Uups, wrong WireMail-Class: do something to inform the user and quit echo "<p>Couldn't get the right WireMail-Module (WireMailSendgrid). found: {$mail->className}</p>"; return; } As a sidenote, you should only install one module on top of the base class. I have encountered that, if you install two, the last one installed is used. I don't know of any method to select from different modules through the WireMail base class.
  2. I think it should be page, not pages: $this->pages->addHookBefore('save'
  3. I'm in a hurry: https://www.google.com/search?q=site:processwire.com+pagination https://www.google.com/search?q=site:processwire.com%2Ftalk+pagination https://processwire.com/api/modules/markup-pager-nav/ (limit) ...
  4. <?php echo $member->get($page->name)->title; ?>
  5. Very cool story! And a very wise decision to switch to PW without telling the client to early. (only after they have seen it live) it makes me:
  6. He, if I get you right, you have version 2.4.10 installed and want upgrade to 2.4.17 (or the latest version available)? you should make a DB-backup rename your current wire folder to something like wire-2410 rename your current index.php to index.php.bak or something and then upload only the wire folder of the latest version and the index.php Regarding changes in the .htaccess file I have compared the 2.4.9 against the 2.4.17 and there were only 2 new lines added (row 150 + 151): # ----------------------------------------------------------------------------------------------- # Access Restrictions: Protect ProcessWire system files # ----------------------------------------------------------------------------------------------- # Allow screenshot files (for install.php only: this 1 line below may be removed after install) RewriteCond %{REQUEST_URI} !(^|/)site-[^/]+/install/[^/]+\.(jpg|jpeg|png|gif)$ # Block access to any htaccess files RewriteCond %{REQUEST_URI} (^|/)\.htaccess$ [NC,OR] You need to update that manually. Then you should start the site by log into the admin and also view your site from the frontend.
  7. @Ivan: as far as I understand -aj- he is aware of that and I share his opinion / suggestion on building that not in the core but building it as a paid ProFeature for enterprise customers.
  8. I never have used a language pack before. Today I want. @nico: I have noticed some things: coming from google or from where ever to the first post of this thread, it would be good if there were some short instructions on how to get the newest lang-pack for stable and for dev. (with links!) A short instruction or appropriate links on how a lang pack must be applied would be useful too. and there shouldn't be old zip archives available for downloading. @Manfred62: really cool that you are that fast with updates to the dev-branch. Is it right that I have to grab the files from yellowleds repo and add the latest pw-lang-de-dev-update.zip to it?
  9. don't know if you can find something useful here, but it sounds like you can grab some code or ideas about 404: https://processwire.com/talk/topic/4884-hook-before-a-404-exception/ yes, here it is: https://github.com/harikt/Assets/blob/master/Assets.module#L59 https://processwire.com/talk/topic/5724-404-search-module/
  10. No. I meant: What's about "get the image size of the cropped image URL" ? What size from what url? But above all: why?
  11. what?
  12. ->getThumb() actually returns an url, not a pageimage object. You may try to use the PiM for that? (with PiM you can manipulate imagefiles, not only pageimages) But because of the lack of native PW methods, you need to use some plain PHP code: // define some vars $cropname = 'crop'; $width = 600; // build the fullpath from the thumbnail url $sourceFilename = $_SERVER['DOCUMENT_ROOT'] . $page->header->getThumb($cropname); // build the targetfilename $targetFilename = dirname($sourceFilename) . '/' . $cropname . '_' . $page->header->name . ".{$width}x0." . pathinfo($sourceFilename, PATHINFO_EXTENSION); // get instance of PiM for manually usage, do the resize and save to a new file and return the targetfilename on success $result = $wire->modules->get('PageImageManipulator')->imLoad($sourceFilename)->setTargetFilename($targetFilename)->resize($width)->pimSave(); if($result==$targetFilename) { // resizing and saving was successful, now we need to get the url from the diskfilename $url = str_replace($_SERVER['DOCUMENT_ROOT'], '', $targetFilename); // and can output an image to the page echo "<img src='{$url}' />"; } This is written in the browser, but I think you get the clue, also it looks a bit clumpsy. But if it works, ...
  13. +1 for #1 (optional)
  14. Hey sunlix, welcome to the forums. Really cool first post! Reading a bit through the code on Github makes me "want to try it out" (unfortunately I haven't enough time now, but will come back to this soon)
  15. shouldn't it be utf-8 by default?
  16. // _init.php $GLOBALS['gallery_used'] = false; // _func.php function renderGallery(){ if(!$GLOBALS['gallery_used']) { $GLOBALS['gallery_used'] = true; return "gallery"; } else { return "already used"; } }
  17. as far as I understand this, orphaned images are images without an original image, but I may be wrong. There are different variations in your assets/files folder: .0x100 // this one is (auto) created for the backend, all others are custom ones => your variations .390x100 .390x125 .390x166 .390x83 .585x125 there are a minimum of 5 variations of each original image. These are no orphaned images because their parent image are still there. 9 x 5 = 45 valid custom variations Do you not use / need them anymore?
  18. @bytesource: it's really nice to build own modules. You make your hands dirty with code and get better skills in PW and PHP. But IMHO for your need to change a page-id into a link, I simply would go with hanna code module.
  19. https://processwire.com/talk/topic/6472-charleswuorinencom/#entry63522 https://processwire.com/talk/topic/6538-using-procache-with-wilcox-adaptive-images-plugin/page-2#entry64304
  20. This draft capability, would it work that way that when you edit (add/remove and /or rearrange) images on a page that is already published that these changes are not directly visible at the frontpage? This one is really odd and need some better handling IMO.
  21. so, forgive me if this is a completly other thing, but what about a crossdomain.xml file? Is this used for something other? <?xml version="1.0"?> <cross-domain-policy> <allow-access-from domain="example.com" /> <allow-access-from domain="www.example.com" /> <allow-access-from domain="data.example.com" /> </cross-domain-policy>
  22. I think you need to build a selector for your selection list with a pseudocode like: select all from teammembers that are not in games.position.teammembers So, it depends on your fieldnames that you use in games.
  23. +2 @adrian: I think you are not over-reacting! After reading #7 my blood pressure and pulse are getting too high for some minutes. (da muss man sich ja fremd-schämen) @blad: I find it good that you have helped with some fixes for those found security issues via PM.
  24. RSS: http://modules.processwire.com/modules/markup-rss/ or better use the webservices module? (http://modules.processwire.com/modules/service-pages/)
  25. @Mel: here is a post that describes how to use a watermark that is uploaded into a single image field (to make an image field a single image field you have to setup the field to only allow 1 file, otherwise, 0 or greater 1 it is a multiple files field): https://processwire.com/talk/topic/4264-release-page-image-manipulator/#entry41883 The general how to you can read in the initial post here in this thread: The $pngAlphaImage can be a filename (full path and not an url!) or a pageimage. Example with filename, assumed you have uploaded a png watermark image per FTP to your server into a directory besides wire and site, called "_mystuff": $png = $_SERVER['DOCUMENT_ROOT'] . '/_mystuff/' . 'basename-of-my-watermark.png'; foreach($images as $image) { $watermarked_image = $image->pimLoad('tw', true)->width(500)->watermarkLogo($png, 'southeast', 0)->pimSave(); echo "<img src='{$watermarked_image->url}' />"; } An example with png from an imagefield, assumed it is called 'watermarkfield' and is on a page with the name/url '/tools/'. The tools page isn't visible from the frontpage, it is only a page that holds some fields and stuff that I need around the site on different places: // assumed the watermarkfield is a single image field: $png = $pages->get('/tools/')->watermarkfield; // assumed the watermarkfield can have multiple images and I want use the first one: $png = $pages->get('/tools/')->watermarkfield->first(); foreach($images as $image) { $watermarked_image = $image->pimLoad('tw', true)->width(500)->watermarkLogo($png, 'northwest', 0)->pimSave(); echo "<img src='{$watermarked_image->url}' />"; }
×
×
  • Create New...