- This topic has 8 replies, 2 voices, and was last updated 9 years, 6 months ago by
Eyal Fitoussi.
-
AuthorPosts
-
November 3, 2012 at 4:12 pm #34313
intervik
MemberI found this is cityYes undefined problem and added a missing address[x].types in locate.js file :
if(address[x].types == 'locality,political' || address[x].types == 'postal_town')
Now the submit is working. I don now if its proper way to do.
Then, the char encoding problem is related to all the cookies. They are set by javascript and read by PHP/ echoed out, so encoding the protocol doesnt work. My cookie ‘wppl_city’ looks like this for the city of Norrköping :
Norrk%F6ping
Then this causes error retriving correct locations. The locate.js file alerts the proper char from google, but when set the cookie I had to add:
setCookie("wppl_city", encodeURIComponent(city),7);
Then in SHORTCODES.php (mark PHP, line 114) I added :
urldecode($_COOKIE['wppl_' . $display_by]);
Then The City works. The question is if there is a smoother way to enforce all cookie sets, and php GETs globally.
Or is there NOT so MANY places to add this fixes ?
/ J
November 3, 2012 at 4:26 pm #34321Eyal Fitoussi
MemberNot sure. I will have to look it up. But thank you for the tip above. Probably will be a good start point on fixing some of te issues. I just replied to the other post of yours.
November 3, 2012 at 4:30 pm #34320Eyal Fitoussi
MemberAnd yes, the cityYes caused the error and the page stopping. I am working on the local.js page. Cleaning it up and removing lot of unnecessary
Code.November 3, 2012 at 4:36 pm #34319Eyal Fitoussi
MemberAlso about the cookies. In my development version I already added the encodeURIComponent into the setcookie function I believe. I am not in front of the computer now. But somewhere in the locale.js there you’ll see the setcookies function so you might be able to modify it with encodeURIComponent so you want have to do it per set cookie call. I remember adding it but I couldn’t verify that it actually works.
Please ,Let me know if you can modify it and if it works.
November 3, 2012 at 4:46 pm #34318intervik
MemberOk, then it seems to be on the roadmap and the set cookie is only done few places.
Im gonna check this out and report back. Gonna work tonight. Yes am single….
Im more worried about the PHP calls, they seem to be called _COOKIE[] directly in each file, not put in to a global scope / array for the logged in user id.
We will probably remove all cookie anyway and work with sessions for security reasons.
If the variables is kept withing PHP scope, the language / mobile devices will have less problem with the plugin.
And in the end we probably build a index for all locations when scaling up the users. But thats another nice problem.
November 3, 2012 at 10:12 pm #34317Eyal Fitoussi
MemberOK,
i cleaned up lot of the code in the locate.js and fixed some of the issue. i took some of your tips above about encoding/decoding the cookies. i removed all the IP address functions for now. I (might but not sure yet )add it back later to let user choose if to turn it on/off.Would you go on my site and test it? see if it get your current location and if the issue with the characters/symbols solved?
thank you
November 3, 2012 at 10:26 pm #34316intervik
MemberGonna check
November 3, 2012 at 11:12 pm #34315intervik
MemberThe char seems fine!
There is a leak on auto locate and if entering just the Country, a link seems to spit twice. An email with pictures is sent.
Göteborg Sverige = Gothenburg, Sweden
Göteborg = Gothenburg, Sweden
Sverige = Get your current location (and a break then: .Sweden )Then (sometimes) The return value gives Gothenburg,Gothenburg
The autolocate still wrong values but Correct Chars. I don know if The IP stuff is worked on but just in case I reporting. Autolocate returns:
Skåne County
When typing manually it returns Malmö Sweden – correct, Sitting in City of Malmö.
(The autolocate on the Location Tab returns my apartment!)
November 3, 2012 at 11:15 pm #34314intervik
MemberIn the future, Is there not a way to combine the 2 and if the first fails, the other (ip) uses. And then, both values can always be overridden by typing manually in the field.
-
AuthorPosts
You must be logged in to reply to this topic.