objetsdeplaisir
Forum Replies Created
-
Forum: Plugins
In reply to: [WP Product Review Lite] Disabling the review box on a postHi,
A simpler solution, if you only want to be able to disable the widget on a particular post after it had been enabled previously, but don’t especially need to change the location of the review box within your post:
In wp-product-review\css\dashboard_styles.css , line 77, comment “display:none;” for “.isReviewYes”:
.isReviewYes { /*display:none;*/ }
The checkbox “Is this a review post ?” will no longer disappear after saving, and it seems to solve the problem.
Forum: Plugins
In reply to: [WP Product Review Lite] Options rated 0 do not appearHi,
Here’s a solution:
In wp-product-review\inc\cwp_frontpage.php :
To fix the calculation of the average grade, line 74, replace:
if(!empty($option1_grade)) { $overall_score += $option1_grade; $iter++; } if(!empty($option2_grade)) { $overall_score += $option2_grade; $iter++; } if(!empty($option3_grade)) { $overall_score += $option3_grade; $iter++; } if(!empty($option4_grade)) { $overall_score += $option4_grade; $iter++; } if(!empty($option5_grade)) { $overall_score += $option5_grade; $iter++; }
with:
if(!empty($option1_grade)||$option1_grade==='0') { $overall_score += $option1_grade; $iter++; } if(!empty($option2_grade)||$option2_grade==='0') { $overall_score += $option2_grade; $iter++; } if(!empty($option3_grade)||$option3_grade==='0') { $overall_score += $option3_grade; $iter++; } if(!empty($option4_grade)||$option4_grade==='0') { $overall_score += $option4_grade; $iter++; } if(!empty($option5_grade)||$option5_grade==='0') { $overall_score += $option5_grade; $iter++; }
To fix the missing display of the “0” grades:
- line 99, replace:
if (!empty($option1_content) && !empty($option1_grade) && strtoupper($option1_content) != 'DEFAULT FEATURE 1')
with:
if (!empty($option1_content) && (!empty($option1_grade)||$option1_grade==='0') && strtoupper($option1_content) != 'DEFAULT FEATURE 1')
- line 119, replace:
if (!empty($option2_content) && !empty($option2_grade) && strtoupper($option2_content) != 'DEFAULT FEATURE 2')
with:
if (!empty($option2_content) && (!empty($option2_grade)||$option2_grade==='0') && strtoupper($option2_content) != 'DEFAULT FEATURE 2')
- line 139, replace:
if (!empty($option3_content) && !empty($option3_grade)&& strtoupper($option3_content) != 'DEFAULT FEATURE 3')
with:
if (!empty($option3_content) && (!empty($option3_grade)||$option3_grade==='0')&& strtoupper($option3_content) != 'DEFAULT FEATURE 3')
- line 159, replace:
if (!empty($option4_content) && !empty($option4_grade) && strtoupper($option4_content) != 'DEFAULT FEATURE 4')
with:
if (!empty($option4_content) && (!empty($option4_grade)||$option4_grade==='0') && strtoupper($option4_content) != 'DEFAULT FEATURE 4')
- Line 177, replace:
if (!empty($option5_content) && !empty($option5_grade) && strtoupper($option5_content) != 'DEFAULT FEATURE 5')
with:
if (!empty($option5_content) && (!empty($option5_grade)||$option5_grade==='0') && strtoupper($option5_content) != 'DEFAULT FEATURE 5')
I hope this will help.
Best regards
Forum: Plugins
In reply to: [WP Product Review Lite] Disabling the review box on a postHi @codeinwp,
I tried to do a few modifications on my own, and I think I managed to find a suitable solution.
A shortcode to put the review box anywhere in the post could solve this (with a shortcode, if one chooses “this is a review post” and saves a post by mistake, not adding the shortcode into the post allows to hide the review box), and also avoid the review box to be displayed after other plugins such as social media sharing.
This could be a third option proposed in “Review position”, in addition to “After content” and “Before content”.
The code to do this is very simple:
- In wp-product-review\admin\inc\config.php, line 457, add a third option “Shortcode” to the array options:
array( "type"=>"select", "name"=>"Review position", "description"=>"Position of the review box", "id"=>"cwppos_show_reviewbox", "options"=>array("yes"=>"After content","no"=>"Before content","shc"=>"Shortcode"), "default"=>"yes" )
- In wp-product-review\inc\cwp_frontpage.php, line 315, add a third return value to the function cwp_pac_before_content($content), when the option chosen for “Review position” is “Shortcode”:
if(cwppos("cwppos_show_reviewbox") == 'shc') return preg_replace ( '[\[wp-product-review\]]' , $return_string , $content, 1);
I would be really grateful if you could add an option like this to your plugin.
Best regards
Forum: Plugins
In reply to: [WP Product Review Lite] Disabling the review box on a postHi @codeinwp,
Thanks for your fast answer.
On a local copy of my blog, I tried to deactivate all other plugins except WP Product Review. The behaviour of the radio buttons “Is this a review post?” seems to be the same: after answering “Yes”, they disappear when I save the article, and the review box cannot be removed any more.
Thanks again for your help.
Best regards.