Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/04/2012 in all areas

  1. Hej! Has anyone ever tried to save & load the files in / from the S3 instead / beside of the local filesystem ? by using http://framework.zend.com/manual/de/zend.cloud.html it is very esay to implement to save/load: http://blog.ebene7.com/2011/01/21/amazon-s3-mit-php-stream-wrapper-verwenden/ - but will PW work with it? By module? Or even better: a plugin that automatically saves/serves any files handled by the backend.. We will now try to build this, but we'll also happy about any thoughts about it!
    2 points
  2. Because users and roles are also pages, you just have to use a normal "page" fieltype for this. When creating the field, go to the input tab, and choose user as the "template of selectable pages". Still on the input tab, insert roles=1013 on the "Custom selector to find selectable pages", where 1013 would be the ID of the given role.
    2 points
  3. Does anybody know if there is a module / fieldtype to generate a dropdown menu for a specified list of users for a given 'role'. This would be handy to assign a page specifically to a user. This would be handy when using the API on an external form (e.g. a non-CMS user) could list/edit/update their related page(s).
    1 point
  4. I had a nagging question: how do I build copy in the admin, check it in the real site but not allow people to see it until I am sure it is all correct. Of course it's simple and likely 100% of you knew this already, but just in case you are like me and didn't quite know, this is it: create a page but don't click 'Publish' on the page's Settings tab click 'Hidden' publish the page edit it as much as you like click 'Save + Keep Unpublished' log out, login, re-read your copy after a nice walk to see if you can improve it want to see your page in-situ (as it will look when it's visible)? Click 'View' and you see a private, unpublished but as-it-would-look version of the page as it is now repeat 4. and 5. as much as you like until you're ready to release your masterpiece, at which point just un-tick 'Hidden' and re-save click 'Publish'. Update: edited above as it's even easier than I realized, thanks Ryan for correcting me Happy editing.
    1 point
  5. Yes, always sanitize anything that gets sent to any API call. If you don't, then anyone can inject anything into that selector just by specifying it in your signup_name field. While I can't think of a major problem that could occur with that in your example, it's best to prevent any injection situation. The stakes may be higher in another situation. That's because selectors are designed for your use, not the users. API calls run as superuser, so it's feasible that in some scenario a hacker could exploit an unsanitized selector. You can't modify data with a selector, so it's not at the same level of concern as something like SQL injection, but still a good idea to sanitize anything getting sent to any API call. Except for $sanitizer API calls of course.
    1 point
  6. I just updated the Input class so that you can now unset URL segments. Use the existing $input->setUrlSegment($n, $value); function, but specify null as the $value for the segment you want to unset. When you do that, it'll unset the segment and reindex. For instance, lets say you had page /about/products/a/b/c/ where /a/b/c/ are the URL segments 1, 2, 3. If you call $input->setUrlSegment(1, null); then /b/c/ would be segments 1, 2 (and no more 3).
    1 point
  7. OK thanks for taking the time to explain that! I think allowing for empty fields will make me a better coder in the long run anyway!
    1 point
  8. Make sure you do this before putting $username in your selector: $name = $sanitizer->pageName($input->post->signup_name); $u = $users->find("name=$name"); While you don't want to have that directly in your selector either way (since it would be unsanitized), I just wanted to add that when you are dereferencing object properties in a string, it's best to surround the statement with {}, like: "{$input->post->signup_name}"; and that should solve the problem.
    1 point
  9. I've been offline for the weekend since Friday, sorry to be stepping into the conversation late. I'll be happy to implement an unset function for url segments, but wondered if it should just unset, or should it also reindex the url segments that are remaining? For instance, if you have both urlSegment1 and urlSegment2 set, and you unset urlSegment1 should urlSegment2 take the place of urlSegment1?
    1 point
  10. Great!! Everything is working very well on a fresh PW install with only this module activated. The navigation and all the links of the default site with the original code unchanged work very well. Suggestions for the Docs: instruction to check "Allow Url Segments" on the language template is missing. would make sense to suggest to check "Hidden: Excluded from lists and searches" on the language pages.
    1 point
  11. The answer to this may help others, I hope. It is not ProcessWire (I didn't think it was but I was hopeful someone else might have had some related knowledge that might have helped hence bothering you guys here). I had already spoken to the hoster in this case to work out which php.ini file was to be edited. The answer is interesting and easy: as I was running a website with FastCGI the php.ini file just above the httpdocs location was the one to edit, not the overall one often found in /etc/php.ini. All good, I edited it. But the problem remained. So a call to (mt), the hosters for this site, and they quickly found and fixed a one-time file that stops FastCGI working with files greater than 128KB. They upped the limit for this file to 1GB and so now this site and any others that use FastCGI will practically be controlled by the settings in their php.ini files. Result: all is working beautifully I hope this is helpful to someone else and thanks again PW people for this superb product. Cheers, -Alan
    1 point
  12. Another update I worked on I commited just now. The theme has now a modules navigation dropdown. It shows all modules by section. Uninstalled modules have only a anchor link to the modules page, it will scroll to the module. If you're already on modules page it will also scroll to the module. All installed modules will get you to the edit screen of the module. Configurable modules are marked with the gear icon. Enjoy.
    1 point
  13. Just wanted to mention that I added $input->urlSegments to the sheet. Along with some code cleanup. I also added the possibility to link and tigger the filter/search on the sheet. Examples: http://processwire.c...ter=urlsegments You can set the advanced mode with &advanced. http://processwire.c...gments It also supports hashes processwire.com/api/cheatsheet/#input
    1 point
  14. for developers: cheatsheet tip of the day
    1 point
  15. My solution is this. I keep list of all templates I want to shown on navigation on my site/config.php file: $config->navTemplates = 'home|basic-page|news|events'; I have templates like news-item, events-item etc who didn't make to the list. And whenever I loop normal navs I check against that list: $templates = $config->navTemplates; foreach($children("limit=50,template=$templates") as $child) { ...output here }
    1 point
  16. Another option, if you want something you can reuse anytime: 1. Create a new field and call it 'redirect_url' or something like that, and use the 'URL' fieldtype. 2. Add that field to your template where you'd want to use it, or create a new template just for the purpose, like a template named 'redirect'. 3. Edit the page that you want to be a symlink and populate the 'redirect_url' field with the URL you want it to redirect to. 4. In your nav-generation code that links to the pages, do something like this: <?php $url = $subpage->get("redirect_url|url"); // use redirect_url if there, otherwise use url echo "<a href='$url'>{$subpage->title}</a>"; 5. You might also want to add this to your template that has the 'redirect_url' field: just in case there's anything linking to it directly. That way it'll send people to the right place either way: <?php if($page->redirect_url) $session->redirect($page->redirect_url);
    1 point
  17. You can change the search to include hidden pages: $matches = $pages->find("title|body|sidebar~=$q, limit=50, include=hidden ");
    1 point
  18. Nice work Philip, fills a useful gap IMO. Ryan, wonder if this one should make its way into the core at some point?
    1 point
×
×
  • Create New...