I got a script and want public users to be able to post comments and rate. The current is only for logged in users. I tried just changing the MM_username to blank but it didn't change anything. Any help will be appreciated. Thanks.
When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
if ($_POST['rate'] == 1 && ((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup']))))
{
$sql_query = "INSERT INTO ratings(layout_id,ip,rating) VALUES(".$_GET['id'].",'".$_SERVER['REMOTE_ADDR']."',".$_POST['rating'].")";
mysql_query($sql_query);
$msg = "Your rating has been posted";
}
if ($_POST['rate'] == 1 && !((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup']))))
{
$msg = "You must login for posting rating.";
}
if ($_POST['comment'] == 1 && !empty($_POST['content']) && $comment_enabled[0] == "on" && ((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup']))))
{
$sql_query = "SELECT id FROM users WHERE uname='".$_SESSION['MM_Username']."'";
$res = mysql_query($sql_query);
$user_id = mysql_fetch_array($res);
$sql_query = "INSERT INTO comments(layout_id,user_id,title,date,content) VALUES(".$_GET['id'].",".$user_id[0].",'".strip_tags($_POST['title'])."',CURRENT_DATE(),'".strip_tags($_POST['content'])."')";
mysql_query($sql_query);
$msg = "Thank You for comment. It will be posted after approved.";
}
if ($_POST['comment'] == 1 && empty($_POST['content']))
{
$msg = "Please fill Comment field.";
}
if ($_POST['comment'] == 1 && !((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup']))))
{
$msg = "You must login for posting comments.";
}