CoreFiles by mySites.guru
rating.php49 lines, 1,547 bytes, from Joomla_3.7.0-alpha1-Alpha-Full_Package.zip
Raw History Compare with 3.6.0-alpha
md5
7e2f88a486cc1f0b9c7d5fa660442000
sha1
50311a2a3790811413c5e41bce9a77d0c53e361b
sha256
d2e203d1c0882b92b05f4c5096b9dcc70d2cd0c5e59709264132873b7aa3a6cf
<?php
/**
 * @package     Joomla.Plugin
 * @subpackage  Content.vote
 *
 * @copyright   Copyright (C) 2005 - 2016 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
 */

$rating = (int) @$row->rating;

$img = '';

// 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);

for ($i = 0; $i < $rating; $i++)
{
	$img .= $starImageOn;
}

for ($i = $rating; $i < 5; $i++)
{
	$img .= $starImageOff;
}

?>
<div class="content_rating" itemprop="aggregateRating" itemscope itemtype="https://schema.org/AggregateRating">
	<p class="unseen element-invisible">
		<?php echo JText::sprintf('PLG_VOTE_USER_RATING', '<span itemprop="ratingValue">' . $rating . '</span>', '<span itemprop="bestRating">5</span>'); ?>
		<meta itemprop="ratingCount" content="<?php echo (int) $row->rating_count; ?>" />
		<meta itemprop="worstRating" content="0" />
	</p>
	<?php echo $img; ?>
</div>

No other release has this exact content. See every version of this file.