Changeset 1501954
- Timestamp:
- 09/24/2016 02:06:23 PM (10 years ago)
- File:
-
- 1 edited
-
review-builder/trunk/com/controllers/Review.php (modified) (19 diffs)
Legend:
- Unmodified
- Added
- Removed
-
review-builder/trunk/com/controllers/Review.php
r1501926 r1501954 36 36 { 37 37 global $sgrb; 38 38 39 39 $attributes = shortcode_atts(array( 40 40 'id' => '1', … … 90 90 $review = new SGRB_ReviewModel(); 91 91 $isUpdate = false; 92 92 93 93 if ($reviewId) { 94 94 $isUpdate = true; … … 103 103 104 104 $tempId = $review->getTemplate_id(); 105 105 106 106 if ($tempId) { 107 107 $template = new Template($tempName,$tempId); … … 264 264 exit(); 265 265 } 266 266 267 267 $review->save(); 268 268 … … 330 330 331 331 $sgrbDataArray = array(); 332 332 333 333 $fields = SGRB_CategoryModel::finder()->findAll('review_id = %d', $sgrbId); 334 334 $sgrbOptions = $sgrbRev->getOptions(); … … 355 355 356 356 $options = $sgrbRev->getOptions(); 357 $options = json_decode($options, true); 357 $options = json_decode($options, true); 358 358 359 359 $sgrbDataArray['title'] = $title; … … 486 486 $html .= $this->createReviewHtml($sgrbDataArray, true); 487 487 } 488 488 489 489 return $html; 490 490 } … … 569 569 $sgrbWidgetWrapper = 'sgrb-widget-wrapper'; 570 570 } 571 571 572 572 if ($review[0]['options']['total-rate'] == 1 || SGRB_PRO_VERSION) { 573 573 $countRates = 0; … … 601 601 $totalRate = round($rating / $countRates); 602 602 } 603 603 604 604 } 605 605 $commentsArray = array(); … … 615 615 $approvedComments = SGRB_CommentModel::finder()->findAll('review_id = %d && approved = %d', array($review[0]['id'], 1)); 616 616 } 617 617 618 618 $commentsArray = $approvedComments; 619 619 } … … 731 731 $UserComEmail = ''; 732 732 $UserComComment = ''; 733 $hideForm = false; 733 734 foreach ($userIps as $userIp) { 734 735 if (@$_SERVER['REMOTE_ADDR'] == $userIp->getIp() || isset($_COOKIE['rater'])) { 735 736 $currentCommentId = $userIp->getComment_id(); 737 if (!$currentCommentId) { 738 $hideForm = true; 739 } 736 740 $eachCategoryRate = true; 737 741 if ($isPostReview) { … … 754 758 } 755 759 $sgrbEachEditableRate = array(); 760 756 761 if ($currentCommentId) { 762 $hideForm = false; 757 763 $currentComment = SGRB_CommentModel::finder()->findByPk($currentCommentId); 758 764 $UserComTitle = $currentComment->getTitle(); … … 877 883 878 884 $mainStyles = ''; 879 885 880 886 if ($review[0]['options']['rate-type'] == SGRB_RATE_TYPE_STAR) { 881 887 $sgrb->includeScript('core/scripts/jquery.rateyo'); … … 918 924 } 919 925 $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 921 927 $categoriesToRate .= '<input class="sgrb-fieldId" name="field[]" type="hidden" value="'.esc_attr($category->getId()).'">'; 922 928 $categoriesToRate .= '<div class="sgrb-row-category" '.$eachCategoryHide.'> … … 1111 1117 } 1112 1118 } 1113 1119 1114 1120 $commentForm = '<div class="sgrb-user-comment-wrapper" style="background-color: '.@$review[0]['options']['total-rate-background-color'].';color: '.$review[0]['options']['rate-text-color'].';"> 1115 1121 <div class="sgrb-hide-show-wrapper"> … … 1196 1202 $ratedHtml = true; 1197 1203 } 1198 if ( !$currentCommentId) {1204 if ($hideForm) { 1199 1205 $commentForm = ''; 1200 1206 } … … 1277 1283 $currentUser = wp_get_current_user(); 1278 1284 $currentUserName = $currentUser->user_nicename; 1279 $subject = 'Review Builder Wordpress plugin.'; 1285 $subject = 'Review Builder Wordpress plugin.'; 1280 1286 $blogName = get_option('blogname'); 1281 1287 $editUrl = $sgrb->adminUrl('Comment/index').'sgrb_allComms&id='.$reviewId; … … 1290 1296 $currentUser = wp_get_current_user(); 1291 1297 $currentUserName = $currentUser->user_nicename; 1292 $subject = 'Review Builder Wordpress plugin.'; 1298 $subject = 'Review Builder Wordpress plugin.'; 1293 1299 $blogName = get_option('blogname'); 1294 1300 $editUrl = $sgrb->adminUrl('Comment/index').'sgrb_allComms&id='.$reviewId; … … 1332 1338 } 1333 1339 } 1334 1340 1335 1341 // if new insert, save the rater 1336 1342 if ($lastComId) {
Note: See TracChangeset
for help on using the changeset viewer.