Alright, now I've managed to fiddle some code that should create a so called "Rich Snippet" that Google could show on search results. You can see what I mean by opening
this link that has as an example my
miniBB forum. The stars on the search result can be a powerful way to get more traffic.
The code that goes to bb_plugins.php is:
$rating_id = 'rt_f'.$forum.'t'.$topic;
$points = "SELECT `nrrates`, REPLACE(ROUND(AVG(totalrate
),0),'.',',') FROM `ratings_plugin_items` WHERE `item` = '$rating_id'";
$topic_title = mysql_query("SELECT `topic_title` FROM `minibb_topics` WHERE `topic_id` = '$topic'");
$topic_title = mysql_result($topic_title,0,0);
$results = mysql_query($points);
$result = mysql_result($results, 0, 1);
$votes = mysql_result($results, 0, 0);
if (($result) or ($result === '0')) {
if ((isset($topic_title)) && (!empty($topic_title))) {
$topic_title = ucfirst($topic_title);
}
else {
$topic_title = '#'.$topic;
}
$result = $result/$votes;
$rating_rich_snippet = '<p id="ratings" itemscope itemtype="http://data-vocabulary.org/Review-aggregate">"<span itemprop="itemreviewed">'.$topic_title.'</span>" has been given <span itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating"><span itemprop="average">'.$result.'</span>/<span itemprop="best">10</span></span>. It´s based on <span itemprop="votes">'.$votes.'</span> votes.</p>';
}
The parts that have been bolded are the ones you should change to your forum's settings. After this code is placed inside bb_plugins.php you can activate the rich snippet HTML by pasting tag {$rating_rich_snippet} inside main_posts.html.
(Sorry Paul, I have no idea how the db_simpleSelect etc. functions are used. :-)