Permalink
Browse files

Add a message after a review is posted to inform user moderation is n…

…eeded. Fixes issue #123
  • Loading branch information...
1 parent e645c13 commit 14c6cbbf27a4be72d4efc3b2c368876087ef0fe4 @markkevans markkevans committed with haraldpdl Nov 13, 2010
@@ -20,5 +20,7 @@
define('TEXT_BAD', '<small><font color="#ff0000"><strong>BAD</strong></font></small>');
define('TEXT_GOOD', '<small><font color="#ff0000"><strong>GOOD</strong></font></small>');
+define('TEXT_REVIEW_RECEIVED', 'Thank you for your review. It has been submitted to the store owner for approval and should appear shortly.');
+
define('TEXT_CLICK_TO_ENLARGE', 'Click to enlarge');
?>
@@ -42,6 +42,12 @@
require(DIR_WS_INCLUDES . 'template_top.php');
?>
+<?php
+ if ($messageStack->size('product_reviews') > 0) {
+ echo $messageStack->output('product_reviews');
+ }
+?>
+
<div>
<h1 style="float: right;"><?php echo $products_price; ?></h1>
<h1><?php echo $products_name; ?></h1>
@@ -12,6 +12,8 @@
require('includes/application_top.php');
+ require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_REVIEWS_WRITE);
+
if (!tep_session_is_registered('customer_id')) {
$navigation->set_snapshot();
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
@@ -50,6 +52,7 @@
tep_db_query("insert into " . TABLE_REVIEWS_DESCRIPTION . " (reviews_id, languages_id, reviews_text) values ('" . (int)$insert_id . "', '" . (int)$languages_id . "', '" . tep_db_input($review) . "')");
+ $messageStack->add_session('product_reviews', TEXT_REVIEW_RECEIVED, 'success');
tep_redirect(tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params(array('action'))));
}
}
@@ -66,8 +69,6 @@
$products_name = $product_info['products_name'];
}
- require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_REVIEWS_WRITE);
-
$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()));
require(DIR_WS_INCLUDES . 'template_top.php');

0 comments on commit 14c6cbb

Please sign in to comment.