-
Posts
396 -
Joined
-
Last visited
-
Days Won
15
Everything posted by heldercervantes
-
Hi, I had to format my pc and reinstall everything from scratch. Now I'm having trouble getting a couple of sites working again on XAMPP. Here's what I did: Copied my entire htdocs folder to my backup drive, containing among other things my two websites; Exported both site's databases from phpMyAdmin. Did two versions of each, one with "Enclose export in a transaction" and "Disable foreign key checks" checked, and another with these unchecked; Formatted, reinstalled everything, smiled at my PC's recovered agility; Copied htdocs back to the PC; Created both databases on phpMyAdmin; Imported the sql files again. Launching the sites I get an internal server error. Can't see anything on Apache's logs. I tried importing both versions of the databases to the same result. Checked DB collation setting on my web server's version of one of the sites to be latin1_swedish_ci, so I replicated that setting on my local database, and still got nothing. Any ideas on what I can do next to get this working?
-
Preview Intranet Application – Office Management
heldercervantes replied to Luis's topic in Showcase
Wow, that's ambitious. It's great to see something this advanced being built with PW. Best of luck to you Luis. -
Thanks guys. Never crossed my mind that, already being logged in, I could fire $session->login again and check the result. Newbie mistake
-
Hi. I'm working on a private area for a site and reached the change password feature. In the form I want to ask the user for the current password and the new one. Can't figure out how to check if the current password entered is the correct one. Since the stored password is hashed, I can't simply make a comparison. How can this be done? thanks, HC
-
Soma, my friend, once again you save my butt. Thanks! To anyone who's interested, the only thing I had to do after Soma's suggestion was tweak the way I set the variable: $page->mapmarker->address = $input->post->map;
-
Following Soma's Create simple forms using API thread I setup a user registration form on a site I'm working on. Everything worked great until I tried adding an InputfieldMapMarker at the end. So I'm using this to get the field in place: $field = $modules->get("InputfieldMapMarker"); $field->label = "Localização"; $field->attr('id+name','map'); $field->attr('address','38.694147, -9.205794'); $field->required = 0; $form->append($field); The field shows up as expected and I even got my JS to change the address value and update the map according to what users put into the contacts fields before they reach the map. The problem is when the form is submitted. Error: Call to a member function set() on null (line 177 of C:\xampp\htdocs\cars\site\modules\FieldtypeMapMarker\InputfieldMapMarker.module) MapMarker's documentation doesn't say much about using the inputfield, and I'm lost. Help a brother out?
-
I'm having trouble with processInput vs InputfieldMapMarker. The result: Error: Call to a member function set() on null (line 177 of C:\xampp\htdocs\cars\site\modules\FieldtypeMapMarker\InputfieldMapMarker.module) Is there any way to set an exception for this variable not to go through processInput? Or perhaps another, better method to fix this?
-
Here's the file. I'm trying the example straight from the documentation. After all the tests I made, I'm convinced this is some sort of configuration problem. dash-new.php
-
This is spooky. Just tried reinstalling the module, and no change. I had installed it today for the first time, so I was using the latest version. In my case I don't even get the submit button. Other tests I've made: generating pages with other templates by page instead of template tried leaving incognito mode in chrome (I needed two logged users) added superuser role EDIT: tried array example from the documentation, discovered an extra ) near the end that causes an error, but even fixing that, no cigar EDIT 2: tested on a previous site with PW 2.5.3 Nothing seems to work. Could it be something to do with XAMPP's default PHP settings?
-
Can't find any errors either on the Apache log or PW's. I'm using PHP 5.6.3 and PW 2.5.29 dev. Here's the output I'm getting: <form id="fhForm1" class="InputfieldForm" name="fhForm1" method="post" action="./" data-colspacing="1"><input type="hidden" name="TOKEN1463213210X1433263864" value="fXJQW/rrJn/a1VrW5nGRJXbxA3MrczWb" class="_post_token"> </form>
-
I'm trying this out and having some trouble. In my usecase, I want to generate a form based on a template. Here's my code: $fh = $modules->get('FormHelper'); $form = $fh->create($templates->get('basic-page')); echo $form->render(); This is outputting a form without fields except for a hidden token. Can't figure out what I'm doing wrong.
-
Same need here. I want to provide my client with a CMS where they can change content and when they're satisfied, export an offline version of the whole site that they can easily upload to their server or run from a pendrive.
-
I have a couple of problems regarding frontend template management and hacking the page tree. Imagine a catalogue that acts as a compilation of various lists of products from multiple users. Looking at the page tree, I have something like this: home -- products ------ toy ------ vase ------ phone -- users ------ john ------ jane ------ mary -- search -- ... Problem #1 : Direct user page links. Although I'm grouping users under the "users" page, I'd like to go around it and generate links that skip the users page, like so: www.site.com/users/john (bad) www.site.com/john (good) Problem #2 : Same product (page), two places, two frontend templates. Visitors can reach the main site, search and find products regardless of the user who added them, or they can go straight in a user's page and browse their specific catalogue. I'd even like to offer the option of having "John's" domain point straight into "www.site.com/john". The problem here is that I want the same product to be represented with a different template in each case. www.site.com/products/toy (main site template) www.site.com/john/toy (user specific template with extra menus and different look) I'm thinking maybe I need to place products inside each user's page. That may organize and simplify a bit, but I'll still have the same problem of using a different frontend template when users search from the main site. Any ideas? Thanks, HC
-
Another guy in trouble with search pagination
heldercervantes replied to heldercervantes's topic in General Support
Being the total noob that I am, I'll add this to my "nice to have" list and consider the improvement later. Right now I'm just glad I got it working -
Another guy in trouble with search pagination
heldercervantes replied to heldercervantes's topic in General Support
FOUND IT! Teppo had part of the solution. I wasn't whitelisting the variable. But the other part of the problem was that I was usign the post method instead of get. Now it works but I'm not liking the dirty url very much (the search form passes other vars, that most of the time the user doesn't fill). Is this "get only"? Thanks for your help guys. Just now I was bragging about all the help I get from this community. -
Another guy in trouble with search pagination
heldercervantes replied to heldercervantes's topic in General Support
I'm just thinking: Could this be a 2.5.29 problem? I upgraded last night for some features 2.5.3 doesn't have. -
Another guy in trouble with search pagination
heldercervantes replied to heldercervantes's topic in General Support
@Lostkobrakai, $q is the post variable for the string. I'm catching it earlier in the header and the only action I'm performing there is an echo: $q = $sanitizer->text($input->post->q); @horst, for a second there I thought "THAT'S IT!", but nope. Changed the code but no effect. Now it reads: foreach($qs as $qf) { $group[] = "$f%=$qf"; } I've also tried discarding the selector altogether and just do a --- $matches = $pages->find("template=ad, limit=2"); ---, same behavior. More pages numbers generated, but can't change page. Changing the method from post to get... same thing. -
Another guy in trouble with search pagination
heldercervantes replied to heldercervantes's topic in General Support
Same result. $q is goes empty when I click a page number, and the IF statement turns false. -
Another guy in trouble with search pagination
heldercervantes replied to heldercervantes's topic in General Support
Yup. Was on to begin with. Tried turning it on and off to the same result. Pagination list renders correctly, same error when I click it. -
Hi guys. I've seen a few posts regarding problems with search and pagination and can't figure out what's going on. I started out with the new blog template's search. There's an IF at the beginning that checks if the query is blank, and I made my changes in there. if($q) { $q = $sanitizer->selectorValue($q); $qs = explode(" ", $q); $fields = explode("|", "ref|title|version|type|notes"); foreach($fields as $f){ $group = array(); foreach($qs as $q) { $group[] = "$f%=$q"; } $selector .= ", (".implode(", ", $group).")"; } $selector .= ", limit=4"; // Find pages that match the selector $ads = $pages->get('/ads/'); $matches = $ads->find($selector); $pagination = $matches->renderPager(); $output = ""; // did we find any matches? ... if($matches->count) { // we found matches $output.=' <ul>'; foreach($matches as $ad) { $output.='<li>'; $output.=' <a href="'.$ad->url.'">'; $output.='</li>'; } $output.=' </ul>'; $output.='</div>'; $output.= $pagination; } else { // we didn't find any $output = "<h2>Sorry, no results were found.</h2>"; } } else { // no search terms provided $output = "<h2>Please enter a search term in the search box (upper right corner)</h2>"; } echo $output; So testing this out, the number of pages ir rendered correctly, but when I click a page, this code always goes into "no search terms provided". The post variable is obviously not being carried over, but looking the examples don't seem to do anything about that. What did I miss?
-
Thanks LostKobrakai, I'll look into those.
-
I'm using FieldtypeSelect
-
Awesome! Thanks for the code. Am I limited to searching for exact matches on FieldtypeSelects? Let's say an option such as "brand new", checked against only "new" as the keyword. Is it possible?
-
Hi guys. I'm trying to build a complex search and so far it seems over my head. Can't find an answer digging through the docs or the forum so here goes. Basically I have a bunch of fields (textfields, textareas and selects) and I want the search keywords to be compared to values in all of them. I'm having trouble with the selects: $selector = "ref|title|type|version|state%=$q"; Since 'state' is a select, I get... Error: Exception: Operator '%=' is not implemented in FieldtypeSelect Oh and since I'm here, there's another problem. I need this search to look for each word without regard for sequence. For example, if I have a page called "this and that" and search "this that" doesn't find it. I have tried using *tilde* instead of %, but that doesn't find keywords shorter than 4 chars and I need that as well.