Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: MOD: Comment Posting By Time  (Read 7817 times)

0 Members and 1 Guest are viewing this topic.

pslawinski

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 48
    • Lighting-Gallery.net
MOD: Comment Posting By Time
« on: November 21, 2005, 02:58:35 am »

I made some modifications to my Upload Activity By Time mod to make it show comment postings by time.


profile.php

Find:
Code: [Select]
        pagefooter();
        ob_end_flush();
        break;
}

Replace with:
Note: Replace all references to images/siteLayout/Contentpanel_Sidebar_11.gif with your own image
Code: [Select]
//Comment Posting By Time
starttable(705, "Comment Posting By Time", 1);
$query = "SELECT msg_date as uploadTime FROM {$CONFIG['TABLE_COMMENTS']} as c WHERE c.author_id = '$uid'";
$result = cpg_db_query($query);
$rowset = cpg_db_fetch_rowset($result);
mysql_free_result($result);
$uploadTimes = array();
$total = 0;
foreach($rowset as $row)
{
$split1 = explode(' ', $row[0]);
$split2 = explode(':', $split1[1]);
switch($split2[0])
{
case '00':
$index = 0;
break;
case '01':
$index = 1;
break;
case '02':
$index = 2;
break;
case '03':
$index = 3;
break;
case '04':
$index = 4;
break;
case '05':
$index = 5;
break;
case '06':
$index = 6;
break;
case '07':
$index = 7;
break;
case '08':
$index = 8;
break;
case '09':
$index = 9;
break;
default:
$index = $split2[0];
}
$uploadTimes[$index] = @$uploadTimes[$index] + 1;
$total++;
}

ksort($uploadTimes, SORT_NUMERIC);

print('<tr><td align="center" colspan="26"><b>Time of Day (GMT'.$CONFIG['time_offset'].')</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/siteLayout/Contentpanel_Sidebar_11.gif" width="1" height="200" /></td>');
for($i = '0'; $i <= '23'; $i++)
{
if(isset($uploadTimes[$i]))
{
print('<td height="100" width="4%" valign="bottom" align="center" style="font-size: 80%">'.round($uploadTimes[$i]/$total*'100',0).'%<br /><img src="images/siteLayout/Contentpanel_Sidebar_05.gif" border="1" alt="" width="15" height="'.round($uploadTimes[$i]/$total*'200',0).'" /></td>');
}
else
{
print('<td height="100" width="4%"></td>');
}
}
print('<td height="100" width="1" valign="bottom"><img src="images/siteLayout/Contentpanel_Sidebar_11.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++)
{
#if(isset($uploadTimes[$i]))
#{
# print('<td width="15">'.$i.' ('.round($uploadTimes[$i]/$total*'200',0).'%)</td>');
#}
#else
#{
print('<td width="4%" align="center">'.$i.'</td>');
#}
}
print('<td></td></tr>');

endtable();


        pagefooter();
        ob_end_flush();
        break;
}

I've attached a grab from the site:
« Last Edit: November 21, 2005, 07:20:23 am by GauGau »
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 20 queries.