Great Reviews!Need help setting up your website, installing Apache, PHP, MySQL, or RavenNuke(tm)?Need help customizing or designing scripts?Please contact us via the Contact Us option for further details and pricing.
If you want only your registered users to be able to enter a review, you can achieve it with the following simple change:
Edit the modules/Reviews/index.php file and find the write_review() function:
function write_review() {
global $admin, $sitename, $user, $cookie, $prefix, $user_prefix,
$currentlang, $multilingual, $dbi, $module_name;
include ('header.php');
OpenTable();
Add the following check after the call to OpenTable():
if (!is_user($user)) {
echo "You need to be
<a href=\"modules.php?name=Your_Account\">logged in</a> or
<a href=\"modules.php?name=Your_Account&op=new_user\">become a member</a>
to submit reviews.";
} else {
This check will only allow registered users to continue with a review, while pointing others to the login or register page. Of course, the IF statement has to be closed - just put a } at the end
of the function, as shown below:
CloseTable();
include ("footer.php");
}
}
Unregistered users will be able to view reviews, but only site members will be able to submit new ones.
Tip
This simple check can be used to restrict access to registered users in any module that does not offer this functionality, not only in Reviews.