- md5
- b8a09fdebf68861be9a2372b9c9f2c2d
- sha1
- 25cc86b020e3c587aa92538061d8045df3b35133
- sha256
- d9326d6221011ddf326ad1eba205d6b965147c27440616719aad83eb002d8df7
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
<?php
/**
* @package Joomla.Plugin
* @subpackage Content.vote
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Layout variables
* -----------------
* @var string $context The context of the content being passed to the plugin
* @var object &$row The article object
* @var object &$params The article params
* @var integer $page The 'page' number
* @var array $parts The context segments
* @var string $path Path to this file
*/
if ($context == 'com_content.categories')
{
return;
}
$rating = (int) $row->rating;
$rcount = (int) $row->rating_count;
// Look for images in template if available
$starImageOn = JHtml::_('image', 'system/rating_star.png', JText::_('PLG_VOTE_STAR_ACTIVE'), null, true);
$starImageOff = JHtml::_('image', 'system/rating_star_blank.png', JText::_('PLG_VOTE_STAR_INACTIVE'), null, true);
$img = '';
for ($i = 0; $i < $rating; $i++)
{
$img .= $starImageOn;
}
for ($i = $rating; $i < 5; $i++)
{
$img .= $starImageOff;
}
?>
<div class="content_rating">
<?php if ($rcount) : ?>
<p class="unseen element-invisible" itemprop="aggregateRating" itemscope itemtype="https://schema.org/AggregateRating">
<?php echo JText::sprintf('PLG_VOTE_USER_RATING', '<span itemprop="ratingValue">' . $rating . '</span>', '<span itemprop="bestRating">5</span>'); ?>
<meta itemprop="ratingCount" content="<?php echo $rcount; ?>" />
<meta itemprop="worstRating" content="1" />
</p>
<?php endif; ?>
<?php echo $img; ?>
</div>
The same content is in 30 releases, Joomla 3.9.15-rc to 3.10.0-alpha1. See them all, or every version of this file.