news4ward-rateit integriert

This commit is contained in:
Carsten Götzinger 2015-02-04 22:29:41 +01:00
parent 90a65bcc43
commit 19feefda83
7 changed files with 24 additions and 29 deletions

View File

@ -67,6 +67,7 @@ $GLOBALS['TL_LANG']['tl_rateit_type_options']['faq'] = 'FAQ';
$GLOBALS['TL_LANG']['tl_rateit_type_options']['ce'] = 'Inhaltselement'; $GLOBALS['TL_LANG']['tl_rateit_type_options']['ce'] = 'Inhaltselement';
$GLOBALS['TL_LANG']['tl_rateit_type_options']['module'] = 'Modul'; $GLOBALS['TL_LANG']['tl_rateit_type_options']['module'] = 'Modul';
$GLOBALS['TL_LANG']['tl_rateit_type_options']['galpic'] = 'Galerie-Bild'; $GLOBALS['TL_LANG']['tl_rateit_type_options']['galpic'] = 'Galerie-Bild';
$GLOBALS['TL_LANG']['tl_rateit_type_options']['news4ward'] = 'Beitrag';
$GLOBALS['TL_LANG']['tl_rateit_order_options']['rating desc'] = 'Bewertung'; $GLOBALS['TL_LANG']['tl_rateit_order_options']['rating desc'] = 'Bewertung';
$GLOBALS['TL_LANG']['tl_rateit_order_options']['title'] = 'Titel'; $GLOBALS['TL_LANG']['tl_rateit_order_options']['title'] = 'Titel';
$GLOBALS['TL_LANG']['tl_rateit_order_options']['typ'] = 'Typ'; $GLOBALS['TL_LANG']['tl_rateit_order_options']['typ'] = 'Typ';

View File

@ -67,6 +67,7 @@ $GLOBALS['TL_LANG']['tl_rateit_type_options']['faq'] = 'FAQ';
$GLOBALS['TL_LANG']['tl_rateit_type_options']['ce'] = 'Content element'; $GLOBALS['TL_LANG']['tl_rateit_type_options']['ce'] = 'Content element';
$GLOBALS['TL_LANG']['tl_rateit_type_options']['module'] = 'Module'; $GLOBALS['TL_LANG']['tl_rateit_type_options']['module'] = 'Module';
$GLOBALS['TL_LANG']['tl_rateit_type_options']['galpic'] = 'Gallery picture'; $GLOBALS['TL_LANG']['tl_rateit_type_options']['galpic'] = 'Gallery picture';
$GLOBALS['TL_LANG']['tl_rateit_type_options']['news4ward'] = 'Blog entry';
$GLOBALS['TL_LANG']['tl_rateit_order_options']['rating desc'] = 'Rating'; $GLOBALS['TL_LANG']['tl_rateit_order_options']['rating desc'] = 'Rating';
$GLOBALS['TL_LANG']['tl_rateit_order_options']['title'] = 'Title'; $GLOBALS['TL_LANG']['tl_rateit_order_options']['title'] = 'Title';
$GLOBALS['TL_LANG']['tl_rateit_order_options']['typ'] = 'Type'; $GLOBALS['TL_LANG']['tl_rateit_order_options']['typ'] = 'Type';

View File

@ -90,6 +90,7 @@
.mod_rateit table.rating td.type-faq { background-color:#ffe0aa; } .mod_rateit table.rating td.type-faq { background-color:#ffe0aa; }
.mod_rateit table.rating td.type-article { background-color:#ffcce0; } .mod_rateit table.rating td.type-article { background-color:#ffcce0; }
.mod_rateit table.rating td.type-galpic { background-color:#ffe066; } .mod_rateit table.rating td.type-galpic { background-color:#ffe066; }
.mod_rateit table.rating td.type-news4ward { background-color:#ffe011; }
.mod_rateit table.rating td.active-1, .mod_rateit table.rating td.type-page { background-color:#e0ffe0; } .mod_rateit table.rating td.active-1, .mod_rateit table.rating td.type-page { background-color:#e0ffe0; }
.mod_rateit table.rating td. .mod_rateit table.rating td.

View File

@ -212,7 +212,7 @@ function doRateIt() {
getStarPercent: function(id) { getStarPercent: function(id) {
/* Format = anyStringHere-<id>-<float(currentStars)>_(scale); /* Format = anyStringHere-<id>-<float(currentStars)>_(scale);
* Example: RateItRatings-5-3_5 //Primary key id = 5, 3/5 stars. */ * Example: RateItRatings-5-3_5 //Primary key id = 5, 3/5 stars. */
var stars = id.match(/(\d*\|?\d*)-(page|article|ce|module|news|faq|galpic)-(\d*\.?\d+)_(\d*\.?\d+)$/); var stars = id.match(/(\d*\|?\d*)-(page|article|ce|module|news|faq|galpic|news4ward)-(\d*\.?\d+)_(\d*\.?\d+)$/);
if (stars != null) { if (stars != null) {
var score = stars[3].toFloat(); var score = stars[3].toFloat();
var scale = stars[4].toFloat(); var scale = stars[4].toFloat();
@ -236,17 +236,17 @@ function doRateIt() {
}, },
getRatableId: function(id) { getRatableId: function(id) {
var stars = id.match(/(\d*\|?\d*)-(page|article|ce|module|news|faq|galpic)-(\d*\.?\d+)_(\d*\.?\d+)$/); var stars = id.match(/(\d*\|?\d*)-(page|article|ce|module|news|faq|galpic|news4ward)-(\d*\.?\d+)_(\d*\.?\d+)$/);
return stars != null ? stars[1] : ''; return stars != null ? stars[1] : '';
}, },
getRatableType: function(id) { getRatableType: function(id) {
var stars = id.match(/(\d*\|?\d*)-(page|article|ce|module|news|faq|galpic)-(\d*\.?\d+)_(\d*\.?\d+)$/); var stars = id.match(/(\d*\|?\d*)-(page|article|ce|module|news|faq|galpic|news4ward)-(\d*\.?\d+)_(\d*\.?\d+)$/);
return stars != null ? stars[2] : ''; return stars != null ? stars[2] : '';
}, },
getRatableMaxValue: function(id) { getRatableMaxValue: function(id) {
var stars = id.match(/(\d*\|?\d*)-(page|article|ce|module|news|faq|galpic)-(\d*\.?\d+)_(\d*\.?\d+)$/); var stars = id.match(/(\d*\|?\d*)-(page|article|ce|module|news|faq|galpic|news4ward)-(\d*\.?\d+)_(\d*\.?\d+)$/);
return stars != null ? stars[4].toInt() : 0; return stars != null ? stars[4].toInt() : 0;
}, },
@ -451,7 +451,7 @@ function doRateIt() {
getStarPercent: function(id) { getStarPercent: function(id) {
/* Format = anyStringHere-<id>-<float(currentStars)>_(scale); /* Format = anyStringHere-<id>-<float(currentStars)>_(scale);
* Example: RateItRatings-5-3_5 //Primary key id = 5, 3/5 stars. */ * Example: RateItRatings-5-3_5 //Primary key id = 5, 3/5 stars. */
var stars = id.match(/(\d*\|?\d*)-(page|article|ce|module|news|faq|galpic)-(\d*\.?\d+)_(\d*\.?\d+)$/); var stars = id.match(/(\d*\|?\d*)-(page|article|ce|module|news|faq|galpic|news4ward)-(\d*\.?\d+)_(\d*\.?\d+)$/);
if (stars != null) { if (stars != null) {
var score = parseFloat(stars[3]); var score = parseFloat(stars[3]);
var scale = parseFloat(stars[4]); var scale = parseFloat(stars[4]);
@ -475,17 +475,17 @@ function doRateIt() {
}, },
getRatableId: function(id) { getRatableId: function(id) {
var stars = id.match(/(\d*\|?\d*)-(page|article|ce|module|news|faq|galpic)-(\d*\.?\d+)_(\d*\.?\d+)$/); var stars = id.match(/(\d*\|?\d*)-(page|article|ce|module|news|faq|galpic|news4ward)-(\d*\.?\d+)_(\d*\.?\d+)$/);
return stars != null ? stars[1] : ''; return stars != null ? stars[1] : '';
}, },
getRatableType: function(id) { getRatableType: function(id) {
var stars = id.match(/(\d*\|?\d*)-(page|article|ce|module|news|faq|galpic)-(\d*\.?\d+)_(\d*\.?\d+)$/); var stars = id.match(/(\d*\|?\d*)-(page|article|ce|module|news|faq|galpic|news4ward)-(\d*\.?\d+)_(\d*\.?\d+)$/);
return stars != null ? stars[2] : ''; return stars != null ? stars[2] : '';
}, },
getRatableMaxValue: function(id) { getRatableMaxValue: function(id) {
var stars = id.match(/(\d*\|?\d*)-(page|article|ce|module|news|faq|galpic)-(\d*\.?\d+)_(\d*\.?\d+)$/); var stars = id.match(/(\d*\|?\d*)-(page|article|ce|module|news|faq|galpic|news4ward)-(\d*\.?\d+)_(\d*\.?\d+)$/);
return stars != null ? parseInt(stars[4]) : 0; return stars != null ? parseInt(stars[4]) : 0;
}, },

File diff suppressed because one or more lines are too long

View File

@ -98,7 +98,7 @@ class RateIt extends \Frontend {
} }
//Make sure that the ratable type is 'page' or 'ce' or 'module' //Make sure that the ratable type is 'page' or 'ce' or 'module'
if (!($type === 'page' || $type === 'article' || $type === 'ce' || $type === 'module' || $type === 'news' || $type === 'faq' || $type === 'galpic')) { if (!($type === 'page' || $type === 'article' || $type === 'ce' || $type === 'module' || $type === 'news' || $type === 'faq' || $type === 'galpic' || $type === 'news4ward')) {
header(RETURN_AJAX_HEADER); header(RETURN_AJAX_HEADER);
echo $GLOBALS['TL_LANG']['rateit']['error']['invalid_type']; echo $GLOBALS['TL_LANG']['rateit']['error']['invalid_type'];
exit; exit;

View File

@ -66,8 +66,7 @@
</div> </div>
<?php if ($this->rateit_rating_after): ?> <?php if ($this->rateit_rating_after): ?>
<!-- indexer::stop --> <!-- indexer::stop -->
<div itemtype="http://data-vocabulary.org/Review-aggregate" itemscope="" class="rating-microdata"> <div id="<?php echo $this->id; ?>" class="<?php echo $this->class; ?> <?php echo $this->rateit_class; ?>">
<div id="<?php echo $this->id; ?>" class="<?php echo $this->class; ?> <?php echo $this->rateit_class; ?>">
<?php if ($this->showBefore) : ?> <?php if ($this->showBefore) : ?>
<div id="<?php echo $this->descriptionId; ?>" class="ratingText"><?php echo $this->description; ?></div> <div id="<?php echo $this->descriptionId; ?>" class="ratingText"><?php echo $this->description; ?></div>
<?php endif; ?> <?php endif; ?>
@ -78,13 +77,6 @@
<?php if ($this->showAfter) : ?> <?php if ($this->showAfter) : ?>
<div id="<?php echo $this->descriptionId; ?>" class="ratingText"><?php echo $this->description; ?></div> <div id="<?php echo $this->descriptionId; ?>" class="ratingText"><?php echo $this->description; ?></div>
<?php endif; ?> <?php endif; ?>
</div>
<span class="rating-microdata" itemprop="itemreviewed"><?php echo $this->itemreviewed; ?></span>
<span class="rating-microdata" itemtype="http://data-vocabulary.org/Rating" itemscope="" itemprop="rating">
<span itemprop="average"><?php echo $this->actRating; ?></span>
<span itemprop="best"><?php echo $this->maxRating; ?></span>
</span>
<span class="rating-microdata" itemprop="votes"><?php echo $this->votes; ?></span>
</div> </div>
<!-- indexer::continue --> <!-- indexer::continue -->
<?php endif; ?> <?php endif; ?>