Changeset 1508612
- Timestamp:
- 10/05/2016 09:17:33 AM (9 years ago)
- File:
-
- 1 edited
-
review-builder/trunk/com/controllers/Review.php (modified) (21 diffs)
Legend:
- Unmodified
- Added
- Removed
-
review-builder/trunk/com/controllers/Review.php
r1508588 r1508612 36 36 { 37 37 global $sgrb; 38 38 39 39 $attributes = shortcode_atts(array( 40 40 'id' => '1', … … 69 69 global $sgrb; 70 70 $sgrb->includeCore('Template'); 71 71 72 72 $tempOptions = array(); 73 73 $options = array(); … … 92 92 $review = new SGRB_ReviewModel(); 93 93 $isUpdate = false; 94 94 95 95 if ($reviewId) { 96 96 $isUpdate = true; … … 105 105 106 106 $tempId = $review->getTemplate_id(); 107 107 108 108 if ($tempId) { 109 109 $template = new Template($tempName,$tempId); … … 207 207 $options['captcha-on'] = $captchaOn; 208 208 } 209 $options['tags'] = json_encode($tagsArray);210 }209 } 210 $options['tags'] = json_encode($tagsArray); 211 211 if ($disableWPcomments) { 212 212 $options['disableWPcomments'] = 1; … … 271 271 wp_create_tag($tags); 272 272 } 273 273 274 274 $review->save(); 275 275 … … 338 338 339 339 $sgrbDataArray = array(); 340 340 341 341 $fields = SGRB_CategoryModel::finder()->findAll('review_id = %d', $sgrbId); 342 342 $sgrbOptions = $sgrbRev->getOptions(); … … 364 364 365 365 $options = $sgrbRev->getOptions(); 366 $options = json_decode($options, true); 366 $options = json_decode($options, true); 367 367 368 368 $sgrbDataArray['title'] = $title; … … 497 497 $html .= $this->createReviewHtml($sgrbDataArray, true); 498 498 } 499 499 500 500 return $html; 501 501 } … … 580 580 $sgrbWidgetWrapper = 'sgrb-widget-wrapper'; 581 581 } 582 582 583 583 if ($review[0]['options']['total-rate'] == 1 || SGRB_PRO_VERSION) { 584 584 $countRates = 0; … … 612 612 $totalRate = round($rating / $countRates); 613 613 } 614 614 615 615 } 616 616 $commentsArray = array(); … … 626 626 $approvedComments = SGRB_CommentModel::finder()->findAll('review_id = %d && approved = %d', array($review[0]['id'], 1)); 627 627 } 628 628 629 629 $commentsArray = $approvedComments; 630 630 } … … 772 772 } 773 773 $sgrbEachEditableRate = array(); 774 774 775 775 if ($currentCommentId) { 776 776 $hideForm = false; … … 897 897 898 898 $mainStyles = ''; 899 899 900 900 if ($review[0]['options']['rate-type'] == SGRB_RATE_TYPE_STAR) { 901 901 $sgrb->includeScript('core/scripts/jquery.rateyo'); … … 938 938 } 939 939 $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>'; 940 940 941 941 $categoriesToRate .= '<input class="sgrb-fieldId" name="field[]" type="hidden" value="'.esc_attr($category->getId()).'">'; 942 942 $categoriesToRate .= '<div class="sgrb-row-category" '.$eachCategoryHide.'> … … 1131 1131 } 1132 1132 } 1133 1133 1134 1134 $commentForm = '<div class="sgrb-user-comment-wrapper" style="background-color: '.@$review[0]['options']['total-rate-background-color'].';color: '.$review[0]['options']['rate-text-color'].';"> 1135 1135 <div class="sgrb-hide-show-wrapper"> … … 1201 1201 </div>'; 1202 1202 1203 1203 1204 1204 if ($isWidget) { 1205 1205 $commentForm = ''; … … 1212 1212 $sgrbTags = array(); 1213 1213 $sgrbTags = json_decode(@$review[0]['options']['tags']); 1214 if ( SGRB_PRO_VERSION &&!empty($sgrbTags)) {1214 if (!empty($sgrbTags)) { 1215 1215 $commentForm .= '<div id="sgrb-review-tags-'.@$review[0]['id'].'" class="sgrb-tags-wrapper"><strong>Tags: </strong>'; 1216 1216 $tagIndex = 0; … … 1306 1306 $currentUser = wp_get_current_user(); 1307 1307 $currentUserName = $currentUser->user_nicename; 1308 $subject = 'Review Builder Wordpress plugin.'; 1308 $subject = 'Review Builder Wordpress plugin.'; 1309 1309 $blogName = get_option('blogname'); 1310 1310 $editUrl = $sgrb->adminUrl('Comment/index').'sgrb_allComms&id='.$reviewId; … … 1319 1319 $currentUser = wp_get_current_user(); 1320 1320 $currentUserName = $currentUser->user_nicename; 1321 $subject = 'Review Builder Wordpress plugin.'; 1321 $subject = 'Review Builder Wordpress plugin.'; 1322 1322 $blogName = get_option('blogname'); 1323 1323 $editUrl = $sgrb->adminUrl('Comment/index').'sgrb_allComms&id='.$reviewId; … … 1361 1361 } 1362 1362 } 1363 1363 1364 1364 // if new insert, save the rater 1365 1365 if ($lastComId) {
Note: See TracChangeset
for help on using the changeset viewer.