Example #1
0
function rcl_edit_rating_user()
{
    global $wpdb;
    $user = intval($_POST['user']);
    $rayting = intval($_POST['rayting']);
    if ($rayting) {
        rcl_update_user_rating(array('user_id' => $user, 'rating_total' => $rayting));
        $log['otvet'] = 100;
    } else {
        $log['otvet'] = 1;
    }
    echo json_encode($log);
    exit;
}
Example #2
0
function rcl_post_update_user_rating($args)
{
    global $rcl_options;
    if (!isset($args['object_author']) || !$args['object_author']) {
        return false;
    }
    if ($rcl_options['rating_user_' . $args['rating_type']] == 1 || $args['rating_type'] == 'edit-admin' || isset($args['user_overall'])) {
        rcl_update_user_rating($args);
    }
}
Example #3
0
 function delete_reviews_user($user)
 {
     global $wpdb, $rcl_options;
     $rews = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . RCL_PREF . "profile_otziv WHERE author_id = '%d'", $user));
     if (!$rews) {
         return false;
     }
     foreach ($rews as $rew) {
         $wpdb->query($wpdb->prepare("DELETE FROM " . RCL_PREF . "profile_otziv WHERE ID = '%d'", $rew->ID));
         if ($rcl_options['rayt_recall_user_rayt'] == 1 && function_exists('rcl_update_user_rating')) {
             $rec = $rew->status;
             if ($rec > 0) {
                 $rec = $rec * -1;
             } else {
                 if ($rec < 0) {
                     $rec = abs($rec);
                 }
             }
             rcl_update_user_rating($rew->user_id, $rec, 'review');
         }
     }
 }