66 reputation
113
bio website
location
age
visits member for 1 year, 10 months
seen Aug 8 at 13:59

Jul
31
comment wpdb getting avatars and author url
Perfect! :) thanks.
Jul
30
comment $wpdb select date range of posts
Ah damnit, I can't get it working. I'll create a new question for it. Thanks again!
Jul
30
comment $wpdb select date range of posts
Ah, that's amazing, bonger! Thanks. I've asked around a bunch of people about this and you're one of the only ones who's been good with the SQL queries. I accepted your answer, really helped! Just one question as an addendum, I've been trying to do something like this <li> <a href="' . get_author_posts_url( $author->ID ) . '">' . get_the_author_meta( 'user_nicename' , $author->ID ) . '</a> (' . $author->posts . ') ' . get_avatar( $author->ID , 40 ) . ' </li> to display avatar and link to profile urls, but it doesn't seem to accept standard WP markup. Ideas?
Jul
30
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.
Jul
30
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.
Jul
30
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.
Jul
29
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.
Jul
29
comment $wpdb select date range of posts
Excellent, thanks.
Jul
29
comment $wpdb select date range of posts
Can you update your answer to write that within the context of my code?
Jul
29
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?
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
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
comment using update_user_meta to rank users
No filters that I can see. It does use Ajax however to register the votes. Made a small edit to the first code block (at the top). I'm sure it's possible to update the user meta with ajax when someone votes on the post, the problem is 1. update_user_meta is a WP function I've never worked with before and 2. Ajax is finicky as heck when I try to get it to work with WP.
Jun
13
comment Sort users by meta_value_num
Reading about update_user_meta just now. Trying to get my head around the logic for this. So it's creating a new row in the database (sorry, not particularly knowledgeable about DB's and their structures etc), will it automatically know the meta_key count for each user?
Jun
13
comment Sort users by meta_value_num
Alright well, I'm silly. Although I can get the total number of 'points' each user has recieved on their author.php page, apparently it's not a user meta key. Urgh. Still possible to query users based on the number of votes they've received on their posts or will I need to learn how to create a user some sort of table/meta key or whatever?