Skip to content

Responsive Multirating Template #436

@LordHelmchen666

Description

@LordHelmchen666

I made multirating template responsive. https://github.com/JoomCoder-com/JoomCCK/blob/main/components/com_joomcck/views/rating_tmpls/multirating/default.php

If you want to add it here is the code.

<?php
/**
 * Joomcck by joomcoder
 * a component for Joomla! 1.7 - 2.5 CMS (http://www.joomla.org)
 * Author Website: https://www.joomcoder.com/
 * @copyright Copyright (C) 2012 joomcoder (https://www.joomcoder.com). All rights reserved.
 * @license GNU/GPL http://www.gnu.org/copyleft/gpl.html
 */

defined('_JEXEC') or die();


?>
<div class="rating-container px-2">
    <div class="row border-bottom">
        <div class="col-sm-6 py-2 fw-bold text-bg-dark"><?php echo \Joomla\CMS\Language\Text::_('CTOTALRATING'); ?></div>
        <div class="col-sm-6 py-2 text-bg-light">
            <?php echo RatingHelp::loadRating($type->params->get('properties.tmpl_rating'), round(@$record->votes_result), $record->id, 500, 'Joomcck.ItemRatingCallBack', false, $record->id);?>
            <small id="rating-text-<?php echo $record->id;?>" class=""><?php echo \Joomla\CMS\Language\Text::sprintf('CRAINGDATA', $record->votes_result, $record->votes); ?></small>
        </div>
    </div>
    
    <?php foreach($options as $key => $option): ?>
        <?php
        $parts = explode('::', $option);
        $canRate = self::canRate('record', $record->user_id, $record->id, $type->params->get('properties.rate_access'), $key, $type->params->get('properties.rate_access_author', 0));
        ?>
        <div class="row border-bottom">
            <div class="col-sm-6 py-2 fw-bold text-bg-secondary"><?php echo \Joomla\CMS\Language\Text::_($parts[0]); ?></div>
            <div class="col-sm-6 py-2 text-bg-light">
                <?php echo RatingHelp::loadRating(
                    isset($parts[1]) ? $parts[1] : $type->params->get('properties.tmpl_rating'),
                    round((int)@$result[$key]['sum']),
                    $record->id,
                    $key,
                    'Joomcck.ItemRatingCallBackMulti',
                    $canRate
                );?>
            </div>
        </div>
    <?php endforeach; ?>
</div>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions