-
Posts
7,479 -
Joined
-
Last visited
-
Days Won
146
Everything posted by kongondo
-
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.
-
HEEELP! This request was aborted because it appears to be forged!
kongondo replied to Pixrael's topic in General Support
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. -
Preview/Discussion: RockDataTables
kongondo replied to bernhard's topic in Module/Plugin Development
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... -
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.
-
Preview/Discussion: RockDataTables
kongondo replied to bernhard's topic in Module/Plugin Development
Ah, I see, thanks. -
Preview/Discussion: RockDataTables
kongondo replied to bernhard's topic in Module/Plugin Development
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. -
It's always off when bootstrapping, so no need to set it yourself.
-
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.
- 1 reply
-
- 3
-
- javascript
- plugin
-
(and 2 more)
Tagged with:
-
[SOLVED] Best way to search a site including hidden child pages
kongondo replied to Juergen's topic in General Support
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 -
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.
-
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
-
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
-
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?
-
. Hmm, aren't admin pages hidden for non-superusers by default?
-
On form submit, check if field values exist
kongondo replied to louisstephens's topic in API & Templates
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"); } -
On form submit, check if field values exist
kongondo replied to louisstephens's topic in API & Templates
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})"); -
On form submit, check if field values exist
kongondo replied to louisstephens's topic in API & Templates
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"); } -
Is it possible to use HTML tags in log files and how?
kongondo replied to Juergen's topic in General Support
No . Tested... -
Ajax - Send raw template only, without _main.php
kongondo replied to Jim Bailie's topic in General Support
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 -
Let me know if you need help .
-
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.
-
☁️ Duplicator: Backup and move sites
kongondo replied to flydev's topic in Module/Plugin Development
Glad that part work. Hmm. Doesn't work on both OS? -
☁️ Duplicator: Backup and move sites
kongondo replied to flydev's topic in Module/Plugin Development
I think it would work. $files->($zip, array|string $files)