Plugin Directory

Changeset 1501954


Ignore:
Timestamp:
09/24/2016 02:06:23 PM (10 years ago)
Author:
reviewbuilder
Message:

Bug fixed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • review-builder/trunk/com/controllers/Review.php

    r1501926 r1501954  
    3636    {
    3737        global $sgrb;
    38        
     38
    3939        $attributes = shortcode_atts(array(
    4040            'id' => '1',
     
    9090            $review = new SGRB_ReviewModel();
    9191            $isUpdate = false;
    92            
     92
    9393            if ($reviewId) {
    9494                $isUpdate = true;
     
    103103
    104104            $tempId = $review->getTemplate_id();
    105            
     105
    106106            if ($tempId) {
    107107                $template = new Template($tempName,$tempId);
     
    264264                exit();
    265265            }
    266            
     266
    267267            $review->save();
    268268
     
    330330
    331331            $sgrbDataArray = array();
    332            
     332
    333333            $fields = SGRB_CategoryModel::finder()->findAll('review_id = %d', $sgrbId);
    334334            $sgrbOptions = $sgrbRev->getOptions();
     
    355355
    356356            $options = $sgrbRev->getOptions();
    357             $options = json_decode($options, true);         
     357            $options = json_decode($options, true);
    358358
    359359            $sgrbDataArray['title'] = $title;
     
    486486            $html .= $this->createReviewHtml($sgrbDataArray, true);
    487487        }
    488        
     488
    489489        return $html;
    490490    }
     
    569569            $sgrbWidgetWrapper = 'sgrb-widget-wrapper';
    570570        }
    571        
     571
    572572        if ($review[0]['options']['total-rate'] == 1 || SGRB_PRO_VERSION) {
    573573            $countRates = 0;
     
    601601                $totalRate = round($rating / $countRates);
    602602            }
    603            
     603
    604604        }
    605605        $commentsArray = array();
     
    615615                $approvedComments = SGRB_CommentModel::finder()->findAll('review_id = %d && approved = %d', array($review[0]['id'], 1));
    616616            }
    617            
     617
    618618            $commentsArray = $approvedComments;
    619619        }
     
    731731        $UserComEmail = '';
    732732        $UserComComment = '';
     733        $hideForm = false;
    733734        foreach ($userIps as $userIp) {
    734735            if (@$_SERVER['REMOTE_ADDR'] == $userIp->getIp() || isset($_COOKIE['rater'])) {
    735736                $currentCommentId = $userIp->getComment_id();
     737                if (!$currentCommentId) {
     738                    $hideForm = true;
     739                }
    736740                $eachCategoryRate = true;
    737741                if ($isPostReview) {
     
    754758        }
    755759        $sgrbEachEditableRate = array();
     760
    756761        if ($currentCommentId) {
     762            $hideForm = false;
    757763            $currentComment = SGRB_CommentModel::finder()->findByPk($currentCommentId);
    758764            $UserComTitle = $currentComment->getTitle();
     
    877883
    878884        $mainStyles = '';
    879        
     885
    880886        if ($review[0]['options']['rate-type'] == SGRB_RATE_TYPE_STAR) {
    881887            $sgrb->includeScript('core/scripts/jquery.rateyo');
     
    918924                    }
    919925                    $html .= '<div class="sgrb-rate-each-skin-wrapper"><input class="sgrb-each-category-total" name="" type="hidden" value="'.$eachCategoryRate.'"><div class="rateYoTotal"></div><div class="sgrb-counter"></div></div></div>';
    920                    
     926
    921927                    $categoriesToRate .= '<input class="sgrb-fieldId" name="field[]" type="hidden" value="'.esc_attr($category->getId()).'">';
    922928                    $categoriesToRate .= '<div class="sgrb-row-category" '.$eachCategoryHide.'>
     
    11111117            }
    11121118        }
    1113        
     1119
    11141120        $commentForm = '<div class="sgrb-user-comment-wrapper" style="background-color: '.@$review[0]['options']['total-rate-background-color'].';color: '.$review[0]['options']['rate-text-color'].';">
    11151121                            <div class="sgrb-hide-show-wrapper">
     
    11961202            $ratedHtml = true;
    11971203        }
    1198         if (!$currentCommentId) {
     1204        if ($hideForm) {
    11991205            $commentForm = '';
    12001206        }
     
    12771283                $currentUser = wp_get_current_user();
    12781284                $currentUserName = $currentUser->user_nicename;
    1279                 $subject = 'Review Builder Wordpress plugin.'; 
     1285                $subject = 'Review Builder Wordpress plugin.';
    12801286                $blogName = get_option('blogname');
    12811287                $editUrl = $sgrb->adminUrl('Comment/index').'sgrb_allComms&id='.$reviewId;
     
    12901296                $currentUser = wp_get_current_user();
    12911297                $currentUserName = $currentUser->user_nicename;
    1292                 $subject = 'Review Builder Wordpress plugin.'; 
     1298                $subject = 'Review Builder Wordpress plugin.';
    12931299                $blogName = get_option('blogname');
    12941300                $editUrl = $sgrb->adminUrl('Comment/index').'sgrb_allComms&id='.$reviewId;
     
    13321338                }
    13331339            }
    1334            
     1340
    13351341            // if new insert, save the rater
    13361342            if ($lastComId) {
Note: See TracChangeset for help on using the changeset viewer.