52 reputation
13
bio website
location
age
visits member for 1 year, 9 months
seen 30 mins ago

59m
revised $wpdb select date range of posts
added 1360 characters in body
59m
comment $wpdb select date range of posts
I edited my original question to reflect the code I'm using. Users are ranked seemingly randomly, not based on either weekly or total votes.
14h
comment $wpdb select date range of posts
After some testing that new output doesn't appear to respect the DESC order for the vote sum.
15h
comment $wpdb select date range of posts
Can you update your answer with it? this sql stuff really goes over my head despite reading the documentation.
15h
comment $wpdb select date range of posts
Having trouble with the concat, want something like this:- CONCAT_WS('<div>VALUE HERE</div>/ this week',, 'VALUE HERE' being the number of votes. Reading about SQL concat_WS now.
16h
comment $wpdb select date range of posts
Excellent, thanks.
20h
comment $wpdb select date range of posts
Can you update your answer to write that within the context of my code?
20h
comment $wpdb select date range of posts
How would I roll both into the query so I could display total in last week AND the total?
1d
awarded  Benefactor
1d
accepted using update_user_meta to rank users
1d
asked $wpdb select date range of posts
Jul
25
comment using update_user_meta to rank users
Appears to be working (I think). As an addendum, is it possible to use strtotime to select the date range of the posts it's getting the sum of the meta value from? Been playing around with it but I've not really used global $wpdb; much before. $date1 = date('Y-m-d', strtotime('+1 days')); $date2 = date('Y-m-d', strtotime('-8 days')); Or something? And how do you declare the number of results?
Jul
25
comment using update_user_meta to rank users
Ah hang on, I think it's working now (will do some testing and report back), you made a small mistake in your query ( ' instead of " ).
Jul
25
comment using update_user_meta to rank users
SQL query breaks the page unfortunately.
Jul
25
revised using update_user_meta to rank users
added 325 characters in body
Jul
25
comment using update_user_meta to rank users
Can you slip the SQL statement into an example loop? Just as a FYI, the first method is doing strange things. Whenever I refresh the page (see the edit at the bottom, that's the loop I'm using to output the ranked users) it adds one or two points to each user. Strange, right?
Jul
24
comment using update_user_meta to rank users
Sure thing! thanks.
Jul
24
comment using update_user_meta to rank users
Ok after some testing I can say this sort of works. The problem is that every time a post is voted on it increments the epicredvote meta field of that user by 1, so a post can be voted up/down/up/down/up/down/ and that users meta value will increase by 8. Obviously it should be the sum of the votes and not how many times the users posts have been voted on.
Jul
24
comment using update_user_meta to rank users
Doing some testing now. Will report back soon.
Jul
23
revised using update_user_meta to rank users
added 397 characters in body