joer80
Members-
Posts
364 -
Joined
-
Last visited
Everything posted by joer80
-
bump
-
Ok, I dont think I am crazy, but I just wanted to let you guys know this is what I seem to be seeing with processwire and sorting.. If you do a selector based search, say sort=price, and show paged results of that, the default process wire behavior seems to handle ties funny. It looks like if there is a sort tie, it randomly shows one result before the other. This was creating a bug in my program because there is a chance to not show a listing when you are paging through the results. ie. If there is a price tie between the last listing on page one, and the first listing one page 2, that item may or may not show as you are flipping through the pages because it may roll a page 2 when you are on page 1, and a page 1 when you are on page 2.. :\ To fix this, I just added a second sort option of title to my query. That way there is never a tie since it would then show the results in title alphabetical. Just thought I would let you guys know what I noticed and how I fixed it! Can any of you guys confirm this behavior? If so, do we need to mention it on the paging section of our documentation? Thanks!
-
I think I have it figured out. I ie9 does not like extra trailing commas in json. Also, it did not like my console.log. I removed those out and it appears to work now! What should I change? Thanks!
-
I would be forever grateful if someone can help me figure out this javascript question! On my homepage, it works fine on any decently new browser, but on ie9 when a change the state, it does not populate the locations! Thanks in advance! goac.greggorrmarine.com
-
Could timeout cause processwire to throw 404 sometimes but not others?
joer80 replied to joer80's topic in General Support
I may do a second cron and break it in half and see... It does like 4 things. Thanks! -
Could timeout cause processwire to throw 404 sometimes but not others?
joer80 replied to joer80's topic in General Support
Well, I was wrong. Instead of curl, I went with wget for the cron. This is the command: wget -O nocache http://www.url.com/cron/ We are probably looking at 5 to 8 minutes of commands in that file. Mostly database work. -
I created a process wire template for a processwire page called cron. I then created a cron job that loads that page using curl. The weird thing is, sometimes it works fine, and sometimes it doesnt.. I can see the same thing when I view the page as well. If when I view it, and it doesnt work, it shows my template with this message in the content area: The page you were looking for is not found.Please use our search engine or navigation above to find the page. If it works, it loads like normal. Anyone know why you would get a 404 page can not be found sometimes but not all the time? There is a lot of processing. Could processwire be timing out and giving up on it? Thanks!
-
Thank you for your feedback! Very good advice!
-
Launched http://www.greggorrauto.com last week! Responsive Theme built with Bootstrap 3 and Processwire! Uses the bootstrap carousel for the slider, and the Affix.js to keep the right column on the inventory search page sticky on scroll. (If the screen is tall enough.) Also uses a modal style lightbox on the inventory detail page as well as animated scrolling to anchors. I know I used the Google maps marker module and the form templates processor module. Also using redirects and batcher. (Redirects for the sub menu items for the price ranges. It just sends the user to the search page with the correct query strings. The homepage slider is managed with the image field so I can drag and drop new slides up, but I didn't know how to manage both the caption and the link url using just the description field, and I did not know how to add another one, so I did a pipe delimited. ie. image caption|http://www.linkurl.com format is used in the image description field. If its easy to add a second box to separate those out, let me know! Also, let me know what you think!
-
I think I got the scroll bar issue fixed! Thanks for pointing that out!
-
I need to do some more slider images and get some more up to date content, but the bulk of the work is done. I did a blog, and google calendar. Responsive since I used Bootstrap 3. Feedback is appreciated! Thanks! http://www.trinitytxk.com/
-
That was the code for sanitizing and whitelisting all get vars, array or not, here is the code I ended up using to turn a set of checkboxes into a selector. I bet it could be cleaned up and simplified though! //Make Selector for Make Checkboxes if($input->get->Makes) { //Make sure get is an array if(!is_array($input->get->Makes)) { //if not array $input->get->Makes = explode(',', $input->get->Makes); } $makesList = str_replace(',', '|', $input->whitelist['Makes']); if(!empty($makesList)){ $selectorList['Makes'] = 'livefeed_Make=' . $makesList; } } // end Makes checkbox selector code
-
Ok, It looks like its empty because I am not white listing the get variables that are arrays. I was just looping through all get vars and white listing them not checking to see if they are an array or not, but whitelist doesnt seem to work on arrays. This is what I have come up with to loop through all GET Vars, sanitize and white list. Does this look right? If the get var is an array, I convert it is csv and white list that. The only thing I am really iffy on, is if you sanitize the individual values, but whitelist the csv string. //if there are get vars, loop through them to sanitize and whitelist(Use like this: $input->whitelist['sb'] for the sort by) if(count($input->get)){ foreach($input->get as $key => $value){ //If its an array, I need to whitelist as csv if(is_array($value)) { $a = $value; $value = ''; foreach($a as $k => $v){ $v = $sanitizer->selectorValue($v); $value .= "$v,"; } $value = rtrim($value, ","); $value = trim($value, '"'); $input->whitelist($key, $value); } else { $value = $sanitizer->selectorValue($value); $value = trim($value, '"'); $input->whitelist($key, $value); } } //end loop through get } //end if get vars
-
Also, how do you sanitize an array? Do you loop through it? Trying to do some research on this today.
-
So can you whitelist an array? Or should you loop through it ahead of time and white list the parts? Or in this case, the selector string?
-
Thanks for all the help so far!
-
With or without encoding, the selector seems to work ok before paging. "?style[]=SUV&style[]=Coupes" does "livefeed_Body=SUV|Coupes" Here is the html: <div class="checkbox"> <label> <input type="checkbox" name="style[]" value="Convertible"> Convertibles </label> </div> This is my php code: if($_GET['style']){ $styles = $_GET['style']; $styleList = ''; foreach ($styles as $style){ $styleList .= $sanitizer->selectorValue($style) . '|'; } //Add the Body Styles to the selector only if there is one. if(!empty($styles[0])){ $selectorList['style'] = 'livefeed_Body=' . trim($styleList, '|'); //trim off the trailing pipe } } //end if there is a style
-
I have a search page that has check boxes for selecting the styles of vehicle you want to see, but when you go to page 2, it does not save the style values. The form and paging work great on anything that only contains one value, like a drop down, but just forgets anything like a checkbox that can have more than one thing when you leave the first page. On post back when 2 things are checked, it makes a query string for each checkbox like this: (If I check the suv and pickup checkboxes) ?style%5B%5D=SUV&style%5B%5D=Pickup+Truck (Basically is url encoded style[]=Value for each checkbox checked.) I think the paging control does not seem to support having []'s in the query string name. It always passes the style as empty, ie. style= Does anyone know how to fix this and allow paging to work with check boxes? Here is what I am working with. It also shows you what the selector string is for testing. Thanks in advance for any advice you can offer!
-
Is it possible to make a child page also work as a subdomain? Say you have a page located at: Home -> Locations -> Texas -> Name of Location What if I wanted NameofLocation.mydomainname.com to point to the above page? (I use cpanel) Thanks!
-
Thanks for the info! This post was on that thread and was very helpful! https://processwire.com/talk/topic/3346-setting-up-manager-role/?p=34589
-
I am still very new to Process Wire. What is the current best way to create a user that should only be able to edit certain pages? Is a module necessary? Or does the api allow this by adding code into my template files? Thanks!
-
I want to get pages where the price is not empty, and not the same as retail. So it needs to act on a value I give, and compare itself to another field. ie. Price!=, Price!=RetailPrice So far, my tests show that the second one does not do anything! Is this possible? Thanks!
-
Awesome! Thanks!
-
Will that work inside an admin process module?
-
Awesome! Do you know if there a away to cache an admin page for x minutes? I got it working on a template page but not sure if it is different or not in a module. Thanks!