Jump to content

ryan

Administrators
  • Posts

    17,304
  • Joined

  • Days Won

    1,724

Everything posted by ryan

  1. I tried to reproduce that here, but it seems to be returning the expected result for me: $items = $pages->find("title|body|parent.title%=France"); Here's the results I got. The "title" matches the first item, and "parent.title" matches the rest of the items (which don't include "France" in any of their fields). They all have a blank 'body' field. /regions/europe/france/ /regions/europe/france/arles/ /regions/europe/france/avignon/ /regions/europe/france/beaune/ /regions/europe/france/blaye/ /regions/europe/france/bordeaux/ /regions/europe/france/cadillac/ /regions/europe/france/chalon/ /regions/europe/france/conflans/ /regions/europe/france/giverny/ /regions/europe/france/les-andelys/ /regions/europe/france/lyon/ /regions/europe/france/normandy-beaches/ /regions/europe/france/paris/ /regions/europe/france/pauillac/ /regions/europe/france/rouen/ /regions/europe/france/saint-emilion/ /regions/europe/france/strasbourg/ /regions/europe/france/tournon/ /regions/europe/france/vernon/ /regions/europe/france/vienne/ /regions/europe/france/viviers/
  2. The skyscrapers profile is available for download so you can see how it's put together. But for the most part, you would build these things the same way as if ProcessWire wasn't there. Then once working, take advantage of the fact that you can pull the data to populate these things from PW. This is not something PW will do on the front-end for you, since it's not generating markup. But this is something you can do very easily on your own… again set it up as if PW wasn't there, then modify it to pull the data to populate from PW. While we're probably not big enough to be a target, I feel good about the security of the core product and have always made security the first priority in development. But security is a factor that goes well beyond the core product. First, PW will only be as secure as the modules you have installed to it. I do my best to keep up-to-date with modules that go into the directory and notify the author if I find any potential security issues. However, this isn't guaranteed as I can't always keep up with everything. Secondly, PW is about as secure as PHP. Meaning, it can be very secure, or not secure at all, depending on how you code your own templates and use PHP. So if you get into handling user input, as you would with processing forms, search engines, etc., then you yourself have to follow PHP best practices towards maintaining good security. ProcessWire does provide several helper functions via the $sanitizer API variable, and I recommend using them when handling user input.
  3. Templates are the recommend way to manage access. While you can accomplish almost anything with this access control, sometimes you can find a more specific way better for your own needs by using PW's access control hooks. The most common being: Page::editable and Page::viewable. However, if you really are talking about only 4 section pages, I would save yourself the trouble and use the built-in recommend method with access control templates. Locking the section pages for edits (like Soma mentioned) is also a good way to keep them from modifying them outside of template access control. If the user doesn't have page-lock permission, then they won't be able to unlock the locked pages. If you ultimately decide you want the fine-grained control of access control hooks, let us know and we can post an example or two to get you started.
  4. I don't think we can do that because a parse error generated as a result of wrong PHP version will occur before ProcessWire can even perform a getModuleInfo() call on it. Module info would have to be stored in a separate file in order for PW to identify and prevent that sort of thing. Even that, or PW would have to file_get_contents() the PHP file and manually parse it looking for that info (which doesn't seem worth it). Though adding support for optional external module info files is something I would like to add at some point.
  5. I think the main value/intention of template labels is for language support. In this manner, you can have something that makes sense with the editor's language, even if different from the developers language. Most of the time, I do not use template labels, as I prefer to just have the template name. Though if I was doing a lot more multi-language sites, I would probably prefer template labels.
  6. I'm not sure that I follow exactly what you are trying to do. But one thing to keep in mind is that a Page can literally be mapped to anything. So while your form field may involve a page selection, you could then say "this page maps to this form" and "that page maps to that form". You could even make the template for that page load a specific form. In Form Builder, you can also specify defined lists of selectable items outside of Pages. So you might just enter each of your selectable items to be the same as the name of a form.
  7. You saw this when first starting the installer, or after completing the database config screen?
  8. How much do you need to know about the portal.domain.com authenticated user on client1.domain.com? Do you just need to know that they are logged in, or do you need to connect them with another account on client1.domain.com? I'm just trying to better understand the extend of access control needs at client1 and whether this is a simple authenticated "yes or no", or broader in scope.
  9. @chim77richalds do you have access to the Form Builder support board? If not, let me know your order number so I can update your access. Also, please post the exact text that you are pasting in the success box.
  10. (Topic moved from Getting Started to Dev Talk) Looks like a good setup! I'm not totally clear about exactly what Homebrew is, but I love the name.
  11. If you need to retrieve a bunch of pages by ID, then getById() is much better than a foreach with get() simply because getById() does its primary work with one query, whereas get() does at least one query per call. But getById is also one of those things that most people will probably never use (it's largely an internal use thing). As a result, it probably just belongs in the 'advanced' API section.
  12. I would really avoid using the h4 title as a URL segment as it seems like a potentially very fragile solution. Page numbers would probably be a little less fragile. If the editor really can't handle repeaters, I'd suggest using <hr> (or something else nice and direct like this) as the page delimiter rather than an <h4>, and sticking to page numbers rather than URL segments.
  13. We have always used ASCII on fields within tables that are for page names (or other names that can't ever contain anything UTF8). Though the tables themselves are always UTF8, even if an individual field within might be defined as ASCII collation. Can you see any potential problems with doing that? Maybe some MySQL version or setting doesn't like this? The "/?/" means the error occurred before PW determined what the current $page was going to be. Everything is UTF8, except for "name" fields. They certainly could be UTF8 too, but figured it would be a better practice and more efficient to enforce ASCII on a field where only ASCII characters allowed. But it sounds like maybe there are issues with doing that I'm not aware of? Though if that were the case, I would also wonder why MySQL would let you change the character set on a field-by-field basis if it wasn't okay to do. This is the first "Illegal mix of collations" error I've heard of in PW.
  14. Thanks Soma, I can reproduce that. I was not using a segment for my default language, so hadn't noticed. It should be fixed on the dev branch.
  15. Big thanks to Mats for the alltpaoland.com example and his clustering updates to my RCDMap class. With these available, I was able to learn enough (and admittedly copy enough!) to make the map project come together: http://www.synbioproject.org/library/inventories/map/ ... my code is a little messy, but it all works for the deadline, and I can go clean it up later. Beyond Google Maps, tools used here are jQuery Mobile, ProcessWire 2.3, ImportPagesCSV module, and ProcessWire Form Builder (for the add/edit map submissions). Thanks again Mats! I don't think I could have made much progress without your alltpaoland site as an example/guide.
  16. No the session should still be active even if they close the browser. Now if they completely quit the browser, that might be different.
  17. It sounds like what you want is instead the MySQL login info? If so, you can put it in a .my.cnf file in your home directory: /home/samuel/.my.cnf [client] user=your_mysql_username pass=your_mysql_password Following that you can access the mysql/mysqldump clients without specifying a username or password. This is helpful for automated backups or [i'm guessing] git based workflow.
  18. Don't worry, I understand. No need to explain, we're all on the same $page. Just trying to make sure I follow up good questions with good answers.
  19. When/where are you guys seeing the 'guest role required' message? Just wondering if this is something that should be fixed in the core ProcessUser module? I guess I haven't noticed this before.
  20. Don't count on the editor though. Make sure you are sanitizing at the server side with HTML Purifier. Rich text editors like TinyMCE and CKEditor don't do any server-side sanitization (they can't, since they are JS apps). So while it may look like they are sanitizing and validating, they can be bypassed easily.
  21. Nice job Soma! Lots of good thinking here, and I like where you are going with the scalability. I look forward to seeing this in the modules directory.
  22. You can go even shorter if you want to <title><?=$page->{'alt_title|title'}?></title>
  23. I'm not sure that I understand exactly what you are trying to do with asmSelect? But it is fairly straightforward to replace the "add new page" process. To do this, copy the existing /wire/modules/Process/ProcessPageAdd/* to /site/modules/ProcessPageAddLuis/. Then rename the class and filenames to ProcessPageAddLuis. Now login to your admin and install the ProcssPageAddLuis module. Then navigate in the tree to Pages > Admin > Page > Add New Page. Edit the "Add New Page" page. Change the "process" field from ProcessPageAdd to ProcessPageAddLuis. Save. Now edit your new module to work how you want it to. It should be safe through upgrades as well.
  24. @adamspruijt it looks like the download link is broken on the http://modules.processwire.com/modules/metro-wire/ listing. Could you update it? Thanks, Ryan
  25. This is what I'd expect to see. This is kind of a mystery, as the language pack shouldn't make any difference here. I'll have to experiment and see what's up. I was going to go take a look at the MetroWire theme, but looks like it's no longer available for download. I'm getting a 404 when clicking the download link: http://modules.processwire.com/modules/metro-wire/
×
×
  • Create New...