示例#1
0
	COption::SetOptionString("main", "rating_assign_type", 'manual');

// save settings
if ($_SERVER["REQUEST_METHOD"] == "POST" && $_POST['save']<>"" && check_bitrix_sessid())
{
	if ($sRatingWeightType == 'auto')
	{
		COption::SetOptionString("main", "rating_normalization_type", $sRatingNormalizationType);
		COption::SetOptionString("main", "rating_normalization", $ratingNormalization);
		COption::SetOptionString("main", "rating_count_vote", $ratingCountVote);
		COption::SetOptionString("main", "rating_authority_weight_formula", $sRatingAuthrorityWeight);
		COption::SetOptionString("main", "rating_community_last_visit", $communityLastVisit);
	}
	if ($sRatingWeightType == 'manual')
	{
		CRatings::SetWeight($_POST['CONFIG']);
	}
	if ($sRatingAssignType == 'auto')
	{
		COption::SetOptionString("main", "rating_assign_rating_group_add", $ratingAssignRatingGroupAdd);
		COption::SetOptionString("main", "rating_assign_rating_group_delete", $ratingAssignRatingGroupDelete);
		COption::SetOptionString("main", "rating_assign_authority_group_add", $ratingAssignAuthorityGroupAdd);
		COption::SetOptionString("main", "rating_assign_authority_group_delete", $ratingAssignAuthorityGroupDelete);
		COption::SetOptionString("main", "rating_assign_rating_group", $ratingAssignRatingGroup);
		COption::SetOptionString("main", "rating_assign_authority_group", $ratingAssignAuthorityGroup);
	}

	COption::SetOptionString("main", "rating_self_vote", $sRatingSelfVote);
	COption::SetOptionString("main", "rating_assign_type", $sRatingAssignType);
	COption::SetOptionString("main", "rating_weight_type", $sRatingWeightType);