MathiasP
Forum Replies Created
-
Forum: Plugins
In reply to: [WordPoints] Hide My Points / WordPoints from wp-admin/profile.phpGreat thx!
Forum: Plugins
In reply to: [WordPoints] Why saving Points in usermetaTotally, thank you!
Forum: Plugins
In reply to: [WordPoints] substract more poits than earned in one point hookUh yeah the – did it 😉 thx
Forum: Plugins
In reply to: [WordPoints] substract more poits than earned in one point hookHey, review for a good plugin 🙂
one more question:
I tried to implement the minimum filter but it doesn’t work the way I need it
Here is my code:
function user_stats_set_minimum_points($minimum, $type){ if ( 'substract' === $type ) { $minimum = 5000; } return $minimum; } add_filter('wordpoints_points_minimum','user_stats_set_minimum_points',10,2);If I now substract points with
wordpoints_subtract_points($user_id, 200, 'substract', 'training_event_winner');the log shows (+) 5000 Points for the user in substract points type.
What I need is: If I use wordpoints_substract_points in the Points type substract (let’s say 200) just substract the points even if the user has 0 Points in that points type
p.s.: I dont even need a limit just substract some points if need to.
is it possible with this filter?
I hope you unterstand my question 🙂
Forum: Plugins
In reply to: [WTI Like Post] User ID is set to 0 in databaseYou just need to fix the wti_like_post_ajax.php
$user_ID = get_current_user_id(); if ( $task == "like" ) { if ( $has_already_voted ) { $query = "UPDATE {$wpdb->prefix}wti_like_post SET "; $query .= "value = value + 1, "; $query .= "date_time = '" . date( 'Y-m-d H:i:s' ) . "' "; $query .= "WHERE post_id = '" . $post_id . "' AND "; $query .= "ip = '$ip'"; } else { $query = "INSERT INTO {$wpdb->prefix}wti_like_post SET "; $query .= "post_id = '" . $post_id . "', "; $query .= "value = '1', "; $query .= "date_time = '" . date( 'Y-m-d H:i:s' ) . "', "; $query .= "ip = '$ip', "; $query .= "user_id = '$user_ID'"; } } else { if ( $has_already_voted ) { $query = "UPDATE {$wpdb->prefix}wti_like_post SET "; $query .= "value = value - 1, "; $query .= "date_time = '" . date( 'Y-m-d H:i:s' ) . "' "; $query .= "WHERE post_id = '" . $post_id . "' AND "; $query .= "ip = '$ip'"; } else { $query = "INSERT INTO {$wpdb->prefix}wti_like_post SET "; $query .= "post_id = '" . $post_id . "', "; $query .= "value = '-1', "; $query .= "date_time = '" . date( 'Y-m-d H:i:s' ) . "', "; $query .= "ip = '$ip', "; $query .= "user_id = '$user_ID'"; } }Forum: Plugins
In reply to: [WordPoints] Give a Point for a post – Hook neededThank you. I think I will use WTI Like posts to realize that. Thanks for the quick answer and I hope u will implement the function in a future update.. but as I recognized u have a lot of work to do 🙂
Forum: Plugins
In reply to: [WordPoints] "Likes" HookHey robint,
did you just get the Hook working well?
I need to realize the same thing (see the newest topic in this support section)Maybe you can help me with that?
Mathias