24-Jan-2011, 03:08 PM
I wonder if is possible to integrate the commentics stars rating system with Google Rich Snippets Microformats to appear in search results.
Thank you.
Thank you.
<?php
if ($average_rating != 0) {
echo $output_average_rating;
echo "<span class='average_rating_text'>";
echo " " . CMTX_AVERAGE_RATING;
echo "</span>";
}
<?php
if ($average_rating != 0) {
echo $output_average_rating;
echo "<span class='average_rating_text'>";
echo " " . CMTX_AVERAGE_RATING;
echo "</span>";
//Start of Google 'Rich Snippets' (Microformats markup)
$number_of_ratings = mysql_query("SELECT COUNT(*) FROM `".$mysql_table_prefix."comments` WHERE is_approved = '1' AND rating != '0' AND page_id = '$page_id'");
$r = mysql_fetch_row($number_of_ratings);
$number_of_ratings = $r[0];
echo "<div class='hreview-aggregate'>";
echo "<span class='item'>";
echo "<span class='fn'>" . cmtx_get_page_reference() . "</span>";
echo "</span>";
echo "<span class='rating'>";
echo "<span class='average'>$average_rating</span>";
echo "<span class='best'>5</span>";
echo "</span>";
echo "<span class='votes'>$number_of_ratings</span>";
echo "<span class='count'>$number_of_comments</span>";
echo "</div>";
//End of Google 'Rich Snippets'
}
.hreview-aggregate {
display: none;
}
(06-Aug-2011, 11:04 AM)stariocek Wrote: Second version of comments.php, now without hidden text for comment - better for SEO.