comment_ID, 'ajrv_userpoint', true ); wp_nonce_field( 'ajrv_comment_update', 'ajrv_comment_update', false ); if($userrating){ ?>
query("update $ajrv_review_user set overall = $user_rating where commentid = $comment_id;"); } } add_action('deleted_comment', 'ajrv_comment_del'); function ajrv_comment_del( $comment_id ) { global $table_prefix, $wpdb; $ajrv_review_user = $table_prefix . 'ajrv_review_user'; delete_comment_meta( $comment_id, 'ajrv_userpoint' ); $mysqli = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); $mysqli->query("delete from $ajrv_review_user where commentid = $comment_id;"); } add_action( 'comment_form_logged_in_after', 'ajrv_comment_box' ); add_action( 'comment_form_after_fields', 'ajrv_comment_box' ); function ajrv_comment_box( $default ) { global $table_prefix, $wpdb; $ajrv_review = $table_prefix . 'ajrv_review'; $ajrv_opt_maxval = get_option('ajrv_opt_maxval', "10"); $ajrv_review_user = $table_prefix . 'ajrv_review_user'; $mysqli = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); $postid = get_the_ID(); $isreviewcontent = false; $res = $mysqli->query("select * from $ajrv_review where postid = $postid;"); $ritemdata = array(); if(mysqli_num_rows($res)){ $isreviewcontent = true; $row = mysqli_fetch_assoc($res); if(is_user_logged_in()){ $current_user = wp_get_current_user(); $ql = "select id from $ajrv_review_user where reviewid = ".$row["id"]." and useremail = '".$current_user->user_email."'"; $res = $mysqli->query($ql); if(mysqli_num_rows($res)){ $isreviewcontent = false; }else{ $user_id = get_current_user_id(); if($row["authorid"] == $user_id){ $isreviewcontent = false; } } } } if($isreviewcontent){ $commenter = wp_get_current_commenter(); $ajrv_opt_userrating = get_option('ajrv_opt_userrating', ""); $ajrv_opt_userrating_onlyloggeduser = get_option('ajrv_opt_userrating_onlyloggeduser', "N"); if(!is_user_logged_in() && $ajrv_opt_userrating_onlyloggeduser == "Y"){ return $default; } if($ajrv_opt_userrating){ echo " "; } } return $default; } add_filter( 'comment_text', 'ajrv_show_comment_rating' ); function ajrv_show_comment_rating($comment_text) { $ajrv_opt_maxval = get_option('ajrv_opt_maxval', "10"); $ajrv_userpoint = get_comment_meta(get_comment_ID(), "ajrv_userpoint", true); if($ajrv_userpoint) { $ajrv_rt = "| "; $ajrv_rt .= " "; $ajrv_rt .= " | ";
$ajrv_rt .= " ".$ajrv_userpoint." ";
$ajrv_rt .= " |