You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 367 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
How to allow only registered users to enter a review

18.4.1. How to allow only registered users to enter a review

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 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.

Powered by TOGETHER TEAM srl ITALY http://www.togetherteam.it - DONDELEO E-COMMERCE http://www.DonDeLeo.com - TUTTISU E-COMMERCE http://www.tuttisu.it
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.032 Seconds - 284 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::