To see total images rated, add this to stats.php
//-----------------------------------------------------
//--- Ratings------------------------------------------
//-----------------------------------------------------
$sql = "SELECT COUNT(image_rating) AS sum
FROM ".IMAGES_TABLE.
" WHERE image_rating > 0";
$row = $site_db->query_firstrow($sql);
$sum = (isset($row['sum'])) ? $row['sum'] : 0;
$total_rating = "".$lang['total_rating']."<B> ".$row['sum']."</B>\n";
$site_template->register_vars("total_rating", $total_rating);
unset($total_rating);
You will also have to add to main.php
$lang['total_rating'] = "Total Images Rated:";
You can now use {total_rating} in your templates. Here is an example of mine:
<table width="450" border="0" cellspacing="0" cellpadding="1">
<tr>
<td class="head1">
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td valign="top" class="head1">Gallery Statistics</td>
</tr>
<tr>
<td valign="top" class="row2"> {total_users}<br>
{total_votes} <br>
{total_comments}<br>
{total_hits}<br>
{total_downloads}<br>
{total_rating} </td>
</tr>
</table>
</td>
</tr>
</table>
I tried to make this a template of its own, like whos_online, but couldn't get it to work. I created it as a separate template called stats.html and added it to the templates used in index.php. Nothing showed up, so I just hard-coded the html into my home and top templates. This works, but isn't as nice, so if anyone has it working a cleaner way, could you please let me know what to do.