Support has been upgraded!
The Support Forum is closed. Not to worry! Providing the top quality support you expect and we're known for will continue! We're not ending support, just changing where you submit requests. This will provide you with the best experience possible.
Premium Support
Have you purchased an addon for Connections such as one of our premium templates or extensions with a valid license and you need help?
Please open a Support Ticket in your user account.
Free Support
Are you using the free Connections plugin? Don't worry, you are still very important to us! We are still providing you with the same high quality support that we're known for.
Please open a new support topic in the WordPress support forums for Connections.
- This topic has 3 replies, 2 voices, and was last updated 8 years, 4 months ago by
Steven Zahm.
-
AuthorPosts
-
01/05/2015 at 8:57 pm #314082
Tim Roberts
ParticipantI am running the connections directory on its own installation of wordpress at
topearner.wpengine.com
I only have one category entered on the installation.
I am using the market template.
I am attempting to sort using the sort function in the shortcode for market template.
In the address section, I am using the zipcode to display a dollar amount instead of an address so the card displays the info I like, without hacking the code.
I can sort up to $9,999,999.00
When I get to $10 million, the sorting function will not list the highest dollar amounts, but seems to insert them randomly.
I have checked the database and there is no limit to the number that can be entered.I do not understand why it will not sort and place the top numbers at the top of the database. Any suggestions would help.
Thanks,
Tim
PS – If you need access, please send me a private email and I will go ahead and send everything you need.
01/06/2015 at 10:10 am #314108Steven Zahm
Keymaster@ Tim
The sorting issue is likely because that field is a text field, not a numerical field. Numerals sorted as text will not sort the way you expect. Here an example…
if sorting 1–10 as numeric in a numeric field you would get 1–10 in order as you expect. However, since it is a text field you would get:
1
10
2
3
4
5
6
7
8
9Anotehr exmaple:
https://support.office.com/en-au/article/Sort-records-on-numeric-values-stored-in-a-text-field-502a36c4-2b6e-4453-91b6-7e842d234157So, you’re large numbers are likely in the right spot and not random, given that context.
Probably, depending on what you entered exactly in the zipcode field, you could alter the query Connections makes when ordering by zipcode using this method:
http://sqlserverplanet.com/tsql/how-to-order-numeric-values-in-a-varchar-fieldBets guess without digging deeper, you’d have to add it after this line of code:
https://github.com/Connections-Business-Directory/Connections/blob/develop/includes/class.retrieve.php#L763Hope that helps!
01/06/2015 at 1:25 pm #314143Tim Roberts
ParticipantHi Steve,
I understand this concept, but do not know PHP. I tried copying this into the section you outlined, but it crashed my site, so I know I did not do it right. Can you give me an exact example of how this would look, with line 673 in the class.retrieve.php file? Sorry to bother, just need explicit help for this one. Thanks.
01/07/2015 at 8:29 am #314162Steven Zahm
Keymaster@ Tim
Yeah, you couldn’t simple copy paste, the code would have had to be altered. It was the concept of what I think might need done.
I can’t give you an exact example as I do not know exactly what is being entered in the zipcode field. It would also take me a few hours to come to a final solution with testing. This would be custom programming that I’d have to charge a fee for. The thing is, to pull this off, the core Connections code would have to be altered which mean you would never be able to update Connections because if you did you would lose the custom zipcode sort. Currently there is not a way to pull this off in an update safe way.
-
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.