Jump to content

woop

Members
  • Posts

    70
  • Joined

  • Last visited

Everything posted by woop

  1. woop

    Lister

    Sure, that could work but I don't think people see it as an additional filter. It feels a bit too specific. I made a quick mockup of my initial suggestion. I'm thinking that the boxes shows up when you hit the "actions" tab - since that's the only place where they'd be needed.
  2. I've always had major issues with keeping my session logged in ever since I started using Processwire. Both on mobile with my phone and on wifi with the laptop. Setting sessionFingerprint to false fixed all issues. Maybe the fingerprinting is a bit too harsh?
  3. woop

    Lister

    Thanks! Yeah, it's fine if it's something you'll only do once - like data cleanup in your database. But I'm thinking that Lister is close to becoming a great moderation tool as well. As a developer, you could just set up a Lister-page called "Incoming stories" and have your reviewers use that listing to review any user-submitted posts. But they would need a quicker way to manage the post, than applying extra filters. Typical use case: Lister shows 10 new, unmoderated story posts. 2 of them needs to get deleted right away because of spam. 3 of them are missing proper categorization and needs to get the tag "tech" added. 1 is of too poor quality and can also get deleted. 4 of them are ready to get published on the site. Being able to quickly apply an action to eg. 3 of 10 items would be a huge productivity boost in this case.
  4. woop

    Lister

    This looks great! I'm just missing a way to apply actions to selected items in a list. Eg. using checkboxes to the left of each item (think Gmail). Some selections, based on eg. quality, can't be handled through automatic filters.
  5. Ok thanks! The same problem appears in Ryan's Skyscraper template - so maybe it's a core issue, then? I'll leave it for now
  6. Thanks for this! I'm trying to list unpublished items in an RSS feed for moderators to keep track on new items. Can't seem to get "status=unpublished" to render any results when I use it in the RSS template, though. Works fine for other templates. Any idea?
  7. Thanks! But isn't that what I'm already doing in search.php? if($q = $sanitizer->selectorValue($input->get->q)) { // do search } else { // don't search }
  8. Same problem in Chrome, at least. URL is encoded, see this as an example: http://processwire.com/skyscrapers/search/?keywords=%26&city=&height=&floors=&year=&submit=Search
  9. I'm using GET. Should be the same code as the skyscraper profile, I think. head.inc: <form id='search-form' action='<?php echo $config->urls->root?>search/' method='get'> <input type='text' name='q' id='search_query' placeholder="Search..." value='<?php echo htmlentities($input->whitelist('q'), ENT_QUOTES, 'UTF-8'); ?>' /> <button type='submit' id='search_submit'>Search</button> </form> search.php: if($q = $sanitizer->selectorValue($input->get->q)) { }
  10. Hi! I noticed a suspicious search string in my website's logs. Someone searched for "&", which causes an error. I noticed that the same string causes an error on the Skyscrapers demo site: http://processwire.com/skyscrapers/search/ Is this something to something to be worried about? -- Error: Exception: Unknown Selector operator: '%=&' -- was your selector value properly escaped?
  11. Thanks! You've managed to articulate my problem in a much better way than I ever could. I'll have to think some more about this. Advanced search isn't an option, unfortunately. I don't think my users care enough to use one if the standard search doesn't work. I'll probably go with regular search and fall back on #2, so I at least can present some results.
  12. Thanks! That almost does it, I think. Seems like it requires a match in both author and title, though. It would be fine for searches like "harry rowling", but wouldn't work for just "harry". Here's how I've been trying to solve it (but the code doesn't work). Maybe it clarifies my thinking. $p = new pageArray(); $p->import($pages); $queryArray = explode(" ", $q); // create an array with all the words foreach($queryArray as $word) { $m = $p->find("title|author|year|genre%=$word"); $p = $m; // redefine the pageArray to only include previous matches }
  13. Hm. This doesn't get me any results. How would $titlePages->find("id=$authorPages"); work?
  14. Sorry. Doesn't seem to work. I don't get any results at all. Changed makeNew to new PageArray(); since that got me an error. Also removed spaces between id and equalsign in the selector. Still no luck. Thanks anyway!
  15. Not sure I follow. Like author|title*=$q,?
  16. Thanks! This helps me avoid empty results but doesn't seem to help specifying the search further. Eg. "rowling potter" now returns both the right post and other books made by rowling. The ideal result would be to only match the harry potter book by rowling. Does that make sense?
  17. Hi! I'm trying to create a search function where a search string could be a mix of different fields. eg. "Rowling Potter" should return the post that has both author="J.K Rowling" and title="harry potter". If set up my selector like author|title*=$q, it will won't return anything since it expects the full string to fit into either the author-field or the title one.
  18. Hi! I'm no php expert but I thought I should share my way of redirecting URLs from my old site setup. I'm going to use Drupal urls in this example, but should work for any url. I can't guarantee this is the best way of doing it, so please feel free to correct me if you have feedback regarding security, speed or similar. Step 1: Make sure that each page in PW has some kind of connection to its previous URL so it can recognize when a redirect needs to be done. I'm going to use the node id:s and taxonomy id:s that my pages had when they were located in Drupal. I've made sure to save them all into each processwire page in a field called "drupal_id". Maybe you could just save the old URL in a field when migrating and use that, as an alternative. Step 2: Open head.inc and add this to the very top: $thisurl = $sanitizer->url("http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"); // Check if the URL reminds you of the old url scheme if (preg_match("/com\/\?q=/", $thisurl)){ // if it looks like a node url if (preg_match("/\?q=node\/[0-9]*/", $thisurl, $nodeslug)){ $oldnid = preg_replace("/\?q=node\//", "", $nodeslug[0]); if ($match = $pages->get("drupal_id={$oldnid}")){ $session->redirect($match->httpUrl); } else { $session->redirect($config->urls->root); } // If it's a taxonomy url } elseif (preg_match("/\?q=taxonomy\/term\/[0-9]*/", $thisurl, $taxonomyslug)) { $oldtid = preg_replace("/\?q=taxonomy\/term\//", "", $taxonomyslug[0]); if ($match = $pages->get("drupal_id={$oldtid}")){ $session->redirect($match->httpUrl); } else { $session->redirect($config->urls->root); } } else { $session->redirect($config->urls->root); } } Regex is used to find URL schemes and extract drupal nids and tids from the url. These are then looked up using the api, only to return the new url. Each time the url redirect fails, it might be suitable presenting a warning to the user. I've added something like $session->message("This URL seems to have changed. Please use the search if you didn't find what you were looking for") on the line before redirect (not part of the code example above, for simplicity's sake). Hope this can be useful for someone else, too. And again, feel free to leave feedback! I'm here to learn, too
  19. True! I didn't catch it either which is why we're having this discussion in the first place. haha Logically, it makes sense, but it's hard to understand the home icon. agreed. What if the home icon was replaced with the root domain in text? Eg. mysite.com > admin > pages. Only downside is that it's longer - but the PW breadcrumb is normally never longer than 2-3 items.
  20. Super useful info in here! I've created a new log file to catch all the spam using the method Ryan describes. Now, the file is getting big rather quickly (go figure)... Any way to limit the amount of logs that gets saved? I only need the last 100 to make sure everything is working correctly.
  21. oh ok. Well, if the breadcrumb always starts with [home icon] > Admin >, then I think the home icon is enough. The "Admin" part states that you're inside the admin, so it makes sense for the home icon to have the "view site" functionality. No need for two buttons, imo. Thanks for clarifying!
  22. Looks great! Can't wait to have this on my site. The only thing I'm missing (as far as I can tell from the screenshots) is a global link to "View site". I think it's a major usability benefit to be able to quickly access your site from anywhere in the admin. Might I suggest a small icon the right of the "Profile" icon in the menu bar? http://fortawesome.github.io/Font-Awesome/icon/external-link/
  23. Hi! I'm getting an "unrecognized path" error when my Editor user is trying to access his profile in the processwire admin. I've enabled the "Profile-edit" permission for his user role, but maybe that won't do it? Is this issue related to the one described above? I've recently moved my installation, but I'm getting the same error on the beta subdomain (where it was first installed). Any clues?
  24. Thanks! This module is absolutely great! I really like the simplicity of it. The only thing I'm missing is a way save my selector searches for later use. I often return to do similar searches.
×
×
  • Create New...