Jump to content

kongondo

PW-Moderators
  • Posts

    7,479
  • Joined

  • Last visited

  • Days Won

    146

Everything posted by kongondo

  1. In that case, it's probably useful to show a PW warning notice for Superusers that some pages are hidden even for them. You might get tired of seeing the warning though :-)...but that can be set to show once per login session I suppose.
  2. Excellent work on solving this! I am curios though, how would upgrading MySQL cause this? It seems the site was working OK pre-the upgrade.
  3. Thanks for this! A while back (actually, a long time ago), I thought I'd checked them all but it seems there's quite a number of new kids on the block (unless I missed them first time round ). I would have loved a Pivot Tables feature (aggrid has this in the paid version). Sorry to hijack your thread Bernhard...
  4. OK. Since your priority is to get you site up and running, is it possible to, are you able to create an alternative database using your older MySQL version? Assuming you have a backup of the site pre-the upgrade, you would then import it into the new database and point ProcessWire to that. That would give you a breather to sort out your main issue. Just thinking out loud here. You've probably thought of these things already.
  5. If it's possible to rollback to the original MySQL, I suggest you do that first. Then, on a separate install (even a local one), test as you incrementally upgrade MySQL.
  6. I'd never heard of this grid, so thanks! I just had a quick look and it looks very powerful. Btw, I couldn't find info about the differences between the free and paid versions. Do you know what these are? Thanks.
  7. It's always off when bootstrapping, so no need to set it yourself.
  8. Hi @Sabrina, I've removed the link in your post. Given that you are a first time poster and there is no indication that you are using ProcessWire, your link could have been subtle advertising. This is not allowed. If I am wrong, please clarify. We'll be happy to help if your site is made using ProcessWire.
  9. I might not be getting the full picture here but... It should be found if you use 'include=hidden' in your selector. Assuming the hidden pages will always refer to their parents... $search = $pages->find('body%=something, include=hidden'); $out = '<ol>'; foreach ($search as $s) { // if page hidden, grab url of parent if($s->isHidden()) $url = $s->parent->url; // if at the top of the tree, just return the found page URL elseif($s->rootParent == $s) $url = $s->url; // normal find else $url = $s->url; $out .= '<li>' . $url . ' (original path: '. $s->url.')</li>';// just for testing } $out .= '</ol>'; echo $out; You might want to change the logic a bit
  10. Actually, you might not even have to rename it. If you save it in /site/modules/, ProcessWire will tell you that you have two similar modules, one in /wire/modules/ and the other in /site/modules/. It will give you a choice to decide which one to use. You'll choose the one in /site/. I'd go for renaming it though to avoid confusion and also so that the one in /wire/modules/ can still be used for its normal purpose.
  11. Yep. Here's the relevant section. http://processwire.com/api/multi-language-support/code-i18n/#translation-function-calls-must-be-on-one-line-and-in-one-pair-of-quotes
  12. Depending on your use case, here's two other options Clone PageAutocomplete, rename the file and class, .e.g PageAutocompleteCustom, edit it to do what you need. The advantage here is portability, no need to Hook into anything, get to know the inner workings of ProcessWire (especially Pagefields, etc). Lister/Lister pro: This option depends on what you mean by 'keyword'. If it means some other ProcessWire property, you can easily filter results in Lister using various criteria
  13. I get you now. You are not talking about ProcessWire /admin/child/....(i.e. children of Page with ID 2) but hidden pages in general. In that case, the module class name, title and description are misleading IMHO. Maybe change to something else?
  14. . Hmm, aren't admin pages hidden for non-superusers by default?
  15. Cool. Just optimise it with get() instead of find(). You could also use OR:groups selector. <?php $existing_name_check = $pages->get("name=$post_name"); $existing_email_check= $pages->get("submission_email=$email"); if (count($existing_name_check)) { $session->redirect("?alert=existing-submission"); } else if (count($existing_email_check)) { $session->redirect("?alert=existing-submission"); } else { // create page $session->redirect("?alert=form-success"); } // OR...make it shorter $exists = false; if($pages->get("name=$post_name")->id) $exists = true; elseif($pages->get("submission_email=$email")->id) $exists = true; if ($exists) { $session->redirect("?alert=existing-submission"); } else { // create page $session->redirect("?alert=form-success"); } // OR..make it even shorter (OR:groups) $exists = false; // @todo: you might want to check if page is in the trash here, i.e. parent.id!=7, etc if($pages->get("(name=$post_name),(email=$email)")->id) $exists = true; if ($exists) { $session->redirect("?alert=existing-submission"); } else { // create page $session->redirect("?alert=form-success"); }
  16. I suspect that's the issue. According to Profields: Textarea docs, you have to search the entire field. Since you want to search for both $somePage->submissions->email and $somePage->submissions->name (assuming name is the name of one of the properties in your Profields: Textarea), based on the example in the Profields: Textarea docs, your get() query could be: $submitted = $pages->get("parent=/submissions/entries/, (submissions%={$post_name}),(submissions%={$email})");
  17. What is submissions? e.g. submissions=$post_name. What sort of field is that? if($submitted->id) means you found an existing page, so you should redirect, and not create a new page in that condition block. Here's some pseudo-ish code based on @elabx's code since I don't know what submissions is. It assumes there is a parent with the path /submissions/ . That parent page has children which have an email field. In this code, we are looking for a child page whose name matches a submitted name and whose email matches a submitted email. I am assuming name here is ProcessWire's in-built name field and not some custom field. I have also used $input rather than $_POST. I have left your stripslashes in there since I don't know why exactly you are using them. if($post->submit){ $name = trim(stripslashes($post->firstname)) . trim(stripslashes($post->lastname)); $upper_name = trim(stripslashes($post->firstname)) . " " . trim(stripslashes($post->lastname)); $post_name = $sanitizer->pageName(strtolower($name));// I am assuming ProcessWire 'name' which is used to build the page URL $email = $sanitizer->email($post->email); $todaysdate = date("F j, Y H:i a"); // rather only get the first page // this is an OR:group selector $submitted = $pages->get("parent=/submissions/entries/, (name={$post_name}),(email={$email})"); // page with email and/or $post_name already exists, redirect if($submitted->id){ $session->redirect("?alert=existing-submission"); } // good to go, create new page else { $u = new Page(); $u->template = "submissions-entry"; $u->parent = '/submissions/entries/'; // some of these already sanitized above $u->name = $post_name; $u->title = $sanitizer->text($upper_name); $u->submissions->_date = $todaysdate; $u->submissions->full_name = $sanitizer->text($upper_name); $u->submissions->email = $email; $u->save(); //$u->setOutputFormatting(false);// @question: why do you need this? $session->redirect("?alert=form-success"); } } // show new form else { //$session->redirect("?alert=form-failure"); }
  18. HI @Jim Bailie. Welcome to ProcessWire and the forums. I don't quite understand the question. ProcessWire does not output anything in the frontend unless you tell it to. Maybe if you could expound a little bit on your question? Otherwise, it's as simple as: if('your condition here') { // do this } else { // do that } As for Ajax..just to elaborate on @elabx's answer if($config->ajax) { // ajax request sent; output ajaxy response stuff and exit; $data = array('foo', 'bar'); header('Content-Type: application/json'); echo json_encode($data); exit;// or use PW halt() if it suits your needs } // echo normal non-ajax stuff
  19. JavaScript, CSS and $this->wire('files')->render('your-file') in Runtime Markup code setting . 'your'file' has the PHP. See video demo below. Works on the fly, no need to save first + shows what's already saved. I do . See video demo. Another option is RM as suggested by @Sergio. See this quick demo. I can post the code later in RM's forum. Picture Options is a Select Options field. Options Illustration is a RuntimeMarkup Field.
  20. Glad that part work. Hmm. Doesn't work on both OS?
  21. I think it would work. $files->($zip, array|string $files)
×
×
  • Create New...