@@ -278,8 +278,9 @@ discard block |
||
| 278 | 278 | |
| 279 | 279 | $post_id = isset($comment_info->comment_post_ID) ? $comment_info->comment_post_ID : ''; |
| 280 | 280 | |
| 281 | - if (!empty($comment_info)) |
|
| 282 | - $status = $comment_info->comment_approved; |
|
| 281 | + if (!empty($comment_info)) { |
|
| 282 | + $status = $comment_info->comment_approved; |
|
| 283 | + } |
|
| 283 | 284 | |
| 284 | 285 | if ($status == 'approve' || $status == 1) {
|
| 285 | 286 | $status = 1; |
@@ -418,12 +419,14 @@ discard block |
||
| 418 | 419 | } |
| 419 | 420 | } else {
|
| 420 | 421 | $rating = 0; |
| 421 | - if (!empty($comment)) |
|
| 422 | - $rating = geodir_get_commentoverall($comment->comment_ID); |
|
| 422 | + if (!empty($comment)) { |
|
| 423 | + $rating = geodir_get_commentoverall($comment->comment_ID); |
|
| 424 | + } |
|
| 423 | 425 | if ($rating != 0 && !is_admin()) {
|
| 424 | 426 | return '<div><div class="gd-rating-text">' . __('Overall Rating', 'geodirectory') . ': <div class="rating">' . $rating . '</div></div>' . geodir_get_rating_stars($rating, $comment->comment_ID) . '</div><div class="description">' . $content . '</div>';
|
| 425 | - } else |
|
| 426 | - return $content; |
|
| 427 | + } else { |
|
| 428 | + return $content; |
|
| 429 | + } |
|
| 427 | 430 | } |
| 428 | 431 | } |
| 429 | 432 | |
@@ -512,11 +515,12 @@ discard block |
||
| 512 | 515 | $post_ratings = get_post_meta($post_id, 'overall_rating'); |
| 513 | 516 | } |
| 514 | 517 | |
| 515 | - if ($post_ratings) |
|
| 516 | - return $post_ratings; |
|
| 517 | - else |
|
| 518 | - return false; |
|
| 519 | -} |
|
| 518 | + if ($post_ratings) { |
|
| 519 | + return $post_ratings; |
|
| 520 | + } else { |
|
| 521 | + return false; |
|
| 522 | + } |
|
| 523 | + } |
|
| 520 | 524 | |
| 521 | 525 | |
| 522 | 526 | /** |
@@ -541,11 +545,12 @@ discard block |
||
| 541 | 545 | ) |
| 542 | 546 | ); |
| 543 | 547 | |
| 544 | - if (!empty($reatings)) |
|
| 545 | - return $reatings; |
|
| 546 | - else |
|
| 547 | - return false; |
|
| 548 | -} |
|
| 548 | + if (!empty($reatings)) { |
|
| 549 | + return $reatings; |
|
| 550 | + } else { |
|
| 551 | + return false; |
|
| 552 | + } |
|
| 553 | + } |
|
| 549 | 554 | |
| 550 | 555 | /** |
| 551 | 556 | * Get review total of a Post. |
@@ -569,11 +574,12 @@ discard block |
||
| 569 | 574 | ) |
| 570 | 575 | ); |
| 571 | 576 | |
| 572 | - if (!empty($results)) |
|
| 573 | - return $results; |
|
| 574 | - else |
|
| 575 | - return false; |
|
| 576 | -} |
|
| 577 | + if (!empty($results)) { |
|
| 578 | + return $results; |
|
| 579 | + } else { |
|
| 580 | + return false; |
|
| 581 | + } |
|
| 582 | + } |
|
| 577 | 583 | |
| 578 | 584 | /** |
| 579 | 585 | * Get review count by user ID. |
@@ -596,11 +602,12 @@ discard block |
||
| 596 | 602 | ) |
| 597 | 603 | ); |
| 598 | 604 | |
| 599 | - if (!empty($results)) |
|
| 600 | - return $results; |
|
| 601 | - else |
|
| 602 | - return false; |
|
| 603 | -} |
|
| 605 | + if (!empty($results)) { |
|
| 606 | + return $results; |
|
| 607 | + } else { |
|
| 608 | + return false; |
|
| 609 | + } |
|
| 610 | + } |
|
| 604 | 611 | |
| 605 | 612 | /** |
| 606 | 613 | * Get average overall rating of a Post. |
@@ -634,11 +641,12 @@ discard block |
||
| 634 | 641 | ) |
| 635 | 642 | ); |
| 636 | 643 | |
| 637 | - if (!empty($results)) |
|
| 638 | - return $results; |
|
| 639 | - else |
|
| 640 | - return false; |
|
| 641 | -} |
|
| 644 | + if (!empty($results)) { |
|
| 645 | + return $results; |
|
| 646 | + } else { |
|
| 647 | + return false; |
|
| 648 | + } |
|
| 649 | + } |
|
| 642 | 650 | |
| 643 | 651 | /** |
| 644 | 652 | * Get review count of a Post. |
@@ -662,11 +670,12 @@ discard block |
||
| 662 | 670 | ) |
| 663 | 671 | ); |
| 664 | 672 | |
| 665 | - if (!empty($results)) |
|
| 666 | - return $results; |
|
| 667 | - else |
|
| 668 | - return false; |
|
| 669 | -} |
|
| 673 | + if (!empty($results)) { |
|
| 674 | + return $results; |
|
| 675 | + } else { |
|
| 676 | + return false; |
|
| 677 | + } |
|
| 678 | + } |
|
| 670 | 679 | |
| 671 | 680 | /** |
| 672 | 681 | * Get comments count of a Post. |
@@ -692,11 +701,12 @@ discard block |
||
| 692 | 701 | ); |
| 693 | 702 | |
| 694 | 703 | |
| 695 | - if (!empty($results)) |
|
| 696 | - return $results; |
|
| 697 | - else |
|
| 698 | - return false; |
|
| 699 | -} |
|
| 704 | + if (!empty($results)) { |
|
| 705 | + return $results; |
|
| 706 | + } else { |
|
| 707 | + return false; |
|
| 708 | + } |
|
| 709 | + } |
|
| 700 | 710 | |
| 701 | 711 | /** |
| 702 | 712 | * Get overall rating of a comment. |
@@ -720,11 +730,12 @@ discard block |
||
| 720 | 730 | ) |
| 721 | 731 | ); |
| 722 | 732 | |
| 723 | - if ($reatings) |
|
| 724 | - return $reatings; |
|
| 725 | - else |
|
| 726 | - return false; |
|
| 727 | -} |
|
| 733 | + if ($reatings) { |
|
| 734 | + return $reatings; |
|
| 735 | + } else { |
|
| 736 | + return false; |
|
| 737 | + } |
|
| 738 | + } |
|
| 728 | 739 | |
| 729 | 740 | /** |
| 730 | 741 | * Returns average overall rating of a Post. Depreciated since ver 1.3.6. |
@@ -970,8 +981,9 @@ discard block |
||
| 970 | 981 | $active_tabs = get_option('geodir_detail_page_tabs_excluded');
|
| 971 | 982 | |
| 972 | 983 | $is_display = true; |
| 973 | - if (!empty($active_tabs) && in_array('reviews', $active_tabs))
|
|
| 974 | - $is_display = false; |
|
| 984 | + if (!empty($active_tabs) && in_array('reviews', $active_tabs)) { |
|
| 985 | + $is_display = false; |
|
| 986 | + } |
|
| 975 | 987 | |
| 976 | 988 | /** |
| 977 | 989 | * Filter to change display value. |