Documentation

Showing rating vote (rating.vote)

Description and parameters

Component is designed to print elements of rating vote and its current results. This component is hidden, it cannot be used via visual editor.

Call example

<?$APPLICATION->IncludeComponent("bitrix:rating.vote","",
          Array(
		"ENTITY_TYPE_ID" => "FORUM_POST",
		"ENTITY_ID" => "1023",
		"OWNER_ID" => "4",
		"USER_HAS_VOTED" => "Y",
		"TOTAL_VOTES" => "18",
		"TOTAL_POSITIVE_VOTES" => "12",
		"TOTAL_NEGATIVE_VOTES" => "6",
		"TOTAL_VALUE" => "6",
		"PATH_TO_USER_PROFILE" => "/people/user/#USER_ID#/",
		),
          null,
          array("HIDE_ICONS" => "Y")
);?>

Parameter description

Field Parameter Description
Vote object ENTITY_TYPE_ID Indicates object name subjected to a vote
  • USER - user rating;
  • FORUM_TOPIC - forum topic rating;
  • FORUM_POST - forum topic port rating;
  • BLOG_POST - blog post;
  • BLOG_COMMENT - blog post comment;
  • IBLOCK_ELEMENT - information block element (photo gallery, document library, wiki).
Vote object identifier ENTITY_ID Object ID.
Object user - owner ID OWNER_ID User ID. Blocks vote for oneself.
Path to user profiles PATH_TO_USER_PROFILE Path to user profile, for example /people/user/#USER_ID#/ (#USER_ID#, #user_id#, #UID# - variable for user ID replacement).
Vote flag USER_HAS_VOTED* [Y|N] Object vote status by current user.
Number of votes TOTAL_VOTES* Number of votes submitted to object.
Number of "positive" votes TOTAL_POSITIVE_VOTES* Number of positive votes.
Number of "negative" votes TOTAL_NEGATIVE_VOTES* Number of negative votes.
Vote result TOTAL_VALUE* Final vote result.
User vote weight USER_VOTE* User vote significance.

Additional information

If do not indicate parameters marked by an asterisk (*), the data will be uploaded automatically. It's recommended to indicate parameters for cases of multiple component calls (for example, in the comment list).

Data retrieval must use CRatings::GetRatingVoteResult or API for the following modules:

Data that can be retrieved by using GetList for specified modules:

  • Blogs and Iblocks:
    Parameter Description
    RATING_TOTAL_VALUE Total vote result.
    RATING_TOTAL_VOTES Number of votes, submitted to object.
    RATING_TOTAL_POSITIVE_VOTES Number of positive votes.
    RATING_TOTAL_NEGATIVE_VOTES Number of negative votes.
    RATING_USER_VOTE_VALUE Current user vote weight.
  • See Also:


    © «Bitrix24», 2001-2024