Es wurde in verschiedenen Threads schon einmal nachgefragt, wie man die Bewertungsfunktion anders gestalten könne. Habe nun folgendes gemacht.
(getestet unter Joomla 1.0.11)
Zum Platzieren der Bewertung unter dem Artikel, wo sie eigentlich auch hingehört
/mambots/content/mosvote.php
Zeile 17
statt
$_MAMBOTS->registerFunction( 'onBeforeContent', 'botVoting' );
folgendes
$_MAMBOTS->registerFunction( 'onAfterDisplayContent', 'botVoting' );
Die "Bewertungsbilder" sind unter /images/M_images/rating_star.png bzw. rating_star_blank.png abgelegt, wenn sie nicht explizit im Template-Ordner zu finden sind. Im Anhang habe ich mal 2 alternative Sternchensymbole statt der Punkte abgelegt
Mann kann die Skala auch varieren (standardmässig auf 5). Dazu muss die o.g. mosvote.php als auch die /components/content.php angepasst werden.
Änderungen mosvote.php (10er Bewertung)
Zeile 37
for ($i=$row->rating; $i < 10; $i++) {
ab Zeile 50
$html .= '<input type="radio" alt="vote 1 star" name="user_rating" value="1" />';
$html .= '<input type="radio" alt="vote 2 star" name="user_rating" value="2" />';
$html .= '<input type="radio" alt="vote 3 star" name="user_rating" value="3" />';
$html .= '<input type="radio" alt="vote 4 star" name="user_rating" value="4" />';
$html .= '<input type="radio" alt="vote 5 star" name="user_rating" value="5" />';
$html .= '<input type="radio" alt="vote 6 star" name="user_rating" value="6" />';
$html .= '<input type="radio" alt="vote 7 star" name="user_rating" value="7" />';
$html .= '<input type="radio" alt="vote 8 star" name="user_rating" value="8" />';
$html .= '<input type="radio" alt="vote 9 star" name="user_rating" value="9" />';
$html .= '<input type="radio" alt="vote 10 star" name="user_rating" value="10" checked="checked" />';
Änderungen content.php (10er Bewertung)
Zeile 2357
if (($user_rating >= 1) and ($user_rating <= 10)) {
Das Aussehen wird u.a. über die Klassen content_rating und content_voting gesteuert.
Habe mal etwas gebastelt...
.content_rating{
background-color: #fbfbfb;
display: block;
width: 350px;
margin-top: 5px;
padding-left: 5px;
padding-top: 5px;
padding-right: 5px;
border-top: 1px solid #999999;
border-right: 1px solid #999999;
border-bottom: 1px none #999999;
border-left: 1px solid #999999;
}
.content_vote{
background-color: #fbfbfb;
display: block;
width: 350px;
padding-left: 5px;
margin-bottom: 5px;
padding-right: 5px;
padding-bottom: 5px;
border-top: 1px none #999999;
border-right: 1px solid #999999;
border-bottom: 1px solid #999999;
border-left: 1px solid #999999;
}
Dazu wurde in der mosvote noch in Zeile 43 ein br rausgenommen
$html .= "</span>\n<br />\n";
Im gezippten Anhang: Sternchenbilder, gehackte mosvote.php, content.php


LinkBack URL
About LinkBacks
Zitieren


Lesezeichen