drewhew Posted November 25, 2014 Share Posted November 25, 2014 Working on a website directory that includes ratings for listed companies. Trying to obtain information from database that would put some companies in a higher category than others. Or at least, I believe that is the approach I should be taking. There are a few tricky issues. 1. Ratings are their own custom posts but are attached to company pages (parents) 2. Rating values I need to obtain are meta keys (1. total number of ratings & 2. rating average of EACH) 3. Ratings are based on four criteria which are summed and averaged for each rating submitted. As a result, values are rarely single digits such as 4 or 5 but include decimals rounded to 1 place (e.g. 4.8 or 3.5) Additional info: Ratings are based on 5-star system (out of 5) Higher category would be business that achieved at least 10 ratings of 4 or more Any help appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/292713-need-help-with-database-query-i-think-wordpress/ Share on other sites More sharing options...
QuickOldCar Posted November 26, 2014 Share Posted November 26, 2014 Working on a website directory that includes ratings for listed companies. Need help with database query (I think?) WORDPRESS You sure you want to tackle this? Trying to obtain information from database that would put some companies in a higher category than others. Or at least, I believe that is the approach I should be taking. Entirely possible if that's what you want to do. There are a few tricky issues. 1. Ratings are their own custom posts but are attached to company pages (parents)2. Rating values I need to obtain are meta keys (1. total number of ratings & 2. rating average of EACH)3. Ratings are based on four criteria which are summed and averaged for each rating submitted. As a result, values are rarely single digits such as 4 or 5 but include decimals rounded to 1 place (e.g. 4.8 or 3.5) Nothing uncommon there, if the data is in the database can be accessed and used. Additional info:Ratings are based on 5-star system (out of 5)Higher category would be business that achieved at least 10 ratings of 4 or more A little more advanced query, still possible. Any help appreciated. Is your goal to just sort your results in your theme? Is this a plugin that creates a directory? You explained your goal well, now just need to see some code,relevant database tables, current query. Any additional useful information would help. If you posted the sites url here or even in a message to me I would look at it. Quote Link to comment https://forums.phpfreaks.com/topic/292713-need-help-with-database-query-i-think-wordpress/#findComment-1497727 Share on other sites More sharing options...
drewhew Posted November 26, 2014 Author Share Posted November 26, 2014 Hi QuickOldCar, The site uses a directory theme. Yes, the overall goal is essentially to sort the results and give top-ranking status to those earning a high number of good ratings. The url is http://merit.jamaica2go.com/dev (I'll message you temporary login as it's a members only directory) Quote Link to comment https://forums.phpfreaks.com/topic/292713-need-help-with-database-query-i-think-wordpress/#findComment-1497765 Share on other sites More sharing options...
QuickOldCar Posted November 27, 2014 Share Posted November 27, 2014 So you are using javo directory, did you contact the creators and ask for such a feature? Sometimes they are willing to add them to improve their product. Quote Link to comment https://forums.phpfreaks.com/topic/292713-need-help-with-database-query-i-think-wordpress/#findComment-1497795 Share on other sites More sharing options...
drewhew Posted November 27, 2014 Author Share Posted November 27, 2014 I didn't ask them about this specifically. I've inquired about a few other features and they've always been met with "hire a freelancer", so I thought I'd go it alone. Quote Link to comment https://forums.phpfreaks.com/topic/292713-need-help-with-database-query-i-think-wordpress/#findComment-1497889 Share on other sites More sharing options...
QuickOldCar Posted November 27, 2014 Share Posted November 27, 2014 I have to admit for the cheap price they give a lot, one of nicest directories with a theme have seen to date for wordpress. Reminds me of airbnb.com Is going to be harder to get help because not many would be willing to go buy it just to help you out. Most likely doing it in a running environment as well. Hard enough to get free help, but redesigning, changing the functions that theme and plugin is probably more than think it is. You never know what custom functions they did or how hooked into wordpress until looked at it all. The creators have a huge advantage over anyone else, they know how they made it work. I assumed was just a plugin using any theme, what you have there will be more complicated to modify, not impossible, but more work. Quote Link to comment https://forums.phpfreaks.com/topic/292713-need-help-with-database-query-i-think-wordpress/#findComment-1497891 Share on other sites More sharing options...
drewhew Posted November 28, 2014 Author Share Posted November 28, 2014 I understand, thanks for your consideration. Quote Link to comment https://forums.phpfreaks.com/topic/292713-need-help-with-database-query-i-think-wordpress/#findComment-1497902 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.