Sorry for the delay Farsni
My code is
<?php
define('IN_COPPERMINE', true);
require('include/init.inc.php');
pageheader("Gallery Statistics");
print('<center><h1 align="center" class="tableh1"><a href="http://www.fotomaf.com/estadisticas/" title="Estadisticas"><font color="#ffffff"> Esta galería ha sido visitada <img src="http://www.fotomaf.com/estadisticas/showhits.php?id=Mauro&st=img" /> veces. </font></a></center></h1> ');
//Activity Graph Function
function activityGraph($cellName, $tableName, $title, $barTile, $notCtime=false)
{
global $CONFIG;
starttable('100%', $title, 26);
$query = "SELECT COUNT(*) AS number, HOUR($cellName) AS period FROM $tableName GROUP BY HOUR($cellName) ";
$result = cpg_db_query ($query);
while ($row = mysql_fetch_assoc($result)) $rowset[$row['period']] = $row['number'];
mysql_free_result($result);
print('<tr><td align="center" colspan="26"><b>Hora del día</b></td></tr>');
print('<tr><td align="center" colspan="26" height="2"></td></tr>');
print('<tr><td align="center" colspan="26" height="2" bgcolor="#000000"></td></tr>');
print('<tr><td align="center" colspan="26" height="1"></td></tr>');
print('<tr><td height="100" width="1" valign="bottom"><img src="images/spacer.gif" width="1" height="200" /></td>');
$total = array_sum($rowset);
$max = max($rowset);
foreach ($rowset as $number)
{
print('<td height="100%" width="4%" valign="bottom" align="center" style="font-size: 80%">'.round(($number/$total)*100,1).'%<br /><img src="'.$barTile.'" border="1" alt="" width="15" height="'.round(($number/$max)*200,0).'" /></td>');
}
print('<td height="100" width="1" valign="bottom"><img src="images/spacer.gif" width="1" height="200" /></td></tr>');
print('<tr><td align="center" colspan="26" height="1"></td></tr>');
print('<tr><td align="center" colspan="26" height="2" bgcolor="#000000"></td></tr>');
print('<tr><td align="center" colspan="26" height="1"></td></tr>');
print('<tr><td></td>');
for($i = '0'; $i <= '23'; $i++)
{
print('<td width="4%" align="center">'.$i.'</td>');
}
print('<td></td></tr>');
endtable();
print('<img src="images/spacer.gif" alt="" height="17 width="1" />');
}
display_thumbnails('lasthits', $cat, 1, $CONFIG['thumbcols'], 4, true);
display_thumbnails('toprated', $cat, 1, $CONFIG['thumbcols'], 3, true);
display_thumbnails('topn', $cat, 1, $CONFIG['thumbcols'], 1, true);
display_thumbnails('lastup', $cat, 1, $CONFIG['thumbcols'], 3, true);
//Start Most Commented
display_thumbnails('mostcom', $cat, 1, $CONFIG['thumbcols'], 2, true);
//End Most Commented
//Start Most Voted
display_thumbnails('mostvot', $cat, 1, $CONFIG['thumbcols'], 2, true);
//End Most Voted
//Start Album Most Commented
display_thumbnails('mostcomalb', $cat, 1, $CONFIG['thumbcols'], 2, true);
//End Album Most Commented
//Start Album Most Voted
display_thumbnails('mostvotalb', $cat, 1, $CONFIG['thumbcols'], 2, true);
//End Album Most Voted
//Start Album Most Viewed
display_thumbnails('mostviealb', $cat, 1, $CONFIG['thumbcols'], 2, true);
//End Album Most Viewed
//Start Upload Activity By Time
activityGraph("FROM_UNIXTIME(ctime)", $CONFIG['TABLE_PICTURES'], "hora de subida de fotos", "http://www.fotomaf.com/images/tile.gif");
//End Upload Activity By Time
//Start Comment Activity By Time
activityGraph("msg_date", $CONFIG['TABLE_COMMENTS'], "Horas a las que mas se comenta", "http://www.fotomaf.com/images/tile.gif", true);
//End Comment Activity By Time
//Start Viewing Activity By Time
//check to make sure hit_stats table exists
if(isset($CONFIG['TABLE_HIT_STATS']))
{
activityGraph("FROM_UNIXTIME(sdate)", $CONFIG['TABLE_HIT_STATS'], "Cuando me visita mas la gente", "http://www.fotomaf.com/images/tile.gif");
}
//End Viewing Activity By Time
pagefooter();
$signature = 'Coppermine Photo Gallery ' . COPPERMINE_VERSION . ' ('. COPPERMINE_VERSION_STATUS . ')';
?>