Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/11/2016 in all areas

  1. https://getuikit.com/docs/uikit3.html I like what I see.
    4 points
  2. I can see two issues there: The Content-Transfer-Encoding needs to be 8bit to support raw utf8 characters The subject needs to be encoded using either quoted-printable or base64 (quoted-printable is most common there, as it leaves parts of the subject readable) Changing the affected functions like this in WireMail.php should get things working with umlauts: public function subject($subject) { //$this->mail['subject'] = $this->sanitizeHeader($subject); $this->mail['subject'] = '=?utf-8?Q?'.quoted_printable_encode($this->sanitizeHeader($subject)).'?='; return $this; } public function ___send() { $header = ''; $from = $this->from; if(!strlen($from)) $from = $this->wire('config')->adminEmail; if(!strlen($from)) $from = 'processwire@' . $this->wire('config')->httpHost; $header = "From: " . ($this->fromName ? $this->bundleEmailAndName($from, $this->fromName) : $from); foreach($this->header as $key => $value) $header .= "\r\n$key: $value"; $param = $this->wire('config')->phpMailAdditionalParameters; if(is_null($param)) $param = ''; foreach($this->param as $value) $param .= " $value"; $header = trim($header); $param = trim($param); $body = ''; $text = $this->body; $html = $this->bodyHTML; if($this->bodyHTML) { if(!strlen($text)) $text = strip_tags($html); $boundary = "==Multipart_Boundary_x" . md5(time()) . "x"; $header .= "\r\nMIME-Version: 1.0"; $header .= "\r\nContent-Type: multipart/alternative;\r\n boundary=\"$boundary\""; $body = "This is a multi-part message in MIME format.\r\n\r\n" . "--$boundary\r\n" . "Content-Type: text/plain; charset=\"utf-8\"\r\n" . //"Content-Transfer-Encoding: 7bit\r\n\r\n" . "Content-Transfer-Encoding: 8bit\r\n\r\n" . "$text\r\n\r\n" . "--$boundary\r\n" . "Content-Type: text/html; charset=\"utf-8\"\r\n" . //"Content-Transfer-Encoding: 7bit\r\n\r\n" . "Content-Transfer-Encoding: 8bit\r\n\r\n" . "$html\r\n\r\n" . "--$boundary--\r\n"; } else { $header .= "\r\nContent-Type: text/plain; charset=\"utf-8\""; $body = $text; } $numSent = 0; foreach($this->to as $to) { $toName = $this->mail['toName'][$to]; if($toName) $to = $this->bundleEmailAndName($to, $toName); // bundle to "User Name <user@example.com" if(@mail($to, $this->subject, $body, $header, $param)) $numSent++; } return $numSent; } If the names in From: or To: headers contain umlauts, they also need to be properly encoded. My fix for the subject() function above is a bit crude, as it doesn't care for long lines that should be wrapped. There's also the mb_encode_mimeheader function in PHP which does wrapping but doesn't care for word boundaries and might cause superfluous whitespaces in between words.
    4 points
  3. Similar to above...this nugget by @diogo has served me well in the past... Also, is there a possibility to do it over the command line?
    4 points
  4. If you use the JS API no need to hide. Just make sure you disable use on other domains.
    4 points
  5. You don't have to hide it. In your Google Console Panel just add the domain name URL with wild card or only certain url addresses for that API.
    4 points
  6. Always happy to help For anybody who feels daring and wants to try it, you can find the patched module here until kongondo finds the time to test my changes. Use at your own risk Edit: Link removed since my changes have been merged into the official module. Please keep on walking, there's nothing to see here...
    4 points
  7. Hello adrian, I will test it tomorrow and post the result here. Best regards
    3 points
  8. Hi @formmailer, I'm not sure if there are better methods, but I have successfully changed a fieldname directly in the MySQL DB. The steps I have done are: open a mysql editor go into rows of table fields find the field in question and change the name in column name last step is renaming the table field_youroldname to field_yournewname That was it. Now I'm able to access it in my templates via $page->yournewname. If you are not able to open that DB live, you may also dump a mysql backup, change the names in it and restore it back, to take effect. (with module ProcessDatabaseBackup, for example)
    3 points
  9. Why not hook into Page::viewable and, if the template is documentation, apply your own logic?
    3 points
  10. @keksmampfer Welcome to the forum. You are using wrong syntax for PHP for() which is: for (expr1; expr2; expr3) Assuming you are talking about foreach(). Using foreach, your code should work within a module too. If you would post the context or function from where you call this loop within the modules class, it would be easier to help.
    3 points
  11. Setting 'requires' => array("LanguageSupport","LanguageSupportPageNames") does not help and this would break the compatibility to single language pages. Using $this->wire("pages")->get($startPage) or $this->pages->get($startPage) makes no difference. Okay i found it. The Page::localHttpUrl hook is defined at ready() and that is too late for this script. For test purpose moving the hook to init() makes the module work. So changing $this->addHookBefore("ProcessPageView::pageNotFound", $this, "renderSitemap"); to $this->addHook("ProcessPageView::pageNotFound", $this, "renderSitemap"); fixes it. Thank you for your time
    2 points
  12. @David Beesley Not sure if this will help, but if you are creating pages using some variable, say $p, inside a loop - try telling $pages to un-cache $p at the end of the loop; $pages->uncache($p); Or omit the $p argument to clear all cached pages.
    2 points
  13. No, you shouldn't leave it deactivated - it is designed to reduce dictionary login attacks. I have just messaged Ryan to see if I can find out more about the behavior of the module also recording successful logins. If that can't be changed, then you may need to set up your own access control if you want to give all users just one login account. Stay tuned - I don't want to send you down the path of setting up something else until I hear from Ryan about the behavior of this module.
    2 points
  14. You migth want to give a try to a CSS only off-canvas menus: https://www.google.hu/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=css+only+off-canvas+menu "..big mistake?" It depends but if you do not want to confuse your visitors, you need to find better solutions.
    2 points
  15. I think this might not be a bug, but even intended. It seems pages are returned without output formatting being enabled, which results in the behaviour you're seeing. Iirc bootstrapping processwire will do the same, but I'm not 100% certain on that. If you want your field settings to be respected call ->setOutputFormatting(true) on the page obj.
    2 points
  16. Keeping an eye on flexible filtering and output options I would store all the cars under the same parent and control the output via urlSegments. In this case an integer field is good and enough. Output path to list all cars /cars/ Output path to list cars builded in 1976, whereas urlSegment1 = filter-key and urlSegment2 = filter-value /cars/build/1976/ Read more about urlSegments https://processwire.com/api/variables/input/
    2 points
  17. You might find something here: http://navnav.co/ It looks like the classic "Off-Canvas Navigation Menu" is the one you might like to build upon. As for the memory problem, isn't it an image resize problem by any chance? E.g.:
    2 points
  18. Okay, thank you. If someone is interested, I have updated the MarkupSitemapXML plugin to ProcressWire 3+ https://github.com/keksmampfer/ProcessWire3-MarkupSitemapXML
    1 point
  19. Thanks for the heads up regrind MAMP - installed that and it was all a breeze. Over and out ;-)
    1 point
  20. @David Beesley One approach I've used before when importing thousands of records that need to be made into pages, is to stash the data from the external API into a work queue (php-resque or one of the WireQueue implementations) and have cron-initiated workers regularly batch-process a certain number of queue entries, creating pages for them, before exiting. I've done this for a client in the past and it works very well.
    1 point
  21. Just to clarify, I think @Konrad is talking about this: https://bitnami.com/stack/processwire You might want to consider just downloading the version from Github as the Bitnami one is now out of date.
    1 point
  22. Hello @Konrad, welcome to the Forums, If I understand you correctly, you have a Bitnami Xampp setup problem, right? Which is at this stage, not yet related to ProcessWire as such. Such an issue fits well our "Dev Talk" section, not this one, but anyway you are probably better off posting such issues here (or maybe a XAMPP community forum?): https://community.bitnami.com/ Do not get me wrong, I do not want to turn you down, you might find someone here with experience in Bitnami/Xampp. I myself have not used it for ages. If you cannot make it work, I recommend MAMP which is relatively easy to get working.
    1 point
  23. @Juergen - If you have a few moments, I think it would be helpful if you could test @BitPoet's changes to confirm they work so that these changes might be incorporated into the core. Thanks!
    1 point
  24. I think that should still work. A domain as root (just no config for it) and other domains on the parent root. But then links won't get parsed correctly, as it doesn't "know" the main domain.
    1 point
  25. Am I seeing things, or are you actually running the TinyMCE module instead of the default CKEditor? What version of PW?
    1 point
  26. No, the new versions does only support to have all domains in the root.
    1 point
  27. Do you have $config->debug enabled? If yes, does setting it to false change memory consumption? Also, you may try calling gc_collect_cycles() at the end of the loop after uncaching the page, to allow PHP to garbage collect unused objects with circular references.
    1 point
  28. If everyone has the same login username, then absolutely - that is what the session login throttle is designed to do. I think your quickest solution will be to disable the SessionLoginThrottle module. Just wanted to get that option to you quickly - I'll post some better solutions in a minute.
    1 point
  29. Ok, well let me know when you can test again later. I am guessing the error was appropriate at the time, and not related to this module. Don't worry about the session_login_throttle database table at this stage.
    1 point
  30. to use session based messages or what am I missing? no it's no pw selector, maybe I'll change wording? it enables you to provide a custom link target (useful at all) just pushed 0.1.6 with custom privacy page url
    1 point
  31. Thanks @teppo. Will put it on my to-do list to check.
    1 point
  32. Agreed. With Options field I'd suggest adding extra 10 years or so right from the start.. and if the site is still running after a decade, you can step in and add +10 years, etc.
    1 point
  33. Thanks @BitPoet...appreciate the work. I have seen the PR...Will get to it when I finally install PW 3.x/2.8 ...hopefully soon.
    1 point
  34. Um, well, I am now feeling very sheepish... I've found the problem and it is monumentally stupid of me. I was trying to include the template partial _BEFORE_ I had run the function to do the search, so of course the variable was empty! The other places I was using the variable were after the function had run! I only spotted it after spending some time away from the code. I've now rejigged the code so it works as intended. Sorry for wasting anybody's time.
    1 point
  35. What do you mean by "elsewhere"? Why don't you store the intermediate values in variable so that you can check them? E.g.: $whitelist=whitelist; bd($whitelist); $search_keywords=$whitelist->search_keywords; bd($search_keywords); $page_body .= wireRenderFile("includes/comic-search-form", array( 'search_keywords' => $search_keywords )); Also, @adrian's Tracy has a panel called "Template Resources" showing all available variables loaded for the page. If it is null in the template partial, then it should be null when it was passed to it...
    1 point
  36. Quick update: it turned out that the problem of blog_files not being added to the template is due to $this->files somehow having become a reserved variable. It holds an instance of WireLog instead of the blog_files field created earlier, though I haven't spotted the part in the core where this happens yet. However, changing $this->files to $this->blogfiles fixed the problem. I'm now going to run some tests. Stay tuned.
    1 point
  37. @antoiba86: I don't think downgrading is really an option. But I've already got the magnific and markup issues sorted and am working on the issue with the blog_files field, so a 3.0-compatible version is around the corner. @kongondo: as I've got a few sites running on 2.8, I try to stay clear of namespaces anyway
    1 point
  38. Actually there was no need for version_compare(): hooking into something that doesn't exist doesn't seem to cause any issues. While hooking into savePageOrFieldReady would make sense, at this point I'm not ready to ditch 2.x support, and since that's not an option, I don't really see any benefit in it Latest version, just pushed to GitHub, fixes one minor bug and adds support for saveFieldReady.
    1 point
  39. Thanks Tom. It would be nice if you can look into the issues. I'm currently testing all existing 'tracking' modules for a project. Also please look in the ProcessChangeLog thread (and the thread linked to) since it faces similar issues.
    1 point
  40. Wanted to mention that there's a new dev version https://github.com/somatonic/Multisite/tree/dev2 that we are testing and using right now. It was tested and works with multilanguage and PW3 various features.
    1 point
  41. @Can Good to point this out. But already with a simple contactform you need cookies. I stay with your module as default. Edit: I ended up with a combination. Added the following code to my config.php /** * if we would use cookies only for the admin area * */ $config->sessionAllow = function($session) { // if URL is an admin URL, allow session if(strpos($_SERVER['REQUEST_URI'], $session->config->urls->admin) === 0) return true; // if there is a session cookie, a session is likely already in use so keep it going if($session->hasCookie()) return true; // user accepted cookies due to EU law (Module MarkupCookieConsent) if(!empty($_COOKIE['eu-cookie'])) return true; // otherwise disallow session return false; }; Small request: I would like to set a more specific target to the privacy policy page including an url fragment string like /privacy-policy/#cookies Would be nice to have an inputfield to add this to the url of the target page. Actually don't need this now but having an option to define an external page would be nice too. I don't really get the usage of Link Target -> Custom Selector Is it just to get the target frame by name according to the html attribute, or is it a kind of PW selector?
    1 point
  42. Is imagefield set to return a single image? This looks like you're accessing the data from a Pagefiles object. In that, case, this should work: echo $site->pages->get(pageid)->imagefield->first()->httpUrl;
    1 point
  43. A new band website for the German electronic avant-garde band DEINE LAKAIEN. The idea was to make this an introduction website for media and new listeners. For in-depth information, the website is accompanied by another new ProcessWire website (with an integrated xenforo forum) for the fanclub: colour-ize.com. and the label website chrom.de. All three websites use the same UI and re-occurring elements (while preserving a unique look), so people find their way around easily. Design/programming details: It was tried to make the dark look (which is the band CI) feeling modern and artistic (avoiding a Nineties look which so many dark themed websites have). The website is built in my spare time in 5 weeks thanks to the ease of ProcessWire 3 and is fully responsive (using uikit and Hype). ProcessWire's new language features were more than welcome to make language management a breeze (People coming from WordPress know what I mean). The backend is build in a way that non-techies (band, volunteer translators, fanclub, booking) can handle the CMS without needing much support and knowledge of SEO. Everything is explained or almost self-explanatory. And the complex internal link-building is done either fully automatic or half automatic.
    1 point
  44. Trekkerweb Supply & Demand https://markt.trekkerweb.nl/ Trekkerweb.nl brings agricultural mechanization news and supply & demand together in a single online platform for all the tractor and machine enthusiasts and others interested in the mechanization sector. The site is multi-language with English as default. None Dutch browsers will get the English version of the site, currently we are finetuning the German version which will be available somewhere in the near future. The search page in English and Dutch language - https://markt.trekkerweb.nl/search/ - https://markt.trekkerweb.nl/nl/zoeken/ Used modules Profields Table Profields Textareas MarkupLoadRSS (fetches brand related new from the main website) PageImageManipulator 2 (PIM2) (for placing watermark image) ProCache ProcessGetVideoThumbs TextformatterVideoEmbed WireMailSmtp LanguageSupport (Site is multi language: Dutch, German and Default English) Couple of custom made modules for user profiles and cross page linkage of the datamodel (Bower) components awesome-bootstrap-checkbox bootstrap-dropdowns-enhancement-sass bootstrap-sass bootstrap-select font-awesome formvalidation.io hashids jquery jquery-file-upload jquery-throttle-debounce jquery.mmenu js-cookie lifestampjs moment semantic-ui-sass verge Front-end user profiles (custom module) Account registration Customizable fields (in module settings) Per field privacy configurable (private, public, on a per user basis). Front-end login/ logout Reset password Email activation for account Request activation mail View profile Public profile Edit profile Set profile picture (cover image and avatar) Modify password Language choice Profile dashboard Front-end Ads management Create new ad Edit existing ad Manage media (images / video) Preview and approve ad Remove ad Data model Categories Subcategories Brands Input fields Options An intuitive data model drives the whole site. A couple custom made modules take care of the cross page assigning of categories to subcategories and brands. Per subcategory we are able to assign the related input fields and options which will be rendered on the 'Create new ad/ Edit ad' form page and combined with the given values rendered on the ad detail page. Database caching + Pro caching One of the challenges was to keep the whole project as low weight as possible. Since the data model with categories, subcategories, brands, inputfields and options is the backbone of the site we came up with the solution to have the names, titles, ids, and relations between them cached. Completely as json/javascript with pro cache and separated with database caching. With the Wire Fuel we made the $dm object available for accessing anywhere in PHP and globalJS.dm from within javascript. This means the whole data model is called only once per request, and while it exists in the database cache and pro-cache it is incredibly fast. Subcategory page The first image shown below represent one of the subcategories (Tractors) with assigned categories, brands, input fields and options. The image there after is a screenshot of the add ad page, where the input fields, options and brands are dynamicly rendered after being loaded via Ajax. Other features cookie based favourites cookie based last-viewed list advanced filter search related ads Thanks to the whole team (Ferdi, Bastiaan, Alex, John, Hessel) and last but not least Ryan for creating ProcessWire and all module developers out there
    1 point
  45. API to change field settings: $field = $fields->get(164); $value = "newoption\n1=oldoption1\n2=oldoption2"; $module = $modules->get('FieldtypeOptions'); $result = $module->manager->setOptionsString($field, $value, true); var_dump($result); /** * description of function setOptionsString() found in Class SelectableOptionManager.php * Set an options string * * Should adhere to the format * * One option per line in the format: 123=title or 123=value|title * where 123 is the option ID, 'value' is an optional value, * and 'title' is a required title. * * For new options, specify just the option title * (or value|title) on its own line. Options should * be in the desired sort order. * * @param Field $field * @param string $value * @param bool $allowDelete Allow removed lines in the string to result in deleted options? * If false, no options will be affected but you can call the getRemovedOptionIDs() method * to retrieve them for confirmation. * @return array containing ('added' => cnt, 'updated' => cnt, 'deleted' => cnt, 'marked' => cnt) * note: 'marked' means marked for deletion * */
    1 point
  46. Over time we have often had discussions about the nature of Pages and the fact that the term 'Pages', in context of ProcessWire(PW), can be misleading. Pages can represent a lot of things and serve multiple goals. (fun read: https://processwire.com/talk/topic/2296-confused-by-pages/ ) You are right that Pages can be seen as (URL accessible) data objects. What data a particular Page can hold is defined via the page his Template and the Fields added to that template. So a Template can, amongst other things, be seen as a data model. ProcessWire has its own way of organizing and relating data. While the underlying database structure might be different than most MVC-ish systems, the Page tree and the Page fieldtype allow for really flexible ways of achieving most, if not all, of the traditional model associations like in Rails' Active Record. Finding and working with pages/data couldn't be easier thanks to the great API, so i don't think there is a need for an 'ORM' because in a way PW already has this.
    1 point
  47. One more: Loop pages in ProcessWire without building a $pageArray. This is useful for when a find() would return too many results to keep in memory. $selector = "template=pages_template"; // as an example while (1) { $p = wire('pages')->get("{$selector}, id>$id"); // get page with id bigger than previous if(!$id = $p->id) break; // assign current page's id to $id or break the loop if it doesn't exist // do stuff using $p as the current page wire('pages')->uncacheAll(); }; This served me well when I had to modify thousands of pages in one go. Works great with bootstrapping from the terminal because it doesn't affect the viewing of the website.
    1 point
  48. According to autocomplete documentation you'd have to do something like this (works). $('#search_query').autocomplete({ source: function(request, response){ $.ajax({ url: '/search/', type: 'get', dataType: 'json', data: { 'q': request.term }, success: function(result){ response(result); } }); }, minLength: 2 });
    1 point
×
×
  • Create New...